From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cV-00077V-3F; Thu, 01 Mar 2012 08:44:15 +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 1S31cT-00077M-TZ
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:14 +0000
Received: from [193.109.254.147:25869] by server-4.bemta-14.messagelabs.com id
	98/5A-08205-DD63F4F4; Thu, 01 Mar 2012 08:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1330591366!62356144!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27736 invoked from network); 1 Mar 2012 08:42:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08:42:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cQ-0002Be-UG
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cQ-0003Hh-P5
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:10 +0000
Message-Id: <E1S31cQ-0003Hh-P5@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: drop the ovmf32 support
	and rename ovmf64 -> ovmf.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Attilio Rao <attilio.rao@citrix.com>
# Date 1330522431 0
# Node ID d6c72d5ab780513e06758044a1a45fec3f5892b7
# Parent  a43eeaedf61ccaf269d0823ea80d3dfa8157cc63
hvmloader: drop the ovmf32 support and rename ovmf64 -> ovmf.

- Remove the 15cpus hack from ovmf because it should be unnecessary on
nowadays windows/EFI supported.

Signed-off-by: Attilio Rao <attilio.rao@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r a43eeaedf61c -r d6c72d5ab780 tools/firmware/hvmloader/Makefile
--- a/tools/firmware/hvmloader/Makefile	Tue Feb 28 10:17:27 2012 +0000
+++ b/tools/firmware/hvmloader/Makefile	Wed Feb 29 13:33:51 2012 +0000
@@ -55,10 +55,9 @@
 
 ifeq ($(CONFIG_OVMF),y)
 OBJS += ovmf.o
-CFLAGS += -DENABLE_OVMF32 -DENABLE_OVMF64
-OVMF32_ROM := $(OVMF_DIR)/ovmf-ia32.bin
-OVMF64_ROM := $(OVMF_DIR)/ovmf-x64.bin
-ROMS += $(OVMF32_ROM) $(OVMF64_ROM)
+CFLAGS += -DENABLE_OVMF
+OVMF_ROM := $(OVMF_DIR)/ovmf.bin
+ROMS += $(OVMF_ROM)
 endif
 
 ifeq ($(CONFIG_ROMBIOS),y)
@@ -102,15 +101,9 @@
 	echo "#endif" >> $@.new
 endif
 
-ifneq ($(OVMF32_ROM),)
-	echo "#ifdef ROM_INCLUDE_OVMF32" >> $@.new
-	sh ./mkhex ovmf32 $(OVMF32_ROM) >> $@.new
-	echo "#endif" >> $@.new	
-endif 
-
-ifneq ($(OVMF64_ROM),)
-	echo "#ifdef ROM_INCLUDE_OVMF64" >> $@.new
-	sh ./mkhex ovmf64 $(OVMF64_ROM) >> $@.new
+ifneq ($(OVMF_ROM),)
+	echo "#ifdef ROM_INCLUDE_OVMF" >> $@.new
+	sh ./mkhex ovmf $(OVMF_ROM) >> $@.new
 	echo "#endif" >> $@.new	
 endif 
 
diff -r a43eeaedf61c -r d6c72d5ab780 tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h	Tue Feb 28 10:17:27 2012 +0000
+++ b/tools/firmware/hvmloader/config.h	Wed Feb 29 13:33:51 2012 +0000
@@ -35,8 +35,7 @@
 
 extern struct bios_config rombios_config;
 extern struct bios_config seabios_config;
-extern struct bios_config ovmf32_config;
-extern struct bios_config ovmf64_config;
+extern struct bios_config ovmf_config;
 
 #define PAGE_SHIFT 12
 #define PAGE_SIZE  (1ul << PAGE_SHIFT)
diff -r a43eeaedf61c -r d6c72d5ab780 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c	Tue Feb 28 10:17:27 2012 +0000
+++ b/tools/firmware/hvmloader/hvmloader.c	Wed Feb 29 13:33:51 2012 +0000
@@ -212,11 +212,8 @@
 #ifdef ENABLE_SEABIOS
     { "seabios", &seabios_config, },
 #endif
-#ifdef ENABLE_OVMF32
-    { "ovmf-ia32", &ovmf32_config, },
-#endif
-#ifdef ENABLE_OVMF64
-    { "ovmf-x64", &ovmf64_config, },
+#ifdef ENABLE_OVMF
+    { "ovmf", &ovmf_config, },
 #endif
     { NULL, NULL }
 };
diff -r a43eeaedf61c -r d6c72d5ab780 tools/firmware/hvmloader/ovmf.c
--- a/tools/firmware/hvmloader/ovmf.c	Tue Feb 28 10:17:27 2012 +0000
+++ b/tools/firmware/hvmloader/ovmf.c	Wed Feb 29 13:33:51 2012 +0000
@@ -35,8 +35,7 @@
 #include <xen/hvm/ioreq.h>
 #include <xen/memory.h>
 
-#define ROM_INCLUDE_OVMF32
-#define ROM_INCLUDE_OVMF64
+#define ROM_INCLUDE_OVMF
 #include "roms.inc"
 
 #define OVMF_BEGIN              0xFFF00000ULL
@@ -48,8 +47,8 @@
 #define LOWCHUNK_MAXOFFSET      0x0000FFFF
 #define LOWCHUNK_END            (OVMF_BEGIN + OVMF_SIZE)
 
-extern unsigned char dsdt_anycpu[], dsdt_15cpu[];
-extern int dsdt_anycpu_len, dsdt_15cpu_len;
+extern unsigned char dsdt_anycpu[];
+extern int dsdt_anycpu_len;
 
 static void ovmf_load(const struct bios_config *config)
 {
@@ -79,8 +78,8 @@
     struct acpi_config config = {
         .dsdt_anycpu = dsdt_anycpu,
         .dsdt_anycpu_len = dsdt_anycpu_len,
-        .dsdt_15cpu = dsdt_15cpu,
-        .dsdt_15cpu_len = dsdt_15cpu_len,
+        .dsdt_15cpu = NULL, 
+        .dsdt_15cpu_len = 0
     };
 
     acpi_build_tables(&config, ACPI_PHYSICAL_ADDRESS);
@@ -94,33 +93,11 @@
         SMBIOS_PHYSICAL_END);
 }
 
-struct bios_config ovmf32_config =  {
-    .name = "OVMF-IA32",
+struct bios_config ovmf_config =  {
+    .name = "OVMF",
 
-    .image = ovmf32,
-    .image_size = sizeof(ovmf32),
-
-    .bios_address = 0,
-    .bios_load = ovmf_load,
-
-    .load_roms = 0,
-
-    .bios_info_setup = NULL,
-    .bios_info_finish = NULL,
-
-    .e820_setup = NULL,
-
-    .acpi_build_tables = ovmf_acpi_build_tables,
-    .create_mp_tables = NULL,
-    .create_smbios_tables = ovmf_create_smbios_tables,
-    .create_pir_tables = NULL,
-};
-
-struct bios_config ovmf64_config =  {
-    .name = "OVMF-X64",
-
-    .image = ovmf64,
-    .image_size = sizeof(ovmf64),
+    .image = ovmf,
+    .image_size = sizeof(ovmf),
 
     .bios_address = 0,
     .bios_load = ovmf_load,

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cW-00077q-8R; Thu, 01 Mar 2012 08: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 1S31cV-00077L-FO
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:15 +0000
Received: from [85.158.139.83:30674] by server-3.bemta-5.messagelabs.com id
	9E/6A-25237-DD63F4F4; Thu, 01 Mar 2012 08:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1330591451!16805724!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9541 invoked from network); 1 Mar 2012 08:44: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;
	1 Mar 2012 08: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 1S31cQ-0002Bb-GE
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cQ-0003HB-7Q
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:10 +0000
Message-Id: <E1S31cQ-0003HB-7Q@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Handle booting on SMP platforms
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330424247 0
# Node ID a43eeaedf61ccaf269d0823ea80d3dfa8157cc63
# Parent  d19a254197d773a9ecdeb3516f2ea473ea255e29
arm: Handle booting on SMP platforms

Make all non-boot CPUs wait forever instead of trying to boot in parallel.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d19a254197d7 -r a43eeaedf61c xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Tue Feb 28 10:17:27 2012 +0000
+++ b/xen/arch/arm/head.S	Tue Feb 28 10:17:27 2012 +0000
@@ -61,6 +61,19 @@
 	add   r8, r10                /* r8 := paddr(DTB) */
 #endif
 
+	/* Are we the boot CPU? */
+	mrc   CP32(r0, MPIDR)
+	tst   r0, #(1<<31)           /* Multiprocessor extension supported? */
+	beq   boot_cpu
+	tst   r0, #(1<<30)           /* Uniprocessor system? */
+	bne   boot_cpu
+	bics  r0, r0, #(0xff << 24)  /* Ignore flags */
+	beq   boot_cpu               /* If all other fields are 0, we win */
+
+1:	wfi
+	b     1b
+	
+boot_cpu:
 #ifdef EARLY_UART_ADDRESS
 	/* Say hello */
 	ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
diff -r d19a254197d7 -r a43eeaedf61c xen/include/asm-arm/cpregs.h
--- a/xen/include/asm-arm/cpregs.h	Tue Feb 28 10:17:27 2012 +0000
+++ b/xen/include/asm-arm/cpregs.h	Tue Feb 28 10:17:27 2012 +0000
@@ -91,6 +91,7 @@
 /* Coprocessor 15 */
 
 /* CP15 CR0: CPUID and Cache Type Registers */
+#define MPIDR           p15,0,c0,c0,5   /* Multiprocessor Affinity Register */
 #define ID_PFR0         p15,0,c0,c1,0   /* Processor Feature Register 0 */
 #define ID_PFR1         p15,0,c0,c1,1   /* Processor Feature Register 1 */
 #define ID_DFR0         p15,0,c0,c1,2   /* Debug Feature Register 0 */

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cW-00077q-8R; Thu, 01 Mar 2012 08: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 1S31cV-00077L-FO
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:15 +0000
Received: from [85.158.139.83:30674] by server-3.bemta-5.messagelabs.com id
	9E/6A-25237-DD63F4F4; Thu, 01 Mar 2012 08:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1330591451!16805724!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9541 invoked from network); 1 Mar 2012 08:44: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;
	1 Mar 2012 08: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 1S31cQ-0002Bb-GE
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cQ-0003HB-7Q
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:10 +0000
Message-Id: <E1S31cQ-0003HB-7Q@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Handle booting on SMP platforms
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330424247 0
# Node ID a43eeaedf61ccaf269d0823ea80d3dfa8157cc63
# Parent  d19a254197d773a9ecdeb3516f2ea473ea255e29
arm: Handle booting on SMP platforms

Make all non-boot CPUs wait forever instead of trying to boot in parallel.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d19a254197d7 -r a43eeaedf61c xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Tue Feb 28 10:17:27 2012 +0000
+++ b/xen/arch/arm/head.S	Tue Feb 28 10:17:27 2012 +0000
@@ -61,6 +61,19 @@
 	add   r8, r10                /* r8 := paddr(DTB) */
 #endif
 
+	/* Are we the boot CPU? */
+	mrc   CP32(r0, MPIDR)
+	tst   r0, #(1<<31)           /* Multiprocessor extension supported? */
+	beq   boot_cpu
+	tst   r0, #(1<<30)           /* Uniprocessor system? */
+	bne   boot_cpu
+	bics  r0, r0, #(0xff << 24)  /* Ignore flags */
+	beq   boot_cpu               /* If all other fields are 0, we win */
+
+1:	wfi
+	b     1b
+	
+boot_cpu:
 #ifdef EARLY_UART_ADDRESS
 	/* Say hello */
 	ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
diff -r d19a254197d7 -r a43eeaedf61c xen/include/asm-arm/cpregs.h
--- a/xen/include/asm-arm/cpregs.h	Tue Feb 28 10:17:27 2012 +0000
+++ b/xen/include/asm-arm/cpregs.h	Tue Feb 28 10:17:27 2012 +0000
@@ -91,6 +91,7 @@
 /* Coprocessor 15 */
 
 /* CP15 CR0: CPUID and Cache Type Registers */
+#define MPIDR           p15,0,c0,c0,5   /* Multiprocessor Affinity Register */
 #define ID_PFR0         p15,0,c0,c1,0   /* Processor Feature Register 0 */
 #define ID_PFR1         p15,0,c0,c1,1   /* Processor Feature Register 1 */
 #define ID_DFR0         p15,0,c0,c1,2   /* Debug Feature Register 0 */

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cV-00077V-3F; Thu, 01 Mar 2012 08:44:15 +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 1S31cT-00077M-TZ
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:14 +0000
Received: from [193.109.254.147:25869] by server-4.bemta-14.messagelabs.com id
	98/5A-08205-DD63F4F4; Thu, 01 Mar 2012 08:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1330591366!62356144!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27736 invoked from network); 1 Mar 2012 08:42:47 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-7.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08:42:47 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cQ-0002Be-UG
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cQ-0003Hh-P5
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:10 +0000
Message-Id: <E1S31cQ-0003Hh-P5@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvmloader: drop the ovmf32 support
	and rename ovmf64 -> ovmf.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Attilio Rao <attilio.rao@citrix.com>
# Date 1330522431 0
# Node ID d6c72d5ab780513e06758044a1a45fec3f5892b7
# Parent  a43eeaedf61ccaf269d0823ea80d3dfa8157cc63
hvmloader: drop the ovmf32 support and rename ovmf64 -> ovmf.

- Remove the 15cpus hack from ovmf because it should be unnecessary on
nowadays windows/EFI supported.

Signed-off-by: Attilio Rao <attilio.rao@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r a43eeaedf61c -r d6c72d5ab780 tools/firmware/hvmloader/Makefile
--- a/tools/firmware/hvmloader/Makefile	Tue Feb 28 10:17:27 2012 +0000
+++ b/tools/firmware/hvmloader/Makefile	Wed Feb 29 13:33:51 2012 +0000
@@ -55,10 +55,9 @@
 
 ifeq ($(CONFIG_OVMF),y)
 OBJS += ovmf.o
-CFLAGS += -DENABLE_OVMF32 -DENABLE_OVMF64
-OVMF32_ROM := $(OVMF_DIR)/ovmf-ia32.bin
-OVMF64_ROM := $(OVMF_DIR)/ovmf-x64.bin
-ROMS += $(OVMF32_ROM) $(OVMF64_ROM)
+CFLAGS += -DENABLE_OVMF
+OVMF_ROM := $(OVMF_DIR)/ovmf.bin
+ROMS += $(OVMF_ROM)
 endif
 
 ifeq ($(CONFIG_ROMBIOS),y)
@@ -102,15 +101,9 @@
 	echo "#endif" >> $@.new
 endif
 
-ifneq ($(OVMF32_ROM),)
-	echo "#ifdef ROM_INCLUDE_OVMF32" >> $@.new
-	sh ./mkhex ovmf32 $(OVMF32_ROM) >> $@.new
-	echo "#endif" >> $@.new	
-endif 
-
-ifneq ($(OVMF64_ROM),)
-	echo "#ifdef ROM_INCLUDE_OVMF64" >> $@.new
-	sh ./mkhex ovmf64 $(OVMF64_ROM) >> $@.new
+ifneq ($(OVMF_ROM),)
+	echo "#ifdef ROM_INCLUDE_OVMF" >> $@.new
+	sh ./mkhex ovmf $(OVMF_ROM) >> $@.new
 	echo "#endif" >> $@.new	
 endif 
 
diff -r a43eeaedf61c -r d6c72d5ab780 tools/firmware/hvmloader/config.h
--- a/tools/firmware/hvmloader/config.h	Tue Feb 28 10:17:27 2012 +0000
+++ b/tools/firmware/hvmloader/config.h	Wed Feb 29 13:33:51 2012 +0000
@@ -35,8 +35,7 @@
 
 extern struct bios_config rombios_config;
 extern struct bios_config seabios_config;
-extern struct bios_config ovmf32_config;
-extern struct bios_config ovmf64_config;
+extern struct bios_config ovmf_config;
 
 #define PAGE_SHIFT 12
 #define PAGE_SIZE  (1ul << PAGE_SHIFT)
diff -r a43eeaedf61c -r d6c72d5ab780 tools/firmware/hvmloader/hvmloader.c
--- a/tools/firmware/hvmloader/hvmloader.c	Tue Feb 28 10:17:27 2012 +0000
+++ b/tools/firmware/hvmloader/hvmloader.c	Wed Feb 29 13:33:51 2012 +0000
@@ -212,11 +212,8 @@
 #ifdef ENABLE_SEABIOS
     { "seabios", &seabios_config, },
 #endif
-#ifdef ENABLE_OVMF32
-    { "ovmf-ia32", &ovmf32_config, },
-#endif
-#ifdef ENABLE_OVMF64
-    { "ovmf-x64", &ovmf64_config, },
+#ifdef ENABLE_OVMF
+    { "ovmf", &ovmf_config, },
 #endif
     { NULL, NULL }
 };
diff -r a43eeaedf61c -r d6c72d5ab780 tools/firmware/hvmloader/ovmf.c
--- a/tools/firmware/hvmloader/ovmf.c	Tue Feb 28 10:17:27 2012 +0000
+++ b/tools/firmware/hvmloader/ovmf.c	Wed Feb 29 13:33:51 2012 +0000
@@ -35,8 +35,7 @@
 #include <xen/hvm/ioreq.h>
 #include <xen/memory.h>
 
-#define ROM_INCLUDE_OVMF32
-#define ROM_INCLUDE_OVMF64
+#define ROM_INCLUDE_OVMF
 #include "roms.inc"
 
 #define OVMF_BEGIN              0xFFF00000ULL
@@ -48,8 +47,8 @@
 #define LOWCHUNK_MAXOFFSET      0x0000FFFF
 #define LOWCHUNK_END            (OVMF_BEGIN + OVMF_SIZE)
 
-extern unsigned char dsdt_anycpu[], dsdt_15cpu[];
-extern int dsdt_anycpu_len, dsdt_15cpu_len;
+extern unsigned char dsdt_anycpu[];
+extern int dsdt_anycpu_len;
 
 static void ovmf_load(const struct bios_config *config)
 {
@@ -79,8 +78,8 @@
     struct acpi_config config = {
         .dsdt_anycpu = dsdt_anycpu,
         .dsdt_anycpu_len = dsdt_anycpu_len,
-        .dsdt_15cpu = dsdt_15cpu,
-        .dsdt_15cpu_len = dsdt_15cpu_len,
+        .dsdt_15cpu = NULL, 
+        .dsdt_15cpu_len = 0
     };
 
     acpi_build_tables(&config, ACPI_PHYSICAL_ADDRESS);
@@ -94,33 +93,11 @@
         SMBIOS_PHYSICAL_END);
 }
 
-struct bios_config ovmf32_config =  {
-    .name = "OVMF-IA32",
+struct bios_config ovmf_config =  {
+    .name = "OVMF",
 
-    .image = ovmf32,
-    .image_size = sizeof(ovmf32),
-
-    .bios_address = 0,
-    .bios_load = ovmf_load,
-
-    .load_roms = 0,
-
-    .bios_info_setup = NULL,
-    .bios_info_finish = NULL,
-
-    .e820_setup = NULL,
-
-    .acpi_build_tables = ovmf_acpi_build_tables,
-    .create_mp_tables = NULL,
-    .create_smbios_tables = ovmf_create_smbios_tables,
-    .create_pir_tables = NULL,
-};
-
-struct bios_config ovmf64_config =  {
-    .name = "OVMF-X64",
-
-    .image = ovmf64,
-    .image_size = sizeof(ovmf64),
+    .image = ovmf,
+    .image_size = sizeof(ovmf),
 
     .bios_address = 0,
     .bios_load = ovmf_load,

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08: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 1S31cZ-00078q-GC; Thu, 01 Mar 2012 08:44:19 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cY-00077K-9c
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1330591450!9960992!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13394 invoked from network); 1 Mar 2012 08:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08: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 1S31cP-0002BY-RD
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cP-0003Gg-MI
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:09 +0000
Message-Id: <E1S31cP-0003Gg-MI@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: strip xen binary
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330424247 0
# Node ID d19a254197d773a9ecdeb3516f2ea473ea255e29
# Parent  72551f5787763afe1c71f7f7e3999c4c2cbdd26f
arm: strip xen binary

The symbols in it are wrong anyway and will only confuse people
who ought to be looking at xen-syms.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 72551f578776 -r d19a254197d7 xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Tue Feb 28 09:06:27 2012 +0100
+++ b/xen/arch/arm/Makefile	Tue Feb 28 10:17:27 2012 +0000
@@ -40,7 +40,7 @@
 	# XXX: VE model loads by VMA so instead of
 	# making a proper ELF we link with LMA == VMA and adjust crudely
 	$(OBJCOPY) --change-addresses +0x80000000 $< $@
-	# XXX strip it
+	$(STRIP) $@
 
 #$(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
 #	./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08: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 1S31cZ-00078q-GC; Thu, 01 Mar 2012 08:44:19 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cY-00077K-9c
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1330591450!9960992!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13394 invoked from network); 1 Mar 2012 08:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08: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 1S31cP-0002BY-RD
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cP-0003Gg-MI
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:09 +0000
Message-Id: <E1S31cP-0003Gg-MI@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: strip xen binary
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330424247 0
# Node ID d19a254197d773a9ecdeb3516f2ea473ea255e29
# Parent  72551f5787763afe1c71f7f7e3999c4c2cbdd26f
arm: strip xen binary

The symbols in it are wrong anyway and will only confuse people
who ought to be looking at xen-syms.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 72551f578776 -r d19a254197d7 xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Tue Feb 28 09:06:27 2012 +0100
+++ b/xen/arch/arm/Makefile	Tue Feb 28 10:17:27 2012 +0000
@@ -40,7 +40,7 @@
 	# XXX: VE model loads by VMA so instead of
 	# making a proper ELF we link with LMA == VMA and adjust crudely
 	$(OBJCOPY) --change-addresses +0x80000000 $< $@
-	# XXX strip it
+	$(STRIP) $@
 
 #$(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
 #	./boot/mkelf32 $(TARGET)-syms $(TARGET) 0x100000 \

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08: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 1S31cY-00078E-BD; Thu, 01 Mar 2012 08:44:18 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cW-00077J-UB
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1330591449!17143952!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1310 invoked from network); 1 Mar 2012 08:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08: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 1S31cP-0002BV-Fb
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cP-0003G8-2x
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:09 +0000
Message-Id: <E1S31cP-0003G8-2x@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] X86: expose HLE/RTM features to 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330416387 -3600
# Node ID 72551f5787763afe1c71f7f7e3999c4c2cbdd26f
# Parent  a7bacdc5449a2f7bb9c35b2a1334b463fe9f29a9
X86: expose HLE/RTM features to dom0

Intel recently release 2 new features, HLE and TRM.
Refer to http://software.intel.com/file/41417.
This patch expose them to dom0.

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


diff -r a7bacdc5449a -r 72551f578776 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Mon Feb 27 17:05:18 2012 +0000
+++ b/xen/arch/x86/traps.c	Tue Feb 28 09:06:27 2012 +0100
@@ -857,9 +857,11 @@
     case 0x00000007:
         if ( regs->ecx == 0 )
             b &= (cpufeat_mask(X86_FEATURE_BMI1) |
+                  cpufeat_mask(X86_FEATURE_HLE)  |
                   cpufeat_mask(X86_FEATURE_AVX2) |
                   cpufeat_mask(X86_FEATURE_BMI2) |
                   cpufeat_mask(X86_FEATURE_ERMS) |
+                  cpufeat_mask(X86_FEATURE_RTM)  |
                   cpufeat_mask(X86_FEATURE_FSGSBASE));
         else
             b = 0;
diff -r a7bacdc5449a -r 72551f578776 xen/include/asm-x86/cpufeature.h
--- a/xen/include/asm-x86/cpufeature.h	Mon Feb 27 17:05:18 2012 +0000
+++ b/xen/include/asm-x86/cpufeature.h	Tue Feb 28 09:06:27 2012 +0100
@@ -149,11 +149,13 @@
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 7 */
 #define X86_FEATURE_FSGSBASE	(7*32+ 0) /* {RD,WR}{FS,GS}BASE instructions */
 #define X86_FEATURE_BMI1	(7*32+ 3) /* 1st bit manipulation extensions */
+#define X86_FEATURE_HLE 	(7*32+ 4) /* Hardware Lock Elision */
 #define X86_FEATURE_AVX2	(7*32+ 5) /* AVX2 instructions */
 #define X86_FEATURE_SMEP	(7*32+ 7) /* Supervisor Mode Execution Protection */
 #define X86_FEATURE_BMI2	(7*32+ 8) /* 2nd bit manipulation extensions */
 #define X86_FEATURE_ERMS	(7*32+ 9) /* Enhanced REP MOVSB/STOSB */
 #define X86_FEATURE_INVPCID	(7*32+10) /* Invalidate Process Context ID */
+#define X86_FEATURE_RTM 	(7*32+11) /* Restricted Transactional Memory */
 
 #define cpu_has(c, bit)		test_bit(bit, (c)->x86_capability)
 #define boot_cpu_has(bit)	test_bit(bit, boot_cpu_data.x86_capability)

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08: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 1S31cY-00078E-BD; Thu, 01 Mar 2012 08:44:18 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cW-00077J-UB
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1330591449!17143952!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1310 invoked from network); 1 Mar 2012 08:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08: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 1S31cP-0002BV-Fb
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cP-0003G8-2x
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:09 +0000
Message-Id: <E1S31cP-0003G8-2x@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] X86: expose HLE/RTM features to 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330416387 -3600
# Node ID 72551f5787763afe1c71f7f7e3999c4c2cbdd26f
# Parent  a7bacdc5449a2f7bb9c35b2a1334b463fe9f29a9
X86: expose HLE/RTM features to dom0

Intel recently release 2 new features, HLE and TRM.
Refer to http://software.intel.com/file/41417.
This patch expose them to dom0.

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


diff -r a7bacdc5449a -r 72551f578776 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Mon Feb 27 17:05:18 2012 +0000
+++ b/xen/arch/x86/traps.c	Tue Feb 28 09:06:27 2012 +0100
@@ -857,9 +857,11 @@
     case 0x00000007:
         if ( regs->ecx == 0 )
             b &= (cpufeat_mask(X86_FEATURE_BMI1) |
+                  cpufeat_mask(X86_FEATURE_HLE)  |
                   cpufeat_mask(X86_FEATURE_AVX2) |
                   cpufeat_mask(X86_FEATURE_BMI2) |
                   cpufeat_mask(X86_FEATURE_ERMS) |
+                  cpufeat_mask(X86_FEATURE_RTM)  |
                   cpufeat_mask(X86_FEATURE_FSGSBASE));
         else
             b = 0;
diff -r a7bacdc5449a -r 72551f578776 xen/include/asm-x86/cpufeature.h
--- a/xen/include/asm-x86/cpufeature.h	Mon Feb 27 17:05:18 2012 +0000
+++ b/xen/include/asm-x86/cpufeature.h	Tue Feb 28 09:06:27 2012 +0100
@@ -149,11 +149,13 @@
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx), word 7 */
 #define X86_FEATURE_FSGSBASE	(7*32+ 0) /* {RD,WR}{FS,GS}BASE instructions */
 #define X86_FEATURE_BMI1	(7*32+ 3) /* 1st bit manipulation extensions */
+#define X86_FEATURE_HLE 	(7*32+ 4) /* Hardware Lock Elision */
 #define X86_FEATURE_AVX2	(7*32+ 5) /* AVX2 instructions */
 #define X86_FEATURE_SMEP	(7*32+ 7) /* Supervisor Mode Execution Protection */
 #define X86_FEATURE_BMI2	(7*32+ 8) /* 2nd bit manipulation extensions */
 #define X86_FEATURE_ERMS	(7*32+ 9) /* Enhanced REP MOVSB/STOSB */
 #define X86_FEATURE_INVPCID	(7*32+10) /* Invalidate Process Context ID */
+#define X86_FEATURE_RTM 	(7*32+11) /* Restricted Transactional Memory */
 
 #define cpu_has(c, bit)		test_bit(bit, (c)->x86_capability)
 #define boot_cpu_has(bit)	test_bit(bit, boot_cpu_data.x86_capability)

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cZ-00078l-Dc; Thu, 01 Mar 2012 08:44: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 1S31cY-000789-9A
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:18 +0000
Received: from [85.158.139.83:5264] by server-11.bemta-5.messagelabs.com id
	37/F9-12959-1E63F4F4; Thu, 01 Mar 2012 08:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1330591455!10014127!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16087 invoked from network); 1 Mar 2012 08:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08:44: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 1S31cV-0002C0-0P
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cU-0003LS-UT
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:14 +0000
Message-Id: <E1S31cU-0003LS-UT@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] vpmu: cleanup structures
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
# Date 1330523472 0
# Node ID bea68a25f368b9a16af028ba6f4512306ca80bad
# Parent  57706facdbdde0a01d97f62455b11e7fdc39201c
vpmu: cleanup structures

- struct msr_load_store_entry is unused
- struct pmumsr is only used in the vmx part

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 57706facdbdd -r bea68a25f368 xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Wed Feb 29 13:48:41 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Wed Feb 29 13:51:12 2012 +0000
@@ -112,6 +112,11 @@
     MSR_IA32_PEBS_ENABLE,
     MSR_IA32_DS_AREA};
 
+struct pmumsr {
+    unsigned int num;
+    u32 *msr;
+};
+
 struct pmumsr core2_counters = {
     3,
     core2_counters_msr
diff -r 57706facdbdd -r bea68a25f368 xen/include/asm-x86/hvm/vpmu.h
--- a/xen/include/asm-x86/hvm/vpmu.h	Wed Feb 29 13:48:41 2012 +0000
+++ b/xen/include/asm-x86/hvm/vpmu.h	Wed Feb 29 13:51:12 2012 +0000
@@ -34,16 +34,6 @@
 #define MSR_TYPE_ARCH_COUNTER       3
 #define MSR_TYPE_ARCH_CTRL          4
 
-struct pmumsr {
-    unsigned int num;
-    u32 *msr;
-};
-
-struct msr_load_store_entry {
-    u32 msr_index;
-    u32 msr_reserved;
-    u64 msr_data;
-};
 
 /* Arch specific operations shared by all vpmus */
 struct arch_vpmu_ops {

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cZ-00078l-Dc; Thu, 01 Mar 2012 08:44: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 1S31cY-000789-9A
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:18 +0000
Received: from [85.158.139.83:5264] by server-11.bemta-5.messagelabs.com id
	37/F9-12959-1E63F4F4; Thu, 01 Mar 2012 08:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1330591455!10014127!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16087 invoked from network); 1 Mar 2012 08:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08:44: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 1S31cV-0002C0-0P
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cU-0003LS-UT
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:14 +0000
Message-Id: <E1S31cU-0003LS-UT@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] vpmu: cleanup structures
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
# Date 1330523472 0
# Node ID bea68a25f368b9a16af028ba6f4512306ca80bad
# Parent  57706facdbdde0a01d97f62455b11e7fdc39201c
vpmu: cleanup structures

- struct msr_load_store_entry is unused
- struct pmumsr is only used in the vmx part

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 57706facdbdd -r bea68a25f368 xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Wed Feb 29 13:48:41 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Wed Feb 29 13:51:12 2012 +0000
@@ -112,6 +112,11 @@
     MSR_IA32_PEBS_ENABLE,
     MSR_IA32_DS_AREA};
 
+struct pmumsr {
+    unsigned int num;
+    u32 *msr;
+};
+
 struct pmumsr core2_counters = {
     3,
     core2_counters_msr
diff -r 57706facdbdd -r bea68a25f368 xen/include/asm-x86/hvm/vpmu.h
--- a/xen/include/asm-x86/hvm/vpmu.h	Wed Feb 29 13:48:41 2012 +0000
+++ b/xen/include/asm-x86/hvm/vpmu.h	Wed Feb 29 13:51:12 2012 +0000
@@ -34,16 +34,6 @@
 #define MSR_TYPE_ARCH_COUNTER       3
 #define MSR_TYPE_ARCH_CTRL          4
 
-struct pmumsr {
-    unsigned int num;
-    u32 *msr;
-};
-
-struct msr_load_store_entry {
-    u32 msr_index;
-    u32 msr_reserved;
-    u64 msr_data;
-};
 
 /* Arch specific operations shared by all vpmus */
 struct arch_vpmu_ops {

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31ca-00079i-Le; Thu, 01 Mar 2012 08:44:20 +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 1S31cZ-00078W-9o
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:19 +0000
Received: from [85.158.139.83:5346] by server-1.bemta-5.messagelabs.com id
	8B/33-28458-2E63F4F4; Thu, 01 Mar 2012 08:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1330591456!6078437!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31922 invoked from network); 1 Mar 2012 08:44:17 -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;
	1 Mar 2012 08:44: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 1S31cV-0002C3-HY
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cV-0003Lw-Fg
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:15 +0000
Message-Id: <E1S31cV-0003Lw-Fg@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] vpmu: No need for two initialisation
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
# Date 1330523502 0
# Node ID 93d379d11cbb191735cd318b0f4aab96e170013e
# Parent  bea68a25f368b9a16af028ba6f4512306ca80bad
vpmu: No need for two initialisation functions

With the changeset 24529:87854d3bed93 we got 2 initialisation
functions for the arch specific stuff. This is no more needed.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r bea68a25f368 -r 93d379d11cbb xen/arch/x86/hvm/svm/vpmu.c
--- a/xen/arch/x86/hvm/svm/vpmu.c	Wed Feb 29 13:51:12 2012 +0000
+++ b/xen/arch/x86/hvm/svm/vpmu.c	Wed Feb 29 13:51:42 2012 +0000
@@ -292,14 +292,14 @@
     return 1;
 }
 
-static void amd_vpmu_initialise(struct vcpu *v)
+static int amd_vpmu_initialise(struct vcpu *v)
 {
     struct amd_vpmu_context *ctxt = NULL;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     uint8_t family = current_cpu_data.x86;
 
     if ( vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
-        return;
+        return 0;
 
     if ( counters == NULL )
     {
@@ -329,11 +329,12 @@
         gdprintk(XENLOG_WARNING, "Insufficient memory for PMU, "
             " PMU feature is unavailable on domain %d vcpu %d.\n",
             v->vcpu_id, v->domain->domain_id);
-        return;
+        return -ENOMEM;
     }
 
     vpmu->context = (void *)ctxt;
     vpmu_set(vpmu, VPMU_CONTEXT_ALLOCATED);
+    return 0;
 }
 
 static void amd_vpmu_destroy(struct vcpu *v)
@@ -357,7 +358,6 @@
     .do_wrmsr = amd_vpmu_do_wrmsr,
     .do_rdmsr = amd_vpmu_do_rdmsr,
     .do_interrupt = amd_vpmu_do_interrupt,
-    .arch_vpmu_initialise = amd_vpmu_initialise,
     .arch_vpmu_destroy = amd_vpmu_destroy,
     .arch_vpmu_save = amd_vpmu_save,
     .arch_vpmu_load = amd_vpmu_restore
@@ -375,7 +375,7 @@
     case 0x14:
     case 0x15:
         vpmu->arch_vpmu_ops = &amd_vpmu_ops;
-        return 0;
+        return amd_vpmu_initialise(v);
     }
 
     printk("VPMU: Initialization failed. "
diff -r bea68a25f368 -r 93d379d11cbb xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Wed Feb 29 13:51:12 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Wed Feb 29 13:51:42 2012 +0000
@@ -583,9 +583,10 @@
     return 1;
 }
 
-static void core2_vpmu_initialise(struct vcpu *v)
+static int core2_vpmu_initialise(struct vcpu *v)
 {
     check_pmc_quirk();
+    return 0;
 }
 
 static void core2_vpmu_destroy(struct vcpu *v)
@@ -607,7 +608,6 @@
     .do_wrmsr = core2_vpmu_do_wrmsr,
     .do_rdmsr = core2_vpmu_do_rdmsr,
     .do_interrupt = core2_vpmu_do_interrupt,
-    .arch_vpmu_initialise = core2_vpmu_initialise,
     .arch_vpmu_destroy = core2_vpmu_destroy,
     .arch_vpmu_save = core2_vpmu_save,
     .arch_vpmu_load = core2_vpmu_load
@@ -633,7 +633,7 @@
         case 47:
         case 58:
             vpmu->arch_vpmu_ops = &core2_vpmu_ops;
-            return 0;
+            return core2_vpmu_initialise(v);
         }
     }
 
diff -r bea68a25f368 -r 93d379d11cbb xen/arch/x86/hvm/vpmu.c
--- a/xen/arch/x86/hvm/vpmu.c	Wed Feb 29 13:51:12 2012 +0000
+++ b/xen/arch/x86/hvm/vpmu.c	Wed Feb 29 13:51:42 2012 +0000
@@ -88,6 +88,8 @@
 
     if ( vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
         vpmu_destroy(v);
+    vpmu_clear(vpmu);
+    vpmu->context = NULL;
 
     switch ( vendor )
     {
@@ -107,13 +109,6 @@
         opt_vpmu_enabled = 0;
         break;
     }
-
-    if ( vpmu->arch_vpmu_ops != NULL )
-    {
-        vpmu_clear(vpmu);
-        vpmu->context = NULL;
-        vpmu->arch_vpmu_ops->arch_vpmu_initialise(v);
-    }
 }
 
 void vpmu_destroy(struct vcpu *v)
diff -r bea68a25f368 -r 93d379d11cbb xen/include/asm-x86/hvm/vpmu.h
--- a/xen/include/asm-x86/hvm/vpmu.h	Wed Feb 29 13:51:12 2012 +0000
+++ b/xen/include/asm-x86/hvm/vpmu.h	Wed Feb 29 13:51:42 2012 +0000
@@ -40,7 +40,6 @@
     int (*do_wrmsr)(unsigned int msr, uint64_t msr_content);
     int (*do_rdmsr)(unsigned int msr, uint64_t *msr_content);
     int (*do_interrupt)(struct cpu_user_regs *regs);
-    void (*arch_vpmu_initialise)(struct vcpu *v);
     void (*arch_vpmu_destroy)(struct vcpu *v);
     void (*arch_vpmu_save)(struct vcpu *v);
     void (*arch_vpmu_load)(struct vcpu *v);

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31ca-00079i-Le; Thu, 01 Mar 2012 08:44:20 +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 1S31cZ-00078W-9o
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:19 +0000
Received: from [85.158.139.83:5346] by server-1.bemta-5.messagelabs.com id
	8B/33-28458-2E63F4F4; Thu, 01 Mar 2012 08:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1330591456!6078437!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31922 invoked from network); 1 Mar 2012 08:44:17 -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;
	1 Mar 2012 08:44: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 1S31cV-0002C3-HY
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cV-0003Lw-Fg
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:15 +0000
Message-Id: <E1S31cV-0003Lw-Fg@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] vpmu: No need for two initialisation
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
# Date 1330523502 0
# Node ID 93d379d11cbb191735cd318b0f4aab96e170013e
# Parent  bea68a25f368b9a16af028ba6f4512306ca80bad
vpmu: No need for two initialisation functions

With the changeset 24529:87854d3bed93 we got 2 initialisation
functions for the arch specific stuff. This is no more needed.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r bea68a25f368 -r 93d379d11cbb xen/arch/x86/hvm/svm/vpmu.c
--- a/xen/arch/x86/hvm/svm/vpmu.c	Wed Feb 29 13:51:12 2012 +0000
+++ b/xen/arch/x86/hvm/svm/vpmu.c	Wed Feb 29 13:51:42 2012 +0000
@@ -292,14 +292,14 @@
     return 1;
 }
 
-static void amd_vpmu_initialise(struct vcpu *v)
+static int amd_vpmu_initialise(struct vcpu *v)
 {
     struct amd_vpmu_context *ctxt = NULL;
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     uint8_t family = current_cpu_data.x86;
 
     if ( vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
-        return;
+        return 0;
 
     if ( counters == NULL )
     {
@@ -329,11 +329,12 @@
         gdprintk(XENLOG_WARNING, "Insufficient memory for PMU, "
             " PMU feature is unavailable on domain %d vcpu %d.\n",
             v->vcpu_id, v->domain->domain_id);
-        return;
+        return -ENOMEM;
     }
 
     vpmu->context = (void *)ctxt;
     vpmu_set(vpmu, VPMU_CONTEXT_ALLOCATED);
+    return 0;
 }
 
 static void amd_vpmu_destroy(struct vcpu *v)
@@ -357,7 +358,6 @@
     .do_wrmsr = amd_vpmu_do_wrmsr,
     .do_rdmsr = amd_vpmu_do_rdmsr,
     .do_interrupt = amd_vpmu_do_interrupt,
-    .arch_vpmu_initialise = amd_vpmu_initialise,
     .arch_vpmu_destroy = amd_vpmu_destroy,
     .arch_vpmu_save = amd_vpmu_save,
     .arch_vpmu_load = amd_vpmu_restore
@@ -375,7 +375,7 @@
     case 0x14:
     case 0x15:
         vpmu->arch_vpmu_ops = &amd_vpmu_ops;
-        return 0;
+        return amd_vpmu_initialise(v);
     }
 
     printk("VPMU: Initialization failed. "
diff -r bea68a25f368 -r 93d379d11cbb xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Wed Feb 29 13:51:12 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Wed Feb 29 13:51:42 2012 +0000
@@ -583,9 +583,10 @@
     return 1;
 }
 
-static void core2_vpmu_initialise(struct vcpu *v)
+static int core2_vpmu_initialise(struct vcpu *v)
 {
     check_pmc_quirk();
+    return 0;
 }
 
 static void core2_vpmu_destroy(struct vcpu *v)
@@ -607,7 +608,6 @@
     .do_wrmsr = core2_vpmu_do_wrmsr,
     .do_rdmsr = core2_vpmu_do_rdmsr,
     .do_interrupt = core2_vpmu_do_interrupt,
-    .arch_vpmu_initialise = core2_vpmu_initialise,
     .arch_vpmu_destroy = core2_vpmu_destroy,
     .arch_vpmu_save = core2_vpmu_save,
     .arch_vpmu_load = core2_vpmu_load
@@ -633,7 +633,7 @@
         case 47:
         case 58:
             vpmu->arch_vpmu_ops = &core2_vpmu_ops;
-            return 0;
+            return core2_vpmu_initialise(v);
         }
     }
 
diff -r bea68a25f368 -r 93d379d11cbb xen/arch/x86/hvm/vpmu.c
--- a/xen/arch/x86/hvm/vpmu.c	Wed Feb 29 13:51:12 2012 +0000
+++ b/xen/arch/x86/hvm/vpmu.c	Wed Feb 29 13:51:42 2012 +0000
@@ -88,6 +88,8 @@
 
     if ( vpmu_is_set(vpmu, VPMU_CONTEXT_ALLOCATED) )
         vpmu_destroy(v);
+    vpmu_clear(vpmu);
+    vpmu->context = NULL;
 
     switch ( vendor )
     {
@@ -107,13 +109,6 @@
         opt_vpmu_enabled = 0;
         break;
     }
-
-    if ( vpmu->arch_vpmu_ops != NULL )
-    {
-        vpmu_clear(vpmu);
-        vpmu->context = NULL;
-        vpmu->arch_vpmu_ops->arch_vpmu_initialise(v);
-    }
 }
 
 void vpmu_destroy(struct vcpu *v)
diff -r bea68a25f368 -r 93d379d11cbb xen/include/asm-x86/hvm/vpmu.h
--- a/xen/include/asm-x86/hvm/vpmu.h	Wed Feb 29 13:51:12 2012 +0000
+++ b/xen/include/asm-x86/hvm/vpmu.h	Wed Feb 29 13:51:42 2012 +0000
@@ -40,7 +40,6 @@
     int (*do_wrmsr)(unsigned int msr, uint64_t msr_content);
     int (*do_rdmsr)(unsigned int msr, uint64_t *msr_content);
     int (*do_interrupt)(struct cpu_user_regs *regs);
-    void (*arch_vpmu_initialise)(struct vcpu *v);
     void (*arch_vpmu_destroy)(struct vcpu *v);
     void (*arch_vpmu_save)(struct vcpu *v);
     void (*arch_vpmu_load)(struct vcpu *v);

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cW-00077l-5r; Thu, 01 Mar 2012 08: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 1S31cV-00077T-3R
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:15 +0000
Received: from [85.158.139.83:30755] by server-9.bemta-5.messagelabs.com id
	F1/38-09826-ED63F4F4; Thu, 01 Mar 2012 08:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1330591451!16805732!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9698 invoked from network); 1 Mar 2012 08:44:13 -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;
	1 Mar 2012 08: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 1S31cR-0002Bh-Fm
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cR-0003ID-AS
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:11 +0000
Message-Id: <E1S31cR-0003ID-AS@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: Export configure variables to
	hypervisor build
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330522825 0
# Node ID f25e5785327e45c8e4e3270effa1d5c3ee4df2ae
# Parent  d6c72d5ab780513e06758044a1a45fec3f5892b7
build: Export configure variables to hypervisor build

Since the introduction of autoconf, builds with XSM enabled in .config
have been broken unless FLASK_ENABLE was explicitly set. Since the
setting in .config has apparently been deprecated in favor of an
autoconf --enable-xsm, add config/Xen.mk to export this to Xen. This
also makes --disable-debug and some paths to be pulled from the
configure process in the hypervisor build.

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


diff -r d6c72d5ab780 -r f25e5785327e .gitignore
--- a/.gitignore	Wed Feb 29 13:33:51 2012 +0000
+++ b/.gitignore	Wed Feb 29 13:40:25 2012 +0000
@@ -111,6 +111,7 @@
 tools/config.status
 tools/config.cache
 config/Tools.mk
+config/Xen.mk
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
 tools/blktap2/drivers/lock-util
diff -r d6c72d5ab780 -r f25e5785327e .hgignore
--- a/.hgignore	Wed Feb 29 13:33:51 2012 +0000
+++ b/.hgignore	Wed Feb 29 13:40:25 2012 +0000
@@ -309,6 +309,7 @@
 ^tools/config\.status$
 ^tools/config\.cache$
 ^config/Tools\.mk$
+^config/Xen\.mk$
 ^xen/\.banner.*$
 ^xen/BLOG$
 ^xen/System.map$
diff -r d6c72d5ab780 -r f25e5785327e config/Tools.mk.in
--- a/config/Tools.mk.in	Wed Feb 29 13:33:51 2012 +0000
+++ b/config/Tools.mk.in	Wed Feb 29 13:40:25 2012 +0000
@@ -24,10 +24,6 @@
 APPEND_INCLUDES     := @APPEND_INCLUDES@
 APPEND_LIB          := @APPEND_LIB@
 
-# Enable XSM security module (by default, Flask).
-XSM_ENABLE          := @xsm@
-FLASK_ENABLE        := @xsm@
-
 # Download GIT repositories via HTTP or GIT's own protocol?
 # GIT's protocol is faster and more robust, when it works at all (firewalls
 # may block it). We make it the default, but if your GIT repository downloads
diff -r d6c72d5ab780 -r f25e5785327e config/Xen.mk.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/Xen.mk.in	Wed Feb 29 13:40:25 2012 +0000
@@ -0,0 +1,19 @@
+# Prefix and install folder
+PREFIX              := @prefix@
+LIBLEAFDIR_x86_64   := @LIB_PATH@
+
+# A debug build of xen?
+debug               := @debug@
+
+# Tools path
+PYTHON              := @PYTHON@
+
+# Extra folder for libs/includes
+PREPEND_INCLUDES    := @PREPEND_INCLUDES@
+PREPEND_LIB         := @PREPEND_LIB@
+APPEND_INCLUDES     := @APPEND_INCLUDES@
+APPEND_LIB          := @APPEND_LIB@
+
+# Enable XSM security module (by default, Flask).
+XSM_ENABLE          := @xsm@
+FLASK_ENABLE        := @xsm@
diff -r d6c72d5ab780 -r f25e5785327e tools/configure.ac
--- a/tools/configure.ac	Wed Feb 29 13:33:51 2012 +0000
+++ b/tools/configure.ac	Wed Feb 29 13:40:25 2012 +0000
@@ -6,6 +6,7 @@
     [xen-devel@lists.xensource.com])
 AC_CONFIG_SRCDIR([libxl/libxl.c])
 AC_CONFIG_FILES([../config/Tools.mk])
+AC_CONFIG_FILES([../config/Xen.mk])
 AC_CONFIG_HEADERS([config.h])
 AC_PREFIX_DEFAULT([/usr])
 AC_CONFIG_AUX_DIR([.])
diff -r d6c72d5ab780 -r f25e5785327e xen/Rules.mk
--- a/xen/Rules.mk	Wed Feb 29 13:33:51 2012 +0000
+++ b/xen/Rules.mk	Wed Feb 29 13:40:25 2012 +0000
@@ -12,6 +12,7 @@
 lto           ?= n
 
 include $(XEN_ROOT)/Config.mk
+include $(XEN_ROOT)/config/Xen.mk
 
 # Hardcoded configuration implications and dependencies.
 # Do this is a neater way if it becomes unwieldy.

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cW-00077l-5r; Thu, 01 Mar 2012 08: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 1S31cV-00077T-3R
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:15 +0000
Received: from [85.158.139.83:30755] by server-9.bemta-5.messagelabs.com id
	F1/38-09826-ED63F4F4; Thu, 01 Mar 2012 08:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-182.messagelabs.com!1330591451!16805732!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9698 invoked from network); 1 Mar 2012 08:44:13 -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;
	1 Mar 2012 08: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 1S31cR-0002Bh-Fm
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cR-0003ID-AS
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:11 +0000
Message-Id: <E1S31cR-0003ID-AS@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: Export configure variables to
	hypervisor build
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330522825 0
# Node ID f25e5785327e45c8e4e3270effa1d5c3ee4df2ae
# Parent  d6c72d5ab780513e06758044a1a45fec3f5892b7
build: Export configure variables to hypervisor build

Since the introduction of autoconf, builds with XSM enabled in .config
have been broken unless FLASK_ENABLE was explicitly set. Since the
setting in .config has apparently been deprecated in favor of an
autoconf --enable-xsm, add config/Xen.mk to export this to Xen. This
also makes --disable-debug and some paths to be pulled from the
configure process in the hypervisor build.

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


diff -r d6c72d5ab780 -r f25e5785327e .gitignore
--- a/.gitignore	Wed Feb 29 13:33:51 2012 +0000
+++ b/.gitignore	Wed Feb 29 13:40:25 2012 +0000
@@ -111,6 +111,7 @@
 tools/config.status
 tools/config.cache
 config/Tools.mk
+config/Xen.mk
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
 tools/blktap2/drivers/lock-util
diff -r d6c72d5ab780 -r f25e5785327e .hgignore
--- a/.hgignore	Wed Feb 29 13:33:51 2012 +0000
+++ b/.hgignore	Wed Feb 29 13:40:25 2012 +0000
@@ -309,6 +309,7 @@
 ^tools/config\.status$
 ^tools/config\.cache$
 ^config/Tools\.mk$
+^config/Xen\.mk$
 ^xen/\.banner.*$
 ^xen/BLOG$
 ^xen/System.map$
diff -r d6c72d5ab780 -r f25e5785327e config/Tools.mk.in
--- a/config/Tools.mk.in	Wed Feb 29 13:33:51 2012 +0000
+++ b/config/Tools.mk.in	Wed Feb 29 13:40:25 2012 +0000
@@ -24,10 +24,6 @@
 APPEND_INCLUDES     := @APPEND_INCLUDES@
 APPEND_LIB          := @APPEND_LIB@
 
-# Enable XSM security module (by default, Flask).
-XSM_ENABLE          := @xsm@
-FLASK_ENABLE        := @xsm@
-
 # Download GIT repositories via HTTP or GIT's own protocol?
 # GIT's protocol is faster and more robust, when it works at all (firewalls
 # may block it). We make it the default, but if your GIT repository downloads
diff -r d6c72d5ab780 -r f25e5785327e config/Xen.mk.in
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/Xen.mk.in	Wed Feb 29 13:40:25 2012 +0000
@@ -0,0 +1,19 @@
+# Prefix and install folder
+PREFIX              := @prefix@
+LIBLEAFDIR_x86_64   := @LIB_PATH@
+
+# A debug build of xen?
+debug               := @debug@
+
+# Tools path
+PYTHON              := @PYTHON@
+
+# Extra folder for libs/includes
+PREPEND_INCLUDES    := @PREPEND_INCLUDES@
+PREPEND_LIB         := @PREPEND_LIB@
+APPEND_INCLUDES     := @APPEND_INCLUDES@
+APPEND_LIB          := @APPEND_LIB@
+
+# Enable XSM security module (by default, Flask).
+XSM_ENABLE          := @xsm@
+FLASK_ENABLE        := @xsm@
diff -r d6c72d5ab780 -r f25e5785327e tools/configure.ac
--- a/tools/configure.ac	Wed Feb 29 13:33:51 2012 +0000
+++ b/tools/configure.ac	Wed Feb 29 13:40:25 2012 +0000
@@ -6,6 +6,7 @@
     [xen-devel@lists.xensource.com])
 AC_CONFIG_SRCDIR([libxl/libxl.c])
 AC_CONFIG_FILES([../config/Tools.mk])
+AC_CONFIG_FILES([../config/Xen.mk])
 AC_CONFIG_HEADERS([config.h])
 AC_PREFIX_DEFAULT([/usr])
 AC_CONFIG_AUX_DIR([.])
diff -r d6c72d5ab780 -r f25e5785327e xen/Rules.mk
--- a/xen/Rules.mk	Wed Feb 29 13:33:51 2012 +0000
+++ b/xen/Rules.mk	Wed Feb 29 13:40:25 2012 +0000
@@ -12,6 +12,7 @@
 lto           ?= n
 
 include $(XEN_ROOT)/Config.mk
+include $(XEN_ROOT)/config/Xen.mk
 
 # Hardcoded configuration implications and dependencies.
 # Do this is a neater way if it becomes unwieldy.

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cb-0007Al-QT; Thu, 01 Mar 2012 08:44: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 1S31ca-00077T-3S
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:20 +0000
Received: from [85.158.139.83:5442] by server-9.bemta-5.messagelabs.com id
	CA/78-09826-3E63F4F4; Thu, 01 Mar 2012 08:44:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1330591457!6078443!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32022 invoked from network); 1 Mar 2012 08:44:18 -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;
	1 Mar 2012 08:44: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 1S31cX-0002CC-7T
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cX-0003NS-5j
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:17 +0000
Message-Id: <E1S31cX-0003NS-5j@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] install: remove old checks from
	install.sh
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1330526164 0
# Node ID 24117fff2fe1576bd0a50842413fc5d150cf60c6
# Parent  606af3fbd6fc54e16a286ccfc296f21c523b5d15
install: remove old checks from install.sh

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 606af3fbd6fc -r 24117fff2fe1 install.sh
--- a/install.sh	Wed Feb 29 14:32:51 2012 +0000
+++ b/install.sh	Wed Feb 29 14:36:04 2012 +0000
@@ -49,9 +49,4 @@
 
 echo "All done."
 
-echo "Checking to see whether prerequisite tools are installed..."
-cd $src/../check
-./chk install
-echo "All done."
-
 exit 0

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cb-0007Al-QT; Thu, 01 Mar 2012 08:44: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 1S31ca-00077T-3S
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:20 +0000
Received: from [85.158.139.83:5442] by server-9.bemta-5.messagelabs.com id
	CA/78-09826-3E63F4F4; Thu, 01 Mar 2012 08:44:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1330591457!6078443!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32022 invoked from network); 1 Mar 2012 08:44:18 -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;
	1 Mar 2012 08:44: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 1S31cX-0002CC-7T
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cX-0003NS-5j
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:17 +0000
Message-Id: <E1S31cX-0003NS-5j@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] install: remove old checks from
	install.sh
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1330526164 0
# Node ID 24117fff2fe1576bd0a50842413fc5d150cf60c6
# Parent  606af3fbd6fc54e16a286ccfc296f21c523b5d15
install: remove old checks from install.sh

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 606af3fbd6fc -r 24117fff2fe1 install.sh
--- a/install.sh	Wed Feb 29 14:32:51 2012 +0000
+++ b/install.sh	Wed Feb 29 14:36:04 2012 +0000
@@ -49,9 +49,4 @@
 
 echo "All done."
 
-echo "Checking to see whether prerequisite tools are installed..."
-cd $src/../check
-./chk install
-echo "All done."
-
 exit 0

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31ca-00079c-JC; Thu, 01 Mar 2012 08:44:20 +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 1S31cZ-00077T-6o
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:19 +0000
Received: from [85.158.139.83:31140] by server-9.bemta-5.messagelabs.com id
	D0/78-09826-2E63F4F4; Thu, 01 Mar 2012 08:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1330591456!17277127!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8898 invoked from network); 1 Mar 2012 08:44:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08:44: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 1S31cW-0002C6-6g
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cW-0003MR-1V
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:16 +0000
Message-Id: <E1S31cW-0003MR-1V@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: rename libxl__yajl_gen_alloc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330525919 0
# Node ID 2b5cf6bde62d4c5278471511cee716650a8eed5a
# Parent  93d379d11cbb191735cd318b0f4aab96e170013e
libxl: rename libxl__yajl_gen_alloc

libxl__yajl_gen_alloc() is called by generic code,
rename it to libx_yajl_gen_alloc().

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


diff -r 93d379d11cbb -r 2b5cf6bde62d tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons	Wed Feb 29 13:51:42 2012 +0000
+++ b/tools/hotplug/Linux/init.d/xencommons	Wed Feb 29 14:31:59 2012 +0000
@@ -58,6 +58,7 @@
 	modprobe xen-gntdev 2>/dev/null
 	modprobe evtchn 2>/dev/null
 	modprobe gntdev 2>/dev/null
+	modprobe processor-passthru 2>/dev/null
 
 	if ! `xenstore-read -s / >/dev/null 2>&1`
 	then
diff -r 93d379d11cbb -r 2b5cf6bde62d tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Wed Feb 29 13:51:42 2012 +0000
+++ b/tools/libxl/libxl_json.c	Wed Feb 29 14:31:59 2012 +0000
@@ -813,7 +813,7 @@
     yajl_gen_status s;
     yajl_gen hand;
 
-    hand = libxl__yajl_gen_alloc(NULL);
+    hand = libxl_yajl_gen_alloc(NULL);
     if (!hand)
         return NULL;
 
diff -r 93d379d11cbb -r 2b5cf6bde62d tools/libxl/libxl_json.h
--- a/tools/libxl/libxl_json.h	Wed Feb 29 13:51:42 2012 +0000
+++ b/tools/libxl/libxl_json.h	Wed Feb 29 14:31:59 2012 +0000
@@ -40,7 +40,7 @@
     return yajl_alloc(callbacks, allocFuncs, ctx);
 }
 
-static inline yajl_gen libxl__yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
+static inline yajl_gen libxl_yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
 {
     return yajl_gen_alloc(allocFuncs);
 }
@@ -62,7 +62,7 @@
     return yajl_alloc(callbacks, &cfg, allocFuncs, ctx);
 }
 
-static inline yajl_gen libxl__yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
+static inline yajl_gen libxl_yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
 {
     yajl_gen_config conf = { 1, "    " };
     return yajl_gen_alloc(&conf, allocFuncs);
diff -r 93d379d11cbb -r 2b5cf6bde62d tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Wed Feb 29 13:51:42 2012 +0000
+++ b/tools/libxl/libxl_qmp.c	Wed Feb 29 14:31:59 2012 +0000
@@ -464,7 +464,7 @@
     yajl_gen hand;
     callback_id_pair *elm = NULL;
 
-    hand = libxl__yajl_gen_alloc(NULL);
+    hand = libxl_yajl_gen_alloc(NULL);
 
     if (!hand) {
         return NULL;

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31ca-00079c-JC; Thu, 01 Mar 2012 08:44:20 +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 1S31cZ-00077T-6o
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:19 +0000
Received: from [85.158.139.83:31140] by server-9.bemta-5.messagelabs.com id
	D0/78-09826-2E63F4F4; Thu, 01 Mar 2012 08:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1330591456!17277127!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8898 invoked from network); 1 Mar 2012 08:44:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08:44: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 1S31cW-0002C6-6g
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cW-0003MR-1V
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:16 +0000
Message-Id: <E1S31cW-0003MR-1V@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: rename libxl__yajl_gen_alloc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330525919 0
# Node ID 2b5cf6bde62d4c5278471511cee716650a8eed5a
# Parent  93d379d11cbb191735cd318b0f4aab96e170013e
libxl: rename libxl__yajl_gen_alloc

libxl__yajl_gen_alloc() is called by generic code,
rename it to libx_yajl_gen_alloc().

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


diff -r 93d379d11cbb -r 2b5cf6bde62d tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons	Wed Feb 29 13:51:42 2012 +0000
+++ b/tools/hotplug/Linux/init.d/xencommons	Wed Feb 29 14:31:59 2012 +0000
@@ -58,6 +58,7 @@
 	modprobe xen-gntdev 2>/dev/null
 	modprobe evtchn 2>/dev/null
 	modprobe gntdev 2>/dev/null
+	modprobe processor-passthru 2>/dev/null
 
 	if ! `xenstore-read -s / >/dev/null 2>&1`
 	then
diff -r 93d379d11cbb -r 2b5cf6bde62d tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Wed Feb 29 13:51:42 2012 +0000
+++ b/tools/libxl/libxl_json.c	Wed Feb 29 14:31:59 2012 +0000
@@ -813,7 +813,7 @@
     yajl_gen_status s;
     yajl_gen hand;
 
-    hand = libxl__yajl_gen_alloc(NULL);
+    hand = libxl_yajl_gen_alloc(NULL);
     if (!hand)
         return NULL;
 
diff -r 93d379d11cbb -r 2b5cf6bde62d tools/libxl/libxl_json.h
--- a/tools/libxl/libxl_json.h	Wed Feb 29 13:51:42 2012 +0000
+++ b/tools/libxl/libxl_json.h	Wed Feb 29 14:31:59 2012 +0000
@@ -40,7 +40,7 @@
     return yajl_alloc(callbacks, allocFuncs, ctx);
 }
 
-static inline yajl_gen libxl__yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
+static inline yajl_gen libxl_yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
 {
     return yajl_gen_alloc(allocFuncs);
 }
@@ -62,7 +62,7 @@
     return yajl_alloc(callbacks, &cfg, allocFuncs, ctx);
 }
 
-static inline yajl_gen libxl__yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
+static inline yajl_gen libxl_yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
 {
     yajl_gen_config conf = { 1, "    " };
     return yajl_gen_alloc(&conf, allocFuncs);
diff -r 93d379d11cbb -r 2b5cf6bde62d tools/libxl/libxl_qmp.c
--- a/tools/libxl/libxl_qmp.c	Wed Feb 29 13:51:42 2012 +0000
+++ b/tools/libxl/libxl_qmp.c	Wed Feb 29 14:31:59 2012 +0000
@@ -464,7 +464,7 @@
     yajl_gen hand;
     callback_id_pair *elm = NULL;
 
-    hand = libxl__yajl_gen_alloc(NULL);
+    hand = libxl_yajl_gen_alloc(NULL);
 
     if (!hand) {
         return NULL;

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cb-0007Ar-Sq; Thu, 01 Mar 2012 08:44:21 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31ca-00077U-EU
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1330591453!18952156!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22449 invoked from network); 1 Mar 2012 08:44:14 -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;
	1 Mar 2012 08: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 1S31cT-0002Bq-2w
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cT-0003Jp-17
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:13 +0000
Message-Id: <E1S31cT-0003Jp-17@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm/flask: clean interdomain event
	channel hook
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330523231 0
# Node ID 2e6c3194c3b291e837df5ba6c80394fb1c0977f4
# Parent  ea7a07622a4321283a1c6b74f8915890dab714a6
xsm/flask: clean interdomain event channel hook

Don't attempt to relabel the already-bound half of the event channel
pair created by an interdomain event channel. This relabeling also
performed an incorrect check that the destination domain is permitted
to create the reverse event channel, which may not be true if the
unbound channel was created by the domain builder (like the xenstore
channel).

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


diff -r ea7a07622a43 -r 2e6c3194c3b2 xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Wed Feb 29 13:46:32 2012 +0000
+++ b/xen/xsm/flask/hooks.c	Wed Feb 29 13:47:11 2012 +0000
@@ -182,12 +182,12 @@
 static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1, 
                                     struct domain *d2, struct evtchn *chn2)
 {
-    u32 newsid1;
-    u32 newsid2;
+    u32 newsid;
     int rc;
-    struct domain_security_struct *dsec1, *dsec2;
+    struct domain_security_struct *dsec, *dsec1, *dsec2;
     struct evtchn_security_struct *esec1, *esec2;
 
+    dsec = current->domain->ssid;
     dsec1 = d1->ssid;
     dsec2 = d2->ssid;
 
@@ -195,7 +195,7 @@
     esec2 = chn2->ssid;
 
     rc = security_transition_sid(dsec1->sid, dsec2->sid, 
-                                 SECCLASS_EVENT, &newsid1);
+                                 SECCLASS_EVENT, &newsid);
     if ( rc )
     {
         printk("%s: security_transition_sid failed, rc=%d (domain=%d)\n",
@@ -203,33 +203,19 @@
         return rc;
     }
 
-    rc = avc_has_perm(dsec1->sid, newsid1, SECCLASS_EVENT, EVENT__CREATE, NULL);
+    rc = avc_has_perm(dsec->sid, newsid, SECCLASS_EVENT, EVENT__CREATE, NULL);
     if ( rc )
         return rc;
 
-    rc = security_transition_sid(dsec2->sid, dsec1->sid, 
-                                 SECCLASS_EVENT, &newsid2);
-    if ( rc )
-    {
-        printk("%s: security_transition_sid failed, rc=%d (domain=%d)\n",
-               __FUNCTION__, -rc, d1->domain_id);
-        return rc;
-    }
-
-    rc = avc_has_perm(dsec2->sid, newsid2, SECCLASS_EVENT, EVENT__CREATE, NULL);
+    rc = avc_has_perm(newsid, dsec2->sid, SECCLASS_EVENT, EVENT__BIND, NULL);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(newsid1, dsec2->sid, SECCLASS_EVENT, EVENT__BIND, NULL);
+    rc = avc_has_perm(esec2->sid, dsec1->sid, SECCLASS_EVENT, EVENT__BIND, NULL);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(newsid2, dsec1->sid, SECCLASS_EVENT, EVENT__BIND, NULL);
-    if ( rc )
-        return rc;    
-
-    esec1->sid = newsid1;
-    esec2->sid = newsid2;
+    esec1->sid = newsid;
 
     return rc;
 }

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cb-0007Ar-Sq; Thu, 01 Mar 2012 08:44:21 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31ca-00077U-EU
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1330591453!18952156!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22449 invoked from network); 1 Mar 2012 08:44:14 -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;
	1 Mar 2012 08: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 1S31cT-0002Bq-2w
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cT-0003Jp-17
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:13 +0000
Message-Id: <E1S31cT-0003Jp-17@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm/flask: clean interdomain event
	channel hook
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330523231 0
# Node ID 2e6c3194c3b291e837df5ba6c80394fb1c0977f4
# Parent  ea7a07622a4321283a1c6b74f8915890dab714a6
xsm/flask: clean interdomain event channel hook

Don't attempt to relabel the already-bound half of the event channel
pair created by an interdomain event channel. This relabeling also
performed an incorrect check that the destination domain is permitted
to create the reverse event channel, which may not be true if the
unbound channel was created by the domain builder (like the xenstore
channel).

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


diff -r ea7a07622a43 -r 2e6c3194c3b2 xen/xsm/flask/hooks.c
--- a/xen/xsm/flask/hooks.c	Wed Feb 29 13:46:32 2012 +0000
+++ b/xen/xsm/flask/hooks.c	Wed Feb 29 13:47:11 2012 +0000
@@ -182,12 +182,12 @@
 static int flask_evtchn_interdomain(struct domain *d1, struct evtchn *chn1, 
                                     struct domain *d2, struct evtchn *chn2)
 {
-    u32 newsid1;
-    u32 newsid2;
+    u32 newsid;
     int rc;
-    struct domain_security_struct *dsec1, *dsec2;
+    struct domain_security_struct *dsec, *dsec1, *dsec2;
     struct evtchn_security_struct *esec1, *esec2;
 
+    dsec = current->domain->ssid;
     dsec1 = d1->ssid;
     dsec2 = d2->ssid;
 
@@ -195,7 +195,7 @@
     esec2 = chn2->ssid;
 
     rc = security_transition_sid(dsec1->sid, dsec2->sid, 
-                                 SECCLASS_EVENT, &newsid1);
+                                 SECCLASS_EVENT, &newsid);
     if ( rc )
     {
         printk("%s: security_transition_sid failed, rc=%d (domain=%d)\n",
@@ -203,33 +203,19 @@
         return rc;
     }
 
-    rc = avc_has_perm(dsec1->sid, newsid1, SECCLASS_EVENT, EVENT__CREATE, NULL);
+    rc = avc_has_perm(dsec->sid, newsid, SECCLASS_EVENT, EVENT__CREATE, NULL);
     if ( rc )
         return rc;
 
-    rc = security_transition_sid(dsec2->sid, dsec1->sid, 
-                                 SECCLASS_EVENT, &newsid2);
-    if ( rc )
-    {
-        printk("%s: security_transition_sid failed, rc=%d (domain=%d)\n",
-               __FUNCTION__, -rc, d1->domain_id);
-        return rc;
-    }
-
-    rc = avc_has_perm(dsec2->sid, newsid2, SECCLASS_EVENT, EVENT__CREATE, NULL);
+    rc = avc_has_perm(newsid, dsec2->sid, SECCLASS_EVENT, EVENT__BIND, NULL);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(newsid1, dsec2->sid, SECCLASS_EVENT, EVENT__BIND, NULL);
+    rc = avc_has_perm(esec2->sid, dsec1->sid, SECCLASS_EVENT, EVENT__BIND, NULL);
     if ( rc )
         return rc;
 
-    rc = avc_has_perm(newsid2, dsec1->sid, SECCLASS_EVENT, EVENT__BIND, NULL);
-    if ( rc )
-        return rc;    
-
-    esec1->sid = newsid1;
-    esec2->sid = newsid2;
+    esec1->sid = newsid;
 
     return rc;
 }

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cd-0007CV-W1; Thu, 01 Mar 2012 08:44:24 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cc-00077z-67
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-174.messagelabs.com!1330591454!15603953!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13328 invoked from network); 1 Mar 2012 08:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08:44: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 1S31cS-0002Bn-HH
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cS-0003JI-Fa
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:12 +0000
Message-Id: <E1S31cS-0003JI-Fa@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm: label xen-consumer event
	channels
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330523192 0
# Node ID ea7a07622a4321283a1c6b74f8915890dab714a6
# Parent  be9d56fada86d1444ff116104c13d2f8600abf8b
xsm: label xen-consumer event channels

Event channels created during the domain build process for HVM domains
did not call the XSM creation hook. Since these channels are used
internally by Xen, redirect them to DOMAIN_INVAID instead of failing
to create if the XSM hook fails the permissions check.

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


diff -r be9d56fada86 -r ea7a07622a43 xen/common/event_channel.c
--- a/xen/common/event_channel.c	Wed Feb 29 13:43:44 2012 +0000
+++ b/xen/common/event_channel.c	Wed Feb 29 13:46:32 2012 +0000
@@ -1105,7 +1105,7 @@
 {
     struct evtchn *chn;
     struct domain *d = local_vcpu->domain;
-    int            port;
+    int            port, rc;
 
     spin_lock(&d->event_lock);
 
@@ -1113,10 +1113,12 @@
         goto out;
     chn = evtchn_from_port(d, port);
 
+    rc = xsm_evtchn_unbound(d, chn, remote_domid);
+
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
     chn->notify_vcpu_id = local_vcpu->vcpu_id;
-    chn->u.unbound.remote_domid = remote_domid;
+    chn->u.unbound.remote_domid = !rc ? remote_domid : DOMID_INVALID;
 
  out:
     spin_unlock(&d->event_lock);

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cd-0007CV-W1; Thu, 01 Mar 2012 08:44:24 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cc-00077z-67
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-174.messagelabs.com!1330591454!15603953!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13328 invoked from network); 1 Mar 2012 08:44:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08:44: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 1S31cS-0002Bn-HH
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cS-0003JI-Fa
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:12 +0000
Message-Id: <E1S31cS-0003JI-Fa@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm: label xen-consumer event
	channels
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330523192 0
# Node ID ea7a07622a4321283a1c6b74f8915890dab714a6
# Parent  be9d56fada86d1444ff116104c13d2f8600abf8b
xsm: label xen-consumer event channels

Event channels created during the domain build process for HVM domains
did not call the XSM creation hook. Since these channels are used
internally by Xen, redirect them to DOMAIN_INVAID instead of failing
to create if the XSM hook fails the permissions check.

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


diff -r be9d56fada86 -r ea7a07622a43 xen/common/event_channel.c
--- a/xen/common/event_channel.c	Wed Feb 29 13:43:44 2012 +0000
+++ b/xen/common/event_channel.c	Wed Feb 29 13:46:32 2012 +0000
@@ -1105,7 +1105,7 @@
 {
     struct evtchn *chn;
     struct domain *d = local_vcpu->domain;
-    int            port;
+    int            port, rc;
 
     spin_lock(&d->event_lock);
 
@@ -1113,10 +1113,12 @@
         goto out;
     chn = evtchn_from_port(d, port);
 
+    rc = xsm_evtchn_unbound(d, chn, remote_domid);
+
     chn->state = ECS_UNBOUND;
     chn->xen_consumer = get_xen_consumer(notification_fn);
     chn->notify_vcpu_id = local_vcpu->vcpu_id;
-    chn->u.unbound.remote_domid = remote_domid;
+    chn->u.unbound.remote_domid = !rc ? remote_domid : DOMID_INVALID;
 
  out:
     spin_unlock(&d->event_lock);

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31ce-0007D8-8C; Thu, 01 Mar 2012 08:44:24 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cc-000781-Ej
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1330591452!13145047!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12864 invoked from network); 1 Mar 2012 08:44:13 -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;
	1 Mar 2012 08: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 1S31cS-0002Bk-2d
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cR-0003Im-Tu
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:11 +0000
Message-Id: <E1S31cR-0003Im-Tu@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update autoconf-generated configure
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330523024 0
# Node ID be9d56fada86d1444ff116104c13d2f8600abf8b
# Parent  f25e5785327e45c8e4e3270effa1d5c3ee4df2ae
Update autoconf-generated configure script.

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


diff -r f25e5785327e -r be9d56fada86 tools/configure
--- a/tools/configure	Wed Feb 29 13:40:25 2012 +0000
+++ b/tools/configure	Wed Feb 29 13:43:44 2012 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for Xen Hypervisor 4.2.
+# Generated by GNU Autoconf 2.68 for Xen Hypervisor 4.2.
 #
 # Report bugs to <xen-devel@lists.xensource.com>.
 #
@@ -91,6 +91,7 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -216,11 +217,18 @@
   # We cannot yet assume a decent shell, so we have to provide a
 	# neutralization value for shells without unset; and this also
 	# works around shells that cannot unset nonexistent variables.
+	# Preserve -v and -x to the replacement shell.
 	BASH_ENV=/dev/null
 	ENV=/dev/null
 	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
 	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+	case $- in # ((((
+	  *v*x* | *x*v* ) as_opts=-vx ;;
+	  *v* ) as_opts=-v ;;
+	  *x* ) as_opts=-x ;;
+	  * ) as_opts= ;;
+	esac
+	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
 fi
 
     if test x$as_have_required = xno; then :
@@ -1155,7 +1163,7 @@
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -1476,7 +1484,7 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 Xen Hypervisor configure 4.2
-generated by GNU Autoconf 2.67
+generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
@@ -1522,7 +1530,7 @@
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
@@ -1559,7 +1567,7 @@
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
@@ -1572,10 +1580,10 @@
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval "test \"\${$3+set}\"" = set; then :
+  if eval \${$3+:} false; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -1642,7 +1650,7 @@
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -1651,7 +1659,7 @@
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_mongrel
 
@@ -1692,7 +1700,7 @@
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
@@ -1706,7 +1714,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1724,7 +1732,7 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_compile
 
@@ -1769,11 +1777,65 @@
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
 
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+	 return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+	    return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
 # ac_fn_c_check_func LINENO FUNC VAR
 # ----------------------------------
 # Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -1782,7 +1844,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1837,64 +1899,10 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_func
 
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=no"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof ($2))
-	 return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
-	    return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  eval "$3=yes"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-
-} # ac_fn_c_check_type
-
 # ac_fn_c_find_intX_t LINENO BITS VAR
 # -----------------------------------
 # Finds a signed integer type with width BITS, setting cache variable VAR
@@ -1904,7 +1912,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
 $as_echo_n "checking for int$2_t... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=no"
@@ -1965,7 +1973,7 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_find_intX_t
 
@@ -1978,7 +1986,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
 $as_echo_n "checking for $2.$3... " >&6; }
-if eval "test \"\${$4+set}\"" = set; then :
+if eval \${$4+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2022,7 +2030,7 @@
 eval ac_res=\$$4
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_member
 
@@ -2035,7 +2043,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
 $as_echo_n "checking for uint$2_t... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=no"
@@ -2075,7 +2083,7 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_find_uintX_t
 cat >config.log <<_ACEOF
@@ -2083,7 +2091,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by Xen Hypervisor $as_me 4.2, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
 
@@ -2341,7 +2349,7 @@
       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
@@ -2438,6 +2446,8 @@
 
 ac_config_files="$ac_config_files ../config/Tools.mk"
 
+ac_config_files="$ac_config_files ../config/Xen.mk"
+
 ac_config_headers="$ac_config_headers config.h"
 
 
@@ -2494,7 +2504,7 @@
 set dummy ${ac_tool_prefix}gcc; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2534,7 +2544,7 @@
 set dummy gcc; 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_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2587,7 +2597,7 @@
 set dummy ${ac_tool_prefix}cc; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2627,7 +2637,7 @@
 set dummy cc; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2686,7 +2696,7 @@
 set dummy $ac_tool_prefix$ac_prog; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2730,7 +2740,7 @@
 set dummy $ac_prog; 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_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2785,7 +2795,7 @@
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -2900,7 +2910,7 @@
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -2943,7 +2953,7 @@
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3002,7 +3012,7 @@
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
     fi
   fi
 fi
@@ -3013,7 +3023,7 @@
 ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
+if ${ac_cv_objext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3054,7 +3064,7 @@
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -3064,7 +3074,7 @@
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3101,7 +3111,7 @@
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -3179,7 +3189,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -3287,7 +3297,7 @@
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then :
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -3403,7 +3413,7 @@
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -3415,7 +3425,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then :
+if ${ac_cv_path_GREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -3478,7 +3488,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
+if ${ac_cv_path_EGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -3545,7 +3555,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3674,7 +3684,7 @@
 
 
   ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
-if test "x$ac_cv_header_minix_config_h" = x""yes; then :
+if test "x$ac_cv_header_minix_config_h" = xyes; then :
   MINIX=yes
 else
   MINIX=
@@ -3696,7 +3706,7 @@
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
-if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
+if ${ac_cv_safe_to_define___extensions__+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3739,7 +3749,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then :
+if ${ac_cv_build+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
@@ -3755,7 +3765,7 @@
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -3773,7 +3783,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then :
+if ${ac_cv_host+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
@@ -3788,7 +3798,7 @@
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -4162,7 +4172,7 @@
 # Checks for programs.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if test "${ac_cv_path_SED+set}" = set; then :
+if ${ac_cv_path_SED+:} false; then :
   $as_echo_n "(cached) " >&6
 else
             ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
@@ -4239,7 +4249,7 @@
 set dummy ${ac_tool_prefix}gcc; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4279,7 +4289,7 @@
 set dummy gcc; 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_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -4332,7 +4342,7 @@
 set dummy ${ac_tool_prefix}cc; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4372,7 +4382,7 @@
 set dummy cc; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4431,7 +4441,7 @@
 set dummy $ac_tool_prefix$ac_prog; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4475,7 +4485,7 @@
 set dummy $ac_prog; 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_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -4530,7 +4540,7 @@
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -4559,7 +4569,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4596,7 +4606,7 @@
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -4674,7 +4684,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -4784,7 +4794,7 @@
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -4828,7 +4838,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then :
+if ${ac_cv_path_install+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -4908,7 +4918,7 @@
 set dummy perl; 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_PERL+set}" = set; then :
+if ${ac_cv_path_PERL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PERL in
@@ -4953,7 +4963,7 @@
 set dummy ip; 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_IP+set}" = set; then :
+if ${ac_cv_path_IP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $IP in
@@ -4998,7 +5008,7 @@
 set dummy bison; 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_BISON+set}" = set; then :
+if ${ac_cv_path_BISON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BISON in
@@ -5043,7 +5053,7 @@
 set dummy flex; 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_FLEX+set}" = set; then :
+if ${ac_cv_path_FLEX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $FLEX in
@@ -5090,7 +5100,7 @@
 set dummy curl-config; 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_CURL+set}" = set; then :
+if ${ac_cv_path_CURL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $CURL in
@@ -5135,7 +5145,7 @@
 set dummy xml2-config; 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_XML+set}" = set; then :
+if ${ac_cv_path_XML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $XML in
@@ -5186,7 +5196,7 @@
 set dummy ${ac_tool_prefix}ocamlc; 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_prog_OCAMLC+set}" = set; then :
+if ${ac_cv_prog_OCAMLC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLC"; then
@@ -5226,7 +5236,7 @@
 set dummy ocamlc; 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_prog_ac_ct_OCAMLC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLC"; then
@@ -5297,7 +5307,7 @@
 set dummy ${ac_tool_prefix}ocamlopt; 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_prog_OCAMLOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPT"; then
@@ -5337,7 +5347,7 @@
 set dummy ocamlopt; 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_prog_ac_ct_OCAMLOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPT"; then
@@ -5407,7 +5417,7 @@
 set dummy ${ac_tool_prefix}ocamlc.opt; 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_prog_OCAMLCDOTOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLCDOTOPT"; then
@@ -5447,7 +5457,7 @@
 set dummy ocamlc.opt; 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_prog_ac_ct_OCAMLCDOTOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLCDOTOPT"; then
@@ -5511,7 +5521,7 @@
 set dummy ${ac_tool_prefix}ocamlopt.opt; 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_prog_OCAMLOPTDOTOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPTDOTOPT"; then
@@ -5551,7 +5561,7 @@
 set dummy ocamlopt.opt; 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_prog_ac_ct_OCAMLOPTDOTOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
@@ -5620,7 +5630,7 @@
 set dummy ${ac_tool_prefix}ocaml; 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_prog_OCAML+set}" = set; then :
+if ${ac_cv_prog_OCAML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAML"; then
@@ -5660,7 +5670,7 @@
 set dummy ocaml; 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_prog_ac_ct_OCAML+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAML"; then
@@ -5714,7 +5724,7 @@
 set dummy ${ac_tool_prefix}ocamldep; 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_prog_OCAMLDEP+set}" = set; then :
+if ${ac_cv_prog_OCAMLDEP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDEP"; then
@@ -5754,7 +5764,7 @@
 set dummy ocamldep; 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_prog_ac_ct_OCAMLDEP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDEP"; then
@@ -5808,7 +5818,7 @@
 set dummy ${ac_tool_prefix}ocamlmktop; 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_prog_OCAMLMKTOP+set}" = set; then :
+if ${ac_cv_prog_OCAMLMKTOP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKTOP"; then
@@ -5848,7 +5858,7 @@
 set dummy ocamlmktop; 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_prog_ac_ct_OCAMLMKTOP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKTOP"; then
@@ -5902,7 +5912,7 @@
 set dummy ${ac_tool_prefix}ocamlmklib; 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_prog_OCAMLMKLIB+set}" = set; then :
+if ${ac_cv_prog_OCAMLMKLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKLIB"; then
@@ -5942,7 +5952,7 @@
 set dummy ocamlmklib; 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_prog_ac_ct_OCAMLMKLIB+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKLIB"; then
@@ -5996,7 +6006,7 @@
 set dummy ${ac_tool_prefix}ocamldoc; 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_prog_OCAMLDOC+set}" = set; then :
+if ${ac_cv_prog_OCAMLDOC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDOC"; then
@@ -6036,7 +6046,7 @@
 set dummy ocamldoc; 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_prog_ac_ct_OCAMLDOC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDOC"; then
@@ -6090,7 +6100,7 @@
 set dummy ${ac_tool_prefix}ocamlbuild; 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_prog_OCAMLBUILD+set}" = set; then :
+if ${ac_cv_prog_OCAMLBUILD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLBUILD"; then
@@ -6130,7 +6140,7 @@
 set dummy ocamlbuild; 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_prog_ac_ct_OCAMLBUILD+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLBUILD"; then
@@ -6193,7 +6203,7 @@
 set dummy bash; 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_BASH+set}" = set; then :
+if ${ac_cv_path_BASH+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BASH in
@@ -6250,7 +6260,7 @@
 set dummy $PYTHON; 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_PYTHONPATH+set}" = set; then :
+if ${ac_cv_path_PYTHONPATH+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PYTHONPATH in
@@ -6342,7 +6352,7 @@
 set dummy xgettext; 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_XGETTEXT+set}" = set; then :
+if ${ac_cv_path_XGETTEXT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $XGETTEXT in
@@ -6386,7 +6396,7 @@
 if test "x$host_os" == "xlinux-gnu"
 then
     ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then :
+if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
 
 else
   as_fn_error $? "cannot find uuid headers" "$LINENO" 5
@@ -6395,7 +6405,7 @@
 
 else
     ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_h" = x""yes; then :
+if test "x$ac_cv_header_uuid_h" = xyes; then :
 
 else
   as_fn_error $? "cannot find uuid headers" "$LINENO" 5
@@ -6416,7 +6426,7 @@
 set dummy ${ac_tool_prefix}pkg-config; 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_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -6459,7 +6469,7 @@
 set dummy pkg-config; 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_ac_pt_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $ac_pt_PKG_CONFIG in
@@ -6604,7 +6614,7 @@
 See the pkg-config man page for more details.
 
 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 else
 	glib_CFLAGS=$pkg_cv_glib_CFLAGS
 	glib_LIBS=$pkg_cv_glib_LIBS
@@ -6628,7 +6638,7 @@
 # Checks for libraries.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_setup in -laio" >&5
 $as_echo_n "checking for io_setup in -laio... " >&6; }
-if test "${ac_cv_lib_aio_io_setup+set}" = set; then :
+if ${ac_cv_lib_aio_io_setup+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6662,7 +6672,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aio_io_setup" >&5
 $as_echo "$ac_cv_lib_aio_io_setup" >&6; }
-if test "x$ac_cv_lib_aio_io_setup" = x""yes; then :
+if test "x$ac_cv_lib_aio_io_setup" = xyes; then :
   system_aio="y"
 else
   system_aio="n"
@@ -6671,7 +6681,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5 in -lcrypto" >&5
 $as_echo_n "checking for MD5 in -lcrypto... " >&6; }
-if test "${ac_cv_lib_crypto_MD5+set}" = set; then :
+if ${ac_cv_lib_crypto_MD5+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6705,7 +6715,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5" >&5
 $as_echo "$ac_cv_lib_crypto_MD5" >&6; }
-if test "x$ac_cv_lib_crypto_MD5" = x""yes; then :
+if test "x$ac_cv_lib_crypto_MD5" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBCRYPTO 1
 _ACEOF
@@ -6718,7 +6728,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext2fs" >&5
 $as_echo_n "checking for ext2fs_open2 in -lext2fs... " >&6; }
-if test "${ac_cv_lib_ext2fs_ext2fs_open2+set}" = set; then :
+if ${ac_cv_lib_ext2fs_ext2fs_open2+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6752,7 +6762,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext2fs_ext2fs_open2" >&5
 $as_echo "$ac_cv_lib_ext2fs_ext2fs_open2" >&6; }
-if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = x""yes; then :
+if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = xyes; then :
   libext2fs="y"
 else
   libext2fs="n"
@@ -6761,7 +6771,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_md_hash_buffer in -lgcrypt" >&5
 $as_echo_n "checking for gcry_md_hash_buffer in -lgcrypt... " >&6; }
-if test "${ac_cv_lib_gcrypt_gcry_md_hash_buffer+set}" = set; then :
+if ${ac_cv_lib_gcrypt_gcry_md_hash_buffer+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6795,7 +6805,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&5
 $as_echo "$ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&6; }
-if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = x""yes; then :
+if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = xyes; then :
   libgcrypt="y"
 else
   libgcrypt="n"
@@ -6804,7 +6814,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
 $as_echo_n "checking for pthread_create in -lpthread... " >&6; }
-if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then :
+if ${ac_cv_lib_pthread_pthread_create+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6838,7 +6848,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then :
+if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
 
 else
   as_fn_error $? "Could not find libpthread" "$LINENO" 5
@@ -6846,7 +6856,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
 $as_echo_n "checking for clock_gettime in -lrt... " >&6; }
-if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then :
+if ${ac_cv_lib_rt_clock_gettime+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6880,7 +6890,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
-if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then :
+if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBRT 1
 _ACEOF
@@ -6891,7 +6901,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5
 $as_echo_n "checking for uuid_clear in -luuid... " >&6; }
-if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then :
+if ${ac_cv_lib_uuid_uuid_clear+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6925,7 +6935,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5
 $as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then :
+if test "x$ac_cv_lib_uuid_uuid_clear" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBUUID 1
 _ACEOF
@@ -6938,7 +6948,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
 $as_echo_n "checking for yajl_alloc in -lyajl... " >&6; }
-if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then :
+if ${ac_cv_lib_yajl_yajl_alloc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6972,7 +6982,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_yajl_yajl_alloc" >&5
 $as_echo "$ac_cv_lib_yajl_yajl_alloc" >&6; }
-if test "x$ac_cv_lib_yajl_yajl_alloc" = x""yes; then :
+if test "x$ac_cv_lib_yajl_yajl_alloc" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBYAJL 1
 _ACEOF
@@ -6985,7 +6995,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflateCopy in -lz" >&5
 $as_echo_n "checking for deflateCopy in -lz... " >&6; }
-if test "${ac_cv_lib_z_deflateCopy+set}" = set; then :
+if ${ac_cv_lib_z_deflateCopy+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -7019,7 +7029,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflateCopy" >&5
 $as_echo "$ac_cv_lib_z_deflateCopy" >&6; }
-if test "x$ac_cv_lib_z_deflateCopy" = x""yes; then :
+if test "x$ac_cv_lib_z_deflateCopy" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBZ 1
 _ACEOF
@@ -7032,7 +7042,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5
 $as_echo_n "checking for libiconv_open in -liconv... " >&6; }
-if test "${ac_cv_lib_iconv_libiconv_open+set}" = set; then :
+if ${ac_cv_lib_iconv_libiconv_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -7066,7 +7076,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5
 $as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; }
-if test "x$ac_cv_lib_iconv_libiconv_open" = x""yes; then :
+if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then :
   libiconv="y"
 else
   libiconv="n"
@@ -7075,11 +7085,22 @@
 
 
 # Checks for header files.
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
 $as_echo_n "checking for working alloca.h... " >&6; }
-if test "${ac_cv_working_alloca_h+set}" = set; then :
+if ${ac_cv_working_alloca_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7112,7 +7133,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
 $as_echo_n "checking for alloca... " >&6; }
-if test "${ac_cv_func_alloca_works+set}" = set; then :
+if ${ac_cv_func_alloca_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7131,7 +7152,7 @@
  #pragma alloca
 #   else
 #    ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
+void *alloca (size_t);
 #    endif
 #   endif
 #  endif
@@ -7175,7 +7196,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if test "${ac_cv_os_cray+set}" = set; then :
+if ${ac_cv_os_cray+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7216,7 +7237,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
 $as_echo_n "checking stack direction for C alloca... " >&6; }
-if test "${ac_cv_c_stack_direction+set}" = set; then :
+if ${ac_cv_c_stack_direction+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -7287,7 +7308,7 @@
 # Checks for typedefs, structures, and compiler characteristics.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
-if test "${ac_cv_header_stdbool_h+set}" = set; then :
+if ${ac_cv_header_stdbool_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7319,7 +7340,7 @@
 	char b[false == 0 ? 1 : -1];
 	char c[__bool_true_false_are_defined == 1 ? 1 : -1];
 	char d[(bool) 0.5 == true ? 1 : -1];
-	bool e = &s;
+	/* See body of main program for 'e'.  */
 	char f[(_Bool) 0.0 == false ? 1 : -1];
 	char g[true];
 	char h[sizeof (_Bool)];
@@ -7330,25 +7351,6 @@
 	_Bool n[m];
 	char o[sizeof n == m * sizeof n[0] ? 1 : -1];
 	char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-#	if defined __xlc__ || defined __GNUC__
-	 /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
-	    reported by James Lemley on 2005-10-05; see
-	    http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-	    This test is not quite right, since xlc is allowed to
-	    reject this program, as the initializer for xlcbug is
-	    not one of the forms that C requires support for.
-	    However, doing the test right would require a runtime
-	    test, and that would make cross-compilation harder.
-	    Let us hope that IBM fixes the xlc bug, and also adds
-	    support for this kind of constant expression.  In the
-	    meantime, this test will reject xlc, which is OK, since
-	    our stdbool.h substitute should suffice.  We also test
-	    this with GCC, where it should work, to detect more
-	    quickly whether someone messes up the test in the
-	    future.  */
-	 char digs[] = "0123456789";
-	 int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
-#	endif
 	/* Catch a bug in an HP-UX C compiler.  See
 	   http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
 	   http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
@@ -7360,6 +7362,7 @@
 main ()
 {
 
+	bool e = &s;
 	*pq |= q;
 	*pq |= ! q;
 	/* Refer to every declared value, to avoid compiler optimizations.  */
@@ -7380,7 +7383,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
 $as_echo "$ac_cv_header_stdbool_h" >&6; }
 ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
-if test "x$ac_cv_type__Bool" = x""yes; then :
+if test "x$ac_cv_type__Bool" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE__BOOL 1
@@ -7397,7 +7400,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
 $as_echo_n "checking for uid_t in sys/types.h... " >&6; }
-if test "${ac_cv_type_uid_t+set}" = set; then :
+if ${ac_cv_type_uid_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7427,7 +7430,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
 $as_echo_n "checking for inline... " >&6; }
-if test "${ac_cv_c_inline+set}" = set; then :
+if ${ac_cv_c_inline+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_c_inline=no
@@ -7512,7 +7515,7 @@
 esac
 
 ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
-if test "x$ac_cv_type_mode_t" = x""yes; then :
+if test "x$ac_cv_type_mode_t" = xyes; then :
 
 else
 
@@ -7523,7 +7526,7 @@
 fi
 
 ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
-if test "x$ac_cv_type_off_t" = x""yes; then :
+if test "x$ac_cv_type_off_t" = xyes; then :
 
 else
 
@@ -7534,7 +7537,7 @@
 fi
 
 ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
-if test "x$ac_cv_type_pid_t" = x""yes; then :
+if test "x$ac_cv_type_pid_t" = xyes; then :
 
 else
 
@@ -7546,7 +7549,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
 $as_echo_n "checking for C/C++ restrict keyword... " >&6; }
-if test "${ac_cv_c_restrict+set}" = set; then :
+if ${ac_cv_c_restrict+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_c_restrict=no
@@ -7591,7 +7594,7 @@
  esac
 
 ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = x""yes; then :
+if test "x$ac_cv_type_size_t" = xyes; then :
 
 else
 
@@ -7602,7 +7605,7 @@
 fi
 
 ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default"
-if test "x$ac_cv_type_ssize_t" = x""yes; then :
+if test "x$ac_cv_type_ssize_t" = xyes; then :
 
 else
 
@@ -7613,7 +7616,7 @@
 fi
 
 ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then :
+if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
@@ -7623,7 +7626,7 @@
 fi
 
 ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then :
+if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_BLOCKS 1
@@ -7643,7 +7646,7 @@
 
 
 ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then :
+if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_RDEV 1
@@ -7707,7 +7710,7 @@
   esac
 
 ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
-if test "x$ac_cv_type_ptrdiff_t" = x""yes; then :
+if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_PTRDIFF_T 1
@@ -7720,7 +7723,7 @@
 # Checks for library functions.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
 $as_echo_n "checking for error_at_line... " >&6; }
-if test "${ac_cv_lib_error_at_line+set}" = set; then :
+if ${ac_cv_lib_error_at_line+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7756,7 +7759,7 @@
 for ac_header in vfork.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
-if test "x$ac_cv_header_vfork_h" = x""yes; then :
+if test "x$ac_cv_header_vfork_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_VFORK_H 1
 _ACEOF
@@ -7780,7 +7783,7 @@
 if test "x$ac_cv_func_fork" = xyes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
 $as_echo_n "checking for working fork... " >&6; }
-if test "${ac_cv_func_fork_works+set}" = set; then :
+if ${ac_cv_func_fork_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -7833,7 +7836,7 @@
 if test "x$ac_cv_func_vfork" = xyes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
 $as_echo_n "checking for working vfork... " >&6; }
-if test "${ac_cv_func_vfork_works+set}" = set; then :
+if ${ac_cv_func_vfork_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -7968,7 +7971,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
-if test "${ac_cv_sys_largefile_source+set}" = set; then :
+if ${ac_cv_sys_largefile_source+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   while :; do
@@ -8036,7 +8039,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
 $as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
-if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then :
+if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   rm -f conftest.sym conftest.file
@@ -8098,7 +8101,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5
 $as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
-if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then :
+if ${ac_cv_header_sys_types_h_makedev+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8126,7 +8129,7 @@
 
 if test $ac_cv_header_sys_types_h_makedev = no; then
 ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then :
+if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
 
 $as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
 
@@ -8136,7 +8139,7 @@
 
   if test $ac_cv_header_sys_mkdev_h = no; then
     ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then :
+if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
 
 $as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
 
@@ -8149,7 +8152,7 @@
 for ac_header in stdlib.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = x""yes; then :
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_STDLIB_H 1
 _ACEOF
@@ -8160,7 +8163,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
 $as_echo_n "checking for GNU libc compatible malloc... " >&6; }
-if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then :
+if ${ac_cv_func_malloc_0_nonnull+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8215,7 +8218,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if test "${ac_cv_header_time+set}" = set; then :
+if ${ac_cv_header_time+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8290,7 +8293,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5
 $as_echo_n "checking for working mktime... " >&6; }
-if test "${ac_cv_func_working_mktime+set}" = set; then :
+if ${ac_cv_func_working_mktime+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8519,7 +8522,7 @@
 for ac_func in getpagesize
 do :
   ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
-if test "x$ac_cv_func_getpagesize" = x""yes; then :
+if test "x$ac_cv_func_getpagesize" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_GETPAGESIZE 1
 _ACEOF
@@ -8529,7 +8532,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
 $as_echo_n "checking for working mmap... " >&6; }
-if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then :
+if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8696,7 +8699,7 @@
 for ac_header in stdlib.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = x""yes; then :
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_STDLIB_H 1
 _ACEOF
@@ -8707,7 +8710,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
 $as_echo_n "checking for GNU libc compatible realloc... " >&6; }
-if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then :
+if ${ac_cv_func_realloc_0_nonnull+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8760,13 +8763,17 @@
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
 $as_echo_n "checking for working strnlen... " >&6; }
-if test "${ac_cv_func_strnlen_working+set}" = set; then :
+if ${ac_cv_func_strnlen_working+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
-  ac_cv_func_strnlen_working=no
+  # Guess no on AIX systems, yes otherwise.
+		case "$host_os" in
+		  aix*) ac_cv_func_strnlen_working=no;;
+		  *)    ac_cv_func_strnlen_working=yes;;
+		esac
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -8815,7 +8822,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5
 $as_echo_n "checking for working strtod... " >&6; }
-if test "${ac_cv_func_strtod+set}" = set; then :
+if ${ac_cv_func_strtod+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8874,14 +8881,14 @@
 esac
 
 ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow"
-if test "x$ac_cv_func_pow" = x""yes; then :
+if test "x$ac_cv_func_pow" = xyes; then :
 
 fi
 
 if test $ac_cv_func_pow = no; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
 $as_echo_n "checking for pow in -lm... " >&6; }
-if test "${ac_cv_lib_m_pow+set}" = set; then :
+if ${ac_cv_lib_m_pow+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -8915,7 +8922,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
 $as_echo "$ac_cv_lib_m_pow" >&6; }
-if test "x$ac_cv_lib_m_pow" = x""yes; then :
+if test "x$ac_cv_lib_m_pow" = xyes; then :
   POW_LIB=-lm
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5
@@ -9011,10 +9018,21 @@
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
+    if test "x$cache_file" != "x/dev/null"; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-    cat confcache >$cache_file
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -9046,7 +9064,7 @@
 
 
 
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -9147,6 +9165,7 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -9454,7 +9473,7 @@
 # values after options handling.
 ac_log="
 This file was extended by Xen Hypervisor $as_me 4.2, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -9516,7 +9535,7 @@
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 Xen Hypervisor config.status 4.2
-configured by $0, generated by GNU Autoconf 2.67,
+configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -9638,9 +9657,10 @@
 do
   case $ac_config_target in
     "../config/Tools.mk") CONFIG_FILES="$CONFIG_FILES ../config/Tools.mk" ;;
+    "../config/Xen.mk") CONFIG_FILES="$CONFIG_FILES ../config/Xen.mk" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -9662,9 +9682,10 @@
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp=
+  tmp= ac_tmp=
   trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
@@ -9672,12 +9693,13 @@
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -9699,7 +9721,7 @@
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -9727,7 +9749,7 @@
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -9775,7 +9797,7 @@
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
 
@@ -9807,7 +9829,7 @@
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
@@ -9841,7 +9863,7 @@
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -9853,8 +9875,8 @@
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_t"; then
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
     break
   elif $ac_last_try; then
     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
@@ -9955,7 +9977,7 @@
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -9974,7 +9996,7 @@
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$tmp/stdin";;
+      -) ac_f="$ac_tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
 	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 	 # because $ac_f cannot contain `:'.
@@ -9983,7 +10005,7 @@
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -10009,8 +10031,8 @@
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -10140,21 +10162,22 @@
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$tmp/stdin"
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
   esac \
   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
@@ -10165,20 +10188,20 @@
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
-    } >"$tmp/config.h" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$tmp/config.h" "$ac_file" \
+      mv "$ac_tmp/config.h" "$ac_file" \
 	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
       || as_fn_error $? "could not create -" "$LINENO" 5
   fi
  ;;

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31ce-0007D8-8C; Thu, 01 Mar 2012 08:44:24 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cc-000781-Ej
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1330591452!13145047!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12864 invoked from network); 1 Mar 2012 08:44:13 -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;
	1 Mar 2012 08: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 1S31cS-0002Bk-2d
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cR-0003Im-Tu
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:11 +0000
Message-Id: <E1S31cR-0003Im-Tu@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update autoconf-generated configure
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330523024 0
# Node ID be9d56fada86d1444ff116104c13d2f8600abf8b
# Parent  f25e5785327e45c8e4e3270effa1d5c3ee4df2ae
Update autoconf-generated configure script.

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


diff -r f25e5785327e -r be9d56fada86 tools/configure
--- a/tools/configure	Wed Feb 29 13:40:25 2012 +0000
+++ b/tools/configure	Wed Feb 29 13:43:44 2012 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.67 for Xen Hypervisor 4.2.
+# Generated by GNU Autoconf 2.68 for Xen Hypervisor 4.2.
 #
 # Report bugs to <xen-devel@lists.xensource.com>.
 #
@@ -91,6 +91,7 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -216,11 +217,18 @@
   # We cannot yet assume a decent shell, so we have to provide a
 	# neutralization value for shells without unset; and this also
 	# works around shells that cannot unset nonexistent variables.
+	# Preserve -v and -x to the replacement shell.
 	BASH_ENV=/dev/null
 	ENV=/dev/null
 	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
 	export CONFIG_SHELL
-	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+	case $- in # ((((
+	  *v*x* | *x*v* ) as_opts=-vx ;;
+	  *v* ) as_opts=-v ;;
+	  *x* ) as_opts=-x ;;
+	  * ) as_opts= ;;
+	esac
+	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
 fi
 
     if test x$as_have_required = xno; then :
@@ -1155,7 +1163,7 @@
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
   esac
@@ -1476,7 +1484,7 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 Xen Hypervisor configure 4.2
-generated by GNU Autoconf 2.67
+generated by GNU Autoconf 2.68
 
 Copyright (C) 2010 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
@@ -1522,7 +1530,7 @@
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
@@ -1559,7 +1567,7 @@
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
@@ -1572,10 +1580,10 @@
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval "test \"\${$3+set}\"" = set; then :
+  if eval \${$3+:} false; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -1642,7 +1650,7 @@
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -1651,7 +1659,7 @@
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_mongrel
 
@@ -1692,7 +1700,7 @@
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
@@ -1706,7 +1714,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1724,7 +1732,7 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_header_compile
 
@@ -1769,11 +1777,65 @@
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
 
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+	 return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+	    return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_type
+
 # ac_fn_c_check_func LINENO FUNC VAR
 # ----------------------------------
 # Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -1782,7 +1844,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1837,64 +1899,10 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_func
 
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=no"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof ($2))
-	 return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
-	    return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  eval "$3=yes"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
-
-} # ac_fn_c_check_type
-
 # ac_fn_c_find_intX_t LINENO BITS VAR
 # -----------------------------------
 # Finds a signed integer type with width BITS, setting cache variable VAR
@@ -1904,7 +1912,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
 $as_echo_n "checking for int$2_t... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=no"
@@ -1965,7 +1973,7 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_find_intX_t
 
@@ -1978,7 +1986,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
 $as_echo_n "checking for $2.$3... " >&6; }
-if eval "test \"\${$4+set}\"" = set; then :
+if eval \${$4+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2022,7 +2030,7 @@
 eval ac_res=\$$4
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_member
 
@@ -2035,7 +2043,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
 $as_echo_n "checking for uint$2_t... " >&6; }
-if eval "test \"\${$3+set}\"" = set; then :
+if eval \${$3+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=no"
@@ -2075,7 +2083,7 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_find_uintX_t
 cat >config.log <<_ACEOF
@@ -2083,7 +2091,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by Xen Hypervisor $as_me 4.2, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+generated by GNU Autoconf 2.68.  Invocation command line was
 
   $ $0 $@
 
@@ -2341,7 +2349,7 @@
       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
   fi
 done
 
@@ -2438,6 +2446,8 @@
 
 ac_config_files="$ac_config_files ../config/Tools.mk"
 
+ac_config_files="$ac_config_files ../config/Xen.mk"
+
 ac_config_headers="$ac_config_headers config.h"
 
 
@@ -2494,7 +2504,7 @@
 set dummy ${ac_tool_prefix}gcc; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2534,7 +2544,7 @@
 set dummy gcc; 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_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2587,7 +2597,7 @@
 set dummy ${ac_tool_prefix}cc; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2627,7 +2637,7 @@
 set dummy cc; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2686,7 +2696,7 @@
 set dummy $ac_tool_prefix$ac_prog; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2730,7 +2740,7 @@
 set dummy $ac_prog; 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_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2785,7 +2795,7 @@
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -2900,7 +2910,7 @@
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -2943,7 +2953,7 @@
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3002,7 +3012,7 @@
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
     fi
   fi
 fi
@@ -3013,7 +3023,7 @@
 ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if test "${ac_cv_objext+set}" = set; then :
+if ${ac_cv_objext+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3054,7 +3064,7 @@
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -3064,7 +3074,7 @@
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3101,7 +3111,7 @@
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -3179,7 +3189,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -3287,7 +3297,7 @@
   CPP=
 fi
 if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then :
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -3403,7 +3413,7 @@
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 ac_ext=c
@@ -3415,7 +3425,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then :
+if ${ac_cv_path_GREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -3478,7 +3488,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then :
+if ${ac_cv_path_EGREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -3545,7 +3555,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then :
+if ${ac_cv_header_stdc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3674,7 +3684,7 @@
 
 
   ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
-if test "x$ac_cv_header_minix_config_h" = x""yes; then :
+if test "x$ac_cv_header_minix_config_h" = xyes; then :
   MINIX=yes
 else
   MINIX=
@@ -3696,7 +3706,7 @@
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
-if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
+if ${ac_cv_safe_to_define___extensions__+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3739,7 +3749,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if test "${ac_cv_build+set}" = set; then :
+if ${ac_cv_build+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
@@ -3755,7 +3765,7 @@
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -3773,7 +3783,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if test "${ac_cv_host+set}" = set; then :
+if ${ac_cv_host+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
@@ -3788,7 +3798,7 @@
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -4162,7 +4172,7 @@
 # Checks for programs.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if test "${ac_cv_path_SED+set}" = set; then :
+if ${ac_cv_path_SED+:} false; then :
   $as_echo_n "(cached) " >&6
 else
             ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
@@ -4239,7 +4249,7 @@
 set dummy ${ac_tool_prefix}gcc; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4279,7 +4289,7 @@
 set dummy gcc; 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_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -4332,7 +4342,7 @@
 set dummy ${ac_tool_prefix}cc; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4372,7 +4382,7 @@
 set dummy cc; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4431,7 +4441,7 @@
 set dummy $ac_tool_prefix$ac_prog; 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_prog_CC+set}" = set; then :
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4475,7 +4485,7 @@
 set dummy $ac_prog; 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_prog_ac_ct_CC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -4530,7 +4540,7 @@
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -4559,7 +4569,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if test "${ac_cv_c_compiler_gnu+set}" = set; then :
+if ${ac_cv_c_compiler_gnu+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4596,7 +4606,7 @@
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if test "${ac_cv_prog_cc_g+set}" = set; then :
+if ${ac_cv_prog_cc_g+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -4674,7 +4684,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then :
+if ${ac_cv_prog_cc_c89+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -4784,7 +4794,7 @@
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -4828,7 +4838,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if test "${ac_cv_path_install+set}" = set; then :
+if ${ac_cv_path_install+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -4908,7 +4918,7 @@
 set dummy perl; 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_PERL+set}" = set; then :
+if ${ac_cv_path_PERL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PERL in
@@ -4953,7 +4963,7 @@
 set dummy ip; 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_IP+set}" = set; then :
+if ${ac_cv_path_IP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $IP in
@@ -4998,7 +5008,7 @@
 set dummy bison; 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_BISON+set}" = set; then :
+if ${ac_cv_path_BISON+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BISON in
@@ -5043,7 +5053,7 @@
 set dummy flex; 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_FLEX+set}" = set; then :
+if ${ac_cv_path_FLEX+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $FLEX in
@@ -5090,7 +5100,7 @@
 set dummy curl-config; 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_CURL+set}" = set; then :
+if ${ac_cv_path_CURL+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $CURL in
@@ -5135,7 +5145,7 @@
 set dummy xml2-config; 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_XML+set}" = set; then :
+if ${ac_cv_path_XML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $XML in
@@ -5186,7 +5196,7 @@
 set dummy ${ac_tool_prefix}ocamlc; 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_prog_OCAMLC+set}" = set; then :
+if ${ac_cv_prog_OCAMLC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLC"; then
@@ -5226,7 +5236,7 @@
 set dummy ocamlc; 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_prog_ac_ct_OCAMLC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLC"; then
@@ -5297,7 +5307,7 @@
 set dummy ${ac_tool_prefix}ocamlopt; 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_prog_OCAMLOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPT"; then
@@ -5337,7 +5347,7 @@
 set dummy ocamlopt; 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_prog_ac_ct_OCAMLOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPT"; then
@@ -5407,7 +5417,7 @@
 set dummy ${ac_tool_prefix}ocamlc.opt; 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_prog_OCAMLCDOTOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLCDOTOPT"; then
@@ -5447,7 +5457,7 @@
 set dummy ocamlc.opt; 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_prog_ac_ct_OCAMLCDOTOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLCDOTOPT"; then
@@ -5511,7 +5521,7 @@
 set dummy ${ac_tool_prefix}ocamlopt.opt; 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_prog_OCAMLOPTDOTOPT+set}" = set; then :
+if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPTDOTOPT"; then
@@ -5551,7 +5561,7 @@
 set dummy ocamlopt.opt; 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_prog_ac_ct_OCAMLOPTDOTOPT+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
@@ -5620,7 +5630,7 @@
 set dummy ${ac_tool_prefix}ocaml; 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_prog_OCAML+set}" = set; then :
+if ${ac_cv_prog_OCAML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAML"; then
@@ -5660,7 +5670,7 @@
 set dummy ocaml; 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_prog_ac_ct_OCAML+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAML+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAML"; then
@@ -5714,7 +5724,7 @@
 set dummy ${ac_tool_prefix}ocamldep; 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_prog_OCAMLDEP+set}" = set; then :
+if ${ac_cv_prog_OCAMLDEP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDEP"; then
@@ -5754,7 +5764,7 @@
 set dummy ocamldep; 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_prog_ac_ct_OCAMLDEP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDEP"; then
@@ -5808,7 +5818,7 @@
 set dummy ${ac_tool_prefix}ocamlmktop; 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_prog_OCAMLMKTOP+set}" = set; then :
+if ${ac_cv_prog_OCAMLMKTOP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKTOP"; then
@@ -5848,7 +5858,7 @@
 set dummy ocamlmktop; 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_prog_ac_ct_OCAMLMKTOP+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKTOP"; then
@@ -5902,7 +5912,7 @@
 set dummy ${ac_tool_prefix}ocamlmklib; 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_prog_OCAMLMKLIB+set}" = set; then :
+if ${ac_cv_prog_OCAMLMKLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKLIB"; then
@@ -5942,7 +5952,7 @@
 set dummy ocamlmklib; 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_prog_ac_ct_OCAMLMKLIB+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKLIB"; then
@@ -5996,7 +6006,7 @@
 set dummy ${ac_tool_prefix}ocamldoc; 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_prog_OCAMLDOC+set}" = set; then :
+if ${ac_cv_prog_OCAMLDOC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDOC"; then
@@ -6036,7 +6046,7 @@
 set dummy ocamldoc; 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_prog_ac_ct_OCAMLDOC+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDOC"; then
@@ -6090,7 +6100,7 @@
 set dummy ${ac_tool_prefix}ocamlbuild; 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_prog_OCAMLBUILD+set}" = set; then :
+if ${ac_cv_prog_OCAMLBUILD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLBUILD"; then
@@ -6130,7 +6140,7 @@
 set dummy ocamlbuild; 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_prog_ac_ct_OCAMLBUILD+set}" = set; then :
+if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLBUILD"; then
@@ -6193,7 +6203,7 @@
 set dummy bash; 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_BASH+set}" = set; then :
+if ${ac_cv_path_BASH+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $BASH in
@@ -6250,7 +6260,7 @@
 set dummy $PYTHON; 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_PYTHONPATH+set}" = set; then :
+if ${ac_cv_path_PYTHONPATH+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PYTHONPATH in
@@ -6342,7 +6352,7 @@
 set dummy xgettext; 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_XGETTEXT+set}" = set; then :
+if ${ac_cv_path_XGETTEXT+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $XGETTEXT in
@@ -6386,7 +6396,7 @@
 if test "x$host_os" == "xlinux-gnu"
 then
     ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then :
+if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
 
 else
   as_fn_error $? "cannot find uuid headers" "$LINENO" 5
@@ -6395,7 +6405,7 @@
 
 else
     ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_h" = x""yes; then :
+if test "x$ac_cv_header_uuid_h" = xyes; then :
 
 else
   as_fn_error $? "cannot find uuid headers" "$LINENO" 5
@@ -6416,7 +6426,7 @@
 set dummy ${ac_tool_prefix}pkg-config; 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_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -6459,7 +6469,7 @@
 set dummy pkg-config; 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_ac_pt_PKG_CONFIG+set}" = set; then :
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   case $ac_pt_PKG_CONFIG in
@@ -6604,7 +6614,7 @@
 See the pkg-config man page for more details.
 
 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5 ; }
+See \`config.log' for more details" "$LINENO" 5; }
 else
 	glib_CFLAGS=$pkg_cv_glib_CFLAGS
 	glib_LIBS=$pkg_cv_glib_LIBS
@@ -6628,7 +6638,7 @@
 # Checks for libraries.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_setup in -laio" >&5
 $as_echo_n "checking for io_setup in -laio... " >&6; }
-if test "${ac_cv_lib_aio_io_setup+set}" = set; then :
+if ${ac_cv_lib_aio_io_setup+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6662,7 +6672,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aio_io_setup" >&5
 $as_echo "$ac_cv_lib_aio_io_setup" >&6; }
-if test "x$ac_cv_lib_aio_io_setup" = x""yes; then :
+if test "x$ac_cv_lib_aio_io_setup" = xyes; then :
   system_aio="y"
 else
   system_aio="n"
@@ -6671,7 +6681,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5 in -lcrypto" >&5
 $as_echo_n "checking for MD5 in -lcrypto... " >&6; }
-if test "${ac_cv_lib_crypto_MD5+set}" = set; then :
+if ${ac_cv_lib_crypto_MD5+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6705,7 +6715,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5" >&5
 $as_echo "$ac_cv_lib_crypto_MD5" >&6; }
-if test "x$ac_cv_lib_crypto_MD5" = x""yes; then :
+if test "x$ac_cv_lib_crypto_MD5" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBCRYPTO 1
 _ACEOF
@@ -6718,7 +6728,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext2fs" >&5
 $as_echo_n "checking for ext2fs_open2 in -lext2fs... " >&6; }
-if test "${ac_cv_lib_ext2fs_ext2fs_open2+set}" = set; then :
+if ${ac_cv_lib_ext2fs_ext2fs_open2+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6752,7 +6762,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext2fs_ext2fs_open2" >&5
 $as_echo "$ac_cv_lib_ext2fs_ext2fs_open2" >&6; }
-if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = x""yes; then :
+if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = xyes; then :
   libext2fs="y"
 else
   libext2fs="n"
@@ -6761,7 +6771,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_md_hash_buffer in -lgcrypt" >&5
 $as_echo_n "checking for gcry_md_hash_buffer in -lgcrypt... " >&6; }
-if test "${ac_cv_lib_gcrypt_gcry_md_hash_buffer+set}" = set; then :
+if ${ac_cv_lib_gcrypt_gcry_md_hash_buffer+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6795,7 +6805,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&5
 $as_echo "$ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&6; }
-if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = x""yes; then :
+if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = xyes; then :
   libgcrypt="y"
 else
   libgcrypt="n"
@@ -6804,7 +6814,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
 $as_echo_n "checking for pthread_create in -lpthread... " >&6; }
-if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then :
+if ${ac_cv_lib_pthread_pthread_create+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6838,7 +6848,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then :
+if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
 
 else
   as_fn_error $? "Could not find libpthread" "$LINENO" 5
@@ -6846,7 +6856,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
 $as_echo_n "checking for clock_gettime in -lrt... " >&6; }
-if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then :
+if ${ac_cv_lib_rt_clock_gettime+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6880,7 +6890,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
-if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then :
+if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBRT 1
 _ACEOF
@@ -6891,7 +6901,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5
 $as_echo_n "checking for uuid_clear in -luuid... " >&6; }
-if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then :
+if ${ac_cv_lib_uuid_uuid_clear+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6925,7 +6935,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5
 $as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then :
+if test "x$ac_cv_lib_uuid_uuid_clear" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBUUID 1
 _ACEOF
@@ -6938,7 +6948,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
 $as_echo_n "checking for yajl_alloc in -lyajl... " >&6; }
-if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then :
+if ${ac_cv_lib_yajl_yajl_alloc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6972,7 +6982,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_yajl_yajl_alloc" >&5
 $as_echo "$ac_cv_lib_yajl_yajl_alloc" >&6; }
-if test "x$ac_cv_lib_yajl_yajl_alloc" = x""yes; then :
+if test "x$ac_cv_lib_yajl_yajl_alloc" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBYAJL 1
 _ACEOF
@@ -6985,7 +6995,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflateCopy in -lz" >&5
 $as_echo_n "checking for deflateCopy in -lz... " >&6; }
-if test "${ac_cv_lib_z_deflateCopy+set}" = set; then :
+if ${ac_cv_lib_z_deflateCopy+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -7019,7 +7029,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflateCopy" >&5
 $as_echo "$ac_cv_lib_z_deflateCopy" >&6; }
-if test "x$ac_cv_lib_z_deflateCopy" = x""yes; then :
+if test "x$ac_cv_lib_z_deflateCopy" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBZ 1
 _ACEOF
@@ -7032,7 +7042,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5
 $as_echo_n "checking for libiconv_open in -liconv... " >&6; }
-if test "${ac_cv_lib_iconv_libiconv_open+set}" = set; then :
+if ${ac_cv_lib_iconv_libiconv_open+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -7066,7 +7076,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5
 $as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; }
-if test "x$ac_cv_lib_iconv_libiconv_open" = x""yes; then :
+if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then :
   libiconv="y"
 else
   libiconv="n"
@@ -7075,11 +7085,22 @@
 
 
 # Checks for header files.
+ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
+if test "x$ac_cv_type_size_t" = xyes; then :
+
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned int
+_ACEOF
+
+fi
+
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
 $as_echo_n "checking for working alloca.h... " >&6; }
-if test "${ac_cv_working_alloca_h+set}" = set; then :
+if ${ac_cv_working_alloca_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7112,7 +7133,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
 $as_echo_n "checking for alloca... " >&6; }
-if test "${ac_cv_func_alloca_works+set}" = set; then :
+if ${ac_cv_func_alloca_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7131,7 +7152,7 @@
  #pragma alloca
 #   else
 #    ifndef alloca /* predefined by HP cc +Olibcalls */
-char *alloca ();
+void *alloca (size_t);
 #    endif
 #   endif
 #  endif
@@ -7175,7 +7196,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if test "${ac_cv_os_cray+set}" = set; then :
+if ${ac_cv_os_cray+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7216,7 +7237,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
 $as_echo_n "checking stack direction for C alloca... " >&6; }
-if test "${ac_cv_c_stack_direction+set}" = set; then :
+if ${ac_cv_c_stack_direction+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -7287,7 +7308,7 @@
 # Checks for typedefs, structures, and compiler characteristics.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
-if test "${ac_cv_header_stdbool_h+set}" = set; then :
+if ${ac_cv_header_stdbool_h+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7319,7 +7340,7 @@
 	char b[false == 0 ? 1 : -1];
 	char c[__bool_true_false_are_defined == 1 ? 1 : -1];
 	char d[(bool) 0.5 == true ? 1 : -1];
-	bool e = &s;
+	/* See body of main program for 'e'.  */
 	char f[(_Bool) 0.0 == false ? 1 : -1];
 	char g[true];
 	char h[sizeof (_Bool)];
@@ -7330,25 +7351,6 @@
 	_Bool n[m];
 	char o[sizeof n == m * sizeof n[0] ? 1 : -1];
 	char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-#	if defined __xlc__ || defined __GNUC__
-	 /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
-	    reported by James Lemley on 2005-10-05; see
-	    http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-	    This test is not quite right, since xlc is allowed to
-	    reject this program, as the initializer for xlcbug is
-	    not one of the forms that C requires support for.
-	    However, doing the test right would require a runtime
-	    test, and that would make cross-compilation harder.
-	    Let us hope that IBM fixes the xlc bug, and also adds
-	    support for this kind of constant expression.  In the
-	    meantime, this test will reject xlc, which is OK, since
-	    our stdbool.h substitute should suffice.  We also test
-	    this with GCC, where it should work, to detect more
-	    quickly whether someone messes up the test in the
-	    future.  */
-	 char digs[] = "0123456789";
-	 int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
-#	endif
 	/* Catch a bug in an HP-UX C compiler.  See
 	   http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
 	   http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
@@ -7360,6 +7362,7 @@
 main ()
 {
 
+	bool e = &s;
 	*pq |= q;
 	*pq |= ! q;
 	/* Refer to every declared value, to avoid compiler optimizations.  */
@@ -7380,7 +7383,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
 $as_echo "$ac_cv_header_stdbool_h" >&6; }
 ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
-if test "x$ac_cv_type__Bool" = x""yes; then :
+if test "x$ac_cv_type__Bool" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE__BOOL 1
@@ -7397,7 +7400,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
 $as_echo_n "checking for uid_t in sys/types.h... " >&6; }
-if test "${ac_cv_type_uid_t+set}" = set; then :
+if ${ac_cv_type_uid_t+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7427,7 +7430,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
 $as_echo_n "checking for inline... " >&6; }
-if test "${ac_cv_c_inline+set}" = set; then :
+if ${ac_cv_c_inline+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_c_inline=no
@@ -7512,7 +7515,7 @@
 esac
 
 ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
-if test "x$ac_cv_type_mode_t" = x""yes; then :
+if test "x$ac_cv_type_mode_t" = xyes; then :
 
 else
 
@@ -7523,7 +7526,7 @@
 fi
 
 ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
-if test "x$ac_cv_type_off_t" = x""yes; then :
+if test "x$ac_cv_type_off_t" = xyes; then :
 
 else
 
@@ -7534,7 +7537,7 @@
 fi
 
 ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
-if test "x$ac_cv_type_pid_t" = x""yes; then :
+if test "x$ac_cv_type_pid_t" = xyes; then :
 
 else
 
@@ -7546,7 +7549,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
 $as_echo_n "checking for C/C++ restrict keyword... " >&6; }
-if test "${ac_cv_c_restrict+set}" = set; then :
+if ${ac_cv_c_restrict+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_c_restrict=no
@@ -7591,7 +7594,7 @@
  esac
 
 ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = x""yes; then :
+if test "x$ac_cv_type_size_t" = xyes; then :
 
 else
 
@@ -7602,7 +7605,7 @@
 fi
 
 ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default"
-if test "x$ac_cv_type_ssize_t" = x""yes; then :
+if test "x$ac_cv_type_ssize_t" = xyes; then :
 
 else
 
@@ -7613,7 +7616,7 @@
 fi
 
 ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then :
+if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
@@ -7623,7 +7626,7 @@
 fi
 
 ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then :
+if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_BLOCKS 1
@@ -7643,7 +7646,7 @@
 
 
 ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then :
+if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_RDEV 1
@@ -7707,7 +7710,7 @@
   esac
 
 ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
-if test "x$ac_cv_type_ptrdiff_t" = x""yes; then :
+if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_PTRDIFF_T 1
@@ -7720,7 +7723,7 @@
 # Checks for library functions.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
 $as_echo_n "checking for error_at_line... " >&6; }
-if test "${ac_cv_lib_error_at_line+set}" = set; then :
+if ${ac_cv_lib_error_at_line+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7756,7 +7759,7 @@
 for ac_header in vfork.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
-if test "x$ac_cv_header_vfork_h" = x""yes; then :
+if test "x$ac_cv_header_vfork_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_VFORK_H 1
 _ACEOF
@@ -7780,7 +7783,7 @@
 if test "x$ac_cv_func_fork" = xyes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
 $as_echo_n "checking for working fork... " >&6; }
-if test "${ac_cv_func_fork_works+set}" = set; then :
+if ${ac_cv_func_fork_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -7833,7 +7836,7 @@
 if test "x$ac_cv_func_vfork" = xyes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
 $as_echo_n "checking for working vfork... " >&6; }
-if test "${ac_cv_func_vfork_works+set}" = set; then :
+if ${ac_cv_func_vfork_works+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -7968,7 +7971,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
-if test "${ac_cv_sys_largefile_source+set}" = set; then :
+if ${ac_cv_sys_largefile_source+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   while :; do
@@ -8036,7 +8039,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
 $as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
-if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then :
+if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   rm -f conftest.sym conftest.file
@@ -8098,7 +8101,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5
 $as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
-if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then :
+if ${ac_cv_header_sys_types_h_makedev+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8126,7 +8129,7 @@
 
 if test $ac_cv_header_sys_types_h_makedev = no; then
 ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then :
+if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
 
 $as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
 
@@ -8136,7 +8139,7 @@
 
   if test $ac_cv_header_sys_mkdev_h = no; then
     ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then :
+if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
 
 $as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
 
@@ -8149,7 +8152,7 @@
 for ac_header in stdlib.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = x""yes; then :
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_STDLIB_H 1
 _ACEOF
@@ -8160,7 +8163,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
 $as_echo_n "checking for GNU libc compatible malloc... " >&6; }
-if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then :
+if ${ac_cv_func_malloc_0_nonnull+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8215,7 +8218,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if test "${ac_cv_header_time+set}" = set; then :
+if ${ac_cv_header_time+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8290,7 +8293,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5
 $as_echo_n "checking for working mktime... " >&6; }
-if test "${ac_cv_func_working_mktime+set}" = set; then :
+if ${ac_cv_func_working_mktime+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8519,7 +8522,7 @@
 for ac_func in getpagesize
 do :
   ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
-if test "x$ac_cv_func_getpagesize" = x""yes; then :
+if test "x$ac_cv_func_getpagesize" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_GETPAGESIZE 1
 _ACEOF
@@ -8529,7 +8532,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
 $as_echo_n "checking for working mmap... " >&6; }
-if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then :
+if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8696,7 +8699,7 @@
 for ac_header in stdlib.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = x""yes; then :
+if test "x$ac_cv_header_stdlib_h" = xyes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_STDLIB_H 1
 _ACEOF
@@ -8707,7 +8710,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
 $as_echo_n "checking for GNU libc compatible realloc... " >&6; }
-if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then :
+if ${ac_cv_func_realloc_0_nonnull+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8760,13 +8763,17 @@
 fi
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
 $as_echo_n "checking for working strnlen... " >&6; }
-if test "${ac_cv_func_strnlen_working+set}" = set; then :
+if ${ac_cv_func_strnlen_working+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
-  ac_cv_func_strnlen_working=no
+  # Guess no on AIX systems, yes otherwise.
+		case "$host_os" in
+		  aix*) ac_cv_func_strnlen_working=no;;
+		  *)    ac_cv_func_strnlen_working=yes;;
+		esac
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -8815,7 +8822,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5
 $as_echo_n "checking for working strtod... " >&6; }
-if test "${ac_cv_func_strtod+set}" = set; then :
+if ${ac_cv_func_strtod+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8874,14 +8881,14 @@
 esac
 
 ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow"
-if test "x$ac_cv_func_pow" = x""yes; then :
+if test "x$ac_cv_func_pow" = xyes; then :
 
 fi
 
 if test $ac_cv_func_pow = no; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
 $as_echo_n "checking for pow in -lm... " >&6; }
-if test "${ac_cv_lib_m_pow+set}" = set; then :
+if ${ac_cv_lib_m_pow+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -8915,7 +8922,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
 $as_echo "$ac_cv_lib_m_pow" >&6; }
-if test "x$ac_cv_lib_m_pow" = x""yes; then :
+if test "x$ac_cv_lib_m_pow" = xyes; then :
   POW_LIB=-lm
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5
@@ -9011,10 +9018,21 @@
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    test "x$cache_file" != "x/dev/null" &&
+    if test "x$cache_file" != "x/dev/null"; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-    cat confcache >$cache_file
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -9046,7 +9064,7 @@
 
 
 
-: ${CONFIG_STATUS=./config.status}
+: "${CONFIG_STATUS=./config.status}"
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -9147,6 +9165,7 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -9454,7 +9473,7 @@
 # values after options handling.
 ac_log="
 This file was extended by Xen Hypervisor $as_me 4.2, which was
-generated by GNU Autoconf 2.67.  Invocation command line was
+generated by GNU Autoconf 2.68.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -9516,7 +9535,7 @@
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 Xen Hypervisor config.status 4.2
-configured by $0, generated by GNU Autoconf 2.67,
+configured by $0, generated by GNU Autoconf 2.68,
   with options \\"\$ac_cs_config\\"
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -9638,9 +9657,10 @@
 do
   case $ac_config_target in
     "../config/Tools.mk") CONFIG_FILES="$CONFIG_FILES ../config/Tools.mk" ;;
+    "../config/Xen.mk") CONFIG_FILES="$CONFIG_FILES ../config/Xen.mk" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
 done
 
@@ -9662,9 +9682,10 @@
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp=
+  tmp= ac_tmp=
   trap 'exit_status=$?
-  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
@@ -9672,12 +9693,13 @@
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -n "$tmp" && test -d "$tmp"
+  test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -9699,7 +9721,7 @@
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$tmp/subs1.awk" &&
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -9727,7 +9749,7 @@
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -9775,7 +9797,7 @@
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
 
@@ -9807,7 +9829,7 @@
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
@@ -9841,7 +9863,7 @@
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$tmp/defines.awk" <<\_ACAWK ||
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -9853,8 +9875,8 @@
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_t"; then
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
     break
   elif $ac_last_try; then
     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
@@ -9955,7 +9977,7 @@
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -9974,7 +9996,7 @@
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$tmp/stdin";;
+      -) ac_f="$ac_tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
 	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 	 # because $ac_f cannot contain `:'.
@@ -9983,7 +10005,7 @@
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -10009,8 +10031,8 @@
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
     esac
     ;;
   esac
@@ -10140,21 +10162,22 @@
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
-  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$tmp/stdin"
+  rm -f "$ac_tmp/stdin"
   case $ac_file in
-  -) cat "$tmp/out" && rm -f "$tmp/out";;
-  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
   esac \
   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
@@ -10165,20 +10188,20 @@
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
-    } >"$tmp/config.h" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$tmp/config.h" "$ac_file" \
+      mv "$ac_tmp/config.h" "$ac_file" \
 	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
       || as_fn_error $? "could not create -" "$LINENO" 5
   fi
  ;;

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31ce-0007Di-Fj; Thu, 01 Mar 2012 08:44:24 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cd-00078C-LA
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1330591455!8246126!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5866 invoked from network); 1 Mar 2012 08:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08:44: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 1S31cU-0002Bx-8s
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cU-0003Kt-5w
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:14 +0000
Message-Id: <E1S31cU-0003Kt-5w@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm: expose context of event channel
	peers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330523321 0
# Node ID 57706facdbdde0a01d97f62455b11e7fdc39201c
# Parent  b8adaf598a6ab7c02416998dcb52c49e81751d8b
xsm: expose context of event channel peers

This hypercall allows a domain to identify the security context of a
domain that it is communicating with using the interdomain event
channel that it is using for the communication. This can be used to
augment Xen's security permissions with intra-domain security checks.

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


diff -r b8adaf598a6a -r 57706facdbdd xen/common/event_channel.c
--- a/xen/common/event_channel.c	Wed Feb 29 13:47:41 2012 +0000
+++ b/xen/common/event_channel.c	Wed Feb 29 13:48:41 2012 +0000
@@ -32,14 +32,6 @@
 #include <public/event_channel.h>
 #include <xsm/xsm.h>
 
-#define bucket_from_port(d,p) \
-    ((d)->evtchn[(p)/EVTCHNS_PER_BUCKET])
-#define port_is_valid(d,p)    \
-    (((p) >= 0) && ((p) < MAX_EVTCHNS(d)) && \
-     (bucket_from_port(d,p) != NULL))
-#define evtchn_from_port(d,p) \
-    (&(bucket_from_port(d,p))[(p)&(EVTCHNS_PER_BUCKET-1)])
-
 #define ERROR_EXIT(_errno)                                          \
     do {                                                            \
         gdprintk(XENLOG_WARNING,                                    \
diff -r b8adaf598a6a -r 57706facdbdd xen/include/public/xsm/flask_op.h
--- a/xen/include/public/xsm/flask_op.h	Wed Feb 29 13:47:41 2012 +0000
+++ b/xen/include/public/xsm/flask_op.h	Wed Feb 29 13:48:41 2012 +0000
@@ -135,6 +135,13 @@
     uint64_t low, high;
 };
 
+struct xen_flask_peersid {
+    /* IN */
+    evtchn_port_t evtchn;
+    /* OUT */
+    uint32_t sid;
+};
+
 struct xen_flask_op {
     uint32_t cmd;
 #define FLASK_LOAD              1
@@ -159,6 +166,7 @@
 #define FLASK_MEMBER            20
 #define FLASK_ADD_OCONTEXT      21
 #define FLASK_DEL_OCONTEXT      22
+#define FLASK_GET_PEER_SID      23
     uint32_t interface_version; /* XEN_FLASK_INTERFACE_VERSION */
     union {
         struct xen_flask_load load;
@@ -176,6 +184,7 @@
         struct xen_flask_cache_stats cache_stats;
         /* FLASK_ADD_OCONTEXT, FLASK_DEL_OCONTEXT */
         struct xen_flask_ocontext ocontext;
+        struct xen_flask_peersid peersid;
     } u;
 };
 typedef struct xen_flask_op xen_flask_op_t;
diff -r b8adaf598a6a -r 57706facdbdd xen/include/xen/event.h
--- a/xen/include/xen/event.h	Wed Feb 29 13:47:41 2012 +0000
+++ b/xen/include/xen/event.h	Wed Feb 29 13:48:41 2012 +0000
@@ -70,6 +70,16 @@
 /* Notify remote end of a Xen-attached event channel.*/
 void notify_via_xen_event_channel(struct domain *ld, int lport);
 
+/* Internal event channel object accessors */
+#define bucket_from_port(d,p) \
+    ((d)->evtchn[(p)/EVTCHNS_PER_BUCKET])
+#define port_is_valid(d,p)    \
+    (((p) >= 0) && ((p) < MAX_EVTCHNS(d)) && \
+     (bucket_from_port(d,p) != NULL))
+#define evtchn_from_port(d,p) \
+    (&(bucket_from_port(d,p))[(p)&(EVTCHNS_PER_BUCKET-1)])
+
+
 /* Wait on a Xen-attached event channel. */
 #define wait_on_xen_event_channel(port, condition)                      \
     do {                                                                \
diff -r b8adaf598a6a -r 57706facdbdd xen/xsm/flask/flask_op.c
--- a/xen/xsm/flask/flask_op.c	Wed Feb 29 13:47:41 2012 +0000
+++ b/xen/xsm/flask/flask_op.c	Wed Feb 29 13:48:41 2012 +0000
@@ -9,6 +9,7 @@
  */
 
 #include <xen/errno.h>
+#include <xen/event.h>
 #include <xsm/xsm.h>
 #include <xen/guest_access.h>
 
@@ -44,6 +45,7 @@
         1UL<<FLASK_AVC_HASHSTATS | \
         1UL<<FLASK_AVC_CACHESTATS | \
         1UL<<FLASK_MEMBER | \
+        1UL<<FLASK_GET_PEER_SID | \
    0)
 
 static DEFINE_SPINLOCK(sel_sem);
@@ -541,6 +543,36 @@
     return security_ocontext_add(arg->ocon, arg->low, arg->high, arg->sid);
 }
 
+static int flask_get_peer_sid(struct xen_flask_peersid *arg)
+{
+    int rv = -EINVAL;
+    struct domain *d = current->domain;
+    struct domain *peer;
+    struct evtchn *chn;
+    struct domain_security_struct *dsec;
+
+    spin_lock(&d->event_lock);
+
+    if ( !port_is_valid(d, arg->evtchn) )
+        goto out;
+
+    chn = evtchn_from_port(d, arg->evtchn);
+    if ( chn->state != ECS_INTERDOMAIN )
+        goto out;
+
+    peer = chn->u.interdomain.remote_dom;
+    if ( !peer )
+        goto out;
+
+    dsec = peer->ssid;
+    arg->sid = dsec->sid;
+    rv = 0;
+
+ out:
+    spin_unlock(&d->event_lock);
+    return rv;
+}
+
 long do_flask_op(XEN_GUEST_HANDLE(xsm_op_t) u_flask_op)
 {
     xen_flask_op_t op;
@@ -644,6 +676,10 @@
         rv = flask_ocontext_del(&op.u.ocontext);
         break;
 
+    case FLASK_GET_PEER_SID:
+        rv = flask_get_peer_sid(&op.u.peersid);
+        break;
+
     default:
         rv = -ENOSYS;
     }

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31ce-0007Di-Fj; Thu, 01 Mar 2012 08:44:24 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cd-00078C-LA
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1330591455!8246126!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5866 invoked from network); 1 Mar 2012 08:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08:44: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 1S31cU-0002Bx-8s
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cU-0003Kt-5w
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:14 +0000
Message-Id: <E1S31cU-0003Kt-5w@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm: expose context of event channel
	peers
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330523321 0
# Node ID 57706facdbdde0a01d97f62455b11e7fdc39201c
# Parent  b8adaf598a6ab7c02416998dcb52c49e81751d8b
xsm: expose context of event channel peers

This hypercall allows a domain to identify the security context of a
domain that it is communicating with using the interdomain event
channel that it is using for the communication. This can be used to
augment Xen's security permissions with intra-domain security checks.

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


diff -r b8adaf598a6a -r 57706facdbdd xen/common/event_channel.c
--- a/xen/common/event_channel.c	Wed Feb 29 13:47:41 2012 +0000
+++ b/xen/common/event_channel.c	Wed Feb 29 13:48:41 2012 +0000
@@ -32,14 +32,6 @@
 #include <public/event_channel.h>
 #include <xsm/xsm.h>
 
-#define bucket_from_port(d,p) \
-    ((d)->evtchn[(p)/EVTCHNS_PER_BUCKET])
-#define port_is_valid(d,p)    \
-    (((p) >= 0) && ((p) < MAX_EVTCHNS(d)) && \
-     (bucket_from_port(d,p) != NULL))
-#define evtchn_from_port(d,p) \
-    (&(bucket_from_port(d,p))[(p)&(EVTCHNS_PER_BUCKET-1)])
-
 #define ERROR_EXIT(_errno)                                          \
     do {                                                            \
         gdprintk(XENLOG_WARNING,                                    \
diff -r b8adaf598a6a -r 57706facdbdd xen/include/public/xsm/flask_op.h
--- a/xen/include/public/xsm/flask_op.h	Wed Feb 29 13:47:41 2012 +0000
+++ b/xen/include/public/xsm/flask_op.h	Wed Feb 29 13:48:41 2012 +0000
@@ -135,6 +135,13 @@
     uint64_t low, high;
 };
 
+struct xen_flask_peersid {
+    /* IN */
+    evtchn_port_t evtchn;
+    /* OUT */
+    uint32_t sid;
+};
+
 struct xen_flask_op {
     uint32_t cmd;
 #define FLASK_LOAD              1
@@ -159,6 +166,7 @@
 #define FLASK_MEMBER            20
 #define FLASK_ADD_OCONTEXT      21
 #define FLASK_DEL_OCONTEXT      22
+#define FLASK_GET_PEER_SID      23
     uint32_t interface_version; /* XEN_FLASK_INTERFACE_VERSION */
     union {
         struct xen_flask_load load;
@@ -176,6 +184,7 @@
         struct xen_flask_cache_stats cache_stats;
         /* FLASK_ADD_OCONTEXT, FLASK_DEL_OCONTEXT */
         struct xen_flask_ocontext ocontext;
+        struct xen_flask_peersid peersid;
     } u;
 };
 typedef struct xen_flask_op xen_flask_op_t;
diff -r b8adaf598a6a -r 57706facdbdd xen/include/xen/event.h
--- a/xen/include/xen/event.h	Wed Feb 29 13:47:41 2012 +0000
+++ b/xen/include/xen/event.h	Wed Feb 29 13:48:41 2012 +0000
@@ -70,6 +70,16 @@
 /* Notify remote end of a Xen-attached event channel.*/
 void notify_via_xen_event_channel(struct domain *ld, int lport);
 
+/* Internal event channel object accessors */
+#define bucket_from_port(d,p) \
+    ((d)->evtchn[(p)/EVTCHNS_PER_BUCKET])
+#define port_is_valid(d,p)    \
+    (((p) >= 0) && ((p) < MAX_EVTCHNS(d)) && \
+     (bucket_from_port(d,p) != NULL))
+#define evtchn_from_port(d,p) \
+    (&(bucket_from_port(d,p))[(p)&(EVTCHNS_PER_BUCKET-1)])
+
+
 /* Wait on a Xen-attached event channel. */
 #define wait_on_xen_event_channel(port, condition)                      \
     do {                                                                \
diff -r b8adaf598a6a -r 57706facdbdd xen/xsm/flask/flask_op.c
--- a/xen/xsm/flask/flask_op.c	Wed Feb 29 13:47:41 2012 +0000
+++ b/xen/xsm/flask/flask_op.c	Wed Feb 29 13:48:41 2012 +0000
@@ -9,6 +9,7 @@
  */
 
 #include <xen/errno.h>
+#include <xen/event.h>
 #include <xsm/xsm.h>
 #include <xen/guest_access.h>
 
@@ -44,6 +45,7 @@
         1UL<<FLASK_AVC_HASHSTATS | \
         1UL<<FLASK_AVC_CACHESTATS | \
         1UL<<FLASK_MEMBER | \
+        1UL<<FLASK_GET_PEER_SID | \
    0)
 
 static DEFINE_SPINLOCK(sel_sem);
@@ -541,6 +543,36 @@
     return security_ocontext_add(arg->ocon, arg->low, arg->high, arg->sid);
 }
 
+static int flask_get_peer_sid(struct xen_flask_peersid *arg)
+{
+    int rv = -EINVAL;
+    struct domain *d = current->domain;
+    struct domain *peer;
+    struct evtchn *chn;
+    struct domain_security_struct *dsec;
+
+    spin_lock(&d->event_lock);
+
+    if ( !port_is_valid(d, arg->evtchn) )
+        goto out;
+
+    chn = evtchn_from_port(d, arg->evtchn);
+    if ( chn->state != ECS_INTERDOMAIN )
+        goto out;
+
+    peer = chn->u.interdomain.remote_dom;
+    if ( !peer )
+        goto out;
+
+    dsec = peer->ssid;
+    arg->sid = dsec->sid;
+    rv = 0;
+
+ out:
+    spin_unlock(&d->event_lock);
+    return rv;
+}
+
 long do_flask_op(XEN_GUEST_HANDLE(xsm_op_t) u_flask_op)
 {
     xen_flask_op_t op;
@@ -644,6 +676,10 @@
         rv = flask_ocontext_del(&op.u.ocontext);
         break;
 
+    case FLASK_GET_PEER_SID:
+        rv = flask_get_peer_sid(&op.u.peersid);
+        break;
+
     default:
         rv = -ENOSYS;
     }

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31ce-0007Dz-J0; Thu, 01 Mar 2012 08:44:24 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cd-00078D-Ol
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1330591455!15568016!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20129 invoked from network); 1 Mar 2012 08:44:16 -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;
	1 Mar 2012 08:44: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 1S31cT-0002Bt-JV
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cT-0003KM-Hm
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:13 +0000
Message-Id: <E1S31cT-0003KM-Hm@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm/flask: buffer AVC messages for
	output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330523261 0
# Node ID b8adaf598a6ab7c02416998dcb52c49e81751d8b
# Parent  2e6c3194c3b291e837df5ba6c80394fb1c0977f4
xsm/flask: buffer AVC messages for output

When multiple CPUs hit an AVC audit message, the resulting output in
the ring buffer and serial console is garbled due to the audit process
using many separate printk invocations for each message. Change the
AVC audit process to use a temporary buffer and output the contents
once the entire audit message is complete.

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


diff -r 2e6c3194c3b2 -r b8adaf598a6a xen/xsm/flask/avc.c
--- a/xen/xsm/flask/avc.c	Wed Feb 29 13:47:11 2012 +0000
+++ b/xen/xsm/flask/avc.c	Wed Feb 29 13:47:41 2012 +0000
@@ -132,12 +132,54 @@
     return (ssid ^ (tsid<<2) ^ (tclass<<4)) & (AVC_CACHE_SLOTS - 1);
 }
 
+/* no use making this larger than the printk buffer */
+#define AVC_BUF_SIZE 1024
+static DEFINE_SPINLOCK(avc_emerg_lock);
+static char avc_emerg_buf[AVC_BUF_SIZE];
+
+struct avc_dump_buf {
+    char *start;
+    char *pos;
+    u32 free;
+};
+
+static void avc_printk(struct avc_dump_buf *buf, const char *fmt, ...)
+{
+    int i;
+    va_list args;
+
+ again:
+    va_start(args, fmt);
+    i = vsnprintf(buf->pos, buf->free, fmt, args);
+    va_end(args);
+    if ( i < buf->free )
+    {
+        buf->pos += i;
+        buf->free -= i;
+    }
+    else if ( buf->free < AVC_BUF_SIZE )
+    {
+        buf->pos[0] = 0;
+        printk("%s", buf->start);
+        buf->pos = buf->start;
+        buf->free = AVC_BUF_SIZE;
+        goto again;
+    }
+    else
+    {
+        printk("%s", buf->start);
+        printk("\navc_printk: overflow\n");
+        buf->pos = buf->start;
+        buf->free = AVC_BUF_SIZE;
+    }
+}
+
 /**
  * avc_dump_av - Display an access vector in human-readable form.
  * @tclass: target security class
  * @av: access vector
  */
-static void avc_dump_av(u16 tclass, u32 av)
+static void avc_dump_av(struct avc_dump_buf *buf, u16 tclass, u32 av)
 {
     const char **common_pts = NULL;
     u32 common_base = 0;
@@ -145,7 +187,7 @@
 
     if ( av == 0 )
     {
-        printk(" null");
+        avc_printk(buf, " null");
         return;
     }
 
@@ -159,14 +201,14 @@
         }
     }
 
-    printk(" {");
+    avc_printk(buf, " {");
     i = 0;
     perm = 1;
     while ( perm < common_base )
     {
         if (perm & av)
         {
-            printk(" %s", common_pts[i]);
+            avc_printk(buf, " %s", common_pts[i]);
             av &= ~perm;
         }
         i++;
@@ -185,7 +227,7 @@
             }
             if ( i2 < ARRAY_SIZE(av_perm_to_string) )
             {
-                printk(" %s", av_perm_to_string[i2].name);
+                avc_printk(buf, " %s", av_perm_to_string[i2].name);
                 av &= ~perm;
             }
         }
@@ -194,9 +236,9 @@
     }
 
     if ( av )
-        printk(" 0x%x", av);
+        avc_printk(buf, " 0x%x", av);
 
-    printk(" }");
+    avc_printk(buf, " }");
 }
 
 /**
@@ -205,7 +247,7 @@
  * @tsid: target security identifier
  * @tclass: target security class
  */
-static void avc_dump_query(u32 ssid, u32 tsid, u16 tclass)
+static void avc_dump_query(struct avc_dump_buf *buf, u32 ssid, u32 tsid, u16 tclass)
 {
     int rc;
     char *scontext;
@@ -213,23 +255,23 @@
 
     rc = security_sid_to_context(ssid, &scontext, &scontext_len);
     if ( rc )
-        printk("ssid=%d", ssid);
+        avc_printk(buf, "ssid=%d", ssid);
     else
     {
-        printk("scontext=%s", scontext);
+        avc_printk(buf, "scontext=%s", scontext);
         xfree(scontext);
     }
 
     rc = security_sid_to_context(tsid, &scontext, &scontext_len);
     if ( rc )
-        printk(" tsid=%d", tsid);
+        avc_printk(buf, " tsid=%d", tsid);
     else
     {
-        printk(" tcontext=%s", scontext);
+        avc_printk(buf, " tcontext=%s", scontext);
         xfree(scontext);
     }
 
-    printk(" tclass=%s", class_to_string[tclass]);
+    avc_printk(buf, " tclass=%s", class_to_string[tclass]);
 }
 
 /**
@@ -544,6 +586,7 @@
 {
     struct domain *cdom = current->domain;
     u32 denied, audited;
+    struct avc_dump_buf buf;
 
     denied = requested & ~avd->allowed;
     if ( denied )
@@ -562,36 +605,50 @@
         if ( !(audited & avd->auditallow) )
             return;
     }
+    buf.start = xmalloc_bytes(AVC_BUF_SIZE);
+    if ( !buf.start )
+    {
+        spin_lock(&avc_emerg_lock);
+        buf.start = avc_emerg_buf;
+    }
+    buf.pos = buf.start;
+    buf.free = AVC_BUF_SIZE;
 
-    printk("avc:  %s ", denied ? "denied" : "granted");
-    avc_dump_av(tclass, audited);
-    printk(" for ");
+    avc_printk(&buf, "avc:  %s ", denied ? "denied" : "granted");
+    avc_dump_av(&buf, tclass, audited);
+    avc_printk(&buf, " for ");
 
     if ( a && (a->sdom || a->tdom) )
     {
         if ( a->sdom && a->tdom && a->sdom != a->tdom )
-            printk("domid=%d target=%d ", a->sdom->domain_id, a->tdom->domain_id);
+            avc_printk(&buf, "domid=%d target=%d ", a->sdom->domain_id, a->tdom->domain_id);
         else if ( a->sdom )
-            printk("domid=%d ", a->sdom->domain_id);
+            avc_printk(&buf, "domid=%d ", a->sdom->domain_id);
         else
-            printk("target=%d ", a->tdom->domain_id);
+            avc_printk(&buf, "target=%d ", a->tdom->domain_id);
     }
     else if ( cdom )
-        printk("domid=%d ", cdom->domain_id);
+        avc_printk(&buf, "domid=%d ", cdom->domain_id);
     switch ( a ? a->type : 0 ) {
     case AVC_AUDIT_DATA_DEV:
-        printk("device=0x%lx ", a->device);
+        avc_printk(&buf, "device=0x%lx ", a->device);
         break;
     case AVC_AUDIT_DATA_IRQ:
-        printk("irq=%d ", a->irq);
+        avc_printk(&buf, "irq=%d ", a->irq);
         break;
     case AVC_AUDIT_DATA_RANGE:
-        printk("range=0x%lx-0x%lx ", a->range.start, a->range.end);
+        avc_printk(&buf, "range=0x%lx-0x%lx ", a->range.start, a->range.end);
         break;
     }
 
-    avc_dump_query(ssid, tsid, tclass);
-    printk("\n");
+    avc_dump_query(&buf, ssid, tsid, tclass);
+    avc_printk(&buf, "\n");
+    printk("%s", buf.start);
+
+    if ( buf.start == avc_emerg_buf )
+        spin_unlock(&avc_emerg_lock);
+    else
+        xfree(buf.start);
 }
 
 /**

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31ce-0007Dz-J0; Thu, 01 Mar 2012 08:44:24 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cd-00078D-Ol
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1330591455!15568016!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20129 invoked from network); 1 Mar 2012 08:44:16 -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;
	1 Mar 2012 08:44: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 1S31cT-0002Bt-JV
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cT-0003KM-Hm
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:13 +0000
Message-Id: <E1S31cT-0003KM-Hm@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xsm/flask: buffer AVC messages for
	output
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330523261 0
# Node ID b8adaf598a6ab7c02416998dcb52c49e81751d8b
# Parent  2e6c3194c3b291e837df5ba6c80394fb1c0977f4
xsm/flask: buffer AVC messages for output

When multiple CPUs hit an AVC audit message, the resulting output in
the ring buffer and serial console is garbled due to the audit process
using many separate printk invocations for each message. Change the
AVC audit process to use a temporary buffer and output the contents
once the entire audit message is complete.

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


diff -r 2e6c3194c3b2 -r b8adaf598a6a xen/xsm/flask/avc.c
--- a/xen/xsm/flask/avc.c	Wed Feb 29 13:47:11 2012 +0000
+++ b/xen/xsm/flask/avc.c	Wed Feb 29 13:47:41 2012 +0000
@@ -132,12 +132,54 @@
     return (ssid ^ (tsid<<2) ^ (tclass<<4)) & (AVC_CACHE_SLOTS - 1);
 }
 
+/* no use making this larger than the printk buffer */
+#define AVC_BUF_SIZE 1024
+static DEFINE_SPINLOCK(avc_emerg_lock);
+static char avc_emerg_buf[AVC_BUF_SIZE];
+
+struct avc_dump_buf {
+    char *start;
+    char *pos;
+    u32 free;
+};
+
+static void avc_printk(struct avc_dump_buf *buf, const char *fmt, ...)
+{
+    int i;
+    va_list args;
+
+ again:
+    va_start(args, fmt);
+    i = vsnprintf(buf->pos, buf->free, fmt, args);
+    va_end(args);
+    if ( i < buf->free )
+    {
+        buf->pos += i;
+        buf->free -= i;
+    }
+    else if ( buf->free < AVC_BUF_SIZE )
+    {
+        buf->pos[0] = 0;
+        printk("%s", buf->start);
+        buf->pos = buf->start;
+        buf->free = AVC_BUF_SIZE;
+        goto again;
+    }
+    else
+    {
+        printk("%s", buf->start);
+        printk("\navc_printk: overflow\n");
+        buf->pos = buf->start;
+        buf->free = AVC_BUF_SIZE;
+    }
+}
+
 /**
  * avc_dump_av - Display an access vector in human-readable form.
  * @tclass: target security class
  * @av: access vector
  */
-static void avc_dump_av(u16 tclass, u32 av)
+static void avc_dump_av(struct avc_dump_buf *buf, u16 tclass, u32 av)
 {
     const char **common_pts = NULL;
     u32 common_base = 0;
@@ -145,7 +187,7 @@
 
     if ( av == 0 )
     {
-        printk(" null");
+        avc_printk(buf, " null");
         return;
     }
 
@@ -159,14 +201,14 @@
         }
     }
 
-    printk(" {");
+    avc_printk(buf, " {");
     i = 0;
     perm = 1;
     while ( perm < common_base )
     {
         if (perm & av)
         {
-            printk(" %s", common_pts[i]);
+            avc_printk(buf, " %s", common_pts[i]);
             av &= ~perm;
         }
         i++;
@@ -185,7 +227,7 @@
             }
             if ( i2 < ARRAY_SIZE(av_perm_to_string) )
             {
-                printk(" %s", av_perm_to_string[i2].name);
+                avc_printk(buf, " %s", av_perm_to_string[i2].name);
                 av &= ~perm;
             }
         }
@@ -194,9 +236,9 @@
     }
 
     if ( av )
-        printk(" 0x%x", av);
+        avc_printk(buf, " 0x%x", av);
 
-    printk(" }");
+    avc_printk(buf, " }");
 }
 
 /**
@@ -205,7 +247,7 @@
  * @tsid: target security identifier
  * @tclass: target security class
  */
-static void avc_dump_query(u32 ssid, u32 tsid, u16 tclass)
+static void avc_dump_query(struct avc_dump_buf *buf, u32 ssid, u32 tsid, u16 tclass)
 {
     int rc;
     char *scontext;
@@ -213,23 +255,23 @@
 
     rc = security_sid_to_context(ssid, &scontext, &scontext_len);
     if ( rc )
-        printk("ssid=%d", ssid);
+        avc_printk(buf, "ssid=%d", ssid);
     else
     {
-        printk("scontext=%s", scontext);
+        avc_printk(buf, "scontext=%s", scontext);
         xfree(scontext);
     }
 
     rc = security_sid_to_context(tsid, &scontext, &scontext_len);
     if ( rc )
-        printk(" tsid=%d", tsid);
+        avc_printk(buf, " tsid=%d", tsid);
     else
     {
-        printk(" tcontext=%s", scontext);
+        avc_printk(buf, " tcontext=%s", scontext);
         xfree(scontext);
     }
 
-    printk(" tclass=%s", class_to_string[tclass]);
+    avc_printk(buf, " tclass=%s", class_to_string[tclass]);
 }
 
 /**
@@ -544,6 +586,7 @@
 {
     struct domain *cdom = current->domain;
     u32 denied, audited;
+    struct avc_dump_buf buf;
 
     denied = requested & ~avd->allowed;
     if ( denied )
@@ -562,36 +605,50 @@
         if ( !(audited & avd->auditallow) )
             return;
     }
+    buf.start = xmalloc_bytes(AVC_BUF_SIZE);
+    if ( !buf.start )
+    {
+        spin_lock(&avc_emerg_lock);
+        buf.start = avc_emerg_buf;
+    }
+    buf.pos = buf.start;
+    buf.free = AVC_BUF_SIZE;
 
-    printk("avc:  %s ", denied ? "denied" : "granted");
-    avc_dump_av(tclass, audited);
-    printk(" for ");
+    avc_printk(&buf, "avc:  %s ", denied ? "denied" : "granted");
+    avc_dump_av(&buf, tclass, audited);
+    avc_printk(&buf, " for ");
 
     if ( a && (a->sdom || a->tdom) )
     {
         if ( a->sdom && a->tdom && a->sdom != a->tdom )
-            printk("domid=%d target=%d ", a->sdom->domain_id, a->tdom->domain_id);
+            avc_printk(&buf, "domid=%d target=%d ", a->sdom->domain_id, a->tdom->domain_id);
         else if ( a->sdom )
-            printk("domid=%d ", a->sdom->domain_id);
+            avc_printk(&buf, "domid=%d ", a->sdom->domain_id);
         else
-            printk("target=%d ", a->tdom->domain_id);
+            avc_printk(&buf, "target=%d ", a->tdom->domain_id);
     }
     else if ( cdom )
-        printk("domid=%d ", cdom->domain_id);
+        avc_printk(&buf, "domid=%d ", cdom->domain_id);
     switch ( a ? a->type : 0 ) {
     case AVC_AUDIT_DATA_DEV:
-        printk("device=0x%lx ", a->device);
+        avc_printk(&buf, "device=0x%lx ", a->device);
         break;
     case AVC_AUDIT_DATA_IRQ:
-        printk("irq=%d ", a->irq);
+        avc_printk(&buf, "irq=%d ", a->irq);
         break;
     case AVC_AUDIT_DATA_RANGE:
-        printk("range=0x%lx-0x%lx ", a->range.start, a->range.end);
+        avc_printk(&buf, "range=0x%lx-0x%lx ", a->range.start, a->range.end);
         break;
     }
 
-    avc_dump_query(ssid, tsid, tclass);
-    printk("\n");
+    avc_dump_query(&buf, ssid, tsid, tclass);
+    avc_printk(&buf, "\n");
+    printk("%s", buf.start);
+
+    if ( buf.start == avc_emerg_buf )
+        spin_unlock(&avc_emerg_lock);
+    else
+        xfree(buf.start);
 }
 
 /**

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cf-0007F9-M8; Thu, 01 Mar 2012 08:44:25 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31ce-00078k-NY
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1330591456!16526354!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12802 invoked from network); 1 Mar 2012 08:44:17 -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;
	1 Mar 2012 08:44: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 1S31cW-0002C9-LS
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cW-0003Mw-Jm
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:16 +0000
Message-Id: <E1S31cW-0003Mw-Jm@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: use libxl wrapper for
	yajl_gen_alloc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330525971 0
# Node ID 606af3fbd6fc54e16a286ccfc296f21c523b5d15
# Parent  2b5cf6bde62d4c5278471511cee716650a8eed5a
libxl: use libxl wrapper for yajl_gen_alloc

To fix compile errors with libyajl2:
 * use libxl_yajl_gen_alloc()
 * use libxl_yajl_length
 * link xl with -lyajl for yajl_gen_string()

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


diff -r 2b5cf6bde62d -r 606af3fbd6fc tools/libxl/Makefile
--- a/tools/libxl/Makefile	Wed Feb 29 14:31:59 2012 +0000
+++ b/tools/libxl/Makefile	Wed Feb 29 14:32:51 2012 +0000
@@ -139,7 +139,7 @@
 	$(AR) rcs libxlutil.a $^
 
 xl: $(XL_OBJS) libxlutil.so libxenlight.so
-	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) -lyajl $(APPEND_LDFLAGS)
 
 testidl: testidl.o libxlutil.so libxenlight.so
 	$(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
diff -r 2b5cf6bde62d -r 606af3fbd6fc tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Feb 29 14:31:59 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Wed Feb 29 14:32:51 2012 +0000
@@ -297,13 +297,12 @@
     if (output_format == OUTPUT_FORMAT_SXP)
         return printf_info_sexp(domid, d_config);
 
-    yajl_gen_config conf = { 1, "    " };
     const char *buf;
-    unsigned int len = 0;
+    libxl_yajl_length len = 0;
     yajl_gen_status s;
     yajl_gen hand;
 
-    hand = yajl_gen_alloc(&conf, NULL);
+    hand = libxl_yajl_gen_alloc(NULL);
     if (!hand) {
         fprintf(stderr, "unable to allocate JSON generator\n");
         return;

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cf-0007F9-M8; Thu, 01 Mar 2012 08:44:25 +0000
Received: from mail216.messagelabs.com ([85.158.143.99])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31ce-00078k-NY
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1330591456!16526354!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12802 invoked from network); 1 Mar 2012 08:44:17 -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;
	1 Mar 2012 08:44: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 1S31cW-0002C9-LS
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cW-0003Mw-Jm
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:16 +0000
Message-Id: <E1S31cW-0003Mw-Jm@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: use libxl wrapper for
	yajl_gen_alloc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330525971 0
# Node ID 606af3fbd6fc54e16a286ccfc296f21c523b5d15
# Parent  2b5cf6bde62d4c5278471511cee716650a8eed5a
libxl: use libxl wrapper for yajl_gen_alloc

To fix compile errors with libyajl2:
 * use libxl_yajl_gen_alloc()
 * use libxl_yajl_length
 * link xl with -lyajl for yajl_gen_string()

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


diff -r 2b5cf6bde62d -r 606af3fbd6fc tools/libxl/Makefile
--- a/tools/libxl/Makefile	Wed Feb 29 14:31:59 2012 +0000
+++ b/tools/libxl/Makefile	Wed Feb 29 14:32:51 2012 +0000
@@ -139,7 +139,7 @@
 	$(AR) rcs libxlutil.a $^
 
 xl: $(XL_OBJS) libxlutil.so libxenlight.so
-	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
+	$(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) -lyajl $(APPEND_LDFLAGS)
 
 testidl: testidl.o libxlutil.so libxenlight.so
 	$(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
diff -r 2b5cf6bde62d -r 606af3fbd6fc tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Feb 29 14:31:59 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Wed Feb 29 14:32:51 2012 +0000
@@ -297,13 +297,12 @@
     if (output_format == OUTPUT_FORMAT_SXP)
         return printf_info_sexp(domid, d_config);
 
-    yajl_gen_config conf = { 1, "    " };
     const char *buf;
-    unsigned int len = 0;
+    libxl_yajl_length len = 0;
     yajl_gen_status s;
     yajl_gen hand;
 
-    hand = yajl_gen_alloc(&conf, NULL);
+    hand = libxl_yajl_gen_alloc(NULL);
     if (!hand) {
         fprintf(stderr, "unable to allocate JSON generator\n");
         return;

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31ce-0007Cu-4X; Thu, 01 Mar 2012 08:44: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 1S31cc-0007AW-9b
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:22 +0000
Received: from [85.158.139.83:31332] by server-2.bemta-5.messagelabs.com id
	FE/E3-20263-5E63F4F4; Thu, 01 Mar 2012 08:44:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1330591459!14645510!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21103 invoked from network); 1 Mar 2012 08:44:20 -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;
	1 Mar 2012 08:44: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 1S31cY-0002CL-T1
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cY-0003P1-Qy
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:18 +0000
Message-Id: <E1S31cY-0003P1-Qy@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl,
	xl: Add the bios option to specify the bios to load
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Attilio Rao <attilio.rao@citrix.com>
# Date 1330532738 0
# Node ID e439559f50eb284d05efd142c4322bef43c2e20b
# Parent  fa3f08ce6b75f8ff1c41bb254ea479de75583c9b
libxl, xl: Add the bios option to specify the bios to load

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


diff -r fa3f08ce6b75 -r e439559f50eb docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Wed Feb 29 15:11:31 2012 +0000
+++ b/docs/man/xl.cfg.pod.5	Wed Feb 29 16:25:38 2012 +0000
@@ -430,6 +430,33 @@
 
 =over 4
 
+=item B<bios="STRING">
+
+Select the virtual firmware that is exposed to the guest.
+By default, a guess is made based on the device model, but sometimes
+it may be useful to request a different one, like UEFI.
+
+=over 4
+
+=item B<rombios>
+
+Loads ROMBIOS, a 16-bit x86 compatible BIOS. This is used by default
+when device_model_version=qemu-xen-traditional. This is the only BIOS
+option supported when device_model_version=qemu-xen-traditional. This is
+the BIOS used by all previous Xen versions.
+
+=item B<seabios>
+
+Loads SeaBIOS, a 16-bit x86 compatible BIOS. This is used by default
+with device_model_version=qemu-xen.
+
+=item B<ovmf>
+
+Loads OVMF, a standard UEFI firmware by Tianocore project.
+Requires device_model_version=qemu-xen.
+
+=back
+
 =item B<pae=BOOLEAN>
 
 Hide or expose the IA32 Physical Address Extensions. These extensions
diff -r fa3f08ce6b75 -r e439559f50eb tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Wed Feb 29 15:11:31 2012 +0000
+++ b/tools/libxl/libxl_create.c	Wed Feb 29 16:25:38 2012 +0000
@@ -89,6 +89,7 @@
     case LIBXL_DOMAIN_TYPE_HVM:
         b_info->video_memkb = 8 * 1024;
         b_info->u.hvm.firmware = NULL;
+        b_info->u.hvm.bios = 0;
         b_info->u.hvm.pae = 1;
         b_info->u.hvm.apic = 1;
         b_info->u.hvm.acpi = 1;
diff -r fa3f08ce6b75 -r e439559f50eb tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Wed Feb 29 15:11:31 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Wed Feb 29 16:25:38 2012 +0000
@@ -66,6 +66,8 @@
 static const char *libxl__domain_bios(libxl__gc *gc,
                                 const libxl_domain_build_info *info)
 {
+    if (info->u.hvm.bios)
+       return libxl_bios_type_to_string(info->u.hvm.bios);
     switch (info->device_model_version) {
     case 1: return "rombios";
     case 2: return "seabios";
diff -r fa3f08ce6b75 -r e439559f50eb tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Wed Feb 29 15:11:31 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Wed Feb 29 16:25:38 2012 +0000
@@ -99,6 +99,12 @@
     (3, "one_missed_tick_pending"),
     ])
 
+libxl_bios_type = Enumeration("bios_type", [
+    (1, "rombios"),
+    (2, "seabios"),
+    (3, "ovmf"),
+    ])
+
 #
 # Complex libxl types
 #
@@ -228,6 +234,7 @@
 
     ("u", KeyedUnion(None, libxl_domain_type, "type",
                 [("hvm", Struct(None, [("firmware", string),
+                                       ("bios", libxl_bios_type),
                                        ("pae", bool),
                                        ("apic", bool),
                                        ("acpi", bool),
diff -r fa3f08ce6b75 -r e439559f50eb tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Feb 29 15:11:31 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Wed Feb 29 16:25:38 2012 +0000
@@ -703,6 +703,12 @@
 
         xlu_cfg_replace_string (config, "firmware_override",
                                 &b_info->u.hvm.firmware, 0);
+        if (!xlu_cfg_get_string(config, "bios", &buf, 0) &&
+            libxl_bios_type_from_string(buf, &b_info->u.hvm.bios)) {
+                fprintf(stderr, "ERROR: invalid value \"%s\" for \"bios\"\n",
+                    buf);
+                exit (1);
+        }
         if (!xlu_cfg_get_long (config, "pae", &l, 0))
             b_info->u.hvm.pae = l;
         if (!xlu_cfg_get_long (config, "apic", &l, 0))

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31ce-0007Cu-4X; Thu, 01 Mar 2012 08:44: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 1S31cc-0007AW-9b
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:22 +0000
Received: from [85.158.139.83:31332] by server-2.bemta-5.messagelabs.com id
	FE/E3-20263-5E63F4F4; Thu, 01 Mar 2012 08:44:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1330591459!14645510!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21103 invoked from network); 1 Mar 2012 08:44:20 -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;
	1 Mar 2012 08:44: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 1S31cY-0002CL-T1
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cY-0003P1-Qy
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:18 +0000
Message-Id: <E1S31cY-0003P1-Qy@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl,
	xl: Add the bios option to specify the bios to load
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Attilio Rao <attilio.rao@citrix.com>
# Date 1330532738 0
# Node ID e439559f50eb284d05efd142c4322bef43c2e20b
# Parent  fa3f08ce6b75f8ff1c41bb254ea479de75583c9b
libxl, xl: Add the bios option to specify the bios to load

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


diff -r fa3f08ce6b75 -r e439559f50eb docs/man/xl.cfg.pod.5
--- a/docs/man/xl.cfg.pod.5	Wed Feb 29 15:11:31 2012 +0000
+++ b/docs/man/xl.cfg.pod.5	Wed Feb 29 16:25:38 2012 +0000
@@ -430,6 +430,33 @@
 
 =over 4
 
+=item B<bios="STRING">
+
+Select the virtual firmware that is exposed to the guest.
+By default, a guess is made based on the device model, but sometimes
+it may be useful to request a different one, like UEFI.
+
+=over 4
+
+=item B<rombios>
+
+Loads ROMBIOS, a 16-bit x86 compatible BIOS. This is used by default
+when device_model_version=qemu-xen-traditional. This is the only BIOS
+option supported when device_model_version=qemu-xen-traditional. This is
+the BIOS used by all previous Xen versions.
+
+=item B<seabios>
+
+Loads SeaBIOS, a 16-bit x86 compatible BIOS. This is used by default
+with device_model_version=qemu-xen.
+
+=item B<ovmf>
+
+Loads OVMF, a standard UEFI firmware by Tianocore project.
+Requires device_model_version=qemu-xen.
+
+=back
+
 =item B<pae=BOOLEAN>
 
 Hide or expose the IA32 Physical Address Extensions. These extensions
diff -r fa3f08ce6b75 -r e439559f50eb tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Wed Feb 29 15:11:31 2012 +0000
+++ b/tools/libxl/libxl_create.c	Wed Feb 29 16:25:38 2012 +0000
@@ -89,6 +89,7 @@
     case LIBXL_DOMAIN_TYPE_HVM:
         b_info->video_memkb = 8 * 1024;
         b_info->u.hvm.firmware = NULL;
+        b_info->u.hvm.bios = 0;
         b_info->u.hvm.pae = 1;
         b_info->u.hvm.apic = 1;
         b_info->u.hvm.acpi = 1;
diff -r fa3f08ce6b75 -r e439559f50eb tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Wed Feb 29 15:11:31 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Wed Feb 29 16:25:38 2012 +0000
@@ -66,6 +66,8 @@
 static const char *libxl__domain_bios(libxl__gc *gc,
                                 const libxl_domain_build_info *info)
 {
+    if (info->u.hvm.bios)
+       return libxl_bios_type_to_string(info->u.hvm.bios);
     switch (info->device_model_version) {
     case 1: return "rombios";
     case 2: return "seabios";
diff -r fa3f08ce6b75 -r e439559f50eb tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Wed Feb 29 15:11:31 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Wed Feb 29 16:25:38 2012 +0000
@@ -99,6 +99,12 @@
     (3, "one_missed_tick_pending"),
     ])
 
+libxl_bios_type = Enumeration("bios_type", [
+    (1, "rombios"),
+    (2, "seabios"),
+    (3, "ovmf"),
+    ])
+
 #
 # Complex libxl types
 #
@@ -228,6 +234,7 @@
 
     ("u", KeyedUnion(None, libxl_domain_type, "type",
                 [("hvm", Struct(None, [("firmware", string),
+                                       ("bios", libxl_bios_type),
                                        ("pae", bool),
                                        ("apic", bool),
                                        ("acpi", bool),
diff -r fa3f08ce6b75 -r e439559f50eb tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Feb 29 15:11:31 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Wed Feb 29 16:25:38 2012 +0000
@@ -703,6 +703,12 @@
 
         xlu_cfg_replace_string (config, "firmware_override",
                                 &b_info->u.hvm.firmware, 0);
+        if (!xlu_cfg_get_string(config, "bios", &buf, 0) &&
+            libxl_bios_type_from_string(buf, &b_info->u.hvm.bios)) {
+                fprintf(stderr, "ERROR: invalid value \"%s\" for \"bios\"\n",
+                    buf);
+                exit (1);
+        }
         if (!xlu_cfg_get_long (config, "pae", &l, 0))
             b_info->u.hvm.pae = l;
         if (!xlu_cfg_get_long (config, "apic", &l, 0))

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44: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 1S31cg-0007H8-Oz; Thu, 01 Mar 2012 08:44:26 +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 1S31cf-00077T-6i
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:25 +0000
Received: from [85.158.139.83:31582] by server-9.bemta-5.messagelabs.com id
	83/C8-09826-8E63F4F4; Thu, 01 Mar 2012 08:44:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1330591459!13482521!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27978 invoked from network); 1 Mar 2012 08:44:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08:44: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 1S31cZ-0002CO-G1
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cZ-0003PY-E6
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:19 +0000
Message-Id: <E1S31cZ-0003PY-E6@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] configure: do not require Bison or
	Flex
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330534901 0
# Node ID d7fe4cd831a0d8d7b3cd71ca302ca0280e3a5096
# Parent  e439559f50eb284d05efd142c4322bef43c2e20b
configure: do not require Bison or Flex

This isn't required because we also checkin the generated files.  A
more complete fix might also allow the user to force regeneration but
I didn't bother here.

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 e439559f50eb -r d7fe4cd831a0 tools/configure
--- a/tools/configure	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/configure	Wed Feb 29 17:01:41 2012 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for Xen Hypervisor 4.2.
+# Generated by GNU Autoconf 2.67 for Xen Hypervisor 4.2.
 #
 # Report bugs to <xen-devel@lists.xensource.com>.
 #
@@ -91,7 +91,6 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -217,18 +216,11 @@
   # We cannot yet assume a decent shell, so we have to provide a
 	# neutralization value for shells without unset; and this also
 	# works around shells that cannot unset nonexistent variables.
-	# Preserve -v and -x to the replacement shell.
 	BASH_ENV=/dev/null
 	ENV=/dev/null
 	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
 	export CONFIG_SHELL
-	case $- in # ((((
-	  *v*x* | *x*v* ) as_opts=-vx ;;
-	  *v* ) as_opts=-v ;;
-	  *x* ) as_opts=-x ;;
-	  * ) as_opts= ;;
-	esac
-	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
 fi
 
     if test x$as_have_required = xno; then :
@@ -1163,7 +1155,7 @@
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
   esac
@@ -1484,7 +1476,7 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 Xen Hypervisor configure 4.2
-generated by GNU Autoconf 2.68
+generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
@@ -1530,7 +1522,7 @@
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
@@ -1567,7 +1559,7 @@
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
@@ -1580,10 +1572,10 @@
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval \${$3+:} false; then :
+  if eval "test \"\${$3+set}\"" = set; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -1650,7 +1642,7 @@
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -1659,7 +1651,7 @@
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_check_header_mongrel
 
@@ -1700,7 +1692,7 @@
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
@@ -1714,7 +1706,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1732,7 +1724,7 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_check_header_compile
 
@@ -1777,65 +1769,11 @@
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
 
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=no"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof ($2))
-	 return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
-	    return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  eval "$3=yes"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_type
-
 # ac_fn_c_check_func LINENO FUNC VAR
 # ----------------------------------
 # Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -1844,7 +1782,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1899,10 +1837,64 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_check_func
 
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+	 return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+	    return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_type
+
 # ac_fn_c_find_intX_t LINENO BITS VAR
 # -----------------------------------
 # Finds a signed integer type with width BITS, setting cache variable VAR
@@ -1912,7 +1904,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
 $as_echo_n "checking for int$2_t... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=no"
@@ -1973,7 +1965,7 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_find_intX_t
 
@@ -1986,7 +1978,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
 $as_echo_n "checking for $2.$3... " >&6; }
-if eval \${$4+:} false; then :
+if eval "test \"\${$4+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2030,7 +2022,7 @@
 eval ac_res=\$$4
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_check_member
 
@@ -2043,7 +2035,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
 $as_echo_n "checking for uint$2_t... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=no"
@@ -2083,7 +2075,7 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_find_uintX_t
 cat >config.log <<_ACEOF
@@ -2091,7 +2083,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by Xen Hypervisor $as_me 4.2, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
 
@@ -2349,7 +2341,7 @@
       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
   fi
 done
 
@@ -2502,7 +2494,7 @@
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2542,7 +2534,7 @@
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2595,7 +2587,7 @@
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2635,7 +2627,7 @@
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2694,7 +2686,7 @@
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2738,7 +2730,7 @@
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2793,7 +2785,7 @@
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -2908,7 +2900,7 @@
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -2951,7 +2943,7 @@
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3010,7 +3002,7 @@
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
     fi
   fi
 fi
@@ -3021,7 +3013,7 @@
 ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
+if test "${ac_cv_objext+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3062,7 +3054,7 @@
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -3072,7 +3064,7 @@
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3109,7 +3101,7 @@
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
+if test "${ac_cv_prog_cc_g+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -3187,7 +3179,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -3295,7 +3287,7 @@
   CPP=
 fi
 if test -z "$CPP"; then
-  if ${ac_cv_prog_CPP+:} false; then :
+  if test "${ac_cv_prog_CPP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -3411,7 +3403,7 @@
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 fi
 
 ac_ext=c
@@ -3423,7 +3415,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
+if test "${ac_cv_path_GREP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -3486,7 +3478,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
+if test "${ac_cv_path_EGREP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -3553,7 +3545,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
+if test "${ac_cv_header_stdc+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3682,7 +3674,7 @@
 
 
   ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
-if test "x$ac_cv_header_minix_config_h" = xyes; then :
+if test "x$ac_cv_header_minix_config_h" = x""yes; then :
   MINIX=yes
 else
   MINIX=
@@ -3704,7 +3696,7 @@
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
-if ${ac_cv_safe_to_define___extensions__+:} false; then :
+if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3747,7 +3739,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
+if test "${ac_cv_build+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
@@ -3763,7 +3755,7 @@
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -3781,7 +3773,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
+if test "${ac_cv_host+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
@@ -3796,7 +3788,7 @@
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -4170,7 +4162,7 @@
 # Checks for programs.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
+if test "${ac_cv_path_SED+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
             ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
@@ -4247,7 +4239,7 @@
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4287,7 +4279,7 @@
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -4340,7 +4332,7 @@
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4380,7 +4372,7 @@
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4439,7 +4431,7 @@
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4483,7 +4475,7 @@
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -4538,7 +4530,7 @@
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -4567,7 +4559,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4604,7 +4596,7 @@
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
+if test "${ac_cv_prog_cc_g+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -4682,7 +4674,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -4792,7 +4784,7 @@
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -4836,7 +4828,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
+if test "${ac_cv_path_install+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -4916,7 +4908,7 @@
 set dummy perl; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PERL+:} false; then :
+if test "${ac_cv_path_PERL+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PERL in
@@ -4961,7 +4953,7 @@
 set dummy ip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_IP+:} false; then :
+if test "${ac_cv_path_IP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $IP in
@@ -5002,103 +4994,13 @@
 then
     as_fn_error $? "Unable to find ip, please install ip" "$LINENO" 5
 fi
-# Extract the first word of "bison", so it can be a program name with args.
-set dummy bison; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_BISON+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $BISON in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_BISON="$BISON" # 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_BISON="$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_BISON" && ac_cv_path_BISON="no"
-  ;;
-esac
-fi
-BISON=$ac_cv_path_BISON
-if test -n "$BISON"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5
-$as_echo "$BISON" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x"${BISON}" == x"no"
-then
-    as_fn_error $? "Unable to find bison, please install bison" "$LINENO" 5
-fi
-# Extract the first word of "flex", so it can be a program name with args.
-set dummy flex; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_FLEX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $FLEX in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_FLEX="$FLEX" # 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_FLEX="$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_FLEX" && ac_cv_path_FLEX="no"
-  ;;
-esac
-fi
-FLEX=$ac_cv_path_FLEX
-if test -n "$FLEX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLEX" >&5
-$as_echo "$FLEX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x"${FLEX}" == x"no"
-then
-    as_fn_error $? "Unable to find flex, please install flex" "$LINENO" 5
-fi
 if test "x$xapi" = "xy"; then :
 
     # Extract the first word of "curl-config", so it can be a program name with args.
 set dummy curl-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CURL+:} false; then :
+if test "${ac_cv_path_CURL+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $CURL in
@@ -5143,7 +5045,7 @@
 set dummy xml2-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_XML+:} false; then :
+if test "${ac_cv_path_XML+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $XML in
@@ -5194,7 +5096,7 @@
 set dummy ${ac_tool_prefix}ocamlc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLC+:} false; then :
+if test "${ac_cv_prog_OCAMLC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLC"; then
@@ -5234,7 +5136,7 @@
 set dummy ocamlc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLC"; then
@@ -5305,7 +5207,7 @@
 set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLOPT+:} false; then :
+if test "${ac_cv_prog_OCAMLOPT+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPT"; then
@@ -5345,7 +5247,7 @@
 set dummy ocamlopt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLOPT+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPT"; then
@@ -5415,7 +5317,7 @@
 set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then :
+if test "${ac_cv_prog_OCAMLCDOTOPT+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLCDOTOPT"; then
@@ -5455,7 +5357,7 @@
 set dummy ocamlc.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLCDOTOPT+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLCDOTOPT"; then
@@ -5519,7 +5421,7 @@
 set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then :
+if test "${ac_cv_prog_OCAMLOPTDOTOPT+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPTDOTOPT"; then
@@ -5559,7 +5461,7 @@
 set dummy ocamlopt.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
@@ -5628,7 +5530,7 @@
 set dummy ${ac_tool_prefix}ocaml; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAML+:} false; then :
+if test "${ac_cv_prog_OCAML+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAML"; then
@@ -5668,7 +5570,7 @@
 set dummy ocaml; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAML+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAML+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAML"; then
@@ -5722,7 +5624,7 @@
 set dummy ${ac_tool_prefix}ocamldep; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLDEP+:} false; then :
+if test "${ac_cv_prog_OCAMLDEP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDEP"; then
@@ -5762,7 +5664,7 @@
 set dummy ocamldep; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLDEP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDEP"; then
@@ -5816,7 +5718,7 @@
 set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLMKTOP+:} false; then :
+if test "${ac_cv_prog_OCAMLMKTOP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKTOP"; then
@@ -5856,7 +5758,7 @@
 set dummy ocamlmktop; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLMKTOP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKTOP"; then
@@ -5910,7 +5812,7 @@
 set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLMKLIB+:} false; then :
+if test "${ac_cv_prog_OCAMLMKLIB+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKLIB"; then
@@ -5950,7 +5852,7 @@
 set dummy ocamlmklib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLMKLIB+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKLIB"; then
@@ -6004,7 +5906,7 @@
 set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLDOC+:} false; then :
+if test "${ac_cv_prog_OCAMLDOC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDOC"; then
@@ -6044,7 +5946,7 @@
 set dummy ocamldoc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLDOC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDOC"; then
@@ -6098,7 +6000,7 @@
 set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLBUILD+:} false; then :
+if test "${ac_cv_prog_OCAMLBUILD+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLBUILD"; then
@@ -6138,7 +6040,7 @@
 set dummy ocamlbuild; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLBUILD+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLBUILD"; then
@@ -6201,7 +6103,7 @@
 set dummy bash; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_BASH+:} false; then :
+if test "${ac_cv_path_BASH+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $BASH in
@@ -6258,7 +6160,7 @@
 set dummy $PYTHON; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PYTHONPATH+:} false; then :
+if test "${ac_cv_path_PYTHONPATH+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PYTHONPATH in
@@ -6350,7 +6252,7 @@
 set dummy xgettext; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_XGETTEXT+:} false; then :
+if test "${ac_cv_path_XGETTEXT+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $XGETTEXT in
@@ -6394,7 +6296,7 @@
 if test "x$host_os" == "xlinux-gnu"
 then
     ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
+if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then :
 
 else
   as_fn_error $? "cannot find uuid headers" "$LINENO" 5
@@ -6403,7 +6305,7 @@
 
 else
     ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_h" = xyes; then :
+if test "x$ac_cv_header_uuid_h" = x""yes; then :
 
 else
   as_fn_error $? "cannot find uuid headers" "$LINENO" 5
@@ -6424,7 +6326,7 @@
 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -6467,7 +6369,7 @@
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $ac_pt_PKG_CONFIG in
@@ -6612,7 +6514,7 @@
 See the pkg-config man page for more details.
 
 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 else
 	glib_CFLAGS=$pkg_cv_glib_CFLAGS
 	glib_LIBS=$pkg_cv_glib_LIBS
@@ -6636,7 +6538,7 @@
 # Checks for libraries.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_setup in -laio" >&5
 $as_echo_n "checking for io_setup in -laio... " >&6; }
-if ${ac_cv_lib_aio_io_setup+:} false; then :
+if test "${ac_cv_lib_aio_io_setup+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6670,7 +6572,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aio_io_setup" >&5
 $as_echo "$ac_cv_lib_aio_io_setup" >&6; }
-if test "x$ac_cv_lib_aio_io_setup" = xyes; then :
+if test "x$ac_cv_lib_aio_io_setup" = x""yes; then :
   system_aio="y"
 else
   system_aio="n"
@@ -6679,7 +6581,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5 in -lcrypto" >&5
 $as_echo_n "checking for MD5 in -lcrypto... " >&6; }
-if ${ac_cv_lib_crypto_MD5+:} false; then :
+if test "${ac_cv_lib_crypto_MD5+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6713,7 +6615,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5" >&5
 $as_echo "$ac_cv_lib_crypto_MD5" >&6; }
-if test "x$ac_cv_lib_crypto_MD5" = xyes; then :
+if test "x$ac_cv_lib_crypto_MD5" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBCRYPTO 1
 _ACEOF
@@ -6726,7 +6628,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext2fs" >&5
 $as_echo_n "checking for ext2fs_open2 in -lext2fs... " >&6; }
-if ${ac_cv_lib_ext2fs_ext2fs_open2+:} false; then :
+if test "${ac_cv_lib_ext2fs_ext2fs_open2+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6760,7 +6662,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext2fs_ext2fs_open2" >&5
 $as_echo "$ac_cv_lib_ext2fs_ext2fs_open2" >&6; }
-if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = xyes; then :
+if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = x""yes; then :
   libext2fs="y"
 else
   libext2fs="n"
@@ -6769,7 +6671,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_md_hash_buffer in -lgcrypt" >&5
 $as_echo_n "checking for gcry_md_hash_buffer in -lgcrypt... " >&6; }
-if ${ac_cv_lib_gcrypt_gcry_md_hash_buffer+:} false; then :
+if test "${ac_cv_lib_gcrypt_gcry_md_hash_buffer+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6803,7 +6705,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&5
 $as_echo "$ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&6; }
-if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = xyes; then :
+if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = x""yes; then :
   libgcrypt="y"
 else
   libgcrypt="n"
@@ -6812,7 +6714,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
 $as_echo_n "checking for pthread_create in -lpthread... " >&6; }
-if ${ac_cv_lib_pthread_pthread_create+:} false; then :
+if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6846,7 +6748,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
+if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then :
 
 else
   as_fn_error $? "Could not find libpthread" "$LINENO" 5
@@ -6854,7 +6756,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
 $as_echo_n "checking for clock_gettime in -lrt... " >&6; }
-if ${ac_cv_lib_rt_clock_gettime+:} false; then :
+if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6888,7 +6790,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
-if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
+if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBRT 1
 _ACEOF
@@ -6899,7 +6801,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5
 $as_echo_n "checking for uuid_clear in -luuid... " >&6; }
-if ${ac_cv_lib_uuid_uuid_clear+:} false; then :
+if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6933,7 +6835,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5
 $as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_clear" = xyes; then :
+if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBUUID 1
 _ACEOF
@@ -6946,7 +6848,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
 $as_echo_n "checking for yajl_alloc in -lyajl... " >&6; }
-if ${ac_cv_lib_yajl_yajl_alloc+:} false; then :
+if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6980,7 +6882,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_yajl_yajl_alloc" >&5
 $as_echo "$ac_cv_lib_yajl_yajl_alloc" >&6; }
-if test "x$ac_cv_lib_yajl_yajl_alloc" = xyes; then :
+if test "x$ac_cv_lib_yajl_yajl_alloc" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBYAJL 1
 _ACEOF
@@ -6993,7 +6895,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflateCopy in -lz" >&5
 $as_echo_n "checking for deflateCopy in -lz... " >&6; }
-if ${ac_cv_lib_z_deflateCopy+:} false; then :
+if test "${ac_cv_lib_z_deflateCopy+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -7027,7 +6929,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflateCopy" >&5
 $as_echo "$ac_cv_lib_z_deflateCopy" >&6; }
-if test "x$ac_cv_lib_z_deflateCopy" = xyes; then :
+if test "x$ac_cv_lib_z_deflateCopy" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBZ 1
 _ACEOF
@@ -7040,7 +6942,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5
 $as_echo_n "checking for libiconv_open in -liconv... " >&6; }
-if ${ac_cv_lib_iconv_libiconv_open+:} false; then :
+if test "${ac_cv_lib_iconv_libiconv_open+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -7074,7 +6976,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5
 $as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; }
-if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then :
+if test "x$ac_cv_lib_iconv_libiconv_open" = x""yes; then :
   libiconv="y"
 else
   libiconv="n"
@@ -7083,22 +6985,11 @@
 
 
 # Checks for header files.
-ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
-
-fi
-
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
 $as_echo_n "checking for working alloca.h... " >&6; }
-if ${ac_cv_working_alloca_h+:} false; then :
+if test "${ac_cv_working_alloca_h+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7131,7 +7022,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
 $as_echo_n "checking for alloca... " >&6; }
-if ${ac_cv_func_alloca_works+:} false; then :
+if test "${ac_cv_func_alloca_works+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7150,7 +7041,7 @@
  #pragma alloca
 #   else
 #    ifndef alloca /* predefined by HP cc +Olibcalls */
-void *alloca (size_t);
+char *alloca ();
 #    endif
 #   endif
 #  endif
@@ -7194,7 +7085,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if ${ac_cv_os_cray+:} false; then :
+if test "${ac_cv_os_cray+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7235,7 +7126,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
 $as_echo_n "checking stack direction for C alloca... " >&6; }
-if ${ac_cv_c_stack_direction+:} false; then :
+if test "${ac_cv_c_stack_direction+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -7306,7 +7197,7 @@
 # Checks for typedefs, structures, and compiler characteristics.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
-if ${ac_cv_header_stdbool_h+:} false; then :
+if test "${ac_cv_header_stdbool_h+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7338,7 +7229,7 @@
 	char b[false == 0 ? 1 : -1];
 	char c[__bool_true_false_are_defined == 1 ? 1 : -1];
 	char d[(bool) 0.5 == true ? 1 : -1];
-	/* See body of main program for 'e'.  */
+	bool e = &s;
 	char f[(_Bool) 0.0 == false ? 1 : -1];
 	char g[true];
 	char h[sizeof (_Bool)];
@@ -7349,6 +7240,25 @@
 	_Bool n[m];
 	char o[sizeof n == m * sizeof n[0] ? 1 : -1];
 	char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+#	if defined __xlc__ || defined __GNUC__
+	 /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
+	    reported by James Lemley on 2005-10-05; see
+	    http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+	    This test is not quite right, since xlc is allowed to
+	    reject this program, as the initializer for xlcbug is
+	    not one of the forms that C requires support for.
+	    However, doing the test right would require a runtime
+	    test, and that would make cross-compilation harder.
+	    Let us hope that IBM fixes the xlc bug, and also adds
+	    support for this kind of constant expression.  In the
+	    meantime, this test will reject xlc, which is OK, since
+	    our stdbool.h substitute should suffice.  We also test
+	    this with GCC, where it should work, to detect more
+	    quickly whether someone messes up the test in the
+	    future.  */
+	 char digs[] = "0123456789";
+	 int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
+#	endif
 	/* Catch a bug in an HP-UX C compiler.  See
 	   http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
 	   http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
@@ -7360,7 +7270,6 @@
 main ()
 {
 
-	bool e = &s;
 	*pq |= q;
 	*pq |= ! q;
 	/* Refer to every declared value, to avoid compiler optimizations.  */
@@ -7381,7 +7290,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
 $as_echo "$ac_cv_header_stdbool_h" >&6; }
 ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
-if test "x$ac_cv_type__Bool" = xyes; then :
+if test "x$ac_cv_type__Bool" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE__BOOL 1
@@ -7398,7 +7307,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
 $as_echo_n "checking for uid_t in sys/types.h... " >&6; }
-if ${ac_cv_type_uid_t+:} false; then :
+if test "${ac_cv_type_uid_t+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7428,7 +7337,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
 $as_echo_n "checking for inline... " >&6; }
-if ${ac_cv_c_inline+:} false; then :
+if test "${ac_cv_c_inline+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_c_inline=no
@@ -7513,7 +7422,7 @@
 esac
 
 ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
-if test "x$ac_cv_type_mode_t" = xyes; then :
+if test "x$ac_cv_type_mode_t" = x""yes; then :
 
 else
 
@@ -7524,7 +7433,7 @@
 fi
 
 ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
-if test "x$ac_cv_type_off_t" = xyes; then :
+if test "x$ac_cv_type_off_t" = x""yes; then :
 
 else
 
@@ -7535,7 +7444,7 @@
 fi
 
 ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
-if test "x$ac_cv_type_pid_t" = xyes; then :
+if test "x$ac_cv_type_pid_t" = x""yes; then :
 
 else
 
@@ -7547,7 +7456,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
 $as_echo_n "checking for C/C++ restrict keyword... " >&6; }
-if ${ac_cv_c_restrict+:} false; then :
+if test "${ac_cv_c_restrict+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_c_restrict=no
@@ -7592,7 +7501,7 @@
  esac
 
 ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
+if test "x$ac_cv_type_size_t" = x""yes; then :
 
 else
 
@@ -7603,7 +7512,7 @@
 fi
 
 ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default"
-if test "x$ac_cv_type_ssize_t" = xyes; then :
+if test "x$ac_cv_type_ssize_t" = x""yes; then :
 
 else
 
@@ -7614,7 +7523,7 @@
 fi
 
 ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then :
+if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
@@ -7624,7 +7533,7 @@
 fi
 
 ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then :
+if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_BLOCKS 1
@@ -7644,7 +7553,7 @@
 
 
 ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then :
+if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_RDEV 1
@@ -7708,7 +7617,7 @@
   esac
 
 ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
-if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
+if test "x$ac_cv_type_ptrdiff_t" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_PTRDIFF_T 1
@@ -7721,7 +7630,7 @@
 # Checks for library functions.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
 $as_echo_n "checking for error_at_line... " >&6; }
-if ${ac_cv_lib_error_at_line+:} false; then :
+if test "${ac_cv_lib_error_at_line+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7757,7 +7666,7 @@
 for ac_header in vfork.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
-if test "x$ac_cv_header_vfork_h" = xyes; then :
+if test "x$ac_cv_header_vfork_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_VFORK_H 1
 _ACEOF
@@ -7781,7 +7690,7 @@
 if test "x$ac_cv_func_fork" = xyes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
 $as_echo_n "checking for working fork... " >&6; }
-if ${ac_cv_func_fork_works+:} false; then :
+if test "${ac_cv_func_fork_works+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -7834,7 +7743,7 @@
 if test "x$ac_cv_func_vfork" = xyes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
 $as_echo_n "checking for working vfork... " >&6; }
-if ${ac_cv_func_vfork_works+:} false; then :
+if test "${ac_cv_func_vfork_works+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -7969,7 +7878,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
-if ${ac_cv_sys_largefile_source+:} false; then :
+if test "${ac_cv_sys_largefile_source+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   while :; do
@@ -8037,7 +7946,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
 $as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
-if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
+if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   rm -f conftest.sym conftest.file
@@ -8099,7 +8008,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5
 $as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
-if ${ac_cv_header_sys_types_h_makedev+:} false; then :
+if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8127,7 +8036,7 @@
 
 if test $ac_cv_header_sys_types_h_makedev = no; then
 ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
+if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then :
 
 $as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
 
@@ -8137,7 +8046,7 @@
 
   if test $ac_cv_header_sys_mkdev_h = no; then
     ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
+if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then :
 
 $as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
 
@@ -8150,7 +8059,7 @@
 for ac_header in stdlib.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = xyes; then :
+if test "x$ac_cv_header_stdlib_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_STDLIB_H 1
 _ACEOF
@@ -8161,7 +8070,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
 $as_echo_n "checking for GNU libc compatible malloc... " >&6; }
-if ${ac_cv_func_malloc_0_nonnull+:} false; then :
+if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8216,7 +8125,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if ${ac_cv_header_time+:} false; then :
+if test "${ac_cv_header_time+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8291,7 +8200,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5
 $as_echo_n "checking for working mktime... " >&6; }
-if ${ac_cv_func_working_mktime+:} false; then :
+if test "${ac_cv_func_working_mktime+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8520,7 +8429,7 @@
 for ac_func in getpagesize
 do :
   ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
-if test "x$ac_cv_func_getpagesize" = xyes; then :
+if test "x$ac_cv_func_getpagesize" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_GETPAGESIZE 1
 _ACEOF
@@ -8530,7 +8439,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
 $as_echo_n "checking for working mmap... " >&6; }
-if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
+if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8697,7 +8606,7 @@
 for ac_header in stdlib.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = xyes; then :
+if test "x$ac_cv_header_stdlib_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_STDLIB_H 1
 _ACEOF
@@ -8708,7 +8617,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
 $as_echo_n "checking for GNU libc compatible realloc... " >&6; }
-if ${ac_cv_func_realloc_0_nonnull+:} false; then :
+if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8761,17 +8670,13 @@
 fi
 
 
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
 $as_echo_n "checking for working strnlen... " >&6; }
-if ${ac_cv_func_strnlen_working+:} false; then :
+if test "${ac_cv_func_strnlen_working+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
-  # Guess no on AIX systems, yes otherwise.
-		case "$host_os" in
-		  aix*) ac_cv_func_strnlen_working=no;;
-		  *)    ac_cv_func_strnlen_working=yes;;
-		esac
+  ac_cv_func_strnlen_working=no
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -8820,7 +8725,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5
 $as_echo_n "checking for working strtod... " >&6; }
-if ${ac_cv_func_strtod+:} false; then :
+if test "${ac_cv_func_strtod+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8879,14 +8784,14 @@
 esac
 
 ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow"
-if test "x$ac_cv_func_pow" = xyes; then :
+if test "x$ac_cv_func_pow" = x""yes; then :
 
 fi
 
 if test $ac_cv_func_pow = no; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
 $as_echo_n "checking for pow in -lm... " >&6; }
-if ${ac_cv_lib_m_pow+:} false; then :
+if test "${ac_cv_lib_m_pow+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -8920,7 +8825,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
 $as_echo "$ac_cv_lib_m_pow" >&6; }
-if test "x$ac_cv_lib_m_pow" = xyes; then :
+if test "x$ac_cv_lib_m_pow" = x""yes; then :
   POW_LIB=-lm
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5
@@ -9016,21 +8921,10 @@
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    if test "x$cache_file" != "x/dev/null"; then
+    test "x$cache_file" != "x/dev/null" &&
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-      if test ! -f "$cache_file" || test -h "$cache_file"; then
-	cat confcache >"$cache_file"
-      else
-        case $cache_file in #(
-        */* | ?:*)
-	  mv -f confcache "$cache_file"$$ &&
-	  mv -f "$cache_file"$$ "$cache_file" ;; #(
-        *)
-	  mv -f confcache "$cache_file" ;;
-	esac
-      fi
-    fi
+    cat confcache >$cache_file
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -9062,7 +8956,7 @@
 
 
 
-: "${CONFIG_STATUS=./config.status}"
+: ${CONFIG_STATUS=./config.status}
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -9163,7 +9057,6 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -9471,7 +9364,7 @@
 # values after options handling.
 ac_log="
 This file was extended by Xen Hypervisor $as_me 4.2, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -9533,7 +9426,7 @@
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 Xen Hypervisor config.status 4.2
-configured by $0, generated by GNU Autoconf 2.68,
+configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -9657,7 +9550,7 @@
     "../config/Tools.mk") CONFIG_FILES="$CONFIG_FILES ../config/Tools.mk" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
   esac
 done
 
@@ -9679,10 +9572,9 @@
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp= ac_tmp=
+  tmp=
   trap 'exit_status=$?
-  : "${ac_tmp:=$tmp}"
-  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
@@ -9690,13 +9582,12 @@
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -d "$tmp"
+  test -n "$tmp" && test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -9718,7 +9609,7 @@
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -9746,7 +9637,7 @@
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -9794,7 +9685,7 @@
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
 
@@ -9826,7 +9717,7 @@
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
@@ -9860,7 +9751,7 @@
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+cat >"$tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -9872,8 +9763,8 @@
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_tt"; then
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
     break
   elif $ac_last_try; then
     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
@@ -9974,7 +9865,7 @@
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -9993,7 +9884,7 @@
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$ac_tmp/stdin";;
+      -) ac_f="$tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
 	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 	 # because $ac_f cannot contain `:'.
@@ -10002,7 +9893,7 @@
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -10028,8 +9919,8 @@
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$ac_tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
     esac
     ;;
   esac
@@ -10159,22 +10050,21 @@
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
-  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
-      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$ac_tmp/stdin"
+  rm -f "$tmp/stdin"
   case $ac_file in
-  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
-  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
   esac \
   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
@@ -10185,20 +10075,20 @@
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
-    } >"$ac_tmp/config.h" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$ac_tmp/config.h" "$ac_file" \
+      mv "$tmp/config.h" "$ac_file" \
 	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
       || as_fn_error $? "could not create -" "$LINENO" 5
   fi
  ;;
diff -r e439559f50eb -r d7fe4cd831a0 tools/configure.ac
--- a/tools/configure.ac	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/configure.ac	Wed Feb 29 17:01:41 2012 +0000
@@ -78,8 +78,6 @@
 AC_PROG_INSTALL
 AX_PATH_PROG_OR_FAIL([PERL], [perl])
 AX_PATH_PROG_OR_FAIL([IP], [ip])
-AX_PATH_PROG_OR_FAIL([BISON], [bison])
-AX_PATH_PROG_OR_FAIL([FLEX], [flex])
 AS_IF([test "x$xapi" = "xy"], [
     AX_PATH_PROG_OR_FAIL([CURL], [curl-config])
     AX_PATH_PROG_OR_FAIL([XML], [xml2-config])

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44: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 1S31cg-0007H8-Oz; Thu, 01 Mar 2012 08:44:26 +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 1S31cf-00077T-6i
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:25 +0000
Received: from [85.158.139.83:31582] by server-9.bemta-5.messagelabs.com id
	83/C8-09826-8E63F4F4; Thu, 01 Mar 2012 08:44:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1330591459!13482521!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27978 invoked from network); 1 Mar 2012 08:44:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08:44: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 1S31cZ-0002CO-G1
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cZ-0003PY-E6
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:19 +0000
Message-Id: <E1S31cZ-0003PY-E6@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] configure: do not require Bison or
	Flex
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330534901 0
# Node ID d7fe4cd831a0d8d7b3cd71ca302ca0280e3a5096
# Parent  e439559f50eb284d05efd142c4322bef43c2e20b
configure: do not require Bison or Flex

This isn't required because we also checkin the generated files.  A
more complete fix might also allow the user to force regeneration but
I didn't bother here.

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 e439559f50eb -r d7fe4cd831a0 tools/configure
--- a/tools/configure	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/configure	Wed Feb 29 17:01:41 2012 +0000
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for Xen Hypervisor 4.2.
+# Generated by GNU Autoconf 2.67 for Xen Hypervisor 4.2.
 #
 # Report bugs to <xen-devel@lists.xensource.com>.
 #
@@ -91,7 +91,6 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -217,18 +216,11 @@
   # We cannot yet assume a decent shell, so we have to provide a
 	# neutralization value for shells without unset; and this also
 	# works around shells that cannot unset nonexistent variables.
-	# Preserve -v and -x to the replacement shell.
 	BASH_ENV=/dev/null
 	ENV=/dev/null
 	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
 	export CONFIG_SHELL
-	case $- in # ((((
-	  *v*x* | *x*v* ) as_opts=-vx ;;
-	  *v* ) as_opts=-v ;;
-	  *x* ) as_opts=-x ;;
-	  * ) as_opts= ;;
-	esac
-	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+	exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
 fi
 
     if test x$as_have_required = xno; then :
@@ -1163,7 +1155,7 @@
     $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
       $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
-    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
     ;;
 
   esac
@@ -1484,7 +1476,7 @@
 if $ac_init_version; then
   cat <<\_ACEOF
 Xen Hypervisor configure 4.2
-generated by GNU Autoconf 2.68
+generated by GNU Autoconf 2.67
 
 Copyright (C) 2010 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
@@ -1530,7 +1522,7 @@
 
 	ac_retval=1
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_compile
@@ -1567,7 +1559,7 @@
 
     ac_retval=1
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_cpp
@@ -1580,10 +1572,10 @@
 ac_fn_c_check_header_mongrel ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval \${$3+:} false; then :
+  if eval "test \"\${$3+set}\"" = set; then :
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 fi
 eval ac_res=\$$3
@@ -1650,7 +1642,7 @@
 esac
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=\$ac_header_compiler"
@@ -1659,7 +1651,7 @@
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
 fi
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_check_header_mongrel
 
@@ -1700,7 +1692,7 @@
        ac_retval=$ac_status
 fi
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_run
@@ -1714,7 +1706,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1732,7 +1724,7 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_check_header_compile
 
@@ -1777,65 +1769,11 @@
   # interfere with the next link command; also delete a directory that is
   # left behind by Apple's compiler.  We do this before executing the actions.
   rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
   as_fn_set_status $ac_retval
 
 } # ac_fn_c_try_link
 
-# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
-# -------------------------------------------
-# Tests whether TYPE exists after having included INCLUDES, setting cache
-# variable VAR accordingly.
-ac_fn_c_check_type ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=no"
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof ($2))
-	 return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-int
-main ()
-{
-if (sizeof (($2)))
-	    return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  eval "$3=yes"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_type
-
 # ac_fn_c_check_func LINENO FUNC VAR
 # ----------------------------------
 # Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -1844,7 +1782,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
 $as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -1899,10 +1837,64 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_check_func
 
+# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
+# -------------------------------------------
+# Tests whether TYPE exists after having included INCLUDES, setting cache
+# variable VAR accordingly.
+ac_fn_c_check_type ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval "test \"\${$3+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=no"
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof ($2))
+	 return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+if (sizeof (($2)))
+	    return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  eval "$3=yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
+
+} # ac_fn_c_check_type
+
 # ac_fn_c_find_intX_t LINENO BITS VAR
 # -----------------------------------
 # Finds a signed integer type with width BITS, setting cache variable VAR
@@ -1912,7 +1904,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5
 $as_echo_n "checking for int$2_t... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=no"
@@ -1973,7 +1965,7 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_find_intX_t
 
@@ -1986,7 +1978,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
 $as_echo_n "checking for $2.$3... " >&6; }
-if eval \${$4+:} false; then :
+if eval "test \"\${$4+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -2030,7 +2022,7 @@
 eval ac_res=\$$4
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_check_member
 
@@ -2043,7 +2035,7 @@
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
 $as_echo_n "checking for uint$2_t... " >&6; }
-if eval \${$3+:} false; then :
+if eval "test \"\${$3+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   eval "$3=no"
@@ -2083,7 +2075,7 @@
 eval ac_res=\$$3
 	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;}
 
 } # ac_fn_c_find_uintX_t
 cat >config.log <<_ACEOF
@@ -2091,7 +2083,7 @@
 running configure, to aid debugging if configure makes a mistake.
 
 It was created by Xen Hypervisor $as_me 4.2, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+generated by GNU Autoconf 2.67.  Invocation command line was
 
   $ $0 $@
 
@@ -2349,7 +2341,7 @@
       || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "failed to load site script $ac_site_file
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
   fi
 done
 
@@ -2502,7 +2494,7 @@
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2542,7 +2534,7 @@
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2595,7 +2587,7 @@
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2635,7 +2627,7 @@
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2694,7 +2686,7 @@
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -2738,7 +2730,7 @@
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -2793,7 +2785,7 @@
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -2908,7 +2900,7 @@
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
@@ -2951,7 +2943,7 @@
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 fi
 rm -f conftest conftest$ac_cv_exeext
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
@@ -3010,7 +3002,7 @@
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
     fi
   fi
 fi
@@ -3021,7 +3013,7 @@
 ac_clean_files=$ac_clean_files_save
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
 $as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
+if test "${ac_cv_objext+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3062,7 +3054,7 @@
 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
@@ -3072,7 +3064,7 @@
 ac_objext=$OBJEXT
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3109,7 +3101,7 @@
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
+if test "${ac_cv_prog_cc_g+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -3187,7 +3179,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -3295,7 +3287,7 @@
   CPP=
 fi
 if test -z "$CPP"; then
-  if ${ac_cv_prog_CPP+:} false; then :
+  if test "${ac_cv_prog_CPP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
       # Double quotes because CPP needs to be expanded
@@ -3411,7 +3403,7 @@
   { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 fi
 
 ac_ext=c
@@ -3423,7 +3415,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
 $as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
+if test "${ac_cv_path_GREP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -z "$GREP"; then
@@ -3486,7 +3478,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
 $as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
+if test "${ac_cv_path_EGREP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
@@ -3553,7 +3545,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
 $as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
+if test "${ac_cv_header_stdc+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3682,7 +3674,7 @@
 
 
   ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
-if test "x$ac_cv_header_minix_config_h" = xyes; then :
+if test "x$ac_cv_header_minix_config_h" = x""yes; then :
   MINIX=yes
 else
   MINIX=
@@ -3704,7 +3696,7 @@
 
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
-if ${ac_cv_safe_to_define___extensions__+:} false; then :
+if test "${ac_cv_safe_to_define___extensions__+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -3747,7 +3739,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
 $as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
+if test "${ac_cv_build+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_build_alias=$build_alias
@@ -3763,7 +3755,7 @@
 $as_echo "$ac_cv_build" >&6; }
 case $ac_cv_build in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;;
 esac
 build=$ac_cv_build
 ac_save_IFS=$IFS; IFS='-'
@@ -3781,7 +3773,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
 $as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
+if test "${ac_cv_host+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "x$host_alias" = x; then
@@ -3796,7 +3788,7 @@
 $as_echo "$ac_cv_host" >&6; }
 case $ac_cv_host in
 *-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;;
 esac
 host=$ac_cv_host
 ac_save_IFS=$IFS; IFS='-'
@@ -4170,7 +4162,7 @@
 # Checks for programs.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
+if test "${ac_cv_path_SED+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
             ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
@@ -4247,7 +4239,7 @@
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4287,7 +4279,7 @@
 set dummy gcc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -4340,7 +4332,7 @@
 set dummy ${ac_tool_prefix}cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4380,7 +4372,7 @@
 set dummy cc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4439,7 +4431,7 @@
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if test "${ac_cv_prog_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$CC"; then
@@ -4483,7 +4475,7 @@
 set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_CC"; then
@@ -4538,7 +4530,7 @@
 test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 
 # Provide some information about the compiler.
 $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
@@ -4567,7 +4559,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
+if test "${ac_cv_c_compiler_gnu+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4604,7 +4596,7 @@
 ac_save_CFLAGS=$CFLAGS
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
 $as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
+if test "${ac_cv_prog_cc_g+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_save_c_werror_flag=$ac_c_werror_flag
@@ -4682,7 +4674,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
+if test "${ac_cv_prog_cc_c89+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_prog_cc_c89=no
@@ -4792,7 +4784,7 @@
 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
 ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.make <<\_ACEOF
@@ -4836,7 +4828,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
 $as_echo_n "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
+if test "${ac_cv_path_install+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -4916,7 +4908,7 @@
 set dummy perl; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PERL+:} false; then :
+if test "${ac_cv_path_PERL+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PERL in
@@ -4961,7 +4953,7 @@
 set dummy ip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_IP+:} false; then :
+if test "${ac_cv_path_IP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $IP in
@@ -5002,103 +4994,13 @@
 then
     as_fn_error $? "Unable to find ip, please install ip" "$LINENO" 5
 fi
-# Extract the first word of "bison", so it can be a program name with args.
-set dummy bison; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_BISON+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $BISON in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_BISON="$BISON" # 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_BISON="$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_BISON" && ac_cv_path_BISON="no"
-  ;;
-esac
-fi
-BISON=$ac_cv_path_BISON
-if test -n "$BISON"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BISON" >&5
-$as_echo "$BISON" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x"${BISON}" == x"no"
-then
-    as_fn_error $? "Unable to find bison, please install bison" "$LINENO" 5
-fi
-# Extract the first word of "flex", so it can be a program name with args.
-set dummy flex; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_FLEX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $FLEX in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_FLEX="$FLEX" # 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_FLEX="$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_FLEX" && ac_cv_path_FLEX="no"
-  ;;
-esac
-fi
-FLEX=$ac_cv_path_FLEX
-if test -n "$FLEX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLEX" >&5
-$as_echo "$FLEX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x"${FLEX}" == x"no"
-then
-    as_fn_error $? "Unable to find flex, please install flex" "$LINENO" 5
-fi
 if test "x$xapi" = "xy"; then :
 
     # Extract the first word of "curl-config", so it can be a program name with args.
 set dummy curl-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_CURL+:} false; then :
+if test "${ac_cv_path_CURL+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $CURL in
@@ -5143,7 +5045,7 @@
 set dummy xml2-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_XML+:} false; then :
+if test "${ac_cv_path_XML+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $XML in
@@ -5194,7 +5096,7 @@
 set dummy ${ac_tool_prefix}ocamlc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLC+:} false; then :
+if test "${ac_cv_prog_OCAMLC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLC"; then
@@ -5234,7 +5136,7 @@
 set dummy ocamlc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLC+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLC"; then
@@ -5305,7 +5207,7 @@
 set dummy ${ac_tool_prefix}ocamlopt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLOPT+:} false; then :
+if test "${ac_cv_prog_OCAMLOPT+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPT"; then
@@ -5345,7 +5247,7 @@
 set dummy ocamlopt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLOPT+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLOPT+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPT"; then
@@ -5415,7 +5317,7 @@
 set dummy ${ac_tool_prefix}ocamlc.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLCDOTOPT+:} false; then :
+if test "${ac_cv_prog_OCAMLCDOTOPT+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLCDOTOPT"; then
@@ -5455,7 +5357,7 @@
 set dummy ocamlc.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLCDOTOPT+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLCDOTOPT+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLCDOTOPT"; then
@@ -5519,7 +5421,7 @@
 set dummy ${ac_tool_prefix}ocamlopt.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLOPTDOTOPT+:} false; then :
+if test "${ac_cv_prog_OCAMLOPTDOTOPT+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLOPTDOTOPT"; then
@@ -5559,7 +5461,7 @@
 set dummy ocamlopt.opt; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLOPTDOTOPT+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLOPTDOTOPT"; then
@@ -5628,7 +5530,7 @@
 set dummy ${ac_tool_prefix}ocaml; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAML+:} false; then :
+if test "${ac_cv_prog_OCAML+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAML"; then
@@ -5668,7 +5570,7 @@
 set dummy ocaml; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAML+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAML+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAML"; then
@@ -5722,7 +5624,7 @@
 set dummy ${ac_tool_prefix}ocamldep; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLDEP+:} false; then :
+if test "${ac_cv_prog_OCAMLDEP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDEP"; then
@@ -5762,7 +5664,7 @@
 set dummy ocamldep; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLDEP+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLDEP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDEP"; then
@@ -5816,7 +5718,7 @@
 set dummy ${ac_tool_prefix}ocamlmktop; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLMKTOP+:} false; then :
+if test "${ac_cv_prog_OCAMLMKTOP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKTOP"; then
@@ -5856,7 +5758,7 @@
 set dummy ocamlmktop; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLMKTOP+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLMKTOP+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKTOP"; then
@@ -5910,7 +5812,7 @@
 set dummy ${ac_tool_prefix}ocamlmklib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLMKLIB+:} false; then :
+if test "${ac_cv_prog_OCAMLMKLIB+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLMKLIB"; then
@@ -5950,7 +5852,7 @@
 set dummy ocamlmklib; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLMKLIB+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLMKLIB+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLMKLIB"; then
@@ -6004,7 +5906,7 @@
 set dummy ${ac_tool_prefix}ocamldoc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLDOC+:} false; then :
+if test "${ac_cv_prog_OCAMLDOC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLDOC"; then
@@ -6044,7 +5946,7 @@
 set dummy ocamldoc; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLDOC+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLDOC+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLDOC"; then
@@ -6098,7 +6000,7 @@
 set dummy ${ac_tool_prefix}ocamlbuild; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_OCAMLBUILD+:} false; then :
+if test "${ac_cv_prog_OCAMLBUILD+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$OCAMLBUILD"; then
@@ -6138,7 +6040,7 @@
 set dummy ocamlbuild; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_OCAMLBUILD+:} false; then :
+if test "${ac_cv_prog_ac_ct_OCAMLBUILD+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test -n "$ac_ct_OCAMLBUILD"; then
@@ -6201,7 +6103,7 @@
 set dummy bash; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_BASH+:} false; then :
+if test "${ac_cv_path_BASH+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $BASH in
@@ -6258,7 +6160,7 @@
 set dummy $PYTHON; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PYTHONPATH+:} false; then :
+if test "${ac_cv_path_PYTHONPATH+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PYTHONPATH in
@@ -6350,7 +6252,7 @@
 set dummy xgettext; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_XGETTEXT+:} false; then :
+if test "${ac_cv_path_XGETTEXT+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $XGETTEXT in
@@ -6394,7 +6296,7 @@
 if test "x$host_os" == "xlinux-gnu"
 then
     ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
+if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then :
 
 else
   as_fn_error $? "cannot find uuid headers" "$LINENO" 5
@@ -6403,7 +6305,7 @@
 
 else
     ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
-if test "x$ac_cv_header_uuid_h" = xyes; then :
+if test "x$ac_cv_header_uuid_h" = x""yes; then :
 
 else
   as_fn_error $? "cannot find uuid headers" "$LINENO" 5
@@ -6424,7 +6326,7 @@
 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $PKG_CONFIG in
@@ -6467,7 +6369,7 @@
 set dummy pkg-config; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   case $ac_pt_PKG_CONFIG in
@@ -6612,7 +6514,7 @@
 See the pkg-config man page for more details.
 
 To get pkg-config, see <http://pkg-config.freedesktop.org/>.
-See \`config.log' for more details" "$LINENO" 5; }
+See \`config.log' for more details" "$LINENO" 5 ; }
 else
 	glib_CFLAGS=$pkg_cv_glib_CFLAGS
 	glib_LIBS=$pkg_cv_glib_LIBS
@@ -6636,7 +6538,7 @@
 # Checks for libraries.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_setup in -laio" >&5
 $as_echo_n "checking for io_setup in -laio... " >&6; }
-if ${ac_cv_lib_aio_io_setup+:} false; then :
+if test "${ac_cv_lib_aio_io_setup+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6670,7 +6572,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_aio_io_setup" >&5
 $as_echo "$ac_cv_lib_aio_io_setup" >&6; }
-if test "x$ac_cv_lib_aio_io_setup" = xyes; then :
+if test "x$ac_cv_lib_aio_io_setup" = x""yes; then :
   system_aio="y"
 else
   system_aio="n"
@@ -6679,7 +6581,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5 in -lcrypto" >&5
 $as_echo_n "checking for MD5 in -lcrypto... " >&6; }
-if ${ac_cv_lib_crypto_MD5+:} false; then :
+if test "${ac_cv_lib_crypto_MD5+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6713,7 +6615,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5" >&5
 $as_echo "$ac_cv_lib_crypto_MD5" >&6; }
-if test "x$ac_cv_lib_crypto_MD5" = xyes; then :
+if test "x$ac_cv_lib_crypto_MD5" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBCRYPTO 1
 _ACEOF
@@ -6726,7 +6628,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ext2fs_open2 in -lext2fs" >&5
 $as_echo_n "checking for ext2fs_open2 in -lext2fs... " >&6; }
-if ${ac_cv_lib_ext2fs_ext2fs_open2+:} false; then :
+if test "${ac_cv_lib_ext2fs_ext2fs_open2+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6760,7 +6662,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ext2fs_ext2fs_open2" >&5
 $as_echo "$ac_cv_lib_ext2fs_ext2fs_open2" >&6; }
-if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = xyes; then :
+if test "x$ac_cv_lib_ext2fs_ext2fs_open2" = x""yes; then :
   libext2fs="y"
 else
   libext2fs="n"
@@ -6769,7 +6671,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_md_hash_buffer in -lgcrypt" >&5
 $as_echo_n "checking for gcry_md_hash_buffer in -lgcrypt... " >&6; }
-if ${ac_cv_lib_gcrypt_gcry_md_hash_buffer+:} false; then :
+if test "${ac_cv_lib_gcrypt_gcry_md_hash_buffer+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6803,7 +6705,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&5
 $as_echo "$ac_cv_lib_gcrypt_gcry_md_hash_buffer" >&6; }
-if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = xyes; then :
+if test "x$ac_cv_lib_gcrypt_gcry_md_hash_buffer" = x""yes; then :
   libgcrypt="y"
 else
   libgcrypt="n"
@@ -6812,7 +6714,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
 $as_echo_n "checking for pthread_create in -lpthread... " >&6; }
-if ${ac_cv_lib_pthread_pthread_create+:} false; then :
+if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6846,7 +6748,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
+if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then :
 
 else
   as_fn_error $? "Could not find libpthread" "$LINENO" 5
@@ -6854,7 +6756,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_gettime in -lrt" >&5
 $as_echo_n "checking for clock_gettime in -lrt... " >&6; }
-if ${ac_cv_lib_rt_clock_gettime+:} false; then :
+if test "${ac_cv_lib_rt_clock_gettime+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6888,7 +6790,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_clock_gettime" >&5
 $as_echo "$ac_cv_lib_rt_clock_gettime" >&6; }
-if test "x$ac_cv_lib_rt_clock_gettime" = xyes; then :
+if test "x$ac_cv_lib_rt_clock_gettime" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBRT 1
 _ACEOF
@@ -6899,7 +6801,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5
 $as_echo_n "checking for uuid_clear in -luuid... " >&6; }
-if ${ac_cv_lib_uuid_uuid_clear+:} false; then :
+if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6933,7 +6835,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5
 $as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_clear" = xyes; then :
+if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBUUID 1
 _ACEOF
@@ -6946,7 +6848,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
 $as_echo_n "checking for yajl_alloc in -lyajl... " >&6; }
-if ${ac_cv_lib_yajl_yajl_alloc+:} false; then :
+if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -6980,7 +6882,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_yajl_yajl_alloc" >&5
 $as_echo "$ac_cv_lib_yajl_yajl_alloc" >&6; }
-if test "x$ac_cv_lib_yajl_yajl_alloc" = xyes; then :
+if test "x$ac_cv_lib_yajl_yajl_alloc" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBYAJL 1
 _ACEOF
@@ -6993,7 +6895,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for deflateCopy in -lz" >&5
 $as_echo_n "checking for deflateCopy in -lz... " >&6; }
-if ${ac_cv_lib_z_deflateCopy+:} false; then :
+if test "${ac_cv_lib_z_deflateCopy+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -7027,7 +6929,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_deflateCopy" >&5
 $as_echo "$ac_cv_lib_z_deflateCopy" >&6; }
-if test "x$ac_cv_lib_z_deflateCopy" = xyes; then :
+if test "x$ac_cv_lib_z_deflateCopy" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_LIBZ 1
 _ACEOF
@@ -7040,7 +6942,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libiconv_open in -liconv" >&5
 $as_echo_n "checking for libiconv_open in -liconv... " >&6; }
-if ${ac_cv_lib_iconv_libiconv_open+:} false; then :
+if test "${ac_cv_lib_iconv_libiconv_open+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -7074,7 +6976,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iconv_libiconv_open" >&5
 $as_echo "$ac_cv_lib_iconv_libiconv_open" >&6; }
-if test "x$ac_cv_lib_iconv_libiconv_open" = xyes; then :
+if test "x$ac_cv_lib_iconv_libiconv_open" = x""yes; then :
   libiconv="y"
 else
   libiconv="n"
@@ -7083,22 +6985,11 @@
 
 
 # Checks for header files.
-ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
-
-else
-
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
-
-fi
-
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
 $as_echo_n "checking for working alloca.h... " >&6; }
-if ${ac_cv_working_alloca_h+:} false; then :
+if test "${ac_cv_working_alloca_h+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7131,7 +7022,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
 $as_echo_n "checking for alloca... " >&6; }
-if ${ac_cv_func_alloca_works+:} false; then :
+if test "${ac_cv_func_alloca_works+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7150,7 +7041,7 @@
  #pragma alloca
 #   else
 #    ifndef alloca /* predefined by HP cc +Olibcalls */
-void *alloca (size_t);
+char *alloca ();
 #    endif
 #   endif
 #  endif
@@ -7194,7 +7085,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
 $as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if ${ac_cv_os_cray+:} false; then :
+if test "${ac_cv_os_cray+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7235,7 +7126,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
 $as_echo_n "checking stack direction for C alloca... " >&6; }
-if ${ac_cv_c_stack_direction+:} false; then :
+if test "${ac_cv_c_stack_direction+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -7306,7 +7197,7 @@
 # Checks for typedefs, structures, and compiler characteristics.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
-if ${ac_cv_header_stdbool_h+:} false; then :
+if test "${ac_cv_header_stdbool_h+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7338,7 +7229,7 @@
 	char b[false == 0 ? 1 : -1];
 	char c[__bool_true_false_are_defined == 1 ? 1 : -1];
 	char d[(bool) 0.5 == true ? 1 : -1];
-	/* See body of main program for 'e'.  */
+	bool e = &s;
 	char f[(_Bool) 0.0 == false ? 1 : -1];
 	char g[true];
 	char h[sizeof (_Bool)];
@@ -7349,6 +7240,25 @@
 	_Bool n[m];
 	char o[sizeof n == m * sizeof n[0] ? 1 : -1];
 	char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+#	if defined __xlc__ || defined __GNUC__
+	 /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
+	    reported by James Lemley on 2005-10-05; see
+	    http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+	    This test is not quite right, since xlc is allowed to
+	    reject this program, as the initializer for xlcbug is
+	    not one of the forms that C requires support for.
+	    However, doing the test right would require a runtime
+	    test, and that would make cross-compilation harder.
+	    Let us hope that IBM fixes the xlc bug, and also adds
+	    support for this kind of constant expression.  In the
+	    meantime, this test will reject xlc, which is OK, since
+	    our stdbool.h substitute should suffice.  We also test
+	    this with GCC, where it should work, to detect more
+	    quickly whether someone messes up the test in the
+	    future.  */
+	 char digs[] = "0123456789";
+	 int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
+#	endif
 	/* Catch a bug in an HP-UX C compiler.  See
 	   http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
 	   http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
@@ -7360,7 +7270,6 @@
 main ()
 {
 
-	bool e = &s;
 	*pq |= q;
 	*pq |= ! q;
 	/* Refer to every declared value, to avoid compiler optimizations.  */
@@ -7381,7 +7290,7 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
 $as_echo "$ac_cv_header_stdbool_h" >&6; }
 ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
-if test "x$ac_cv_type__Bool" = xyes; then :
+if test "x$ac_cv_type__Bool" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE__BOOL 1
@@ -7398,7 +7307,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
 $as_echo_n "checking for uid_t in sys/types.h... " >&6; }
-if ${ac_cv_type_uid_t+:} false; then :
+if test "${ac_cv_type_uid_t+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7428,7 +7337,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
 $as_echo_n "checking for inline... " >&6; }
-if ${ac_cv_c_inline+:} false; then :
+if test "${ac_cv_c_inline+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_c_inline=no
@@ -7513,7 +7422,7 @@
 esac
 
 ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
-if test "x$ac_cv_type_mode_t" = xyes; then :
+if test "x$ac_cv_type_mode_t" = x""yes; then :
 
 else
 
@@ -7524,7 +7433,7 @@
 fi
 
 ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
-if test "x$ac_cv_type_off_t" = xyes; then :
+if test "x$ac_cv_type_off_t" = x""yes; then :
 
 else
 
@@ -7535,7 +7444,7 @@
 fi
 
 ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
-if test "x$ac_cv_type_pid_t" = xyes; then :
+if test "x$ac_cv_type_pid_t" = x""yes; then :
 
 else
 
@@ -7547,7 +7456,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
 $as_echo_n "checking for C/C++ restrict keyword... " >&6; }
-if ${ac_cv_c_restrict+:} false; then :
+if test "${ac_cv_c_restrict+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_cv_c_restrict=no
@@ -7592,7 +7501,7 @@
  esac
 
 ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
+if test "x$ac_cv_type_size_t" = x""yes; then :
 
 else
 
@@ -7603,7 +7512,7 @@
 fi
 
 ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default"
-if test "x$ac_cv_type_ssize_t" = xyes; then :
+if test "x$ac_cv_type_ssize_t" = x""yes; then :
 
 else
 
@@ -7614,7 +7523,7 @@
 fi
 
 ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then :
+if test "x$ac_cv_member_struct_stat_st_blksize" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
@@ -7624,7 +7533,7 @@
 fi
 
 ac_fn_c_check_member "$LINENO" "struct stat" "st_blocks" "ac_cv_member_struct_stat_st_blocks" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_blocks" = xyes; then :
+if test "x$ac_cv_member_struct_stat_st_blocks" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_BLOCKS 1
@@ -7644,7 +7553,7 @@
 
 
 ac_fn_c_check_member "$LINENO" "struct stat" "st_rdev" "ac_cv_member_struct_stat_st_rdev" "$ac_includes_default"
-if test "x$ac_cv_member_struct_stat_st_rdev" = xyes; then :
+if test "x$ac_cv_member_struct_stat_st_rdev" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_STRUCT_STAT_ST_RDEV 1
@@ -7708,7 +7617,7 @@
   esac
 
 ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
-if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
+if test "x$ac_cv_type_ptrdiff_t" = x""yes; then :
 
 cat >>confdefs.h <<_ACEOF
 #define HAVE_PTRDIFF_T 1
@@ -7721,7 +7630,7 @@
 # Checks for library functions.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
 $as_echo_n "checking for error_at_line... " >&6; }
-if ${ac_cv_lib_error_at_line+:} false; then :
+if test "${ac_cv_lib_error_at_line+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -7757,7 +7666,7 @@
 for ac_header in vfork.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default"
-if test "x$ac_cv_header_vfork_h" = xyes; then :
+if test "x$ac_cv_header_vfork_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_VFORK_H 1
 _ACEOF
@@ -7781,7 +7690,7 @@
 if test "x$ac_cv_func_fork" = xyes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5
 $as_echo_n "checking for working fork... " >&6; }
-if ${ac_cv_func_fork_works+:} false; then :
+if test "${ac_cv_func_fork_works+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -7834,7 +7743,7 @@
 if test "x$ac_cv_func_vfork" = xyes; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5
 $as_echo_n "checking for working vfork... " >&6; }
-if ${ac_cv_func_vfork_works+:} false; then :
+if test "${ac_cv_func_vfork_works+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -7969,7 +7878,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
-if ${ac_cv_sys_largefile_source+:} false; then :
+if test "${ac_cv_sys_largefile_source+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   while :; do
@@ -8037,7 +7946,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
 $as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
-if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
+if test "${ac_cv_func_lstat_dereferences_slashed_symlink+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   rm -f conftest.sym conftest.file
@@ -8099,7 +8008,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sys/types.h defines makedev" >&5
 $as_echo_n "checking whether sys/types.h defines makedev... " >&6; }
-if ${ac_cv_header_sys_types_h_makedev+:} false; then :
+if test "${ac_cv_header_sys_types_h_makedev+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8127,7 +8036,7 @@
 
 if test $ac_cv_header_sys_types_h_makedev = no; then
 ac_fn_c_check_header_mongrel "$LINENO" "sys/mkdev.h" "ac_cv_header_sys_mkdev_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_mkdev_h" = xyes; then :
+if test "x$ac_cv_header_sys_mkdev_h" = x""yes; then :
 
 $as_echo "#define MAJOR_IN_MKDEV 1" >>confdefs.h
 
@@ -8137,7 +8046,7 @@
 
   if test $ac_cv_header_sys_mkdev_h = no; then
     ac_fn_c_check_header_mongrel "$LINENO" "sys/sysmacros.h" "ac_cv_header_sys_sysmacros_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_sysmacros_h" = xyes; then :
+if test "x$ac_cv_header_sys_sysmacros_h" = x""yes; then :
 
 $as_echo "#define MAJOR_IN_SYSMACROS 1" >>confdefs.h
 
@@ -8150,7 +8059,7 @@
 for ac_header in stdlib.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = xyes; then :
+if test "x$ac_cv_header_stdlib_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_STDLIB_H 1
 _ACEOF
@@ -8161,7 +8070,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
 $as_echo_n "checking for GNU libc compatible malloc... " >&6; }
-if ${ac_cv_func_malloc_0_nonnull+:} false; then :
+if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8216,7 +8125,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5
 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if ${ac_cv_header_time+:} false; then :
+if test "${ac_cv_header_time+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8291,7 +8200,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5
 $as_echo_n "checking for working mktime... " >&6; }
-if ${ac_cv_func_working_mktime+:} false; then :
+if test "${ac_cv_func_working_mktime+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8520,7 +8429,7 @@
 for ac_func in getpagesize
 do :
   ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
-if test "x$ac_cv_func_getpagesize" = xyes; then :
+if test "x$ac_cv_func_getpagesize" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_GETPAGESIZE 1
 _ACEOF
@@ -8530,7 +8439,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
 $as_echo_n "checking for working mmap... " >&6; }
-if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
+if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8697,7 +8606,7 @@
 for ac_header in stdlib.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = xyes; then :
+if test "x$ac_cv_header_stdlib_h" = x""yes; then :
   cat >>confdefs.h <<_ACEOF
 #define HAVE_STDLIB_H 1
 _ACEOF
@@ -8708,7 +8617,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5
 $as_echo_n "checking for GNU libc compatible realloc... " >&6; }
-if ${ac_cv_func_realloc_0_nonnull+:} false; then :
+if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8761,17 +8670,13 @@
 fi
 
 
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
 $as_echo_n "checking for working strnlen... " >&6; }
-if ${ac_cv_func_strnlen_working+:} false; then :
+if test "${ac_cv_func_strnlen_working+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
-  # Guess no on AIX systems, yes otherwise.
-		case "$host_os" in
-		  aix*) ac_cv_func_strnlen_working=no;;
-		  *)    ac_cv_func_strnlen_working=yes;;
-		esac
+  ac_cv_func_strnlen_working=no
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -8820,7 +8725,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5
 $as_echo_n "checking for working strtod... " >&6; }
-if ${ac_cv_func_strtod+:} false; then :
+if test "${ac_cv_func_strtod+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then :
@@ -8879,14 +8784,14 @@
 esac
 
 ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow"
-if test "x$ac_cv_func_pow" = xyes; then :
+if test "x$ac_cv_func_pow" = x""yes; then :
 
 fi
 
 if test $ac_cv_func_pow = no; then
   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
 $as_echo_n "checking for pow in -lm... " >&6; }
-if ${ac_cv_lib_m_pow+:} false; then :
+if test "${ac_cv_lib_m_pow+set}" = set; then :
   $as_echo_n "(cached) " >&6
 else
   ac_check_lib_save_LIBS=$LIBS
@@ -8920,7 +8825,7 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
 $as_echo "$ac_cv_lib_m_pow" >&6; }
-if test "x$ac_cv_lib_m_pow" = xyes; then :
+if test "x$ac_cv_lib_m_pow" = x""yes; then :
   POW_LIB=-lm
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5
@@ -9016,21 +8921,10 @@
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
-    if test "x$cache_file" != "x/dev/null"; then
+    test "x$cache_file" != "x/dev/null" &&
       { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
 $as_echo "$as_me: updating cache $cache_file" >&6;}
-      if test ! -f "$cache_file" || test -h "$cache_file"; then
-	cat confcache >"$cache_file"
-      else
-        case $cache_file in #(
-        */* | ?:*)
-	  mv -f confcache "$cache_file"$$ &&
-	  mv -f "$cache_file"$$ "$cache_file" ;; #(
-        *)
-	  mv -f confcache "$cache_file" ;;
-	esac
-      fi
-    fi
+    cat confcache >$cache_file
   else
     { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
@@ -9062,7 +8956,7 @@
 
 
 
-: "${CONFIG_STATUS=./config.status}"
+: ${CONFIG_STATUS=./config.status}
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
@@ -9163,7 +9057,6 @@
 IFS=" ""	$as_nl"
 
 # Find who we are.  Look in the path if we contain no directory separator.
-as_myself=
 case $0 in #((
   *[\\/]* ) as_myself=$0 ;;
   *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -9471,7 +9364,7 @@
 # values after options handling.
 ac_log="
 This file was extended by Xen Hypervisor $as_me 4.2, which was
-generated by GNU Autoconf 2.68.  Invocation command line was
+generated by GNU Autoconf 2.67.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -9533,7 +9426,7 @@
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
 Xen Hypervisor config.status 4.2
-configured by $0, generated by GNU Autoconf 2.68,
+configured by $0, generated by GNU Autoconf 2.67,
   with options \\"\$ac_cs_config\\"
 
 Copyright (C) 2010 Free Software Foundation, Inc.
@@ -9657,7 +9550,7 @@
     "../config/Tools.mk") CONFIG_FILES="$CONFIG_FILES ../config/Tools.mk" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 
-  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;;
   esac
 done
 
@@ -9679,10 +9572,9 @@
 # after its creation but before its name has been assigned to `$tmp'.
 $debug ||
 {
-  tmp= ac_tmp=
+  tmp=
   trap 'exit_status=$?
-  : "${ac_tmp:=$tmp}"
-  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
 ' 0
   trap 'as_fn_exit 1' 1 2 13 15
 }
@@ -9690,13 +9582,12 @@
 
 {
   tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
-  test -d "$tmp"
+  test -n "$tmp" && test -d "$tmp"
 }  ||
 {
   tmp=./conf$$-$RANDOM
   (umask 077 && mkdir "$tmp")
 } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
-ac_tmp=$tmp
 
 # Set up the scripts for CONFIG_FILES section.
 # No need to generate them if there are no CONFIG_FILES.
@@ -9718,7 +9609,7 @@
   ac_cs_awk_cr=$ac_cr
 fi
 
-echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+echo 'BEGIN {' >"$tmp/subs1.awk" &&
 _ACEOF
 
 
@@ -9746,7 +9637,7 @@
 rm -f conf$$subs.sh
 
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+cat >>"\$tmp/subs1.awk" <<\\_ACAWK &&
 _ACEOF
 sed -n '
 h
@@ -9794,7 +9685,7 @@
 rm -f conf$$subs.awk
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 _ACAWK
-cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+cat >>"\$tmp/subs1.awk" <<_ACAWK &&
   for (key in S) S_is_set[key] = 1
   FS = ""
 
@@ -9826,7 +9717,7 @@
   sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
 else
   cat
-fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \
   || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
 _ACEOF
 
@@ -9860,7 +9751,7 @@
 # No need to generate them if there are no CONFIG_HEADERS.
 # This happens for instance with `./config.status Makefile'.
 if test -n "$CONFIG_HEADERS"; then
-cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+cat >"$tmp/defines.awk" <<\_ACAWK ||
 BEGIN {
 _ACEOF
 
@@ -9872,8 +9763,8 @@
 # handling of long lines.
 ac_delim='%!_!# '
 for ac_last_try in false false :; do
-  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
-  if test -z "$ac_tt"; then
+  ac_t=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_t"; then
     break
   elif $ac_last_try; then
     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
@@ -9974,7 +9865,7 @@
   esac
   case $ac_mode$ac_tag in
   :[FHL]*:*);;
-  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;;
   :[FH]-) ac_tag=-:-;;
   :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
   esac
@@ -9993,7 +9884,7 @@
     for ac_f
     do
       case $ac_f in
-      -) ac_f="$ac_tmp/stdin";;
+      -) ac_f="$tmp/stdin";;
       *) # Look for the file first in the build tree, then in the source tree
 	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
 	 # because $ac_f cannot contain `:'.
@@ -10002,7 +9893,7 @@
 	   [\\/$]*) false;;
 	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
 	   esac ||
-	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;;
       esac
       case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
@@ -10028,8 +9919,8 @@
     esac
 
     case $ac_tag in
-    *:-:* | *:-) cat >"$ac_tmp/stdin" \
-      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    *:-:* | *:-) cat >"$tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5  ;;
     esac
     ;;
   esac
@@ -10159,22 +10050,21 @@
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
 "
-eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
-  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
-  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
-  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
-      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&5
 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&2;}
 
-  rm -f "$ac_tmp/stdin"
+  rm -f "$tmp/stdin"
   case $ac_file in
-  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
-  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  -) cat "$tmp/out" && rm -f "$tmp/out";;
+  *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";;
   esac \
   || as_fn_error $? "could not create $ac_file" "$LINENO" 5
  ;;
@@ -10185,20 +10075,20 @@
   if test x"$ac_file" != x-; then
     {
       $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
-    } >"$ac_tmp/config.h" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs"
+    } >"$tmp/config.h" \
       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
-    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+    if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then
       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
 $as_echo "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
-      mv "$ac_tmp/config.h" "$ac_file" \
+      mv "$tmp/config.h" "$ac_file" \
 	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
     $as_echo "/* $configure_input  */" \
-      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \
       || as_fn_error $? "could not create -" "$LINENO" 5
   fi
  ;;
diff -r e439559f50eb -r d7fe4cd831a0 tools/configure.ac
--- a/tools/configure.ac	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/configure.ac	Wed Feb 29 17:01:41 2012 +0000
@@ -78,8 +78,6 @@
 AC_PROG_INSTALL
 AX_PATH_PROG_OR_FAIL([PERL], [perl])
 AX_PATH_PROG_OR_FAIL([IP], [ip])
-AX_PATH_PROG_OR_FAIL([BISON], [bison])
-AX_PATH_PROG_OR_FAIL([FLEX], [flex])
 AS_IF([test "x$xapi" = "xy"], [
     AX_PATH_PROG_OR_FAIL([CURL], [curl-config])
     AX_PATH_PROG_OR_FAIL([XML], [xml2-config])

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44: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 1S31cg-0007HO-S2; Thu, 01 Mar 2012 08:44:26 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cf-00079Y-SG
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1330591458!3808973!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20704 invoked from network); 1 Mar 2012 08:44:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08:44: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 1S31cX-0002CF-OI
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cX-0003O0-Mr
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:17 +0000
Message-Id: <E1S31cX-0003O0-Mr@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: xencommons: revert accidental
	hunk in 24905:2b5cf6bde62d
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330526308 0
# Node ID 39283113682e31f633a919f164cf5d16868ac352
# Parent  24117fff2fe1576bd0a50842413fc5d150cf60c6
tools: xencommons: revert accidental hunk in 24905:2b5cf6bde62d

24905:2b5cf6bde62d accidentally contained a change to
tools/hotplug/Linux/init.d/xencommons.  That change is probably OK but
should not be in 24905 so remove it.

Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 24117fff2fe1 -r 39283113682e tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons	Wed Feb 29 14:36:04 2012 +0000
+++ b/tools/hotplug/Linux/init.d/xencommons	Wed Feb 29 14:38:28 2012 +0000
@@ -58,7 +58,6 @@
 	modprobe xen-gntdev 2>/dev/null
 	modprobe evtchn 2>/dev/null
 	modprobe gntdev 2>/dev/null
-	modprobe processor-passthru 2>/dev/null
 
 	if ! `xenstore-read -s / >/dev/null 2>&1`
 	then

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44: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 1S31cg-0007HO-S2; Thu, 01 Mar 2012 08:44:26 +0000
Received: from mail21.messagelabs.com ([85.158.143.35])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cf-00079Y-SG
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1330591458!3808973!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20704 invoked from network); 1 Mar 2012 08:44:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	1 Mar 2012 08:44: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 1S31cX-0002CF-OI
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cX-0003O0-Mr
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:17 +0000
Message-Id: <E1S31cX-0003O0-Mr@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: xencommons: revert accidental
	hunk in 24905:2b5cf6bde62d
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330526308 0
# Node ID 39283113682e31f633a919f164cf5d16868ac352
# Parent  24117fff2fe1576bd0a50842413fc5d150cf60c6
tools: xencommons: revert accidental hunk in 24905:2b5cf6bde62d

24905:2b5cf6bde62d accidentally contained a change to
tools/hotplug/Linux/init.d/xencommons.  That change is probably OK but
should not be in 24905 so remove it.

Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 24117fff2fe1 -r 39283113682e tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons	Wed Feb 29 14:36:04 2012 +0000
+++ b/tools/hotplug/Linux/init.d/xencommons	Wed Feb 29 14:38:28 2012 +0000
@@ -58,7 +58,6 @@
 	modprobe xen-gntdev 2>/dev/null
 	modprobe evtchn 2>/dev/null
 	modprobe gntdev 2>/dev/null
-	modprobe processor-passthru 2>/dev/null
 
 	if ! `xenstore-read -s / >/dev/null 2>&1`
 	then

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cj-0007Ji-1B; Thu, 01 Mar 2012 08:44:29 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31ch-0007BP-Vk
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1330591459!15600357!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31646 invoked from network); 1 Mar 2012 08:44:21 -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;
	1 Mar 2012 08:44: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 1S31cY-0002CI-Ac
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cY-0003OW-9B
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:18 +0000
Message-Id: <E1S31cY-0003OW-9B@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Revert 24897:f25e5785327e "Export
	configure variables to hypervisor build"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330528291 0
# Node ID fa3f08ce6b75f8ff1c41bb254ea479de75583c9b
# Parent  39283113682e31f633a919f164cf5d16868ac352
Revert 24897:f25e5785327e "Export configure variables to hypervisor build"

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


diff -r 39283113682e -r fa3f08ce6b75 .gitignore
--- a/.gitignore	Wed Feb 29 14:38:28 2012 +0000
+++ b/.gitignore	Wed Feb 29 15:11:31 2012 +0000
@@ -111,7 +111,6 @@
 tools/config.status
 tools/config.cache
 config/Tools.mk
-config/Xen.mk
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
 tools/blktap2/drivers/lock-util
diff -r 39283113682e -r fa3f08ce6b75 .hgignore
--- a/.hgignore	Wed Feb 29 14:38:28 2012 +0000
+++ b/.hgignore	Wed Feb 29 15:11:31 2012 +0000
@@ -309,7 +309,6 @@
 ^tools/config\.status$
 ^tools/config\.cache$
 ^config/Tools\.mk$
-^config/Xen\.mk$
 ^xen/\.banner.*$
 ^xen/BLOG$
 ^xen/System.map$
diff -r 39283113682e -r fa3f08ce6b75 config/Tools.mk.in
--- a/config/Tools.mk.in	Wed Feb 29 14:38:28 2012 +0000
+++ b/config/Tools.mk.in	Wed Feb 29 15:11:31 2012 +0000
@@ -24,6 +24,10 @@
 APPEND_INCLUDES     := @APPEND_INCLUDES@
 APPEND_LIB          := @APPEND_LIB@
 
+# Enable XSM security module (by default, Flask).
+XSM_ENABLE          := @xsm@
+FLASK_ENABLE        := @xsm@
+
 # Download GIT repositories via HTTP or GIT's own protocol?
 # GIT's protocol is faster and more robust, when it works at all (firewalls
 # may block it). We make it the default, but if your GIT repository downloads
diff -r 39283113682e -r fa3f08ce6b75 config/Xen.mk.in
--- a/config/Xen.mk.in	Wed Feb 29 14:38:28 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-# Prefix and install folder
-PREFIX              := @prefix@
-LIBLEAFDIR_x86_64   := @LIB_PATH@
-
-# A debug build of xen?
-debug               := @debug@
-
-# Tools path
-PYTHON              := @PYTHON@
-
-# Extra folder for libs/includes
-PREPEND_INCLUDES    := @PREPEND_INCLUDES@
-PREPEND_LIB         := @PREPEND_LIB@
-APPEND_INCLUDES     := @APPEND_INCLUDES@
-APPEND_LIB          := @APPEND_LIB@
-
-# Enable XSM security module (by default, Flask).
-XSM_ENABLE          := @xsm@
-FLASK_ENABLE        := @xsm@
diff -r 39283113682e -r fa3f08ce6b75 tools/configure
--- a/tools/configure	Wed Feb 29 14:38:28 2012 +0000
+++ b/tools/configure	Wed Feb 29 15:11:31 2012 +0000
@@ -2446,8 +2446,6 @@
 
 ac_config_files="$ac_config_files ../config/Tools.mk"
 
-ac_config_files="$ac_config_files ../config/Xen.mk"
-
 ac_config_headers="$ac_config_headers config.h"
 
 
@@ -9657,7 +9655,6 @@
 do
   case $ac_config_target in
     "../config/Tools.mk") CONFIG_FILES="$CONFIG_FILES ../config/Tools.mk" ;;
-    "../config/Xen.mk") CONFIG_FILES="$CONFIG_FILES ../config/Xen.mk" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
diff -r 39283113682e -r fa3f08ce6b75 tools/configure.ac
--- a/tools/configure.ac	Wed Feb 29 14:38:28 2012 +0000
+++ b/tools/configure.ac	Wed Feb 29 15:11:31 2012 +0000
@@ -6,7 +6,6 @@
     [xen-devel@lists.xensource.com])
 AC_CONFIG_SRCDIR([libxl/libxl.c])
 AC_CONFIG_FILES([../config/Tools.mk])
-AC_CONFIG_FILES([../config/Xen.mk])
 AC_CONFIG_HEADERS([config.h])
 AC_PREFIX_DEFAULT([/usr])
 AC_CONFIG_AUX_DIR([.])
diff -r 39283113682e -r fa3f08ce6b75 xen/Rules.mk
--- a/xen/Rules.mk	Wed Feb 29 14:38:28 2012 +0000
+++ b/xen/Rules.mk	Wed Feb 29 15:11:31 2012 +0000
@@ -12,7 +12,6 @@
 lto           ?= n
 
 include $(XEN_ROOT)/Config.mk
-include $(XEN_ROOT)/config/Xen.mk
 
 # Hardcoded configuration implications and dependencies.
 # Do this is a neater way if it becomes unwieldy.

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 08:44:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 08:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S31cj-0007Ji-1B; Thu, 01 Mar 2012 08:44:29 +0000
Received: from mail174.messagelabs.com ([85.158.138.51])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31ch-0007BP-Vk
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1330591459!15600357!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31646 invoked from network); 1 Mar 2012 08:44:21 -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;
	1 Mar 2012 08:44: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 1S31cY-0002CI-Ac
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S31cY-0003OW-9B
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 08:44:18 +0000
Message-Id: <E1S31cY-0003OW-9B@xenbits.xen.org>
Date: Thu, 01 Mar 2012 08:44:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Revert 24897:f25e5785327e "Export
	configure variables to hypervisor build"
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330528291 0
# Node ID fa3f08ce6b75f8ff1c41bb254ea479de75583c9b
# Parent  39283113682e31f633a919f164cf5d16868ac352
Revert 24897:f25e5785327e "Export configure variables to hypervisor build"

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


diff -r 39283113682e -r fa3f08ce6b75 .gitignore
--- a/.gitignore	Wed Feb 29 14:38:28 2012 +0000
+++ b/.gitignore	Wed Feb 29 15:11:31 2012 +0000
@@ -111,7 +111,6 @@
 tools/config.status
 tools/config.cache
 config/Tools.mk
-config/Xen.mk
 tools/blktap2/daemon/blktapctrl
 tools/blktap2/drivers/img2qcow
 tools/blktap2/drivers/lock-util
diff -r 39283113682e -r fa3f08ce6b75 .hgignore
--- a/.hgignore	Wed Feb 29 14:38:28 2012 +0000
+++ b/.hgignore	Wed Feb 29 15:11:31 2012 +0000
@@ -309,7 +309,6 @@
 ^tools/config\.status$
 ^tools/config\.cache$
 ^config/Tools\.mk$
-^config/Xen\.mk$
 ^xen/\.banner.*$
 ^xen/BLOG$
 ^xen/System.map$
diff -r 39283113682e -r fa3f08ce6b75 config/Tools.mk.in
--- a/config/Tools.mk.in	Wed Feb 29 14:38:28 2012 +0000
+++ b/config/Tools.mk.in	Wed Feb 29 15:11:31 2012 +0000
@@ -24,6 +24,10 @@
 APPEND_INCLUDES     := @APPEND_INCLUDES@
 APPEND_LIB          := @APPEND_LIB@
 
+# Enable XSM security module (by default, Flask).
+XSM_ENABLE          := @xsm@
+FLASK_ENABLE        := @xsm@
+
 # Download GIT repositories via HTTP or GIT's own protocol?
 # GIT's protocol is faster and more robust, when it works at all (firewalls
 # may block it). We make it the default, but if your GIT repository downloads
diff -r 39283113682e -r fa3f08ce6b75 config/Xen.mk.in
--- a/config/Xen.mk.in	Wed Feb 29 14:38:28 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,19 +0,0 @@
-# Prefix and install folder
-PREFIX              := @prefix@
-LIBLEAFDIR_x86_64   := @LIB_PATH@
-
-# A debug build of xen?
-debug               := @debug@
-
-# Tools path
-PYTHON              := @PYTHON@
-
-# Extra folder for libs/includes
-PREPEND_INCLUDES    := @PREPEND_INCLUDES@
-PREPEND_LIB         := @PREPEND_LIB@
-APPEND_INCLUDES     := @APPEND_INCLUDES@
-APPEND_LIB          := @APPEND_LIB@
-
-# Enable XSM security module (by default, Flask).
-XSM_ENABLE          := @xsm@
-FLASK_ENABLE        := @xsm@
diff -r 39283113682e -r fa3f08ce6b75 tools/configure
--- a/tools/configure	Wed Feb 29 14:38:28 2012 +0000
+++ b/tools/configure	Wed Feb 29 15:11:31 2012 +0000
@@ -2446,8 +2446,6 @@
 
 ac_config_files="$ac_config_files ../config/Tools.mk"
 
-ac_config_files="$ac_config_files ../config/Xen.mk"
-
 ac_config_headers="$ac_config_headers config.h"
 
 
@@ -9657,7 +9655,6 @@
 do
   case $ac_config_target in
     "../config/Tools.mk") CONFIG_FILES="$CONFIG_FILES ../config/Tools.mk" ;;
-    "../config/Xen.mk") CONFIG_FILES="$CONFIG_FILES ../config/Xen.mk" ;;
     "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
 
   *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
diff -r 39283113682e -r fa3f08ce6b75 tools/configure.ac
--- a/tools/configure.ac	Wed Feb 29 14:38:28 2012 +0000
+++ b/tools/configure.ac	Wed Feb 29 15:11:31 2012 +0000
@@ -6,7 +6,6 @@
     [xen-devel@lists.xensource.com])
 AC_CONFIG_SRCDIR([libxl/libxl.c])
 AC_CONFIG_FILES([../config/Tools.mk])
-AC_CONFIG_FILES([../config/Xen.mk])
 AC_CONFIG_HEADERS([config.h])
 AC_PREFIX_DEFAULT([/usr])
 AC_CONFIG_AUX_DIR([.])
diff -r 39283113682e -r fa3f08ce6b75 xen/Rules.mk
--- a/xen/Rules.mk	Wed Feb 29 14:38:28 2012 +0000
+++ b/xen/Rules.mk	Wed Feb 29 15:11:31 2012 +0000
@@ -12,7 +12,6 @@
 lto           ?= n
 
 include $(XEN_ROOT)/Config.mk
-include $(XEN_ROOT)/config/Xen.mk
 
 # Hardcoded configuration implications and dependencies.
 # Do this is a neater way if it becomes unwieldy.

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 19:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 19: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 1S3BPF-00051G-Rg; Thu, 01 Mar 2012 19:11:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1S3BPE-000515-4B
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 19:11:12 +0000
Received: from [85.158.143.99:44624] by server-2.bemta-4.messagelabs.com id
	29/83-17550-FC9CF4F4; Thu, 01 Mar 2012 19:11:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1330629063!17182726!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8765 invoked from network); 1 Mar 2012 19:11:04 -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;
	1 Mar 2012 19:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1S3BP5-0001sM-Nm
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 19:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1S3BP5-0007LM-DQ
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 19:11:03 +0000
Date: Thu, 01 Mar 2012 19:11:03 +0000
Message-Id: <E1S3BP5-0007LM-DQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-xen: ignore console
	disconnect events for console/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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2503d4d5a29e7af8dffd1e11229e11c1917d2ccf
Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date:   Thu Mar 1 18:58:27 2012 +0000

    qemu-xen: ignore console disconnect events for console/0
    
    The first console has a different location compared to other PV devices
    (console, rather than device/console/0) and doesn't obey the xenstore
    state protocol. We already special case the first console in con_init
    and con_initialise, we should also do it in con_disconnect.
    
    This patch should be applied to 4.1 too.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_console.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/xen_console.c b/hw/xen_console.c
index d7099c4..8d14131 100644
--- a/hw/xen_console.c
+++ b/hw/xen_console.c
@@ -253,6 +253,8 @@ static void con_disconnect(struct XenDevice *xendev)
 {
     struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);
 
+    if (!xendev->dev)
+        return;
     if (con->chr)
         qemu_chr_add_handlers(con->chr, NULL, NULL, NULL, NULL);
     xen_be_unbind_evtchn(&con->xendev);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Thu Mar 01 19:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 01 Mar 2012 19: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 1S3BPF-00051G-Rg; Thu, 01 Mar 2012 19:11:13 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1S3BPE-000515-4B
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 19:11:12 +0000
Received: from [85.158.143.99:44624] by server-2.bemta-4.messagelabs.com id
	29/83-17550-FC9CF4F4; Thu, 01 Mar 2012 19:11:11 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-8.tower-216.messagelabs.com!1330629063!17182726!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8765 invoked from network); 1 Mar 2012 19:11:04 -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;
	1 Mar 2012 19:11:04 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1S3BP5-0001sM-Nm
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 19:11:03 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1S3BP5-0007LM-DQ
	for xen-changelog@lists.xensource.com; Thu, 01 Mar 2012 19:11:03 +0000
Date: Thu, 01 Mar 2012 19:11:03 +0000
Message-Id: <E1S3BP5-0007LM-DQ@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-unstable] qemu-xen: ignore console
	disconnect events for console/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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 2503d4d5a29e7af8dffd1e11229e11c1917d2ccf
Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date:   Thu Mar 1 18:58:27 2012 +0000

    qemu-xen: ignore console disconnect events for console/0
    
    The first console has a different location compared to other PV devices
    (console, rather than device/console/0) and doesn't obey the xenstore
    state protocol. We already special case the first console in con_init
    and con_initialise, we should also do it in con_disconnect.
    
    This patch should be applied to 4.1 too.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
---
 hw/xen_console.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/xen_console.c b/hw/xen_console.c
index d7099c4..8d14131 100644
--- a/hw/xen_console.c
+++ b/hw/xen_console.c
@@ -253,6 +253,8 @@ static void con_disconnect(struct XenDevice *xendev)
 {
     struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);
 
+    if (!xendev->dev)
+        return;
     if (con->chr)
         qemu_chr_add_handlers(con->chr, NULL, NULL, NULL, NULL);
     xen_be_unbind_evtchn(&con->xendev);
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gej-0000Bc-Ko; Sat, 03 Mar 2012 04:33: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 1S3geh-0000AS-Sk
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:16 +0000
Received: from [85.158.139.83:18797] by server-4.bemta-5.messagelabs.com id
	24/FB-10788-B0F915F4; Sat, 03 Mar 2012 04:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1330749193!17010004!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4670 invoked from network); 3 Mar 2012 04:33:14 -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;
	3 Mar 2012 04:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gec-0004ff-QV
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gec-0003KN-Hy
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:10 +0000
Message-Id: <E1S3gec-0003KN-Hy@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: allow specification of
	testidl random seed.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID d66fe43c6cfdd7f7c39fa8fd0dd888a5a9b35000
# Parent  b8f2b17e897b013e5715b47872ae360371f10034
libxl: allow specification of testidl random seed.

Useful if you are interested in before/after results of changing the IDL or
generator.

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


diff -r b8f2b17e897b -r d66fe43c6cfd tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/gentest.py	Thu Mar 01 12:26:13 2012 +0000
@@ -1,5 +1,6 @@
 #!/usr/bin/python
 
+import os
 import sys
 import re
 import random
@@ -72,7 +73,7 @@
         print >>sys.stderr, "Usage: gentest.py <idl> <implementation>"
         sys.exit(1)
 
-    random.seed()
+    random.seed(os.getenv('LIBXL_TESTIDL_SEED'))
 
     (builtins,types) = idl.parse(sys.argv[1])
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gej-0000Bm-Pp; Sat, 03 Mar 2012 04:33: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 1S3geh-0000Ab-Vn
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:16 +0000
Received: from [85.158.139.83:18798] by server-10.bemta-5.messagelabs.com id
	92/3D-08260-B0F915F4; Sat, 03 Mar 2012 04:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1330749192!16808784!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12088 invoked from network); 3 Mar 2012 04:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gee-0004fo-F8
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gee-0003Lw-AT
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:12 +0000
Message-Id: <E1S3gee-0003Lw-AT@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: provide _init and _setdefault
	for libxl_domain_create_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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID bf72799de4d6039da71771df01fa3567a6ea118e
# Parent  c3198eb7c0028d0293a3bb6d4de4b55b5aa63a81
libxl: provide _init and _setdefault for libxl_domain_create_info.

Some fields require further scaffolding before they can use the
_init/_setdefault scheme and are handled in later patches.

It doesn't seem reasonable for the library to pick a default for the domain
type so reject as invalid.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r c3198eb7c002 -r bf72799de4d6 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
@@ -356,7 +356,7 @@
 int libxl_ctx_postfork(libxl_ctx *ctx);
 
 /* domain related functions */
-int libxl_init_create_info(libxl_ctx *ctx, libxl_domain_create_info *c_info);
+void libxl_domain_create_info_init(libxl_domain_create_info *c_info);
 int libxl_init_build_info(libxl_ctx *ctx,
                           libxl_domain_build_info *b_info,
                           libxl_domain_create_info *c_info);
diff -r c3198eb7c002 -r bf72799de4d6 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:13 2012 +0000
@@ -50,16 +50,19 @@
     libxl_domain_build_info_dispose(&d_config->b_info);
 }
 
-int libxl_init_create_info(libxl_ctx *ctx, libxl_domain_create_info *c_info)
+void libxl_domain_create_info_init(libxl_domain_create_info *c_info)
 {
     memset(c_info, '\0', sizeof(*c_info));
-    c_info->xsdata = NULL;
-    c_info->platformdata = NULL;
     c_info->hap = 1;
-    c_info->type = LIBXL_DOMAIN_TYPE_HVM;
     c_info->oos = 1;
-    c_info->ssidref = 0;
-    c_info->poolid = 0;
+}
+
+int libxl__domain_create_info_setdefault(libxl__gc *gc,
+                                         libxl_domain_create_info *c_info)
+{
+    if (!c_info->type)
+        return ERROR_INVAL;
+
     return 0;
 }
 
@@ -470,6 +473,9 @@
 
     domid = 0;
 
+    ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info);
+    if (ret) goto error_out;
+
     ret = libxl__domain_make(gc, &d_config->c_info, &domid);
     if (ret) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot make domain: %d", ret);
diff -r c3198eb7c002 -r bf72799de4d6 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:13 2012 +0000
@@ -705,7 +705,7 @@
         goto out;
     }
 
-    memset(&dm_config.c_info, 0x00, sizeof(libxl_domain_create_info));
+    libxl_domain_create_info_init(&dm_config.c_info);
     dm_config.c_info.type = LIBXL_DOMAIN_TYPE_PV;
     dm_config.c_info.name = libxl__sprintf(gc, "%s-dm",
                                     libxl__domid_to_name(gc, guest_domid));
@@ -740,6 +740,9 @@
     dm_config.vifs = guest_config->vifs;
     dm_config.num_vifs = guest_config->num_vifs;
 
+    ret = libxl__domain_create_info_setdefault(gc, &dm_config.c_info);
+    if (ret) goto out;
+
     libxl__vfb_and_vkb_from_hvm_guest_config(gc, guest_config, &vfb, &vkb);
     dm_config.vfbs = &vfb;
     dm_config.num_vfbs = 1;
diff -r c3198eb7c002 -r bf72799de4d6 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:13 2012 +0000
@@ -187,6 +187,8 @@
  * version of the _evdisable_FOO function; the internal one is
  * used during cleanup.
  */
+_hidden int libxl__domain_create_info_setdefault(libxl__gc *gc,
+                                        libxl_domain_create_info *c_info);
 
 struct libxl__evgen_domain_death {
     uint32_t domid;
diff -r c3198eb7c002 -r bf72799de4d6 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -535,8 +535,7 @@
         exit(1);
     }
 
-    if (libxl_init_create_info(ctx, c_info))
-        exit(1);
+    libxl_domain_create_info_init(c_info);
 
     if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
         e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gej-0000Bc-Ko; Sat, 03 Mar 2012 04:33: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 1S3geh-0000AS-Sk
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:16 +0000
Received: from [85.158.139.83:18797] by server-4.bemta-5.messagelabs.com id
	24/FB-10788-B0F915F4; Sat, 03 Mar 2012 04:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1330749193!17010004!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4670 invoked from network); 3 Mar 2012 04:33:14 -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;
	3 Mar 2012 04:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gec-0004ff-QV
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gec-0003KN-Hy
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:10 +0000
Message-Id: <E1S3gec-0003KN-Hy@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: allow specification of
	testidl random seed.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID d66fe43c6cfdd7f7c39fa8fd0dd888a5a9b35000
# Parent  b8f2b17e897b013e5715b47872ae360371f10034
libxl: allow specification of testidl random seed.

Useful if you are interested in before/after results of changing the IDL or
generator.

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


diff -r b8f2b17e897b -r d66fe43c6cfd tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/gentest.py	Thu Mar 01 12:26:13 2012 +0000
@@ -1,5 +1,6 @@
 #!/usr/bin/python
 
+import os
 import sys
 import re
 import random
@@ -72,7 +73,7 @@
         print >>sys.stderr, "Usage: gentest.py <idl> <implementation>"
         sys.exit(1)
 
-    random.seed()
+    random.seed(os.getenv('LIBXL_TESTIDL_SEED'))
 
     (builtins,types) = idl.parse(sys.argv[1])
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gel-0000Cl-4X; Sat, 03 Mar 2012 04:33: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 1S3gej-0000B5-TJ
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:18 +0000
Received: from [85.158.143.35:62721] by server-1.bemta-4.messagelabs.com id
	EA/B9-20925-D0F915F4; Sat, 03 Mar 2012 04:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1330749195!2445025!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4587 invoked from network); 3 Mar 2012 04:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geh-0004g3-7R
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geh-0003OX-5x
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:15 +0000
Message-Id: <E1S3geh-0003OX-5x@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: disk: use _init/_setdefault
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID 41731e865e399de1ff5a100ae7b6b139f232adfc
# Parent  66d0a12239dac983785c0a692f4f1b5f2501cbd2
libxl: disk: use _init/_setdefault

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 66d0a12239da -r 41731e865e39 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -1186,10 +1186,19 @@
 
 /******************************************************************************/
 
-int libxl_device_disk_init(libxl_ctx *ctx, libxl_device_disk *disk)
+void libxl_device_disk_init(libxl_device_disk *disk)
 {
     memset(disk, 0x00, sizeof(libxl_device_disk));
-    return 0;
+}
+
+int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
+{
+    int rc;
+
+    rc = libxl__device_disk_set_backend(gc, disk);
+    if (rc) return rc;
+
+    return rc;
 }
 
 static int libxl__device_from_disk(libxl__gc *gc, uint32_t domid,
@@ -1241,10 +1250,7 @@
     libxl__device device;
     int major, minor, rc;
 
-    rc = libxl__device_disk_set_backend(gc, disk);
-    if (rc) goto out;
-
-    rc = libxl__device_disk_set_backend(gc, disk);
+    rc = libxl__device_disk_setdefault(gc, disk);
     if (rc) goto out;
 
     front = flexarray_make(16, 1);
@@ -1396,7 +1402,7 @@
     unsigned int len;
     char *tmp;
 
-    libxl_device_disk_init(ctx, disk);
+    libxl_device_disk_init(disk);
 
     tmp = xs_read(ctx->xsh, XBT_NULL,
                   libxl__sprintf(gc, "%s/params", be_path), &len);
@@ -1440,7 +1446,7 @@
     char *dompath, *path;
     int rc = ERROR_FAIL;
 
-    libxl_device_disk_init(ctx, disk);
+    libxl_device_disk_init(disk);
 
     dompath = libxl__xs_get_dompath(gc, domid);
     if (!dompath) {
@@ -1604,7 +1610,7 @@
     char *ret = NULL;
     int rc;
 
-    rc = libxl__device_disk_set_backend(gc, disk);
+    rc = libxl__device_disk_setdefault(gc, disk);
     if (rc) goto out;
 
     switch (disk->backend) {
diff -r 66d0a12239da -r 41731e865e39 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
@@ -498,7 +498,7 @@
  */
 
 /* Disks */
-int libxl_device_disk_init(libxl_ctx *ctx, libxl_device_disk *disk);
+void libxl_device_disk_init(libxl_device_disk *disk);
 int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk);
 int libxl_device_disk_remove(libxl_ctx *ctx, uint32_t domid,
                              libxl_device_disk *disk,
diff -r 66d0a12239da -r 41731e865e39 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
@@ -536,7 +536,7 @@
     if (ret) goto error_out;
 
     for (i = 0; i < d_config->num_disks; i++) {
-        ret = libxl__device_disk_set_backend(gc, &d_config->disks[i]);
+        ret = libxl__device_disk_setdefault(gc, &d_config->disks[i]);
         if (ret) goto error_out;
     }
 
diff -r 66d0a12239da -r 41731e865e39 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
@@ -191,6 +191,8 @@
                                         libxl_domain_create_info *c_info);
 _hidden int libxl__domain_build_info_setdefault(libxl__gc *gc,
                                         libxl_domain_build_info *b_info);
+_hidden int libxl__device_disk_setdefault(libxl__gc *gc,
+                                          libxl_device_disk *disk);
 
 struct libxl__evgen_domain_death {
     uint32_t domid;
diff -r 66d0a12239da -r 41731e865e39 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -382,7 +382,7 @@
 {
     int e;
 
-    libxl_device_disk_init(ctx, disk);
+    libxl_device_disk_init(disk);
 
     if (!*config) {
         *config = xlu_cfg_init(stderr, "command line");

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gel-0000Cl-4X; Sat, 03 Mar 2012 04:33: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 1S3gej-0000B5-TJ
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:18 +0000
Received: from [85.158.143.35:62721] by server-1.bemta-4.messagelabs.com id
	EA/B9-20925-D0F915F4; Sat, 03 Mar 2012 04:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1330749195!2445025!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4587 invoked from network); 3 Mar 2012 04:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geh-0004g3-7R
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geh-0003OX-5x
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:15 +0000
Message-Id: <E1S3geh-0003OX-5x@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: disk: use _init/_setdefault
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID 41731e865e399de1ff5a100ae7b6b139f232adfc
# Parent  66d0a12239dac983785c0a692f4f1b5f2501cbd2
libxl: disk: use _init/_setdefault

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 66d0a12239da -r 41731e865e39 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -1186,10 +1186,19 @@
 
 /******************************************************************************/
 
-int libxl_device_disk_init(libxl_ctx *ctx, libxl_device_disk *disk)
+void libxl_device_disk_init(libxl_device_disk *disk)
 {
     memset(disk, 0x00, sizeof(libxl_device_disk));
-    return 0;
+}
+
+int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
+{
+    int rc;
+
+    rc = libxl__device_disk_set_backend(gc, disk);
+    if (rc) return rc;
+
+    return rc;
 }
 
 static int libxl__device_from_disk(libxl__gc *gc, uint32_t domid,
@@ -1241,10 +1250,7 @@
     libxl__device device;
     int major, minor, rc;
 
-    rc = libxl__device_disk_set_backend(gc, disk);
-    if (rc) goto out;
-
-    rc = libxl__device_disk_set_backend(gc, disk);
+    rc = libxl__device_disk_setdefault(gc, disk);
     if (rc) goto out;
 
     front = flexarray_make(16, 1);
@@ -1396,7 +1402,7 @@
     unsigned int len;
     char *tmp;
 
-    libxl_device_disk_init(ctx, disk);
+    libxl_device_disk_init(disk);
 
     tmp = xs_read(ctx->xsh, XBT_NULL,
                   libxl__sprintf(gc, "%s/params", be_path), &len);
@@ -1440,7 +1446,7 @@
     char *dompath, *path;
     int rc = ERROR_FAIL;
 
-    libxl_device_disk_init(ctx, disk);
+    libxl_device_disk_init(disk);
 
     dompath = libxl__xs_get_dompath(gc, domid);
     if (!dompath) {
@@ -1604,7 +1610,7 @@
     char *ret = NULL;
     int rc;
 
-    rc = libxl__device_disk_set_backend(gc, disk);
+    rc = libxl__device_disk_setdefault(gc, disk);
     if (rc) goto out;
 
     switch (disk->backend) {
diff -r 66d0a12239da -r 41731e865e39 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
@@ -498,7 +498,7 @@
  */
 
 /* Disks */
-int libxl_device_disk_init(libxl_ctx *ctx, libxl_device_disk *disk);
+void libxl_device_disk_init(libxl_device_disk *disk);
 int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk);
 int libxl_device_disk_remove(libxl_ctx *ctx, uint32_t domid,
                              libxl_device_disk *disk,
diff -r 66d0a12239da -r 41731e865e39 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
@@ -536,7 +536,7 @@
     if (ret) goto error_out;
 
     for (i = 0; i < d_config->num_disks; i++) {
-        ret = libxl__device_disk_set_backend(gc, &d_config->disks[i]);
+        ret = libxl__device_disk_setdefault(gc, &d_config->disks[i]);
         if (ret) goto error_out;
     }
 
diff -r 66d0a12239da -r 41731e865e39 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
@@ -191,6 +191,8 @@
                                         libxl_domain_create_info *c_info);
 _hidden int libxl__domain_build_info_setdefault(libxl__gc *gc,
                                         libxl_domain_build_info *b_info);
+_hidden int libxl__device_disk_setdefault(libxl__gc *gc,
+                                          libxl_device_disk *disk);
 
 struct libxl__evgen_domain_death {
     uint32_t domid;
diff -r 66d0a12239da -r 41731e865e39 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -382,7 +382,7 @@
 {
     int e;
 
-    libxl_device_disk_init(ctx, disk);
+    libxl_device_disk_init(disk);
 
     if (!*config) {
         *config = xlu_cfg_init(stderr, "command line");

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gej-0000Bm-Pp; Sat, 03 Mar 2012 04:33: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 1S3geh-0000Ab-Vn
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:16 +0000
Received: from [85.158.139.83:18798] by server-10.bemta-5.messagelabs.com id
	92/3D-08260-B0F915F4; Sat, 03 Mar 2012 04:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1330749192!16808784!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12088 invoked from network); 3 Mar 2012 04:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gee-0004fo-F8
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gee-0003Lw-AT
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:12 +0000
Message-Id: <E1S3gee-0003Lw-AT@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: provide _init and _setdefault
	for libxl_domain_create_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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID bf72799de4d6039da71771df01fa3567a6ea118e
# Parent  c3198eb7c0028d0293a3bb6d4de4b55b5aa63a81
libxl: provide _init and _setdefault for libxl_domain_create_info.

Some fields require further scaffolding before they can use the
_init/_setdefault scheme and are handled in later patches.

It doesn't seem reasonable for the library to pick a default for the domain
type so reject as invalid.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r c3198eb7c002 -r bf72799de4d6 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
@@ -356,7 +356,7 @@
 int libxl_ctx_postfork(libxl_ctx *ctx);
 
 /* domain related functions */
-int libxl_init_create_info(libxl_ctx *ctx, libxl_domain_create_info *c_info);
+void libxl_domain_create_info_init(libxl_domain_create_info *c_info);
 int libxl_init_build_info(libxl_ctx *ctx,
                           libxl_domain_build_info *b_info,
                           libxl_domain_create_info *c_info);
diff -r c3198eb7c002 -r bf72799de4d6 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:13 2012 +0000
@@ -50,16 +50,19 @@
     libxl_domain_build_info_dispose(&d_config->b_info);
 }
 
-int libxl_init_create_info(libxl_ctx *ctx, libxl_domain_create_info *c_info)
+void libxl_domain_create_info_init(libxl_domain_create_info *c_info)
 {
     memset(c_info, '\0', sizeof(*c_info));
-    c_info->xsdata = NULL;
-    c_info->platformdata = NULL;
     c_info->hap = 1;
-    c_info->type = LIBXL_DOMAIN_TYPE_HVM;
     c_info->oos = 1;
-    c_info->ssidref = 0;
-    c_info->poolid = 0;
+}
+
+int libxl__domain_create_info_setdefault(libxl__gc *gc,
+                                         libxl_domain_create_info *c_info)
+{
+    if (!c_info->type)
+        return ERROR_INVAL;
+
     return 0;
 }
 
@@ -470,6 +473,9 @@
 
     domid = 0;
 
+    ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info);
+    if (ret) goto error_out;
+
     ret = libxl__domain_make(gc, &d_config->c_info, &domid);
     if (ret) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot make domain: %d", ret);
diff -r c3198eb7c002 -r bf72799de4d6 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:13 2012 +0000
@@ -705,7 +705,7 @@
         goto out;
     }
 
-    memset(&dm_config.c_info, 0x00, sizeof(libxl_domain_create_info));
+    libxl_domain_create_info_init(&dm_config.c_info);
     dm_config.c_info.type = LIBXL_DOMAIN_TYPE_PV;
     dm_config.c_info.name = libxl__sprintf(gc, "%s-dm",
                                     libxl__domid_to_name(gc, guest_domid));
@@ -740,6 +740,9 @@
     dm_config.vifs = guest_config->vifs;
     dm_config.num_vifs = guest_config->num_vifs;
 
+    ret = libxl__domain_create_info_setdefault(gc, &dm_config.c_info);
+    if (ret) goto out;
+
     libxl__vfb_and_vkb_from_hvm_guest_config(gc, guest_config, &vfb, &vkb);
     dm_config.vfbs = &vfb;
     dm_config.num_vfbs = 1;
diff -r c3198eb7c002 -r bf72799de4d6 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:13 2012 +0000
@@ -187,6 +187,8 @@
  * version of the _evdisable_FOO function; the internal one is
  * used during cleanup.
  */
+_hidden int libxl__domain_create_info_setdefault(libxl__gc *gc,
+                                        libxl_domain_create_info *c_info);
 
 struct libxl__evgen_domain_death {
     uint32_t domid;
diff -r c3198eb7c002 -r bf72799de4d6 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -535,8 +535,7 @@
         exit(1);
     }
 
-    if (libxl_init_create_info(ctx, c_info))
-        exit(1);
+    libxl_domain_create_info_init(c_info);
 
     if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
         e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3geh-0000AM-7A; Sat, 03 Mar 2012 04:33:15 +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 1S3gef-0000AC-Tf
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:14 +0000
Received: from [193.109.254.147:9462] by server-5.bemta-14.messagelabs.com id
	F2/4B-01689-80F915F4; Sat, 03 Mar 2012 04:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1330749165!50171211!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30059 invoked from network); 3 Mar 2012 04:32:46 -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;
	3 Mar 2012 04:32:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gec-0004fb-6O
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geb-0003Jp-Vg
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:09 +0000
Message-Id: <E1S3geb-0003Jp-Vg@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Remove xen/sched.h from
	public interface
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID b8f2b17e897b013e5715b47872ae360371f10034
# Parent  ba05ea3bf452ac9c5bb78f86f99ead38d581e590
libxl: Remove xen/sched.h from public interface

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ba05ea3bf452 -r b8f2b17e897b tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
@@ -137,8 +137,6 @@
 
 #include <xentoollog.h>
 
-#include <xen/sched.h>
-
 #include <libxl_uuid.h>
 #include <_libxl_list.h>
 
@@ -638,12 +636,7 @@
 int libxl_cpupool_cpuremove_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus);
 int libxl_cpupool_movedomain(libxl_ctx *ctx, uint32_t poolid, uint32_t domid);
 
-static inline int libxl_domid_valid_guest(uint32_t domid)
-{
-    /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
-     * does not check whether the domain actually exists */
-    return domid > 0 && domid < DOMID_FIRST_RESERVED;
-}
+int libxl_domid_valid_guest(uint32_t domid);
 
 int libxl_flask_context_to_sid(libxl_ctx *ctx, char *buf, size_t len,
                                uint32_t *ssidref);
diff -r ba05ea3bf452 -r b8f2b17e897b tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:13 2012 +0000
@@ -113,6 +113,15 @@
     (7, "arinc653"),
     ])
 
+# Consistent with SHUTDOWN_* in sched.h
+libxl_shutdown_reason = Enumeration("shutdown_reason", [
+    (0, "poweroff"),
+    (1, "reboot"),
+    (2, "suspend"),
+    (3, "crash"),
+    (4, "watchdog"),
+    ])
+
 #
 # Complex libxl types
 #
@@ -156,11 +165,11 @@
     ("shutdown",    bool),
     ("dying",       bool),
 
-    # Valid SHUTDOWN_* value from xen/sched.h iff (shutdown||dying).
+    # Valid iff (shutdown||dying).
     #
     # Otherwise set to a value guaranteed not to clash with any valid
-    # SHUTDOWN_* constant.
-    ("shutdown_reason", uint8),
+    # LIBXL_SHUTDOWN_REASON_* constant.
+    ("shutdown_reason", libxl_shutdown_reason),
     ("current_memkb",   uint64),
     ("shared_memkb", uint64),
     ("max_memkb",   uint64),
diff -r ba05ea3bf452 -r b8f2b17e897b tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_utils.c	Thu Mar 01 12:26:13 2012 +0000
@@ -507,6 +507,13 @@
     free(list);
 }
 
+int libxl_domid_valid_guest(uint32_t domid)
+{
+    /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
+     * does not check whether the domain actually exists */
+    return domid > 0 && domid < DOMID_FIRST_RESERVED;
+}
+
 /*
  * Local variables:
  * mode: C
diff -r ba05ea3bf452 -r b8f2b17e897b tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -1235,19 +1235,19 @@
     libxl_action_on_shutdown action;
 
     switch (event->u.domain_shutdown.shutdown_reason) {
-    case SHUTDOWN_poweroff:
+    case LIBXL_SHUTDOWN_REASON_POWEROFF:
         action = d_config->on_poweroff;
         break;
-    case SHUTDOWN_reboot:
+    case LIBXL_SHUTDOWN_REASON_REBOOT:
         action = d_config->on_reboot;
         break;
-    case SHUTDOWN_suspend:
+    case LIBXL_SHUTDOWN_REASON_SUSPEND:
         LOG("Domain has suspended.");
         return 0;
-    case SHUTDOWN_crash:
+    case LIBXL_SHUTDOWN_REASON_CRASH:
         action = d_config->on_crash;
         break;
-    case SHUTDOWN_watchdog:
+    case LIBXL_SHUTDOWN_REASON_WATCHDOG:
         action = d_config->on_watchdog;
         break;
     default:
diff -r ba05ea3bf452 -r b8f2b17e897b tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/python/xen/lowlevel/xl/xl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -762,11 +762,11 @@
     Py_INCREF(xl_error_obj);
     PyModule_AddObject(m, "Error", xl_error_obj);
 
-    _INT_CONST(m, SHUTDOWN_poweroff);
-    _INT_CONST(m, SHUTDOWN_reboot);
-    _INT_CONST(m, SHUTDOWN_suspend);
-    _INT_CONST(m, SHUTDOWN_crash);
-    _INT_CONST(m, SHUTDOWN_watchdog);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_POWEROFF);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_REBOOT);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_SUSPEND);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_CRASH);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_WATCHDOG);
 
     genwrap__init(m);
 }

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gei-0000B2-FX; Sat, 03 Mar 2012 04:33: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 1S3geh-0000AK-K6
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:15 +0000
Received: from [85.158.139.83:18789] by server-9.bemta-5.messagelabs.com id
	1D/8F-09826-A0F915F4; Sat, 03 Mar 2012 04:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1330749192!17673474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12324 invoked from network); 3 Mar 2012 04:33:13 -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;
	3 Mar 2012 04:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3ged-0004fi-EM
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3ged-0003Ku-5A
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:11 +0000
Message-Id: <E1S3ged-0003Ku-5A@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: generate a _dispose function
	for all Aggregate types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID 4ed7554ad6e58c208c34d559b2ae499d5532d86d
# Parent  d66fe43c6cfdd7f7c39fa8fd0dd888a5a9b35000
libxl: generate a _dispose function for all Aggregate types

Don't special case types which we happen to know do not contain allocated data
such that in the future if this changes we do not need to add an API. Although
there is likely to be latent bugs in callers due to this having the API in old
libraries mean that when callers are fixed they will not need to make special
arrangements to handle old and new versions of the library.

Adds dispose functions for:
 - libxl_dominfo
 - libxl_cpupoolinfo
 - libxl_physinfo
 - libxl_sched_credit
 - libxl_sched_credit2

I have attempted to fix any latent bugs in xl by inspection but have not
bothered with libxl (on the basis that internally the library is allowed to
make these sorts of assumptions and because it was looking like a very invasive
job and that more would only creep in anyway).

Several callsites use libxl_domain_info to check for the presence of a domain
and throw away the actual info. As a convenience accept a NULL info pointer and
just return the status.

Also fix a memory leak in libxl_domain_list.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d66fe43c6cfd -r 4ed7554ad6e5 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -442,6 +442,7 @@
     ret = xc_domain_getinfolist(ctx->xch, 0, 1024, info);
     if (ret<0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting domain info list");
+        free(ptr);
         return NULL;
     }
 
@@ -464,7 +465,8 @@
     }
     if (ret==0 || xcinfo.domain != domid) return ERROR_INVAL;
 
-    xcinfo2xlinfo(&xcinfo, info_r);
+    if (info_r)
+        xcinfo2xlinfo(&xcinfo, info_r);
     return 0;
 }
 
@@ -986,13 +988,12 @@
 int libxl_domain_destroy(libxl_ctx *ctx, uint32_t domid)
 {
     GC_INIT(ctx);
-    libxl_dominfo dominfo;
     char *dom_path;
     char *vm_path;
     char *pid;
     int rc, dm_present;
 
-    rc = libxl_domain_info(ctx, &dominfo, domid);
+    rc = libxl_domain_info(ctx, NULL, domid);
     switch(rc) {
     case 0:
         break;
diff -r d66fe43c6cfd -r 4ed7554ad6e5 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
@@ -387,11 +387,14 @@
  * guests using pygrub. */
 int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm);
 
+/* May be called with info_r == NULL to check for domain's existance */
 int libxl_domain_info(libxl_ctx*, libxl_dominfo *info_r,
                       uint32_t domid);
 libxl_dominfo * libxl_list_domain(libxl_ctx*, int *nb_domain);
+void libxl_dominfo_list_free(libxl_dominfo *list, int nr);
 libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx*, int *nb_pool);
 libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm);
+void libxl_vminfo_list_free(libxl_vminfo *list, int nr);
 
 /*
  * Devices
diff -r d66fe43c6cfd -r 4ed7554ad6e5 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:13 2012 +0000
@@ -177,7 +177,7 @@
     ("vcpu_max_id", uint32),
     ("vcpu_online", uint32),
     ("cpupool",     uint32),
-    ], dispose_fn=None)
+    ])
 
 libxl_cpupoolinfo = Struct("cpupoolinfo", [
     ("poolid",      uint32),
@@ -189,7 +189,7 @@
 libxl_vminfo = Struct("vminfo", [
     ("uuid", libxl_uuid),
     ("domid", libxl_domid),
-    ], dispose_fn=None)
+    ])
 
 libxl_version_info = Struct("version_info", [
     ("xen_version_major", integer),
@@ -408,7 +408,7 @@
 
     ("cap_hvm", bool),
     ("cap_hvm_directio", bool),
-    ], dispose_fn=None, dir=DIR_OUT)
+    ], dir=DIR_OUT)
 
 libxl_cputopology = Struct("cputopology", [
     ("core", uint32),
@@ -419,11 +419,11 @@
 libxl_sched_credit_domain = Struct("sched_credit_domain", [
     ("weight", integer),
     ("cap", integer),
-    ], dispose_fn=None)
+    ])
 
 libxl_sched_credit2_domain = Struct("sched_credit2_domain", [
     ("weight", integer),
-    ], dispose_fn=None)
+    ])
 
 libxl_sched_sedf_domain = Struct("sched_sedf_domain", [
     ("period", integer),
@@ -431,7 +431,7 @@
     ("latency", integer),
     ("extratime", integer),
     ("weight", integer),
-    ], dispose_fn=None)
+    ])
 
 libxl_event_type = Enumeration("event_type", [
     (1, "DOMAIN_SHUTDOWN"),
diff -r d66fe43c6cfd -r 4ed7554ad6e5 tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_utils.c	Thu Mar 01 12:26:13 2012 +0000
@@ -507,6 +507,22 @@
     free(list);
 }
 
+void libxl_dominfo_list_free(libxl_dominfo *list, int nr)
+{
+    int i;
+    for (i = 0; i < nr; i++)
+        libxl_dominfo_dispose(&list[i]);
+    free(list);
+}
+
+void libxl_vminfo_list_free(libxl_vminfo *list, int nr)
+{
+    int i;
+    for (i = 0; i < nr; i++)
+        libxl_vminfo_dispose(&list[i]);
+    free(list);
+}
+
 int libxl_domid_valid_guest(uint32_t domid)
 {
     /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
diff -r d66fe43c6cfd -r 4ed7554ad6e5 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -144,7 +144,6 @@
 static int domain_qualifier_to_domid(const char *p, uint32_t *domid_r,
                                      int *was_name_r)
 {
-    libxl_dominfo dominfo;
     int was_name, rc;
 
     was_name = qualifier_to_id(p, domid_r);
@@ -156,7 +155,7 @@
         if (rc)
             return rc;
     } else {
-        rc = libxl_domain_info(ctx, &dominfo, *domid_r);
+        rc = libxl_domain_info(ctx, NULL, *domid_r);
         /* error only if domain does not exist */
         if (rc == ERROR_INVAL)
             return rc;
@@ -2505,7 +2504,7 @@
             info[i].domid, domname);
         free(domname);
     }
-    free(info);
+    libxl_vminfo_list_free(info, nb_vm);
 }
 
 static void save_domain_core_begin(const char *domain_spec,
@@ -3302,7 +3301,10 @@
     else
         list_domains(verbose, context, info, nb_domain);
 
-    free(info_free);
+    if (info_free)
+        libxl_dominfo_list_free(info, nb_domain);
+    else
+        libxl_dominfo_dispose(info);
 
     return 0;
 }
@@ -3565,8 +3567,7 @@
         for (i = 0; i<nb_domain; i++)
             print_domain_vcpuinfo(dominfo[i].domid, physinfo.nr_cpus);
 
-        free(dominfo);
-
+        libxl_dominfo_list_free(dominfo, nb_domain);
     } else {
         for (; argc > 0; ++argv, --argc) {
             if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
@@ -3578,7 +3579,7 @@
         }
     }
   vcpulist_out:
-    ;
+    libxl_physinfo_dispose(&physinfo);
 }
 
 int main_vcpulist(int argc, char **argv)
@@ -3778,6 +3779,7 @@
         free(cpumap.map);
     }
 
+    libxl_physinfo_dispose(&info);
     return;
 }
 
@@ -3912,7 +3914,9 @@
     sharing(info, nb_domain);
 
     if (info_free)
-        free(info_free);
+        libxl_dominfo_list_free(info_free, nb_domain);
+    else
+        libxl_dominfo_dispose(info);
 
     return 0;
 }
@@ -4968,6 +4972,7 @@
         info = libxl_list_vm(ctx, &nb_vm);
         for (i = 0; i < nb_vm; i++)
             print_domU_uptime(info[i].domid, short_mode, now);
+        libxl_vminfo_list_free(info, nb_vm);
     } else {
         for (i = 0; i < nb_doms; i++) {
             if (doms[i] == 0)

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3geh-0000AM-7A; Sat, 03 Mar 2012 04:33:15 +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 1S3gef-0000AC-Tf
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:14 +0000
Received: from [193.109.254.147:9462] by server-5.bemta-14.messagelabs.com id
	F2/4B-01689-80F915F4; Sat, 03 Mar 2012 04:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1330749165!50171211!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30059 invoked from network); 3 Mar 2012 04:32:46 -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;
	3 Mar 2012 04:32:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gec-0004fb-6O
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geb-0003Jp-Vg
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:09 +0000
Message-Id: <E1S3geb-0003Jp-Vg@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Remove xen/sched.h from
	public interface
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID b8f2b17e897b013e5715b47872ae360371f10034
# Parent  ba05ea3bf452ac9c5bb78f86f99ead38d581e590
libxl: Remove xen/sched.h from public interface

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r ba05ea3bf452 -r b8f2b17e897b tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
@@ -137,8 +137,6 @@
 
 #include <xentoollog.h>
 
-#include <xen/sched.h>
-
 #include <libxl_uuid.h>
 #include <_libxl_list.h>
 
@@ -638,12 +636,7 @@
 int libxl_cpupool_cpuremove_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus);
 int libxl_cpupool_movedomain(libxl_ctx *ctx, uint32_t poolid, uint32_t domid);
 
-static inline int libxl_domid_valid_guest(uint32_t domid)
-{
-    /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
-     * does not check whether the domain actually exists */
-    return domid > 0 && domid < DOMID_FIRST_RESERVED;
-}
+int libxl_domid_valid_guest(uint32_t domid);
 
 int libxl_flask_context_to_sid(libxl_ctx *ctx, char *buf, size_t len,
                                uint32_t *ssidref);
diff -r ba05ea3bf452 -r b8f2b17e897b tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:13 2012 +0000
@@ -113,6 +113,15 @@
     (7, "arinc653"),
     ])
 
+# Consistent with SHUTDOWN_* in sched.h
+libxl_shutdown_reason = Enumeration("shutdown_reason", [
+    (0, "poweroff"),
+    (1, "reboot"),
+    (2, "suspend"),
+    (3, "crash"),
+    (4, "watchdog"),
+    ])
+
 #
 # Complex libxl types
 #
@@ -156,11 +165,11 @@
     ("shutdown",    bool),
     ("dying",       bool),
 
-    # Valid SHUTDOWN_* value from xen/sched.h iff (shutdown||dying).
+    # Valid iff (shutdown||dying).
     #
     # Otherwise set to a value guaranteed not to clash with any valid
-    # SHUTDOWN_* constant.
-    ("shutdown_reason", uint8),
+    # LIBXL_SHUTDOWN_REASON_* constant.
+    ("shutdown_reason", libxl_shutdown_reason),
     ("current_memkb",   uint64),
     ("shared_memkb", uint64),
     ("max_memkb",   uint64),
diff -r ba05ea3bf452 -r b8f2b17e897b tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_utils.c	Thu Mar 01 12:26:13 2012 +0000
@@ -507,6 +507,13 @@
     free(list);
 }
 
+int libxl_domid_valid_guest(uint32_t domid)
+{
+    /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
+     * does not check whether the domain actually exists */
+    return domid > 0 && domid < DOMID_FIRST_RESERVED;
+}
+
 /*
  * Local variables:
  * mode: C
diff -r ba05ea3bf452 -r b8f2b17e897b tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -1235,19 +1235,19 @@
     libxl_action_on_shutdown action;
 
     switch (event->u.domain_shutdown.shutdown_reason) {
-    case SHUTDOWN_poweroff:
+    case LIBXL_SHUTDOWN_REASON_POWEROFF:
         action = d_config->on_poweroff;
         break;
-    case SHUTDOWN_reboot:
+    case LIBXL_SHUTDOWN_REASON_REBOOT:
         action = d_config->on_reboot;
         break;
-    case SHUTDOWN_suspend:
+    case LIBXL_SHUTDOWN_REASON_SUSPEND:
         LOG("Domain has suspended.");
         return 0;
-    case SHUTDOWN_crash:
+    case LIBXL_SHUTDOWN_REASON_CRASH:
         action = d_config->on_crash;
         break;
-    case SHUTDOWN_watchdog:
+    case LIBXL_SHUTDOWN_REASON_WATCHDOG:
         action = d_config->on_watchdog;
         break;
     default:
diff -r ba05ea3bf452 -r b8f2b17e897b tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/python/xen/lowlevel/xl/xl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -762,11 +762,11 @@
     Py_INCREF(xl_error_obj);
     PyModule_AddObject(m, "Error", xl_error_obj);
 
-    _INT_CONST(m, SHUTDOWN_poweroff);
-    _INT_CONST(m, SHUTDOWN_reboot);
-    _INT_CONST(m, SHUTDOWN_suspend);
-    _INT_CONST(m, SHUTDOWN_crash);
-    _INT_CONST(m, SHUTDOWN_watchdog);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_POWEROFF);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_REBOOT);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_SUSPEND);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_CRASH);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_WATCHDOG);
 
     genwrap__init(m);
 }

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gem-0000Dw-CK; Sat, 03 Mar 2012 04:33: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 1S3gek-0000B5-Gp
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:18 +0000
Received: from [85.158.143.99:30565] by server-1.bemta-4.messagelabs.com id
	6C/B9-20925-E0F915F4; Sat, 03 Mar 2012 04:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1330749196!17137832!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32613 invoked from network); 3 Mar 2012 04:33:17 -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;
	3 Mar 2012 04:33: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 1S3geh-0004g6-QW
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geh-0003P4-PJ
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:15 +0000
Message-Id: <E1S3geh-0003P4-PJ@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: nic: use _init/_setdefault
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID bc49dfa119baa61a9fa22d44e26191f8d0fc24f6
# Parent  41731e865e399de1ff5a100ae7b6b139f232adfc
libxl: nic: use _init/_setdefault

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 41731e865e39 -r bc49dfa119ba tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -1677,32 +1677,43 @@
 }
 
 /******************************************************************************/
-int libxl_device_nic_init(libxl_ctx *ctx, libxl_device_nic *nic)
+void libxl_device_nic_init(libxl_device_nic *nic)
 {
-    const uint8_t *r;
-    libxl_uuid uuid;
-
-    libxl_uuid_generate(&uuid);
-    r = libxl_uuid_bytearray(&uuid);
     memset(nic, '\0', sizeof(*nic));
-
-    nic->backend_domid = 0;
-    nic->devid = -1;
-    nic->mtu = 1492;
-    nic->model = strdup("rtl8139");
-    nic->mac[0] = 0x00;
-    nic->mac[1] = 0x16;
-    nic->mac[2] = 0x3e;
-    nic->mac[3] = r[0] & 0x7f;
-    nic->mac[4] = r[1];
-    nic->mac[5] = r[2];
-    nic->ifname = NULL;
-    nic->bridge = strdup("xenbr0");
-    nic->ip = NULL;
-    if ( asprintf(&nic->script, "%s/vif-bridge",
-               libxl_xen_script_dir_path()) < 0 )
+}
+
+int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic)
+{
+    if (!nic->mtu)
+        nic->mtu = 1492;
+    if (!nic->model) {
+        nic->model = strdup("rtl8139");
+        if (!nic->model) return ERROR_NOMEM;
+    }
+    if (!nic->mac[0] && !nic->mac[1] && !nic->mac[2] &&
+        !nic->mac[3] && !nic->mac[4] && !nic->mac[5]) {
+        const uint8_t *r;
+        libxl_uuid uuid;
+
+        libxl_uuid_generate(&uuid);
+        r = libxl_uuid_bytearray(&uuid);
+
+        nic->mac[0] = 0x00;
+        nic->mac[1] = 0x16;
+        nic->mac[2] = 0x3e;
+        nic->mac[3] = r[0] & 0x7f;
+        nic->mac[4] = r[1];
+        nic->mac[5] = r[2];
+    }
+    if (!nic->bridge) {
+        nic->bridge = strdup("xenbr0");
+        if (!nic->bridge) return ERROR_NOMEM;
+    }
+    if ( !nic->script && asprintf(&nic->script, "%s/vif-bridge",
+                                  libxl_xen_script_dir_path()) < 0 )
         return ERROR_FAIL;
-    nic->nictype = LIBXL_NIC_TYPE_IOEMU;
+    if (!nic->nictype)
+        nic->nictype = LIBXL_NIC_TYPE_IOEMU;
     return 0;
 }
 
@@ -1729,6 +1740,9 @@
     char *dompath, **l;
     unsigned int nb, rc;
 
+    rc = libxl__device_nic_setdefault(gc, nic);
+    if (rc) goto out;
+
     front = flexarray_make(16, 1);
     if (!front) {
         rc = ERROR_NOMEM;
diff -r 41731e865e39 -r bc49dfa119ba tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
@@ -524,7 +524,7 @@
 int libxl_device_disk_local_detach(libxl_ctx *ctx, libxl_device_disk *disk);
 
 /* Network Interfaces */
-int libxl_device_nic_init(libxl_ctx *ctx, libxl_device_nic *nic);
+void libxl_device_nic_init(libxl_device_nic *nic);
 int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic);
 int libxl_device_nic_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_nic *nic,
diff -r 41731e865e39 -r bc49dfa119ba tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
@@ -193,6 +193,7 @@
                                         libxl_domain_build_info *b_info);
 _hidden int libxl__device_disk_setdefault(libxl__gc *gc,
                                           libxl_device_disk *disk);
+_hidden int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic);
 
 struct libxl__evgen_domain_death {
     uint32_t domid;
diff -r 41731e865e39 -r bc49dfa119ba tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -844,7 +844,7 @@
 
             d_config->vifs = (libxl_device_nic *) realloc(d_config->vifs, sizeof (libxl_device_nic) * (d_config->num_vifs+1));
             nic = d_config->vifs + d_config->num_vifs;
-            CHK_ERRNO( libxl_device_nic_init(ctx, nic) );
+            libxl_device_nic_init(nic);
             nic->devid = d_config->num_vifs;
 
             if (default_vifscript) {
@@ -4614,7 +4614,7 @@
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
         return 1;
     }
-    libxl_device_nic_init(ctx, &nic);
+    libxl_device_nic_init(&nic);
     for (argv += optind+1, argc -= optind+1; argc > 0; ++argv, --argc) {
         if (MATCH_OPTION("type", *argv, oparg)) {
             if (!strcmp("vif", oparg)) {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gei-0000B2-FX; Sat, 03 Mar 2012 04:33: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 1S3geh-0000AK-K6
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:15 +0000
Received: from [85.158.139.83:18789] by server-9.bemta-5.messagelabs.com id
	1D/8F-09826-A0F915F4; Sat, 03 Mar 2012 04:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1330749192!17673474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12324 invoked from network); 3 Mar 2012 04:33:13 -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;
	3 Mar 2012 04:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3ged-0004fi-EM
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3ged-0003Ku-5A
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:11 +0000
Message-Id: <E1S3ged-0003Ku-5A@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: generate a _dispose function
	for all Aggregate types
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID 4ed7554ad6e58c208c34d559b2ae499d5532d86d
# Parent  d66fe43c6cfdd7f7c39fa8fd0dd888a5a9b35000
libxl: generate a _dispose function for all Aggregate types

Don't special case types which we happen to know do not contain allocated data
such that in the future if this changes we do not need to add an API. Although
there is likely to be latent bugs in callers due to this having the API in old
libraries mean that when callers are fixed they will not need to make special
arrangements to handle old and new versions of the library.

Adds dispose functions for:
 - libxl_dominfo
 - libxl_cpupoolinfo
 - libxl_physinfo
 - libxl_sched_credit
 - libxl_sched_credit2

I have attempted to fix any latent bugs in xl by inspection but have not
bothered with libxl (on the basis that internally the library is allowed to
make these sorts of assumptions and because it was looking like a very invasive
job and that more would only creep in anyway).

Several callsites use libxl_domain_info to check for the presence of a domain
and throw away the actual info. As a convenience accept a NULL info pointer and
just return the status.

Also fix a memory leak in libxl_domain_list.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d66fe43c6cfd -r 4ed7554ad6e5 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -442,6 +442,7 @@
     ret = xc_domain_getinfolist(ctx->xch, 0, 1024, info);
     if (ret<0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting domain info list");
+        free(ptr);
         return NULL;
     }
 
@@ -464,7 +465,8 @@
     }
     if (ret==0 || xcinfo.domain != domid) return ERROR_INVAL;
 
-    xcinfo2xlinfo(&xcinfo, info_r);
+    if (info_r)
+        xcinfo2xlinfo(&xcinfo, info_r);
     return 0;
 }
 
@@ -986,13 +988,12 @@
 int libxl_domain_destroy(libxl_ctx *ctx, uint32_t domid)
 {
     GC_INIT(ctx);
-    libxl_dominfo dominfo;
     char *dom_path;
     char *vm_path;
     char *pid;
     int rc, dm_present;
 
-    rc = libxl_domain_info(ctx, &dominfo, domid);
+    rc = libxl_domain_info(ctx, NULL, domid);
     switch(rc) {
     case 0:
         break;
diff -r d66fe43c6cfd -r 4ed7554ad6e5 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
@@ -387,11 +387,14 @@
  * guests using pygrub. */
 int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm);
 
+/* May be called with info_r == NULL to check for domain's existance */
 int libxl_domain_info(libxl_ctx*, libxl_dominfo *info_r,
                       uint32_t domid);
 libxl_dominfo * libxl_list_domain(libxl_ctx*, int *nb_domain);
+void libxl_dominfo_list_free(libxl_dominfo *list, int nr);
 libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx*, int *nb_pool);
 libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm);
+void libxl_vminfo_list_free(libxl_vminfo *list, int nr);
 
 /*
  * Devices
diff -r d66fe43c6cfd -r 4ed7554ad6e5 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:13 2012 +0000
@@ -177,7 +177,7 @@
     ("vcpu_max_id", uint32),
     ("vcpu_online", uint32),
     ("cpupool",     uint32),
-    ], dispose_fn=None)
+    ])
 
 libxl_cpupoolinfo = Struct("cpupoolinfo", [
     ("poolid",      uint32),
@@ -189,7 +189,7 @@
 libxl_vminfo = Struct("vminfo", [
     ("uuid", libxl_uuid),
     ("domid", libxl_domid),
-    ], dispose_fn=None)
+    ])
 
 libxl_version_info = Struct("version_info", [
     ("xen_version_major", integer),
@@ -408,7 +408,7 @@
 
     ("cap_hvm", bool),
     ("cap_hvm_directio", bool),
-    ], dispose_fn=None, dir=DIR_OUT)
+    ], dir=DIR_OUT)
 
 libxl_cputopology = Struct("cputopology", [
     ("core", uint32),
@@ -419,11 +419,11 @@
 libxl_sched_credit_domain = Struct("sched_credit_domain", [
     ("weight", integer),
     ("cap", integer),
-    ], dispose_fn=None)
+    ])
 
 libxl_sched_credit2_domain = Struct("sched_credit2_domain", [
     ("weight", integer),
-    ], dispose_fn=None)
+    ])
 
 libxl_sched_sedf_domain = Struct("sched_sedf_domain", [
     ("period", integer),
@@ -431,7 +431,7 @@
     ("latency", integer),
     ("extratime", integer),
     ("weight", integer),
-    ], dispose_fn=None)
+    ])
 
 libxl_event_type = Enumeration("event_type", [
     (1, "DOMAIN_SHUTDOWN"),
diff -r d66fe43c6cfd -r 4ed7554ad6e5 tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_utils.c	Thu Mar 01 12:26:13 2012 +0000
@@ -507,6 +507,22 @@
     free(list);
 }
 
+void libxl_dominfo_list_free(libxl_dominfo *list, int nr)
+{
+    int i;
+    for (i = 0; i < nr; i++)
+        libxl_dominfo_dispose(&list[i]);
+    free(list);
+}
+
+void libxl_vminfo_list_free(libxl_vminfo *list, int nr)
+{
+    int i;
+    for (i = 0; i < nr; i++)
+        libxl_vminfo_dispose(&list[i]);
+    free(list);
+}
+
 int libxl_domid_valid_guest(uint32_t domid)
 {
     /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
diff -r d66fe43c6cfd -r 4ed7554ad6e5 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -144,7 +144,6 @@
 static int domain_qualifier_to_domid(const char *p, uint32_t *domid_r,
                                      int *was_name_r)
 {
-    libxl_dominfo dominfo;
     int was_name, rc;
 
     was_name = qualifier_to_id(p, domid_r);
@@ -156,7 +155,7 @@
         if (rc)
             return rc;
     } else {
-        rc = libxl_domain_info(ctx, &dominfo, *domid_r);
+        rc = libxl_domain_info(ctx, NULL, *domid_r);
         /* error only if domain does not exist */
         if (rc == ERROR_INVAL)
             return rc;
@@ -2505,7 +2504,7 @@
             info[i].domid, domname);
         free(domname);
     }
-    free(info);
+    libxl_vminfo_list_free(info, nb_vm);
 }
 
 static void save_domain_core_begin(const char *domain_spec,
@@ -3302,7 +3301,10 @@
     else
         list_domains(verbose, context, info, nb_domain);
 
-    free(info_free);
+    if (info_free)
+        libxl_dominfo_list_free(info, nb_domain);
+    else
+        libxl_dominfo_dispose(info);
 
     return 0;
 }
@@ -3565,8 +3567,7 @@
         for (i = 0; i<nb_domain; i++)
             print_domain_vcpuinfo(dominfo[i].domid, physinfo.nr_cpus);
 
-        free(dominfo);
-
+        libxl_dominfo_list_free(dominfo, nb_domain);
     } else {
         for (; argc > 0; ++argv, --argc) {
             if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
@@ -3578,7 +3579,7 @@
         }
     }
   vcpulist_out:
-    ;
+    libxl_physinfo_dispose(&physinfo);
 }
 
 int main_vcpulist(int argc, char **argv)
@@ -3778,6 +3779,7 @@
         free(cpumap.map);
     }
 
+    libxl_physinfo_dispose(&info);
     return;
 }
 
@@ -3912,7 +3914,9 @@
     sharing(info, nb_domain);
 
     if (info_free)
-        free(info_free);
+        libxl_dominfo_list_free(info_free, nb_domain);
+    else
+        libxl_dominfo_dispose(info);
 
     return 0;
 }
@@ -4968,6 +4972,7 @@
         info = libxl_list_vm(ctx, &nb_vm);
         for (i = 0; i < nb_vm; i++)
             print_domU_uptime(info[i].domid, short_mode, now);
+        libxl_vminfo_list_free(info, nb_vm);
     } else {
         for (i = 0; i < nb_doms; i++) {
             if (doms[i] == 0)

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gei-0000Ax-Cq; Sat, 03 Mar 2012 04:33: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 1S3geh-0000AJ-7i
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:15 +0000
Received: from [85.158.143.99:62554] by server-2.bemta-4.messagelabs.com id
	A8/7D-17550-A0F915F4; Sat, 03 Mar 2012 04:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1330749192!17462331!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14657 invoked from network); 3 Mar 2012 04:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3ged-0004fl-VF
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3ged-0003LP-NA
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:11 +0000
Message-Id: <E1S3ged-0003LP-NA@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Document
	_init/_dispose/_setdefault 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID c3198eb7c0028d0293a3bb6d4de4b55b5aa63a81
# Parent  4ed7554ad6e58c208c34d559b2ae499d5532d86d
libxl: Document _init/_dispose/_setdefault functions.

Subsequent patches will transition to them.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4ed7554ad6e5 -r c3198eb7c002 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
@@ -124,6 +124,50 @@
  * Therefore public functions which initialize a libxl__gc MUST call
  * libxl__free_all() before returning.
  */
+/*
+ * libxl types
+ *
+ * Most libxl types are defined by the libxl IDL (see
+ * libxl_types.idl). The library provides a common set of methods for
+ * initialising and freeing these types.
+ *
+ * void libxl_<type>_init(<type> *p):
+ *
+ *    Initialises the members of "p" to all defaults. These may either
+ *    be special value which indicates to the library that it should
+ *    select an appropriate default when using this field or actual
+ *    default values.
+ *
+ *    Some fields within a data type (e.g. unions) cannot be sensibly
+ *    initialised without further information. In these cases a
+ *    separate subfield initialisation function is provided (see
+ *    below).
+ *
+ *    An instance which has been initialised using this method can
+ *    always be safely passed to the dispose function (see
+ *    below). This is true even if the data type contains fields which
+ *    require a separate call to a subfield initialisation function.
+ *
+ *    This method is provided for any aggregate type which is used as
+ *    an input parameter.
+ *
+ * void libxl_<type>_init_<subfield>(<type> *p, subfield):
+ *
+ *    Initialise those parts of "p" which are not initialised by the
+ *    main init function due to the unknown value of "subfield". Sets
+ *    p->subfield as well as initialising any fields to their default
+ *    values.
+ *
+ *    p->subfield must not have been previously initialised.
+ *
+ *    This method is provided for any aggregate type.
+ *
+ * void libxl_<type>_dispose(instance *p):
+ *
+ *    Frees any dynamically allocated memory used by the members of
+ *    "p" but not the storage used by "p" itself (this allows for the
+ *    allocation of arrays of types and for the composition of types).
+ */
 #ifndef LIBXL_H
 #define LIBXL_H
 
@@ -405,8 +449,9 @@
  * additional data type libxl_device_<TYPE>_getinfo which contains
  * further runtime information about the device.
  *
- * A common set of methods are available for each device type. These
- * are described below.
+ * In addition to the general methods available for libxl types (see
+ * "libxl types" above) a common set of methods are available for each
+ * device type. These are described below.
  *
  * Querying
  * --------
@@ -424,10 +469,6 @@
  * Creation / Control
  * ------------------
  *
- * libxl_device_<type>_init(ctx, device):
- *
- *    Initalises device to a default configuration.
- *
  * libxl_device_<type>_add(ctx, domid, device):
  *
  *   Adds the given device to the specified domain. This can be called
diff -r 4ed7554ad6e5 -r c3198eb7c002 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:13 2012 +0000
@@ -665,6 +665,19 @@
 _hidden int libxl__devices_destroy(libxl__gc *gc, uint32_t domid);
 _hidden int libxl__wait_for_backend(libxl__gc *gc, char *be_path, char *state);
 
+/*
+ * For each aggregate type which can be used as an input we provide:
+ *
+ * int libxl__<type>_setdefault(gc, <type> *p):
+ *
+ *     Idempotently sets any members of "p" which is currently set to
+ *     a special value indicating that the defaults should be used
+ *     (per libxl_<type>_init) to a specific value.
+ *
+ *     All libxl API functions are expected to have arranged for this
+ *     to be called before using any values within these structures.
+ */
+
 /* Arranges that dev will be removed from its guest.  When
  * this is done, the ao will be completed.  An error
  * return from libxl__initiate_device_remove means that the ao

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gem-0000Dw-CK; Sat, 03 Mar 2012 04:33: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 1S3gek-0000B5-Gp
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:18 +0000
Received: from [85.158.143.99:30565] by server-1.bemta-4.messagelabs.com id
	6C/B9-20925-E0F915F4; Sat, 03 Mar 2012 04:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1330749196!17137832!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32613 invoked from network); 3 Mar 2012 04:33:17 -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;
	3 Mar 2012 04:33: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 1S3geh-0004g6-QW
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geh-0003P4-PJ
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:15 +0000
Message-Id: <E1S3geh-0003P4-PJ@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: nic: use _init/_setdefault
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID bc49dfa119baa61a9fa22d44e26191f8d0fc24f6
# Parent  41731e865e399de1ff5a100ae7b6b139f232adfc
libxl: nic: use _init/_setdefault

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 41731e865e39 -r bc49dfa119ba tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -1677,32 +1677,43 @@
 }
 
 /******************************************************************************/
-int libxl_device_nic_init(libxl_ctx *ctx, libxl_device_nic *nic)
+void libxl_device_nic_init(libxl_device_nic *nic)
 {
-    const uint8_t *r;
-    libxl_uuid uuid;
-
-    libxl_uuid_generate(&uuid);
-    r = libxl_uuid_bytearray(&uuid);
     memset(nic, '\0', sizeof(*nic));
-
-    nic->backend_domid = 0;
-    nic->devid = -1;
-    nic->mtu = 1492;
-    nic->model = strdup("rtl8139");
-    nic->mac[0] = 0x00;
-    nic->mac[1] = 0x16;
-    nic->mac[2] = 0x3e;
-    nic->mac[3] = r[0] & 0x7f;
-    nic->mac[4] = r[1];
-    nic->mac[5] = r[2];
-    nic->ifname = NULL;
-    nic->bridge = strdup("xenbr0");
-    nic->ip = NULL;
-    if ( asprintf(&nic->script, "%s/vif-bridge",
-               libxl_xen_script_dir_path()) < 0 )
+}
+
+int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic)
+{
+    if (!nic->mtu)
+        nic->mtu = 1492;
+    if (!nic->model) {
+        nic->model = strdup("rtl8139");
+        if (!nic->model) return ERROR_NOMEM;
+    }
+    if (!nic->mac[0] && !nic->mac[1] && !nic->mac[2] &&
+        !nic->mac[3] && !nic->mac[4] && !nic->mac[5]) {
+        const uint8_t *r;
+        libxl_uuid uuid;
+
+        libxl_uuid_generate(&uuid);
+        r = libxl_uuid_bytearray(&uuid);
+
+        nic->mac[0] = 0x00;
+        nic->mac[1] = 0x16;
+        nic->mac[2] = 0x3e;
+        nic->mac[3] = r[0] & 0x7f;
+        nic->mac[4] = r[1];
+        nic->mac[5] = r[2];
+    }
+    if (!nic->bridge) {
+        nic->bridge = strdup("xenbr0");
+        if (!nic->bridge) return ERROR_NOMEM;
+    }
+    if ( !nic->script && asprintf(&nic->script, "%s/vif-bridge",
+                                  libxl_xen_script_dir_path()) < 0 )
         return ERROR_FAIL;
-    nic->nictype = LIBXL_NIC_TYPE_IOEMU;
+    if (!nic->nictype)
+        nic->nictype = LIBXL_NIC_TYPE_IOEMU;
     return 0;
 }
 
@@ -1729,6 +1740,9 @@
     char *dompath, **l;
     unsigned int nb, rc;
 
+    rc = libxl__device_nic_setdefault(gc, nic);
+    if (rc) goto out;
+
     front = flexarray_make(16, 1);
     if (!front) {
         rc = ERROR_NOMEM;
diff -r 41731e865e39 -r bc49dfa119ba tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
@@ -524,7 +524,7 @@
 int libxl_device_disk_local_detach(libxl_ctx *ctx, libxl_device_disk *disk);
 
 /* Network Interfaces */
-int libxl_device_nic_init(libxl_ctx *ctx, libxl_device_nic *nic);
+void libxl_device_nic_init(libxl_device_nic *nic);
 int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic);
 int libxl_device_nic_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_nic *nic,
diff -r 41731e865e39 -r bc49dfa119ba tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
@@ -193,6 +193,7 @@
                                         libxl_domain_build_info *b_info);
 _hidden int libxl__device_disk_setdefault(libxl__gc *gc,
                                           libxl_device_disk *disk);
+_hidden int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic);
 
 struct libxl__evgen_domain_death {
     uint32_t domid;
diff -r 41731e865e39 -r bc49dfa119ba tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -844,7 +844,7 @@
 
             d_config->vifs = (libxl_device_nic *) realloc(d_config->vifs, sizeof (libxl_device_nic) * (d_config->num_vifs+1));
             nic = d_config->vifs + d_config->num_vifs;
-            CHK_ERRNO( libxl_device_nic_init(ctx, nic) );
+            libxl_device_nic_init(nic);
             nic->devid = d_config->num_vifs;
 
             if (default_vifscript) {
@@ -4614,7 +4614,7 @@
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
         return 1;
     }
-    libxl_device_nic_init(ctx, &nic);
+    libxl_device_nic_init(&nic);
     for (argv += optind+1, argc -= optind+1; argc > 0; ++argv, --argc) {
         if (MATCH_OPTION("type", *argv, oparg)) {
             if (!strcmp("vif", oparg)) {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gej-0000Bs-SS; Sat, 03 Mar 2012 04:33: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 1S3gei-0000AS-GQ
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:16 +0000
Received: from [85.158.139.83:61855] by server-4.bemta-5.messagelabs.com id
	75/FB-10788-C0F915F4; Sat, 03 Mar 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1330749193!17592074!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12362 invoked from network); 3 Mar 2012 04:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gef-0004fr-5V
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gee-0003MT-Ti
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:12 +0000
Message-Id: <E1S3gee-0003MT-Ti@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: provide _init and _setdefault
	for libxl_domain_build_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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID f791c5db01a89f205cda78cf868e2889caa52ed2
# Parent  bf72799de4d6039da71771df01fa3567a6ea118e
libxl: provide _init and _setdefault for libxl_domain_build_info.

Some fields require further scaffolding before they can use the
_init/_setdefault scheme and are handled in later patches.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r bf72799de4d6 -r f791c5db01a8 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -2625,7 +2625,11 @@
                              uint32_t *need_memkb)
 {
     GC_INIT(ctx);
-    int rc = ERROR_INVAL;
+    int rc;
+
+    rc = libxl__domain_build_info_setdefault(gc, b_info);
+    if (rc) goto out;
+
     *need_memkb = b_info->target_memkb;
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
@@ -2637,6 +2641,7 @@
         *need_memkb += b_info->shadow_memkb + LIBXL_PV_EXTRA_MEMORY;
         break;
     default:
+        rc = ERROR_INVAL;
         goto out;
     }
     if (*need_memkb % (2 * 1024))
diff -r bf72799de4d6 -r f791c5db01a8 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
@@ -357,9 +357,8 @@
 
 /* domain related functions */
 void libxl_domain_create_info_init(libxl_domain_create_info *c_info);
-int libxl_init_build_info(libxl_ctx *ctx,
-                          libxl_domain_build_info *b_info,
-                          libxl_domain_create_info *c_info);
+void libxl_domain_build_info_init(libxl_domain_build_info *b_info,
+                          const libxl_domain_create_info *c_info);
 typedef int (*libxl_console_ready)(libxl_ctx *ctx, uint32_t domid, void *priv);
 int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid);
 int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid, int restore_fd);
diff -r bf72799de4d6 -r f791c5db01a8 tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_bootloader.c	Thu Mar 01 12:26:13 2012 +0000
@@ -346,6 +346,9 @@
 
     struct stat st_buf;
 
+    rc = libxl__domain_build_info_setdefault(gc, info);
+    if (rc) goto out;
+
     if (info->type != LIBXL_DOMAIN_TYPE_PV || !info->u.pv.bootloader)
         goto out;
 
diff -r bf72799de4d6 -r f791c5db01a8 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:13 2012 +0000
@@ -66,16 +66,10 @@
     return 0;
 }
 
-int libxl_init_build_info(libxl_ctx *ctx,
-                          libxl_domain_build_info *b_info,
-                          libxl_domain_create_info *c_info)
+void libxl_domain_build_info_init(libxl_domain_build_info *b_info,
+                                  const libxl_domain_create_info *c_info)
 {
     memset(b_info, '\0', sizeof(*b_info));
-    b_info->max_vcpus = 1;
-    b_info->cur_vcpus = 1;
-    if (libxl_cpumap_alloc(ctx, &b_info->cpumap))
-        return ERROR_NOMEM;
-    libxl_cpumap_set_any(&b_info->cpumap);
     b_info->max_memkb = 32 * 1024;
     b_info->target_memkb = b_info->max_memkb;
     b_info->disable_migrate = 0;
@@ -83,8 +77,6 @@
     b_info->shadow_memkb = 0;
     b_info->type = c_info->type;
 
-    b_info->device_model_version =
-        LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
     b_info->device_model_stubdomain = false;
     b_info->device_model = NULL;
 
@@ -108,15 +100,9 @@
 
         b_info->u.hvm.stdvga = 0;
         b_info->u.hvm.vnc.enable = 1;
-        b_info->u.hvm.vnc.listen = strdup("127.0.0.1");
         b_info->u.hvm.vnc.display = 0;
         b_info->u.hvm.vnc.findunused = 1;
-        b_info->u.hvm.keymap = NULL;
-        b_info->u.hvm.sdl.enable = 0;
-        b_info->u.hvm.sdl.opengl = 0;
-        b_info->u.hvm.nographic = 0;
         b_info->u.hvm.serial = NULL;
-        b_info->u.hvm.boot = strdup("cda");
         b_info->u.hvm.usb = 0;
         b_info->u.hvm.usbdevice = NULL;
         b_info->u.hvm.xen_platform_pci = 1;
@@ -125,7 +111,47 @@
         b_info->u.pv.slack_memkb = 8 * 1024;
         break;
     default:
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+        abort();
+    }
+}
+
+int libxl__domain_build_info_setdefault(libxl__gc *gc,
+                                        libxl_domain_build_info *b_info)
+{
+    if (!b_info->device_model_version)
+        b_info->device_model_version =
+            LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
+
+    if (!b_info->max_vcpus)
+        b_info->max_vcpus = 1;
+    if (!b_info->cur_vcpus)
+        b_info->cur_vcpus = 1;
+
+    if (!b_info->cpumap.size) {
+        if (libxl_cpumap_alloc(CTX, &b_info->cpumap))
+            return ERROR_NOMEM;
+        libxl_cpumap_set_any(&b_info->cpumap);
+    }
+
+    switch (b_info->type) {
+    case LIBXL_DOMAIN_TYPE_HVM:
+        if (!b_info->u.hvm.boot) {
+            b_info->u.hvm.boot = strdup("cda");
+            if (!b_info->u.hvm.boot) return ERROR_NOMEM;
+        }
+
+        if (b_info->u.hvm.vnc.enable) {
+            if (!b_info->u.hvm.vnc.listen) {
+                b_info->u.hvm.vnc.listen = strdup("127.0.0.1");
+                if (!b_info->u.hvm.vnc.listen) return ERROR_NOMEM;
+            }
+        }
+
+        break;
+    case LIBXL_DOMAIN_TYPE_PV:
+        break;
+    default:
+        LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
                    "invalid domain type %s in create info",
                    libxl_domain_type_to_string(b_info->type));
         return ERROR_INVAL;
@@ -488,6 +514,8 @@
             goto error_out;
     }
 
+    ret = libxl__domain_build_info_setdefault(gc, &d_config->b_info);
+    if (ret) goto error_out;
 
     for (i = 0; i < d_config->num_disks; i++) {
         ret = libxl__device_disk_set_backend(gc, &d_config->disks[i]);
diff -r bf72799de4d6 -r f791c5db01a8 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:13 2012 +0000
@@ -713,13 +713,12 @@
 
     libxl_uuid_generate(&dm_config.c_info.uuid);
 
-    memset(&dm_config.b_info, 0x00, sizeof(libxl_domain_build_info));
-    dm_config.b_info.type = dm_config.c_info.type;
+    libxl_domain_build_info_init(&dm_config.b_info, &dm_config.c_info);
+
     dm_config.b_info.max_vcpus = 1;
     dm_config.b_info.max_memkb = 32 * 1024;
     dm_config.b_info.target_memkb = dm_config.b_info.max_memkb;
 
-    dm_config.b_info.type = LIBXL_DOMAIN_TYPE_PV;
     dm_config.b_info.u.pv.kernel.path = libxl__abs_path(gc, "ioemu-stubdom.gz",
                                               libxl_xenfirmwaredir_path());
     dm_config.b_info.u.pv.cmdline = libxl__sprintf(gc, " -d %d", guest_domid);
@@ -742,6 +741,8 @@
 
     ret = libxl__domain_create_info_setdefault(gc, &dm_config.c_info);
     if (ret) goto out;
+    ret = libxl__domain_build_info_setdefault(gc, &dm_config.b_info);
+    if (ret) goto out;
 
     libxl__vfb_and_vkb_from_hvm_guest_config(gc, guest_config, &vfb, &vkb);
     dm_config.vfbs = &vfb;
diff -r bf72799de4d6 -r f791c5db01a8 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:13 2012 +0000
@@ -189,6 +189,8 @@
  */
 _hidden int libxl__domain_create_info_setdefault(libxl__gc *gc,
                                         libxl_domain_create_info *c_info);
+_hidden int libxl__domain_build_info_setdefault(libxl__gc *gc,
+                                        libxl_domain_build_info *b_info);
 
 struct libxl__evgen_domain_death {
     uint32_t domid;
diff -r bf72799de4d6 -r f791c5db01a8 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -584,8 +584,7 @@
         exit(1);
     }
 
-    if (libxl_init_build_info(ctx, b_info, c_info))
-        exit(1);
+    libxl_domain_build_info_init(b_info, c_info);
 
     /* the following is the actual config parsing with overriding values in the structures */
     if (!xlu_cfg_get_long (config, "vcpus", &l, 0)) {
@@ -599,6 +598,11 @@
     if (!xlu_cfg_get_list (config, "cpus", &cpus, 0, 1)) {
         int i, n_cpus = 0;
 
+        if (libxl_cpumap_alloc(ctx, &b_info->cpumap)) {
+            fprintf(stderr, "Unable to allocate cpumap\n");
+            exit(1);
+        }
+
         libxl_cpumap_set_none(&b_info->cpumap);
         while ((buf = xlu_cfg_get_listitem(cpus, n_cpus)) != NULL) {
             i = atoi(buf);
@@ -613,6 +617,11 @@
     else if (!xlu_cfg_get_string (config, "cpus", &buf, 0)) {
         char *buf2 = strdup(buf);
 
+        if (libxl_cpumap_alloc(ctx, &b_info->cpumap)) {
+            fprintf(stderr, "Unable to allocate cpumap\n");
+            exit(1);
+        }
+
         libxl_cpumap_set_none(&b_info->cpumap);
         if (vcpupin_parse(buf2, &b_info->cpumap))
             exit(1);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gej-0000Bs-SS; Sat, 03 Mar 2012 04:33: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 1S3gei-0000AS-GQ
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:16 +0000
Received: from [85.158.139.83:61855] by server-4.bemta-5.messagelabs.com id
	75/FB-10788-C0F915F4; Sat, 03 Mar 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1330749193!17592074!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12362 invoked from network); 3 Mar 2012 04:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gef-0004fr-5V
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gee-0003MT-Ti
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:12 +0000
Message-Id: <E1S3gee-0003MT-Ti@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: provide _init and _setdefault
	for libxl_domain_build_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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID f791c5db01a89f205cda78cf868e2889caa52ed2
# Parent  bf72799de4d6039da71771df01fa3567a6ea118e
libxl: provide _init and _setdefault for libxl_domain_build_info.

Some fields require further scaffolding before they can use the
_init/_setdefault scheme and are handled in later patches.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r bf72799de4d6 -r f791c5db01a8 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -2625,7 +2625,11 @@
                              uint32_t *need_memkb)
 {
     GC_INIT(ctx);
-    int rc = ERROR_INVAL;
+    int rc;
+
+    rc = libxl__domain_build_info_setdefault(gc, b_info);
+    if (rc) goto out;
+
     *need_memkb = b_info->target_memkb;
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
@@ -2637,6 +2641,7 @@
         *need_memkb += b_info->shadow_memkb + LIBXL_PV_EXTRA_MEMORY;
         break;
     default:
+        rc = ERROR_INVAL;
         goto out;
     }
     if (*need_memkb % (2 * 1024))
diff -r bf72799de4d6 -r f791c5db01a8 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
@@ -357,9 +357,8 @@
 
 /* domain related functions */
 void libxl_domain_create_info_init(libxl_domain_create_info *c_info);
-int libxl_init_build_info(libxl_ctx *ctx,
-                          libxl_domain_build_info *b_info,
-                          libxl_domain_create_info *c_info);
+void libxl_domain_build_info_init(libxl_domain_build_info *b_info,
+                          const libxl_domain_create_info *c_info);
 typedef int (*libxl_console_ready)(libxl_ctx *ctx, uint32_t domid, void *priv);
 int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid);
 int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid, int restore_fd);
diff -r bf72799de4d6 -r f791c5db01a8 tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_bootloader.c	Thu Mar 01 12:26:13 2012 +0000
@@ -346,6 +346,9 @@
 
     struct stat st_buf;
 
+    rc = libxl__domain_build_info_setdefault(gc, info);
+    if (rc) goto out;
+
     if (info->type != LIBXL_DOMAIN_TYPE_PV || !info->u.pv.bootloader)
         goto out;
 
diff -r bf72799de4d6 -r f791c5db01a8 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:13 2012 +0000
@@ -66,16 +66,10 @@
     return 0;
 }
 
-int libxl_init_build_info(libxl_ctx *ctx,
-                          libxl_domain_build_info *b_info,
-                          libxl_domain_create_info *c_info)
+void libxl_domain_build_info_init(libxl_domain_build_info *b_info,
+                                  const libxl_domain_create_info *c_info)
 {
     memset(b_info, '\0', sizeof(*b_info));
-    b_info->max_vcpus = 1;
-    b_info->cur_vcpus = 1;
-    if (libxl_cpumap_alloc(ctx, &b_info->cpumap))
-        return ERROR_NOMEM;
-    libxl_cpumap_set_any(&b_info->cpumap);
     b_info->max_memkb = 32 * 1024;
     b_info->target_memkb = b_info->max_memkb;
     b_info->disable_migrate = 0;
@@ -83,8 +77,6 @@
     b_info->shadow_memkb = 0;
     b_info->type = c_info->type;
 
-    b_info->device_model_version =
-        LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
     b_info->device_model_stubdomain = false;
     b_info->device_model = NULL;
 
@@ -108,15 +100,9 @@
 
         b_info->u.hvm.stdvga = 0;
         b_info->u.hvm.vnc.enable = 1;
-        b_info->u.hvm.vnc.listen = strdup("127.0.0.1");
         b_info->u.hvm.vnc.display = 0;
         b_info->u.hvm.vnc.findunused = 1;
-        b_info->u.hvm.keymap = NULL;
-        b_info->u.hvm.sdl.enable = 0;
-        b_info->u.hvm.sdl.opengl = 0;
-        b_info->u.hvm.nographic = 0;
         b_info->u.hvm.serial = NULL;
-        b_info->u.hvm.boot = strdup("cda");
         b_info->u.hvm.usb = 0;
         b_info->u.hvm.usbdevice = NULL;
         b_info->u.hvm.xen_platform_pci = 1;
@@ -125,7 +111,47 @@
         b_info->u.pv.slack_memkb = 8 * 1024;
         break;
     default:
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+        abort();
+    }
+}
+
+int libxl__domain_build_info_setdefault(libxl__gc *gc,
+                                        libxl_domain_build_info *b_info)
+{
+    if (!b_info->device_model_version)
+        b_info->device_model_version =
+            LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
+
+    if (!b_info->max_vcpus)
+        b_info->max_vcpus = 1;
+    if (!b_info->cur_vcpus)
+        b_info->cur_vcpus = 1;
+
+    if (!b_info->cpumap.size) {
+        if (libxl_cpumap_alloc(CTX, &b_info->cpumap))
+            return ERROR_NOMEM;
+        libxl_cpumap_set_any(&b_info->cpumap);
+    }
+
+    switch (b_info->type) {
+    case LIBXL_DOMAIN_TYPE_HVM:
+        if (!b_info->u.hvm.boot) {
+            b_info->u.hvm.boot = strdup("cda");
+            if (!b_info->u.hvm.boot) return ERROR_NOMEM;
+        }
+
+        if (b_info->u.hvm.vnc.enable) {
+            if (!b_info->u.hvm.vnc.listen) {
+                b_info->u.hvm.vnc.listen = strdup("127.0.0.1");
+                if (!b_info->u.hvm.vnc.listen) return ERROR_NOMEM;
+            }
+        }
+
+        break;
+    case LIBXL_DOMAIN_TYPE_PV:
+        break;
+    default:
+        LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
                    "invalid domain type %s in create info",
                    libxl_domain_type_to_string(b_info->type));
         return ERROR_INVAL;
@@ -488,6 +514,8 @@
             goto error_out;
     }
 
+    ret = libxl__domain_build_info_setdefault(gc, &d_config->b_info);
+    if (ret) goto error_out;
 
     for (i = 0; i < d_config->num_disks; i++) {
         ret = libxl__device_disk_set_backend(gc, &d_config->disks[i]);
diff -r bf72799de4d6 -r f791c5db01a8 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:13 2012 +0000
@@ -713,13 +713,12 @@
 
     libxl_uuid_generate(&dm_config.c_info.uuid);
 
-    memset(&dm_config.b_info, 0x00, sizeof(libxl_domain_build_info));
-    dm_config.b_info.type = dm_config.c_info.type;
+    libxl_domain_build_info_init(&dm_config.b_info, &dm_config.c_info);
+
     dm_config.b_info.max_vcpus = 1;
     dm_config.b_info.max_memkb = 32 * 1024;
     dm_config.b_info.target_memkb = dm_config.b_info.max_memkb;
 
-    dm_config.b_info.type = LIBXL_DOMAIN_TYPE_PV;
     dm_config.b_info.u.pv.kernel.path = libxl__abs_path(gc, "ioemu-stubdom.gz",
                                               libxl_xenfirmwaredir_path());
     dm_config.b_info.u.pv.cmdline = libxl__sprintf(gc, " -d %d", guest_domid);
@@ -742,6 +741,8 @@
 
     ret = libxl__domain_create_info_setdefault(gc, &dm_config.c_info);
     if (ret) goto out;
+    ret = libxl__domain_build_info_setdefault(gc, &dm_config.b_info);
+    if (ret) goto out;
 
     libxl__vfb_and_vkb_from_hvm_guest_config(gc, guest_config, &vfb, &vkb);
     dm_config.vfbs = &vfb;
diff -r bf72799de4d6 -r f791c5db01a8 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:13 2012 +0000
@@ -189,6 +189,8 @@
  */
 _hidden int libxl__domain_create_info_setdefault(libxl__gc *gc,
                                         libxl_domain_create_info *c_info);
+_hidden int libxl__domain_build_info_setdefault(libxl__gc *gc,
+                                        libxl_domain_build_info *b_info);
 
 struct libxl__evgen_domain_death {
     uint32_t domid;
diff -r bf72799de4d6 -r f791c5db01a8 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -584,8 +584,7 @@
         exit(1);
     }
 
-    if (libxl_init_build_info(ctx, b_info, c_info))
-        exit(1);
+    libxl_domain_build_info_init(b_info, c_info);
 
     /* the following is the actual config parsing with overriding values in the structures */
     if (!xlu_cfg_get_long (config, "vcpus", &l, 0)) {
@@ -599,6 +598,11 @@
     if (!xlu_cfg_get_list (config, "cpus", &cpus, 0, 1)) {
         int i, n_cpus = 0;
 
+        if (libxl_cpumap_alloc(ctx, &b_info->cpumap)) {
+            fprintf(stderr, "Unable to allocate cpumap\n");
+            exit(1);
+        }
+
         libxl_cpumap_set_none(&b_info->cpumap);
         while ((buf = xlu_cfg_get_listitem(cpus, n_cpus)) != NULL) {
             i = atoi(buf);
@@ -613,6 +617,11 @@
     else if (!xlu_cfg_get_string (config, "cpus", &buf, 0)) {
         char *buf2 = strdup(buf);
 
+        if (libxl_cpumap_alloc(ctx, &b_info->cpumap)) {
+            fprintf(stderr, "Unable to allocate cpumap\n");
+            exit(1);
+        }
+
         libxl_cpumap_set_none(&b_info->cpumap);
         if (vcpupin_parse(buf2, &b_info->cpumap))
             exit(1);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gei-0000Ax-Cq; Sat, 03 Mar 2012 04:33: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 1S3geh-0000AJ-7i
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:15 +0000
Received: from [85.158.143.99:62554] by server-2.bemta-4.messagelabs.com id
	A8/7D-17550-A0F915F4; Sat, 03 Mar 2012 04:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1330749192!17462331!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14657 invoked from network); 3 Mar 2012 04:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3ged-0004fl-VF
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3ged-0003LP-NA
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:11 +0000
Message-Id: <E1S3ged-0003LP-NA@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Document
	_init/_dispose/_setdefault 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID c3198eb7c0028d0293a3bb6d4de4b55b5aa63a81
# Parent  4ed7554ad6e58c208c34d559b2ae499d5532d86d
libxl: Document _init/_dispose/_setdefault functions.

Subsequent patches will transition to them.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4ed7554ad6e5 -r c3198eb7c002 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
@@ -124,6 +124,50 @@
  * Therefore public functions which initialize a libxl__gc MUST call
  * libxl__free_all() before returning.
  */
+/*
+ * libxl types
+ *
+ * Most libxl types are defined by the libxl IDL (see
+ * libxl_types.idl). The library provides a common set of methods for
+ * initialising and freeing these types.
+ *
+ * void libxl_<type>_init(<type> *p):
+ *
+ *    Initialises the members of "p" to all defaults. These may either
+ *    be special value which indicates to the library that it should
+ *    select an appropriate default when using this field or actual
+ *    default values.
+ *
+ *    Some fields within a data type (e.g. unions) cannot be sensibly
+ *    initialised without further information. In these cases a
+ *    separate subfield initialisation function is provided (see
+ *    below).
+ *
+ *    An instance which has been initialised using this method can
+ *    always be safely passed to the dispose function (see
+ *    below). This is true even if the data type contains fields which
+ *    require a separate call to a subfield initialisation function.
+ *
+ *    This method is provided for any aggregate type which is used as
+ *    an input parameter.
+ *
+ * void libxl_<type>_init_<subfield>(<type> *p, subfield):
+ *
+ *    Initialise those parts of "p" which are not initialised by the
+ *    main init function due to the unknown value of "subfield". Sets
+ *    p->subfield as well as initialising any fields to their default
+ *    values.
+ *
+ *    p->subfield must not have been previously initialised.
+ *
+ *    This method is provided for any aggregate type.
+ *
+ * void libxl_<type>_dispose(instance *p):
+ *
+ *    Frees any dynamically allocated memory used by the members of
+ *    "p" but not the storage used by "p" itself (this allows for the
+ *    allocation of arrays of types and for the composition of types).
+ */
 #ifndef LIBXL_H
 #define LIBXL_H
 
@@ -405,8 +449,9 @@
  * additional data type libxl_device_<TYPE>_getinfo which contains
  * further runtime information about the device.
  *
- * A common set of methods are available for each device type. These
- * are described below.
+ * In addition to the general methods available for libxl types (see
+ * "libxl types" above) a common set of methods are available for each
+ * device type. These are described below.
  *
  * Querying
  * --------
@@ -424,10 +469,6 @@
  * Creation / Control
  * ------------------
  *
- * libxl_device_<type>_init(ctx, device):
- *
- *    Initalises device to a default configuration.
- *
  * libxl_device_<type>_add(ctx, domid, device):
  *
  *   Adds the given device to the specified domain. This can be called
diff -r 4ed7554ad6e5 -r c3198eb7c002 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:13 2012 +0000
@@ -665,6 +665,19 @@
 _hidden int libxl__devices_destroy(libxl__gc *gc, uint32_t domid);
 _hidden int libxl__wait_for_backend(libxl__gc *gc, char *be_path, char *state);
 
+/*
+ * For each aggregate type which can be used as an input we provide:
+ *
+ * int libxl__<type>_setdefault(gc, <type> *p):
+ *
+ *     Idempotently sets any members of "p" which is currently set to
+ *     a special value indicating that the defaults should be used
+ *     (per libxl_<type>_init) to a specific value.
+ *
+ *     All libxl API functions are expected to have arranged for this
+ *     to be called before using any values within these structures.
+ */
+
 /* Arranges that dev will be removed from its guest.  When
  * this is done, the ao will be completed.  An error
  * return from libxl__initiate_device_remove means that the ao

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gem-0000Dr-9Q; Sat, 03 Mar 2012 04:33:20 +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 1S3gej-0000AS-Rl
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:18 +0000
Received: from [85.158.139.83:18829] by server-4.bemta-5.messagelabs.com id
	D6/FB-10788-D0F915F4; Sat, 03 Mar 2012 04:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1330749195!17010006!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4699 invoked from network); 3 Mar 2012 04:33:16 -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;
	3 Mar 2012 04:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geg-0004g0-LI
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geg-0003O1-J9
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:14 +0000
Message-Id: <E1S3geg-0003O1-J9@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: introduce a descriminating
	default value for memkb fields.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID 66d0a12239dac983785c0a692f4f1b5f2501cbd2
# Parent  0f0f126f4a99a35a89f6136c74a046ababfd7645
libxl: introduce a descriminating default value for memkb fields.

Consitently make such fields 64 bit values as used by dominfo.

It is not clear if ->video_memkb and/or shadow_memkb shouldn't be part of
->u.hvm but I have not changed that here.

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


diff -r 0f0f126f4a99 -r 66d0a12239da tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/gentest.py	Thu Mar 01 12:26:14 2012 +0000
@@ -197,6 +197,7 @@
 }
 """)
     for ty in builtins + types:
+        if isinstance(ty, idl.Number): continue
         if ty.typename not in handcoded:
             f.write("static void %s_rand_init(%s);\n" % \
                     (ty.typename,
diff -r 0f0f126f4a99 -r 66d0a12239da tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
@@ -246,6 +246,7 @@
 typedef struct libxl__ctx libxl_ctx;
 
 #define LIBXL_TIMER_MODE_DEFAULT -1
+#define LIBXL_MEMKB_DEFAULT ~0ULL
 
 #include "_libxl_types.h"
 
diff -r 0f0f126f4a99 -r 66d0a12239da tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
@@ -70,19 +70,20 @@
                                   const libxl_domain_create_info *c_info)
 {
     memset(b_info, '\0', sizeof(*b_info));
-    b_info->max_memkb = 32 * 1024;
-    b_info->target_memkb = b_info->max_memkb;
     b_info->disable_migrate = 0;
     b_info->cpuid = NULL;
-    b_info->shadow_memkb = 0;
     b_info->type = c_info->type;
 
+    b_info->max_memkb = LIBXL_MEMKB_DEFAULT;
+    b_info->target_memkb = LIBXL_MEMKB_DEFAULT;
+    b_info->shadow_memkb = LIBXL_MEMKB_DEFAULT;
+    b_info->video_memkb =  LIBXL_MEMKB_DEFAULT;
+
     b_info->device_model_stubdomain = false;
     b_info->device_model = NULL;
 
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
-        b_info->video_memkb = 8 * 1024;
         b_info->u.hvm.firmware = NULL;
         b_info->u.hvm.bios = 0;
         b_info->u.hvm.pae = 1;
@@ -133,8 +134,17 @@
         libxl_cpumap_set_any(&b_info->cpumap);
     }
 
+    if (b_info->max_memkb == LIBXL_MEMKB_DEFAULT)
+        b_info->max_memkb = 32 * 1024;
+    if (b_info->target_memkb == LIBXL_MEMKB_DEFAULT)
+        b_info->target_memkb = b_info->max_memkb;
+
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
+        if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->shadow_memkb = 0;
+        if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->video_memkb = 8 * 1024;
         if (b_info->u.hvm.timer_mode == LIBXL_TIMER_MODE_DEFAULT)
             b_info->u.hvm.timer_mode =
                 LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS;
@@ -153,6 +163,10 @@
 
         break;
     case LIBXL_DOMAIN_TYPE_PV:
+        if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->shadow_memkb = 0;
+        if (b_info->u.pv.slack_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->u.pv.slack_memkb = 0;
         break;
     default:
         LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
diff -r 0f0f126f4a99 -r 66d0a12239da tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_dom.c	Thu Mar 01 12:26:14 2012 +0000
@@ -129,11 +129,12 @@
 
     ents = libxl__calloc(gc, 12 + (info->max_vcpus * 2) + 2, sizeof(char *));
     ents[0] = "memory/static-max";
-    ents[1] = libxl__sprintf(gc, "%d", info->max_memkb);
+    ents[1] = libxl__sprintf(gc, "%"PRId64, info->max_memkb);
     ents[2] = "memory/target";
-    ents[3] = libxl__sprintf(gc, "%d", info->target_memkb - info->video_memkb);
+    ents[3] = libxl__sprintf(gc, "%"PRId64,
+                             info->target_memkb - info->video_memkb);
     ents[4] = "memory/videoram";
-    ents[5] = libxl__sprintf(gc, "%d", info->video_memkb);
+    ents[5] = libxl__sprintf(gc, "%"PRId64, info->video_memkb);
     ents[6] = "domid";
     ents[7] = libxl__sprintf(gc, "%d", domid);
     ents[8] = "store/port";
diff -r 0f0f126f4a99 -r 66d0a12239da tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
@@ -18,6 +18,12 @@
 libxl_hwcap = Builtin("hwcap", passby=PASS_BY_REFERENCE)
 
 #
+# Specific integer types
+#
+
+MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
+
+#
 # Constants / Enumerations
 #
 
@@ -170,9 +176,9 @@
     # Otherwise set to a value guaranteed not to clash with any valid
     # LIBXL_SHUTDOWN_REASON_* constant.
     ("shutdown_reason", libxl_shutdown_reason),
-    ("current_memkb",   uint64),
-    ("shared_memkb", uint64),
-    ("max_memkb",   uint64),
+    ("current_memkb",   MemKB),
+    ("shared_memkb", MemKB),
+    ("max_memkb",   MemKB),
     ("cpu_time",    uint64),
     ("vcpu_max_id", uint32),
     ("vcpu_online", uint32),
@@ -228,10 +234,10 @@
     ("cur_vcpus",       integer),
     ("cpumap",          libxl_cpumap),
     ("tsc_mode",        libxl_tsc_mode),
-    ("max_memkb",       uint32),
-    ("target_memkb",    uint32),
-    ("video_memkb",     uint32),
-    ("shadow_memkb",    uint32),
+    ("max_memkb",       MemKB),
+    ("target_memkb",    MemKB),
+    ("video_memkb",     MemKB),
+    ("shadow_memkb",    MemKB),
     ("disable_migrate", bool),
     ("cpuid",           libxl_cpuid_policy_list),
     ("type",            libxl_domain_type),
@@ -286,7 +292,7 @@
                                        ("xen_platform_pci", bool),
                                        ])),
                  ("pv", Struct(None, [("kernel", libxl_file_reference),
-                                      ("slack_memkb", uint32),
+                                      ("slack_memkb", MemKB),
                                       ("bootloader", string),
                                       ("bootloader_args", libxl_string_list),
                                       ("cmdline", string),
diff -r 0f0f126f4a99 -r 66d0a12239da tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:14 2012 +0000
@@ -21,6 +21,7 @@
 #include "libxl_osdeps.h"
 
 #include <stdlib.h>
+#include <inttypes.h>
 
 #include "libxl.h"
 #include "libxl_utils.h"
@@ -68,8 +69,8 @@
     printf("\t(build_info)\n");
     printf("\t(max_vcpus %d)\n", b_info->max_vcpus);
     printf("\t(tsc_mode %s)\n", libxl_tsc_mode_to_string(b_info->tsc_mode));
-    printf("\t(max_memkb %d)\n", b_info->max_memkb);
-    printf("\t(target_memkb %d)\n", b_info->target_memkb);
+    printf("\t(max_memkb %"PRId64")\n", b_info->max_memkb);
+    printf("\t(target_memkb %"PRId64")\n", b_info->target_memkb);
     printf("\t(nomigrate %d)\n", b_info->disable_migrate);
 
     if (c_info->type == LIBXL_DOMAIN_TYPE_PV && b_info->u.pv.bootloader) {
@@ -88,8 +89,8 @@
     case LIBXL_DOMAIN_TYPE_HVM:
         printf("\t\t(hvm\n");
         printf("\t\t\t(firmware %s)\n", b_info->u.hvm.firmware);
-        printf("\t\t\t(video_memkb %d)\n", b_info->video_memkb);
-        printf("\t\t\t(shadow_memkb %d)\n", b_info->shadow_memkb);
+        printf("\t\t\t(video_memkb %"PRId64")\n", b_info->video_memkb);
+        printf("\t\t\t(shadow_memkb %"PRId64")\n", b_info->shadow_memkb);
         printf("\t\t\t(pae %d)\n", b_info->u.hvm.pae);
         printf("\t\t\t(apic %d)\n", b_info->u.hvm.apic);
         printf("\t\t\t(acpi %d)\n", b_info->u.hvm.acpi);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gei-0000As-A3; Sat, 03 Mar 2012 04:33: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 1S3geg-0000AI-VW
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:15 +0000
Received: from [85.158.138.51:26311] by server-1.bemta-3.messagelabs.com id
	B6/31-02415-A0F915F4; Sat, 03 Mar 2012 04:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1330749190!15908750!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20507 invoked from network); 3 Mar 2012 04:33:11 -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;
	3 Mar 2012 04:33: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 1S3geb-0004fZ-Px
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geb-0003JG-9Y
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:09 +0000
Message-Id: <E1S3geb-0003JG-9Y@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: remove sysctl.h from public
	interface
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID ba05ea3bf452ac9c5bb78f86f99ead38d581e590
# Parent  e439559f50eb284d05efd142c4322bef43c2e20b
libxl: remove sysctl.h from public interface

Using sysctl.h is restricted to "node control tools only" and requires magic
defines. Therefore make its use internal to libxl.

Also removes an indirect include of domctl.h which has the same restrction.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r e439559f50eb -r ba05ea3bf452 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -491,7 +491,7 @@
         }
         ptr = tmp;
         ptr[i].poolid = info->cpupool_id;
-        ptr[i].sched_id = info->sched_id;
+        ptr[i].sched = info->sched_id;
         ptr[i].n_dom = info->n_dom;
         if (libxl_cpumap_alloc(ctx, &ptr[i].cpumap)) {
             xc_cpupool_infofree(ctx->xch, info);
@@ -2750,7 +2750,10 @@
     physinfo->sharing_used_frames = xc_sharing_used_frames(ctx->xch);
     physinfo->nr_nodes = xcphysinfo.nr_nodes;
     memcpy(physinfo->hw_cap,xcphysinfo.hw_cap, sizeof(physinfo->hw_cap));
-    physinfo->phys_cap = xcphysinfo.capabilities;
+
+    physinfo->cap_hvm = !!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_hvm);
+    physinfo->cap_hvm_directio =
+        !!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_hvm_directio);
 
     return 0;
 }
@@ -2961,14 +2964,11 @@
     return rc;
 }
 
-/*
- * returns one of the XEN_SCHEDULER_* constants from public/domctl.h
- */
-int libxl_get_sched_id(libxl_ctx *ctx)
+libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx)
 {
-    int sched, ret;
-
-    if ((ret = xc_sched_id(ctx->xch, &sched)) != 0) {
+    libxl_scheduler sched, ret;
+
+    if ((ret = xc_sched_id(ctx->xch, (int *)&sched)) != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list");
         return ERROR_FAIL;
     }
@@ -3443,7 +3443,8 @@
     return 0;
 }
 
-int libxl_cpupool_create(libxl_ctx *ctx, const char *name, int schedid,
+int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
+                         libxl_scheduler sched,
                          libxl_cpumap cpumap, libxl_uuid *uuid,
                          uint32_t *poolid)
 {
@@ -3459,7 +3460,7 @@
         return ERROR_NOMEM;
     }
 
-    rc = xc_cpupool_create(ctx->xch, poolid, schedid);
+    rc = xc_cpupool_create(ctx->xch, poolid, sched);
     if (rc) {
         LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
            "Could not create cpupool");
diff -r e439559f50eb -r ba05ea3bf452 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
@@ -138,7 +138,6 @@
 #include <xentoollog.h>
 
 #include <xen/sched.h>
-#include <xen/sysctl.h>
 
 #include <libxl_uuid.h>
 #include <_libxl_list.h>
@@ -584,7 +583,7 @@
                                unsigned int max_vcpus, libxl_cpumap *cpumap);
 int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_cpumap *cpumap);
 
-int libxl_get_sched_id(libxl_ctx *ctx);
+libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx);
 
 
 int libxl_sched_credit_domain_get(libxl_ctx *ctx, uint32_t domid,
@@ -627,7 +626,8 @@
 int libxl_tmem_freeable(libxl_ctx *ctx);
 
 int libxl_get_freecpus(libxl_ctx *ctx, libxl_cpumap *cpumap);
-int libxl_cpupool_create(libxl_ctx *ctx, const char *name, int schedid,
+int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
+                         libxl_scheduler sched,
                          libxl_cpumap cpumap, libxl_uuid *uuid,
                          uint32_t *poolid);
 int libxl_cpupool_destroy(libxl_ctx *ctx, uint32_t poolid);
diff -r e439559f50eb -r ba05ea3bf452 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:13 2012 +0000
@@ -105,6 +105,14 @@
     (3, "ovmf"),
     ])
 
+# Consistent with values defined in domctl.h
+libxl_scheduler = Enumeration("scheduler", [
+    (4, "sedf"),
+    (5, "credit"),
+    (6, "credit2"),
+    (7, "arinc653"),
+    ])
+
 #
 # Complex libxl types
 #
@@ -164,7 +172,7 @@
 
 libxl_cpupoolinfo = Struct("cpupoolinfo", [
     ("poolid",      uint32),
-    ("sched_id",    uint32),
+    ("sched",       libxl_scheduler),
     ("n_dom",       uint32),
     ("cpumap",      libxl_cpumap)
     ])
@@ -388,7 +396,9 @@
 
     ("nr_nodes", uint32),
     ("hw_cap", libxl_hwcap),
-    ("phys_cap", uint32),
+
+    ("cap_hvm", bool),
+    ("cap_hvm_directio", bool),
     ], dispose_fn=None, dir=DIR_OUT)
 
 libxl_cputopology = Struct("cputopology", [
diff -r e439559f50eb -r ba05ea3bf452 tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/libxl/libxl_utils.c	Thu Mar 01 12:26:13 2012 +0000
@@ -19,18 +19,6 @@
 
 #include "libxl_internal.h"
 
-struct schedid_name {
-    char *name;
-    int id;
-};
-
-static struct schedid_name schedid_name[] = {
-    { "credit", XEN_SCHEDULER_CREDIT },
-    { "sedf", XEN_SCHEDULER_SEDF },
-    { "credit2", XEN_SCHEDULER_CREDIT2 },
-    { NULL, -1 }
-};
-
 const char *libxl_basename(const char *name)
 {
     const char *filename;
@@ -151,28 +139,6 @@
     return ret;
 }
 
-int libxl_name_to_schedid(libxl_ctx *ctx, const char *name)
-{
-    int i;
-
-    for (i = 0; schedid_name[i].name != NULL; i++)
-        if (strcmp(name, schedid_name[i].name) == 0)
-            return schedid_name[i].id;
-
-    return ERROR_INVAL;
-}
-
-char *libxl_schedid_to_name(libxl_ctx *ctx, int schedid)
-{
-    int i;
-
-    for (i = 0; schedid_name[i].name != NULL; i++)
-        if (schedid_name[i].id == schedid)
-            return schedid_name[i].name;
-
-    return "unknown";
-}
-
 int libxl_get_stubdom_id(libxl_ctx *ctx, int guest_domid)
 {
     GC_INIT(ctx);
diff -r e439559f50eb -r ba05ea3bf452 tools/libxl/libxl_utils.h
--- a/tools/libxl/libxl_utils.h	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/libxl/libxl_utils.h	Thu Mar 01 12:26:13 2012 +0000
@@ -24,8 +24,6 @@
 char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid);
 int libxl_name_to_cpupoolid(libxl_ctx *ctx, const char *name, uint32_t *poolid);
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid);
-int libxl_name_to_schedid(libxl_ctx *ctx, const char *name);
-char *libxl_schedid_to_name(libxl_ctx *ctx, int schedid);
 int libxl_get_stubdom_id(libxl_ctx *ctx, int guest_domid);
 int libxl_is_stubdom(libxl_ctx *ctx, uint32_t domid, uint32_t *target_domid);
 int libxl_create_logfile(libxl_ctx *ctx, char *name, char **full_name);
diff -r e439559f50eb -r ba05ea3bf452 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -3693,15 +3693,15 @@
 static void output_xeninfo(void)
 {
     const libxl_version_info *info;
-    int sched_id;
+    libxl_scheduler sched;
 
     if (!(info = libxl_get_version_info(ctx))) {
         fprintf(stderr, "libxl_get_version_info failed.\n");
         return;
     }
 
-    if ((sched_id = libxl_get_sched_id(ctx)) < 0) {
-        fprintf(stderr, "get_sched_id sysctl failed.\n");
+    if ((sched = libxl_get_scheduler(ctx)) < 0) {
+        fprintf(stderr, "get_scheduler sysctl failed.\n");
         return;
     }
 
@@ -3709,7 +3709,7 @@
     printf("xen_minor              : %d\n", info->xen_version_minor);
     printf("xen_extra              : %s\n", info->xen_version_extra);
     printf("xen_caps               : %s\n", info->capabilities);
-    printf("xen_scheduler          : %s\n", libxl_schedid_to_name(ctx, sched_id));
+    printf("xen_scheduler          : %s\n", libxl_scheduler_to_string(sched));
     printf("xen_pagesize           : %u\n", info->pagesize);
     printf("platform_params        : virt_start=0x%"PRIx64"\n", info->virt_start);
     printf("xen_changeset          : %s\n", info->changeset);
@@ -3757,9 +3757,9 @@
     for (i = 0; i < 8; i++)
         printf("%08x%c", info.hw_cap[i], i < 7 ? ':' : '\n');
     printf("virt_caps              :");
-    if (info.phys_cap & XEN_SYSCTL_PHYSCAP_hvm)
+    if (info.cap_hvm)
         printf(" hvm");
-    if (info.phys_cap & XEN_SYSCTL_PHYSCAP_hvm_directio)
+    if (info.cap_hvm_directio)
         printf(" hvm_directio");
     printf("\n");
     vinfo = libxl_get_version_info(ctx);
@@ -4065,7 +4065,7 @@
 }
 
 static int sched_domain_output(
-    uint32_t sched, int (*output)(int), const char *cpupool)
+    libxl_scheduler sched, int (*output)(int), const char *cpupool)
 {
     libxl_dominfo *info;
     libxl_cpupoolinfo *poolinfo = NULL;
@@ -4094,7 +4094,7 @@
     }
 
     for (p = 0; !rc && (p < n_pools); p++) {
-        if ((poolinfo[p].sched_id != sched) ||
+        if ((poolinfo[p].sched != sched) ||
             (cpupool && (poolid != poolinfo[p].poolid)))
             continue;
 
@@ -4175,7 +4175,7 @@
     }
 
     if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(XEN_SCHEDULER_CREDIT,
+        return -sched_domain_output(LIBXL_SCHEDULER_CREDIT,
                                     sched_credit_domain_output, cpupool);
     } else {
         find_domain(dom);
@@ -4251,7 +4251,7 @@
     }
 
     if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(XEN_SCHEDULER_CREDIT2,
+        return -sched_domain_output(LIBXL_SCHEDULER_CREDIT2,
                                     sched_credit2_domain_output, cpupool);
     } else {
         find_domain(dom);
@@ -4353,7 +4353,7 @@
     }
 
     if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(XEN_SCHEDULER_SEDF,
+        return -sched_domain_output(LIBXL_SCHEDULER_SEDF,
                                     sched_sedf_domain_output, cpupool);
     } else {
         find_domain(dom);
@@ -5292,9 +5292,8 @@
     XLU_Config *config;
     const char *buf;
     const char *name;
-    const char *sched;
     uint32_t poolid;
-    int schedid = -1;
+    libxl_scheduler sched = 0;
     XLU_ConfigList *cpus;
     XLU_ConfigList *nodes;
     int n_cpus, n_nodes, i, n;
@@ -5389,17 +5388,16 @@
     }
 
     if (!xlu_cfg_get_string (config, "sched", &buf, 0)) {
-        if ((schedid = libxl_name_to_schedid(ctx, buf)) < 0) {
+        if ((libxl_scheduler_from_string(buf, &sched)) < 0) {
             fprintf(stderr, "Unknown scheduler\n");
             return -ERROR_FAIL;
         }
     } else {
-        if ((schedid = libxl_get_sched_id(ctx)) < 0) {
-            fprintf(stderr, "get_sched_id sysctl failed.\n");
+        if ((sched = libxl_get_scheduler(ctx)) < 0) {
+            fprintf(stderr, "get_scheduler sysctl failed.\n");
             return -ERROR_FAIL;
         }
     }
-    sched = libxl_schedid_to_name(ctx, schedid);
 
     if (libxl_get_freecpus(ctx, &freemap)) {
         fprintf(stderr, "libxl_get_freecpus failed\n");
@@ -5467,14 +5465,14 @@
 
     printf("Using config file \"%s\"\n", filename);
     printf("cpupool name:   %s\n", name);
-    printf("scheduler:      %s\n", sched);
+    printf("scheduler:      %s\n", libxl_scheduler_to_string(sched));
     printf("number of cpus: %d\n", n_cpus);
 
     if (dryrun_only)
         return 0;
 
     poolid = 0;
-    if (libxl_cpupool_create(ctx, name, schedid, cpumap, &uuid, &poolid)) {
+    if (libxl_cpupool_create(ctx, name, sched, cpumap, &uuid, &poolid)) {
         fprintf(stderr, "error on creating cpupool\n");
         return -ERROR_FAIL;
     }
@@ -5559,7 +5557,7 @@
                     }
                 if (!opt_cpus) {
                     printf("%3d %9s       y       %4d", n,
-                           libxl_schedid_to_name(ctx, poolinfo[p].sched_id),
+                           libxl_scheduler_to_string(poolinfo[p].sched),
                            poolinfo[p].n_dom);
                 }
                 printf("\n");
@@ -5744,7 +5742,7 @@
     int c;
     int n;
     uint32_t poolid;
-    int schedid;
+    libxl_scheduler sched;
     int n_pools;
     int node;
     int n_cpus;
@@ -5765,7 +5763,7 @@
         return -ERROR_NOMEM;
     }
     poolid = poolinfo[0].poolid;
-    schedid = poolinfo[0].sched_id;
+    sched = poolinfo[0].sched;
     for (p = 0; p < n_pools; p++) {
         libxl_cpupoolinfo_dispose(poolinfo + p);
     }
@@ -5845,7 +5843,7 @@
         snprintf(name, 15, "Pool-node%d", node);
         libxl_uuid_generate(&uuid);
         poolid = 0;
-        ret = -libxl_cpupool_create(ctx, name, schedid, cpumap, &uuid, &poolid);
+        ret = -libxl_cpupool_create(ctx, name, sched, cpumap, &uuid, &poolid);
         if (ret) {
             fprintf(stderr, "error on creating cpupool\n");
             goto out;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gen-0000Et-LR; Sat, 03 Mar 2012 04:33: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 1S3gem-0000Dd-Mw
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:21 +0000
Received: from [85.158.139.83:18856] by server-3.bemta-5.messagelabs.com id
	D0/02-25237-F0F915F4; Sat, 03 Mar 2012 04:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1330749197!13726940!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8025 invoked from network); 3 Mar 2012 04:33:18 -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 Mar 2012 04:33: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 1S3gei-0004gC-Uf
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gei-0003Q5-TN
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:16 +0000
Message-Id: <E1S3gei-0003Q5-TN@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: make libxl_device_console
	internal
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID d36443bc098c28c2649f3e494ae6f44722870261
# Parent  e5bc6847f24882143b71318e2683772f4f34251e
libxl: make libxl_device_console internal

consoles are not directly exposed to users of the library and there are no API
functions for manipluating them (only the console_exec function). Rather than
commit to a particular API now make the type internal.

When a user does come along it is much easier to add a completely new API
rather than to fix an existing broken one. It's easier to do this in a manner
which users of the library can cope with in a compatible way e.g. adding a new
API is easier to check for with ./configure.

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


diff -r e5bc6847f248 -r d36443bc098c tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -2023,7 +2023,7 @@
 
 /******************************************************************************/
 int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
-                              libxl_device_console *console,
+                              libxl__device_console *console,
                               libxl__domain_build_state *state)
 {
     flexarray_t *front;
@@ -2070,7 +2070,7 @@
     flexarray_append(front, "limit");
     flexarray_append(front, libxl__sprintf(gc, "%d", LIBXL_XENCONSOLE_LIMIT));
     flexarray_append(front, "type");
-    if (console->consback == LIBXL_CONSOLE_BACKEND_XENCONSOLED)
+    if (console->consback == LIBXL__CONSOLE_BACKEND_XENCONSOLED)
         flexarray_append(front, "xenconsoled");
     else
         flexarray_append(front, "ioemu");
diff -r e5bc6847f248 -r d36443bc098c tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
@@ -177,17 +177,16 @@
     return 0;
 }
 
-static int init_console_info(libxl_device_console *console, int dev_num)
+static int init_console_info(libxl__device_console *console, int dev_num)
 {
-    memset(console, 0x00, sizeof(libxl_device_console));
+    memset(console, 0x00, sizeof(libxl__device_console));
     console->devid = dev_num;
-    console->consback = LIBXL_CONSOLE_BACKEND_XENCONSOLED;
+    console->consback = LIBXL__CONSOLE_BACKEND_XENCONSOLED;
     console->output = strdup("pty");
-    if ( NULL == console->output )
+    if (!console->output)
         return ERROR_NOMEM;
     return 0;
 }
-
 int libxl__domain_build(libxl__gc *gc,
                         libxl_domain_build_info *info,
                         uint32_t domid,
@@ -586,14 +585,14 @@
     switch (d_config->c_info.type) {
     case LIBXL_DOMAIN_TYPE_HVM:
     {
-        libxl_device_console console;
+        libxl__device_console console;
         libxl_device_vkb vkb;
 
         ret = init_console_info(&console, 0);
         if ( ret )
             goto error_out;
         libxl__device_console_add(gc, domid, &console, &state);
-        libxl_device_console_dispose(&console);
+        libxl__device_console_dispose(&console);
 
         libxl_device_vkb_init(&vkb);
         libxl_device_vkb_add(ctx, domid, &vkb);
@@ -611,7 +610,7 @@
     case LIBXL_DOMAIN_TYPE_PV:
     {
         int need_qemu = 0;
-        libxl_device_console console;
+        libxl__device_console console;
 
         for (i = 0; i < d_config->num_vfbs; i++) {
             libxl_device_vfb_add(ctx, domid, &d_config->vfbs[i]);
@@ -627,10 +626,10 @@
                 d_config->num_disks, &d_config->disks[0]);
 
         if (need_qemu)
-             console.consback = LIBXL_CONSOLE_BACKEND_IOEMU;
+             console.consback = LIBXL__CONSOLE_BACKEND_IOEMU;
 
         libxl__device_console_add(gc, domid, &console, &state);
-        libxl_device_console_dispose(&console);
+        libxl__device_console_dispose(&console);
 
         if (need_qemu) {
             libxl__create_xenpv_qemu(gc, domid, d_config, &state, &dm_starting);
diff -r e5bc6847f248 -r d36443bc098c tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:14 2012 +0000
@@ -688,7 +688,7 @@
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     int i, num_console = STUBDOM_SPECIAL_CONSOLES, ret;
-    libxl_device_console *console;
+    libxl__device_console *console;
     libxl_domain_config dm_config;
     libxl_device_vfb vfb;
     libxl_device_vkb vkb;
@@ -820,7 +820,7 @@
     if (guest_config->b_info.u.hvm.serial)
         num_console++;
 
-    console = libxl__calloc(gc, num_console, sizeof(libxl_device_console));
+    console = libxl__calloc(gc, num_console, sizeof(libxl__device_console));
     if (!console) {
         ret = ERROR_NOMEM;
         goto out_free;
@@ -828,7 +828,7 @@
 
     for (i = 0; i < num_console; i++) {
         console[i].devid = i;
-        console[i].consback = LIBXL_CONSOLE_BACKEND_IOEMU;
+        console[i].consback = LIBXL__CONSOLE_BACKEND_IOEMU;
         /* STUBDOM_CONSOLE_LOGGING (console 0) is for minios logging
          * STUBDOM_CONSOLE_SAVE (console 1) is for writing the save file
          * STUBDOM_CONSOLE_RESTORE (console 2) is for reading the save file
@@ -1092,7 +1092,7 @@
 }
 
 int libxl__need_xenpv_qemu(libxl__gc *gc,
-        int nr_consoles, libxl_device_console *consoles,
+        int nr_consoles, libxl__device_console *consoles,
         int nr_vfbs, libxl_device_vfb *vfbs,
         int nr_disks, libxl_device_disk *disks)
 {
@@ -1104,7 +1104,7 @@
     }
 
     for (i = 0; i < nr_consoles; i++) {
-        if (consoles[i].consback == LIBXL_CONSOLE_BACKEND_IOEMU) {
+        if (consoles[i].consback == LIBXL__CONSOLE_BACKEND_IOEMU) {
             ret = 1;
             goto out;
         }
diff -r e5bc6847f248 -r d36443bc098c tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
@@ -661,7 +661,7 @@
                                           int *pdisk, int *ppartition);
 
 _hidden int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
-                                      libxl_device_console *console,
+                                      libxl__device_console *console,
                                       libxl__domain_build_state *state);
 
 _hidden int libxl__device_generic_add(libxl__gc *gc, libxl__device *device,
@@ -904,7 +904,7 @@
                               libxl__domain_build_state *state,
                               libxl__spawner_starting **starting_r);
 _hidden int libxl__need_xenpv_qemu(libxl__gc *gc,
-        int nr_consoles, libxl_device_console *consoles,
+        int nr_consoles, libxl__device_console *consoles,
         int nr_vfbs, libxl_device_vfb *vfbs,
         int nr_disks, libxl_device_disk *disks);
   /* Caller must either: pass starting_r==0, or on successful
diff -r e5bc6847f248 -r d36443bc098c tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
@@ -42,11 +42,6 @@
     (2, "PV"),
     ])
 
-libxl_console_backend = Enumeration("console_backend", [
-    (1, "XENCONSOLED"),
-    (2, "IOEMU"),
-    ])
-
 libxl_disk_format = Enumeration("disk_format", [
     (0, "UNKNOWN"),
     (1, "QCOW"),
@@ -319,13 +314,6 @@
     ("devid", integer),
     ])
 
-libxl_device_console = Struct("device_console", [
-    ("backend_domid", libxl_domid),
-    ("devid", integer),
-    ("consback", libxl_console_backend),
-    ("output", string),
-    ])
-
 libxl_device_disk = Struct("device_disk", [
     ("backend_domid", libxl_domid),
     ("pdev_path", string),
diff -r e5bc6847f248 -r d36443bc098c tools/libxl/libxl_types_internal.idl
--- a/tools/libxl/libxl_types_internal.idl	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_types_internal.idl	Thu Mar 01 12:26:14 2012 +0000
@@ -1,5 +1,7 @@
 namespace("libxl__")
 
+libxl_domid = Builtin("domid", namespace="libxl_", json_fn = "yajl_gen_integer")
+
 libxl__qmp_message_type = Enumeration("qmp_message_type", [
     (1, "QMP"),
     (2, "return"),
@@ -17,3 +19,15 @@
     (6, "VKBD"),
     (7, "CONSOLE"),
     ])
+
+libxl__console_backend = Enumeration("console_backend", [
+    (1, "XENCONSOLED"),
+    (2, "IOEMU"),
+    ])
+
+libxl__device_console = Struct("device_console", [
+    ("backend_domid", libxl_domid),
+    ("devid", integer),
+    ("consback", libxl__console_backend),
+    ("output", string),
+    ])

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gem-0000Dr-9Q; Sat, 03 Mar 2012 04:33:20 +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 1S3gej-0000AS-Rl
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:18 +0000
Received: from [85.158.139.83:18829] by server-4.bemta-5.messagelabs.com id
	D6/FB-10788-D0F915F4; Sat, 03 Mar 2012 04:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1330749195!17010006!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4699 invoked from network); 3 Mar 2012 04:33:16 -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;
	3 Mar 2012 04:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geg-0004g0-LI
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geg-0003O1-J9
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:14 +0000
Message-Id: <E1S3geg-0003O1-J9@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: introduce a descriminating
	default value for memkb fields.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID 66d0a12239dac983785c0a692f4f1b5f2501cbd2
# Parent  0f0f126f4a99a35a89f6136c74a046ababfd7645
libxl: introduce a descriminating default value for memkb fields.

Consitently make such fields 64 bit values as used by dominfo.

It is not clear if ->video_memkb and/or shadow_memkb shouldn't be part of
->u.hvm but I have not changed that here.

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


diff -r 0f0f126f4a99 -r 66d0a12239da tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/gentest.py	Thu Mar 01 12:26:14 2012 +0000
@@ -197,6 +197,7 @@
 }
 """)
     for ty in builtins + types:
+        if isinstance(ty, idl.Number): continue
         if ty.typename not in handcoded:
             f.write("static void %s_rand_init(%s);\n" % \
                     (ty.typename,
diff -r 0f0f126f4a99 -r 66d0a12239da tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
@@ -246,6 +246,7 @@
 typedef struct libxl__ctx libxl_ctx;
 
 #define LIBXL_TIMER_MODE_DEFAULT -1
+#define LIBXL_MEMKB_DEFAULT ~0ULL
 
 #include "_libxl_types.h"
 
diff -r 0f0f126f4a99 -r 66d0a12239da tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
@@ -70,19 +70,20 @@
                                   const libxl_domain_create_info *c_info)
 {
     memset(b_info, '\0', sizeof(*b_info));
-    b_info->max_memkb = 32 * 1024;
-    b_info->target_memkb = b_info->max_memkb;
     b_info->disable_migrate = 0;
     b_info->cpuid = NULL;
-    b_info->shadow_memkb = 0;
     b_info->type = c_info->type;
 
+    b_info->max_memkb = LIBXL_MEMKB_DEFAULT;
+    b_info->target_memkb = LIBXL_MEMKB_DEFAULT;
+    b_info->shadow_memkb = LIBXL_MEMKB_DEFAULT;
+    b_info->video_memkb =  LIBXL_MEMKB_DEFAULT;
+
     b_info->device_model_stubdomain = false;
     b_info->device_model = NULL;
 
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
-        b_info->video_memkb = 8 * 1024;
         b_info->u.hvm.firmware = NULL;
         b_info->u.hvm.bios = 0;
         b_info->u.hvm.pae = 1;
@@ -133,8 +134,17 @@
         libxl_cpumap_set_any(&b_info->cpumap);
     }
 
+    if (b_info->max_memkb == LIBXL_MEMKB_DEFAULT)
+        b_info->max_memkb = 32 * 1024;
+    if (b_info->target_memkb == LIBXL_MEMKB_DEFAULT)
+        b_info->target_memkb = b_info->max_memkb;
+
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
+        if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->shadow_memkb = 0;
+        if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->video_memkb = 8 * 1024;
         if (b_info->u.hvm.timer_mode == LIBXL_TIMER_MODE_DEFAULT)
             b_info->u.hvm.timer_mode =
                 LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS;
@@ -153,6 +163,10 @@
 
         break;
     case LIBXL_DOMAIN_TYPE_PV:
+        if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->shadow_memkb = 0;
+        if (b_info->u.pv.slack_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->u.pv.slack_memkb = 0;
         break;
     default:
         LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
diff -r 0f0f126f4a99 -r 66d0a12239da tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_dom.c	Thu Mar 01 12:26:14 2012 +0000
@@ -129,11 +129,12 @@
 
     ents = libxl__calloc(gc, 12 + (info->max_vcpus * 2) + 2, sizeof(char *));
     ents[0] = "memory/static-max";
-    ents[1] = libxl__sprintf(gc, "%d", info->max_memkb);
+    ents[1] = libxl__sprintf(gc, "%"PRId64, info->max_memkb);
     ents[2] = "memory/target";
-    ents[3] = libxl__sprintf(gc, "%d", info->target_memkb - info->video_memkb);
+    ents[3] = libxl__sprintf(gc, "%"PRId64,
+                             info->target_memkb - info->video_memkb);
     ents[4] = "memory/videoram";
-    ents[5] = libxl__sprintf(gc, "%d", info->video_memkb);
+    ents[5] = libxl__sprintf(gc, "%"PRId64, info->video_memkb);
     ents[6] = "domid";
     ents[7] = libxl__sprintf(gc, "%d", domid);
     ents[8] = "store/port";
diff -r 0f0f126f4a99 -r 66d0a12239da tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
@@ -18,6 +18,12 @@
 libxl_hwcap = Builtin("hwcap", passby=PASS_BY_REFERENCE)
 
 #
+# Specific integer types
+#
+
+MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
+
+#
 # Constants / Enumerations
 #
 
@@ -170,9 +176,9 @@
     # Otherwise set to a value guaranteed not to clash with any valid
     # LIBXL_SHUTDOWN_REASON_* constant.
     ("shutdown_reason", libxl_shutdown_reason),
-    ("current_memkb",   uint64),
-    ("shared_memkb", uint64),
-    ("max_memkb",   uint64),
+    ("current_memkb",   MemKB),
+    ("shared_memkb", MemKB),
+    ("max_memkb",   MemKB),
     ("cpu_time",    uint64),
     ("vcpu_max_id", uint32),
     ("vcpu_online", uint32),
@@ -228,10 +234,10 @@
     ("cur_vcpus",       integer),
     ("cpumap",          libxl_cpumap),
     ("tsc_mode",        libxl_tsc_mode),
-    ("max_memkb",       uint32),
-    ("target_memkb",    uint32),
-    ("video_memkb",     uint32),
-    ("shadow_memkb",    uint32),
+    ("max_memkb",       MemKB),
+    ("target_memkb",    MemKB),
+    ("video_memkb",     MemKB),
+    ("shadow_memkb",    MemKB),
     ("disable_migrate", bool),
     ("cpuid",           libxl_cpuid_policy_list),
     ("type",            libxl_domain_type),
@@ -286,7 +292,7 @@
                                        ("xen_platform_pci", bool),
                                        ])),
                  ("pv", Struct(None, [("kernel", libxl_file_reference),
-                                      ("slack_memkb", uint32),
+                                      ("slack_memkb", MemKB),
                                       ("bootloader", string),
                                       ("bootloader_args", libxl_string_list),
                                       ("cmdline", string),
diff -r 0f0f126f4a99 -r 66d0a12239da tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:14 2012 +0000
@@ -21,6 +21,7 @@
 #include "libxl_osdeps.h"
 
 #include <stdlib.h>
+#include <inttypes.h>
 
 #include "libxl.h"
 #include "libxl_utils.h"
@@ -68,8 +69,8 @@
     printf("\t(build_info)\n");
     printf("\t(max_vcpus %d)\n", b_info->max_vcpus);
     printf("\t(tsc_mode %s)\n", libxl_tsc_mode_to_string(b_info->tsc_mode));
-    printf("\t(max_memkb %d)\n", b_info->max_memkb);
-    printf("\t(target_memkb %d)\n", b_info->target_memkb);
+    printf("\t(max_memkb %"PRId64")\n", b_info->max_memkb);
+    printf("\t(target_memkb %"PRId64")\n", b_info->target_memkb);
     printf("\t(nomigrate %d)\n", b_info->disable_migrate);
 
     if (c_info->type == LIBXL_DOMAIN_TYPE_PV && b_info->u.pv.bootloader) {
@@ -88,8 +89,8 @@
     case LIBXL_DOMAIN_TYPE_HVM:
         printf("\t\t(hvm\n");
         printf("\t\t\t(firmware %s)\n", b_info->u.hvm.firmware);
-        printf("\t\t\t(video_memkb %d)\n", b_info->video_memkb);
-        printf("\t\t\t(shadow_memkb %d)\n", b_info->shadow_memkb);
+        printf("\t\t\t(video_memkb %"PRId64")\n", b_info->video_memkb);
+        printf("\t\t\t(shadow_memkb %"PRId64")\n", b_info->shadow_memkb);
         printf("\t\t\t(pae %d)\n", b_info->u.hvm.pae);
         printf("\t\t\t(apic %d)\n", b_info->u.hvm.apic);
         printf("\t\t\t(acpi %d)\n", b_info->u.hvm.acpi);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gei-0000As-A3; Sat, 03 Mar 2012 04:33: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 1S3geg-0000AI-VW
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:15 +0000
Received: from [85.158.138.51:26311] by server-1.bemta-3.messagelabs.com id
	B6/31-02415-A0F915F4; Sat, 03 Mar 2012 04:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1330749190!15908750!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20507 invoked from network); 3 Mar 2012 04:33:11 -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;
	3 Mar 2012 04:33: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 1S3geb-0004fZ-Px
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geb-0003JG-9Y
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:09 +0000
Message-Id: <E1S3geb-0003JG-9Y@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: remove sysctl.h from public
	interface
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID ba05ea3bf452ac9c5bb78f86f99ead38d581e590
# Parent  e439559f50eb284d05efd142c4322bef43c2e20b
libxl: remove sysctl.h from public interface

Using sysctl.h is restricted to "node control tools only" and requires magic
defines. Therefore make its use internal to libxl.

Also removes an indirect include of domctl.h which has the same restrction.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r e439559f50eb -r ba05ea3bf452 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -491,7 +491,7 @@
         }
         ptr = tmp;
         ptr[i].poolid = info->cpupool_id;
-        ptr[i].sched_id = info->sched_id;
+        ptr[i].sched = info->sched_id;
         ptr[i].n_dom = info->n_dom;
         if (libxl_cpumap_alloc(ctx, &ptr[i].cpumap)) {
             xc_cpupool_infofree(ctx->xch, info);
@@ -2750,7 +2750,10 @@
     physinfo->sharing_used_frames = xc_sharing_used_frames(ctx->xch);
     physinfo->nr_nodes = xcphysinfo.nr_nodes;
     memcpy(physinfo->hw_cap,xcphysinfo.hw_cap, sizeof(physinfo->hw_cap));
-    physinfo->phys_cap = xcphysinfo.capabilities;
+
+    physinfo->cap_hvm = !!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_hvm);
+    physinfo->cap_hvm_directio =
+        !!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_hvm_directio);
 
     return 0;
 }
@@ -2961,14 +2964,11 @@
     return rc;
 }
 
-/*
- * returns one of the XEN_SCHEDULER_* constants from public/domctl.h
- */
-int libxl_get_sched_id(libxl_ctx *ctx)
+libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx)
 {
-    int sched, ret;
-
-    if ((ret = xc_sched_id(ctx->xch, &sched)) != 0) {
+    libxl_scheduler sched, ret;
+
+    if ((ret = xc_sched_id(ctx->xch, (int *)&sched)) != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list");
         return ERROR_FAIL;
     }
@@ -3443,7 +3443,8 @@
     return 0;
 }
 
-int libxl_cpupool_create(libxl_ctx *ctx, const char *name, int schedid,
+int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
+                         libxl_scheduler sched,
                          libxl_cpumap cpumap, libxl_uuid *uuid,
                          uint32_t *poolid)
 {
@@ -3459,7 +3460,7 @@
         return ERROR_NOMEM;
     }
 
-    rc = xc_cpupool_create(ctx->xch, poolid, schedid);
+    rc = xc_cpupool_create(ctx->xch, poolid, sched);
     if (rc) {
         LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
            "Could not create cpupool");
diff -r e439559f50eb -r ba05ea3bf452 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
@@ -138,7 +138,6 @@
 #include <xentoollog.h>
 
 #include <xen/sched.h>
-#include <xen/sysctl.h>
 
 #include <libxl_uuid.h>
 #include <_libxl_list.h>
@@ -584,7 +583,7 @@
                                unsigned int max_vcpus, libxl_cpumap *cpumap);
 int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_cpumap *cpumap);
 
-int libxl_get_sched_id(libxl_ctx *ctx);
+libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx);
 
 
 int libxl_sched_credit_domain_get(libxl_ctx *ctx, uint32_t domid,
@@ -627,7 +626,8 @@
 int libxl_tmem_freeable(libxl_ctx *ctx);
 
 int libxl_get_freecpus(libxl_ctx *ctx, libxl_cpumap *cpumap);
-int libxl_cpupool_create(libxl_ctx *ctx, const char *name, int schedid,
+int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
+                         libxl_scheduler sched,
                          libxl_cpumap cpumap, libxl_uuid *uuid,
                          uint32_t *poolid);
 int libxl_cpupool_destroy(libxl_ctx *ctx, uint32_t poolid);
diff -r e439559f50eb -r ba05ea3bf452 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:13 2012 +0000
@@ -105,6 +105,14 @@
     (3, "ovmf"),
     ])
 
+# Consistent with values defined in domctl.h
+libxl_scheduler = Enumeration("scheduler", [
+    (4, "sedf"),
+    (5, "credit"),
+    (6, "credit2"),
+    (7, "arinc653"),
+    ])
+
 #
 # Complex libxl types
 #
@@ -164,7 +172,7 @@
 
 libxl_cpupoolinfo = Struct("cpupoolinfo", [
     ("poolid",      uint32),
-    ("sched_id",    uint32),
+    ("sched",       libxl_scheduler),
     ("n_dom",       uint32),
     ("cpumap",      libxl_cpumap)
     ])
@@ -388,7 +396,9 @@
 
     ("nr_nodes", uint32),
     ("hw_cap", libxl_hwcap),
-    ("phys_cap", uint32),
+
+    ("cap_hvm", bool),
+    ("cap_hvm_directio", bool),
     ], dispose_fn=None, dir=DIR_OUT)
 
 libxl_cputopology = Struct("cputopology", [
diff -r e439559f50eb -r ba05ea3bf452 tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/libxl/libxl_utils.c	Thu Mar 01 12:26:13 2012 +0000
@@ -19,18 +19,6 @@
 
 #include "libxl_internal.h"
 
-struct schedid_name {
-    char *name;
-    int id;
-};
-
-static struct schedid_name schedid_name[] = {
-    { "credit", XEN_SCHEDULER_CREDIT },
-    { "sedf", XEN_SCHEDULER_SEDF },
-    { "credit2", XEN_SCHEDULER_CREDIT2 },
-    { NULL, -1 }
-};
-
 const char *libxl_basename(const char *name)
 {
     const char *filename;
@@ -151,28 +139,6 @@
     return ret;
 }
 
-int libxl_name_to_schedid(libxl_ctx *ctx, const char *name)
-{
-    int i;
-
-    for (i = 0; schedid_name[i].name != NULL; i++)
-        if (strcmp(name, schedid_name[i].name) == 0)
-            return schedid_name[i].id;
-
-    return ERROR_INVAL;
-}
-
-char *libxl_schedid_to_name(libxl_ctx *ctx, int schedid)
-{
-    int i;
-
-    for (i = 0; schedid_name[i].name != NULL; i++)
-        if (schedid_name[i].id == schedid)
-            return schedid_name[i].name;
-
-    return "unknown";
-}
-
 int libxl_get_stubdom_id(libxl_ctx *ctx, int guest_domid)
 {
     GC_INIT(ctx);
diff -r e439559f50eb -r ba05ea3bf452 tools/libxl/libxl_utils.h
--- a/tools/libxl/libxl_utils.h	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/libxl/libxl_utils.h	Thu Mar 01 12:26:13 2012 +0000
@@ -24,8 +24,6 @@
 char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid);
 int libxl_name_to_cpupoolid(libxl_ctx *ctx, const char *name, uint32_t *poolid);
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid);
-int libxl_name_to_schedid(libxl_ctx *ctx, const char *name);
-char *libxl_schedid_to_name(libxl_ctx *ctx, int schedid);
 int libxl_get_stubdom_id(libxl_ctx *ctx, int guest_domid);
 int libxl_is_stubdom(libxl_ctx *ctx, uint32_t domid, uint32_t *target_domid);
 int libxl_create_logfile(libxl_ctx *ctx, char *name, char **full_name);
diff -r e439559f50eb -r ba05ea3bf452 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Feb 29 16:25:38 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:13 2012 +0000
@@ -3693,15 +3693,15 @@
 static void output_xeninfo(void)
 {
     const libxl_version_info *info;
-    int sched_id;
+    libxl_scheduler sched;
 
     if (!(info = libxl_get_version_info(ctx))) {
         fprintf(stderr, "libxl_get_version_info failed.\n");
         return;
     }
 
-    if ((sched_id = libxl_get_sched_id(ctx)) < 0) {
-        fprintf(stderr, "get_sched_id sysctl failed.\n");
+    if ((sched = libxl_get_scheduler(ctx)) < 0) {
+        fprintf(stderr, "get_scheduler sysctl failed.\n");
         return;
     }
 
@@ -3709,7 +3709,7 @@
     printf("xen_minor              : %d\n", info->xen_version_minor);
     printf("xen_extra              : %s\n", info->xen_version_extra);
     printf("xen_caps               : %s\n", info->capabilities);
-    printf("xen_scheduler          : %s\n", libxl_schedid_to_name(ctx, sched_id));
+    printf("xen_scheduler          : %s\n", libxl_scheduler_to_string(sched));
     printf("xen_pagesize           : %u\n", info->pagesize);
     printf("platform_params        : virt_start=0x%"PRIx64"\n", info->virt_start);
     printf("xen_changeset          : %s\n", info->changeset);
@@ -3757,9 +3757,9 @@
     for (i = 0; i < 8; i++)
         printf("%08x%c", info.hw_cap[i], i < 7 ? ':' : '\n');
     printf("virt_caps              :");
-    if (info.phys_cap & XEN_SYSCTL_PHYSCAP_hvm)
+    if (info.cap_hvm)
         printf(" hvm");
-    if (info.phys_cap & XEN_SYSCTL_PHYSCAP_hvm_directio)
+    if (info.cap_hvm_directio)
         printf(" hvm_directio");
     printf("\n");
     vinfo = libxl_get_version_info(ctx);
@@ -4065,7 +4065,7 @@
 }
 
 static int sched_domain_output(
-    uint32_t sched, int (*output)(int), const char *cpupool)
+    libxl_scheduler sched, int (*output)(int), const char *cpupool)
 {
     libxl_dominfo *info;
     libxl_cpupoolinfo *poolinfo = NULL;
@@ -4094,7 +4094,7 @@
     }
 
     for (p = 0; !rc && (p < n_pools); p++) {
-        if ((poolinfo[p].sched_id != sched) ||
+        if ((poolinfo[p].sched != sched) ||
             (cpupool && (poolid != poolinfo[p].poolid)))
             continue;
 
@@ -4175,7 +4175,7 @@
     }
 
     if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(XEN_SCHEDULER_CREDIT,
+        return -sched_domain_output(LIBXL_SCHEDULER_CREDIT,
                                     sched_credit_domain_output, cpupool);
     } else {
         find_domain(dom);
@@ -4251,7 +4251,7 @@
     }
 
     if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(XEN_SCHEDULER_CREDIT2,
+        return -sched_domain_output(LIBXL_SCHEDULER_CREDIT2,
                                     sched_credit2_domain_output, cpupool);
     } else {
         find_domain(dom);
@@ -4353,7 +4353,7 @@
     }
 
     if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(XEN_SCHEDULER_SEDF,
+        return -sched_domain_output(LIBXL_SCHEDULER_SEDF,
                                     sched_sedf_domain_output, cpupool);
     } else {
         find_domain(dom);
@@ -5292,9 +5292,8 @@
     XLU_Config *config;
     const char *buf;
     const char *name;
-    const char *sched;
     uint32_t poolid;
-    int schedid = -1;
+    libxl_scheduler sched = 0;
     XLU_ConfigList *cpus;
     XLU_ConfigList *nodes;
     int n_cpus, n_nodes, i, n;
@@ -5389,17 +5388,16 @@
     }
 
     if (!xlu_cfg_get_string (config, "sched", &buf, 0)) {
-        if ((schedid = libxl_name_to_schedid(ctx, buf)) < 0) {
+        if ((libxl_scheduler_from_string(buf, &sched)) < 0) {
             fprintf(stderr, "Unknown scheduler\n");
             return -ERROR_FAIL;
         }
     } else {
-        if ((schedid = libxl_get_sched_id(ctx)) < 0) {
-            fprintf(stderr, "get_sched_id sysctl failed.\n");
+        if ((sched = libxl_get_scheduler(ctx)) < 0) {
+            fprintf(stderr, "get_scheduler sysctl failed.\n");
             return -ERROR_FAIL;
         }
     }
-    sched = libxl_schedid_to_name(ctx, schedid);
 
     if (libxl_get_freecpus(ctx, &freemap)) {
         fprintf(stderr, "libxl_get_freecpus failed\n");
@@ -5467,14 +5465,14 @@
 
     printf("Using config file \"%s\"\n", filename);
     printf("cpupool name:   %s\n", name);
-    printf("scheduler:      %s\n", sched);
+    printf("scheduler:      %s\n", libxl_scheduler_to_string(sched));
     printf("number of cpus: %d\n", n_cpus);
 
     if (dryrun_only)
         return 0;
 
     poolid = 0;
-    if (libxl_cpupool_create(ctx, name, schedid, cpumap, &uuid, &poolid)) {
+    if (libxl_cpupool_create(ctx, name, sched, cpumap, &uuid, &poolid)) {
         fprintf(stderr, "error on creating cpupool\n");
         return -ERROR_FAIL;
     }
@@ -5559,7 +5557,7 @@
                     }
                 if (!opt_cpus) {
                     printf("%3d %9s       y       %4d", n,
-                           libxl_schedid_to_name(ctx, poolinfo[p].sched_id),
+                           libxl_scheduler_to_string(poolinfo[p].sched),
                            poolinfo[p].n_dom);
                 }
                 printf("\n");
@@ -5744,7 +5742,7 @@
     int c;
     int n;
     uint32_t poolid;
-    int schedid;
+    libxl_scheduler sched;
     int n_pools;
     int node;
     int n_cpus;
@@ -5765,7 +5763,7 @@
         return -ERROR_NOMEM;
     }
     poolid = poolinfo[0].poolid;
-    schedid = poolinfo[0].sched_id;
+    sched = poolinfo[0].sched;
     for (p = 0; p < n_pools; p++) {
         libxl_cpupoolinfo_dispose(poolinfo + p);
     }
@@ -5845,7 +5843,7 @@
         snprintf(name, 15, "Pool-node%d", node);
         libxl_uuid_generate(&uuid);
         poolid = 0;
-        ret = -libxl_cpupool_create(ctx, name, schedid, cpumap, &uuid, &poolid);
+        ret = -libxl_cpupool_create(ctx, name, sched, cpumap, &uuid, &poolid);
         if (ret) {
             fprintf(stderr, "error on creating cpupool\n");
             goto out;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gek-0000CU-V2; Sat, 03 Mar 2012 04:33: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 1S3gej-0000B5-2x
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:17 +0000
Received: from [85.158.143.35:28650] by server-1.bemta-4.messagelabs.com id
	F7/B9-20925-C0F915F4; Sat, 03 Mar 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1330749194!11841185!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4811 invoked from network); 3 Mar 2012 04:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geg-0004fx-2D
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geg-0003NS-0L
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:14 +0000
Message-Id: <E1S3geg-0003NS-0L@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: drop 8M slack for PV guests.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID 0f0f126f4a99a35a89f6136c74a046ababfd7645
# Parent  2d194ff3b459c9e5a8d2adc499f69fd840814bd7
libxl: drop 8M slack for PV guests.

This serves no purpose. It relates to the old 8M to "account for backend
allocations" which we used to add. This leaves a bit of unpopulated space in
the Pseudo-physical address space which can be used by backends when mapping
foreign memory. However 8M is not representative of that any more and modern
kernels do not operate in this way anyway.

I suspect an argument could be made for removing this from the libxl API
altogether but instead lets just set the overhead to 0.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 2d194ff3b459 -r 0f0f126f4a99 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
@@ -108,7 +108,7 @@
         b_info->u.hvm.xen_platform_pci = 1;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
-        b_info->u.pv.slack_memkb = 8 * 1024;
+        b_info->u.pv.slack_memkb = 0;
         break;
     default:
         abort();

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gen-0000Et-LR; Sat, 03 Mar 2012 04:33: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 1S3gem-0000Dd-Mw
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:21 +0000
Received: from [85.158.139.83:18856] by server-3.bemta-5.messagelabs.com id
	D0/02-25237-F0F915F4; Sat, 03 Mar 2012 04:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1330749197!13726940!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8025 invoked from network); 3 Mar 2012 04:33:18 -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 Mar 2012 04:33: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 1S3gei-0004gC-Uf
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gei-0003Q5-TN
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:16 +0000
Message-Id: <E1S3gei-0003Q5-TN@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: make libxl_device_console
	internal
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID d36443bc098c28c2649f3e494ae6f44722870261
# Parent  e5bc6847f24882143b71318e2683772f4f34251e
libxl: make libxl_device_console internal

consoles are not directly exposed to users of the library and there are no API
functions for manipluating them (only the console_exec function). Rather than
commit to a particular API now make the type internal.

When a user does come along it is much easier to add a completely new API
rather than to fix an existing broken one. It's easier to do this in a manner
which users of the library can cope with in a compatible way e.g. adding a new
API is easier to check for with ./configure.

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


diff -r e5bc6847f248 -r d36443bc098c tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -2023,7 +2023,7 @@
 
 /******************************************************************************/
 int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
-                              libxl_device_console *console,
+                              libxl__device_console *console,
                               libxl__domain_build_state *state)
 {
     flexarray_t *front;
@@ -2070,7 +2070,7 @@
     flexarray_append(front, "limit");
     flexarray_append(front, libxl__sprintf(gc, "%d", LIBXL_XENCONSOLE_LIMIT));
     flexarray_append(front, "type");
-    if (console->consback == LIBXL_CONSOLE_BACKEND_XENCONSOLED)
+    if (console->consback == LIBXL__CONSOLE_BACKEND_XENCONSOLED)
         flexarray_append(front, "xenconsoled");
     else
         flexarray_append(front, "ioemu");
diff -r e5bc6847f248 -r d36443bc098c tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
@@ -177,17 +177,16 @@
     return 0;
 }
 
-static int init_console_info(libxl_device_console *console, int dev_num)
+static int init_console_info(libxl__device_console *console, int dev_num)
 {
-    memset(console, 0x00, sizeof(libxl_device_console));
+    memset(console, 0x00, sizeof(libxl__device_console));
     console->devid = dev_num;
-    console->consback = LIBXL_CONSOLE_BACKEND_XENCONSOLED;
+    console->consback = LIBXL__CONSOLE_BACKEND_XENCONSOLED;
     console->output = strdup("pty");
-    if ( NULL == console->output )
+    if (!console->output)
         return ERROR_NOMEM;
     return 0;
 }
-
 int libxl__domain_build(libxl__gc *gc,
                         libxl_domain_build_info *info,
                         uint32_t domid,
@@ -586,14 +585,14 @@
     switch (d_config->c_info.type) {
     case LIBXL_DOMAIN_TYPE_HVM:
     {
-        libxl_device_console console;
+        libxl__device_console console;
         libxl_device_vkb vkb;
 
         ret = init_console_info(&console, 0);
         if ( ret )
             goto error_out;
         libxl__device_console_add(gc, domid, &console, &state);
-        libxl_device_console_dispose(&console);
+        libxl__device_console_dispose(&console);
 
         libxl_device_vkb_init(&vkb);
         libxl_device_vkb_add(ctx, domid, &vkb);
@@ -611,7 +610,7 @@
     case LIBXL_DOMAIN_TYPE_PV:
     {
         int need_qemu = 0;
-        libxl_device_console console;
+        libxl__device_console console;
 
         for (i = 0; i < d_config->num_vfbs; i++) {
             libxl_device_vfb_add(ctx, domid, &d_config->vfbs[i]);
@@ -627,10 +626,10 @@
                 d_config->num_disks, &d_config->disks[0]);
 
         if (need_qemu)
-             console.consback = LIBXL_CONSOLE_BACKEND_IOEMU;
+             console.consback = LIBXL__CONSOLE_BACKEND_IOEMU;
 
         libxl__device_console_add(gc, domid, &console, &state);
-        libxl_device_console_dispose(&console);
+        libxl__device_console_dispose(&console);
 
         if (need_qemu) {
             libxl__create_xenpv_qemu(gc, domid, d_config, &state, &dm_starting);
diff -r e5bc6847f248 -r d36443bc098c tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:14 2012 +0000
@@ -688,7 +688,7 @@
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     int i, num_console = STUBDOM_SPECIAL_CONSOLES, ret;
-    libxl_device_console *console;
+    libxl__device_console *console;
     libxl_domain_config dm_config;
     libxl_device_vfb vfb;
     libxl_device_vkb vkb;
@@ -820,7 +820,7 @@
     if (guest_config->b_info.u.hvm.serial)
         num_console++;
 
-    console = libxl__calloc(gc, num_console, sizeof(libxl_device_console));
+    console = libxl__calloc(gc, num_console, sizeof(libxl__device_console));
     if (!console) {
         ret = ERROR_NOMEM;
         goto out_free;
@@ -828,7 +828,7 @@
 
     for (i = 0; i < num_console; i++) {
         console[i].devid = i;
-        console[i].consback = LIBXL_CONSOLE_BACKEND_IOEMU;
+        console[i].consback = LIBXL__CONSOLE_BACKEND_IOEMU;
         /* STUBDOM_CONSOLE_LOGGING (console 0) is for minios logging
          * STUBDOM_CONSOLE_SAVE (console 1) is for writing the save file
          * STUBDOM_CONSOLE_RESTORE (console 2) is for reading the save file
@@ -1092,7 +1092,7 @@
 }
 
 int libxl__need_xenpv_qemu(libxl__gc *gc,
-        int nr_consoles, libxl_device_console *consoles,
+        int nr_consoles, libxl__device_console *consoles,
         int nr_vfbs, libxl_device_vfb *vfbs,
         int nr_disks, libxl_device_disk *disks)
 {
@@ -1104,7 +1104,7 @@
     }
 
     for (i = 0; i < nr_consoles; i++) {
-        if (consoles[i].consback == LIBXL_CONSOLE_BACKEND_IOEMU) {
+        if (consoles[i].consback == LIBXL__CONSOLE_BACKEND_IOEMU) {
             ret = 1;
             goto out;
         }
diff -r e5bc6847f248 -r d36443bc098c tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
@@ -661,7 +661,7 @@
                                           int *pdisk, int *ppartition);
 
 _hidden int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
-                                      libxl_device_console *console,
+                                      libxl__device_console *console,
                                       libxl__domain_build_state *state);
 
 _hidden int libxl__device_generic_add(libxl__gc *gc, libxl__device *device,
@@ -904,7 +904,7 @@
                               libxl__domain_build_state *state,
                               libxl__spawner_starting **starting_r);
 _hidden int libxl__need_xenpv_qemu(libxl__gc *gc,
-        int nr_consoles, libxl_device_console *consoles,
+        int nr_consoles, libxl__device_console *consoles,
         int nr_vfbs, libxl_device_vfb *vfbs,
         int nr_disks, libxl_device_disk *disks);
   /* Caller must either: pass starting_r==0, or on successful
diff -r e5bc6847f248 -r d36443bc098c tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
@@ -42,11 +42,6 @@
     (2, "PV"),
     ])
 
-libxl_console_backend = Enumeration("console_backend", [
-    (1, "XENCONSOLED"),
-    (2, "IOEMU"),
-    ])
-
 libxl_disk_format = Enumeration("disk_format", [
     (0, "UNKNOWN"),
     (1, "QCOW"),
@@ -319,13 +314,6 @@
     ("devid", integer),
     ])
 
-libxl_device_console = Struct("device_console", [
-    ("backend_domid", libxl_domid),
-    ("devid", integer),
-    ("consback", libxl_console_backend),
-    ("output", string),
-    ])
-
 libxl_device_disk = Struct("device_disk", [
     ("backend_domid", libxl_domid),
     ("pdev_path", string),
diff -r e5bc6847f248 -r d36443bc098c tools/libxl/libxl_types_internal.idl
--- a/tools/libxl/libxl_types_internal.idl	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_types_internal.idl	Thu Mar 01 12:26:14 2012 +0000
@@ -1,5 +1,7 @@
 namespace("libxl__")
 
+libxl_domid = Builtin("domid", namespace="libxl_", json_fn = "yajl_gen_integer")
+
 libxl__qmp_message_type = Enumeration("qmp_message_type", [
     (1, "QMP"),
     (2, "return"),
@@ -17,3 +19,15 @@
     (6, "VKBD"),
     (7, "CONSOLE"),
     ])
+
+libxl__console_backend = Enumeration("console_backend", [
+    (1, "XENCONSOLED"),
+    (2, "IOEMU"),
+    ])
+
+libxl__device_console = Struct("device_console", [
+    ("backend_domid", libxl_domid),
+    ("devid", integer),
+    ("consback", libxl__console_backend),
+    ("output", string),
+    ])

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gek-0000CU-V2; Sat, 03 Mar 2012 04:33: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 1S3gej-0000B5-2x
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:17 +0000
Received: from [85.158.143.35:28650] by server-1.bemta-4.messagelabs.com id
	F7/B9-20925-C0F915F4; Sat, 03 Mar 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1330749194!11841185!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4811 invoked from network); 3 Mar 2012 04:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geg-0004fx-2D
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geg-0003NS-0L
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:14 +0000
Message-Id: <E1S3geg-0003NS-0L@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: drop 8M slack for PV guests.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID 0f0f126f4a99a35a89f6136c74a046ababfd7645
# Parent  2d194ff3b459c9e5a8d2adc499f69fd840814bd7
libxl: drop 8M slack for PV guests.

This serves no purpose. It relates to the old 8M to "account for backend
allocations" which we used to add. This leaves a bit of unpopulated space in
the Pseudo-physical address space which can be used by backends when mapping
foreign memory. However 8M is not representative of that any more and modern
kernels do not operate in this way anyway.

I suspect an argument could be made for removing this from the libxl API
altogether but instead lets just set the overhead to 0.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 2d194ff3b459 -r 0f0f126f4a99 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
@@ -108,7 +108,7 @@
         b_info->u.hvm.xen_platform_pci = 1;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
-        b_info->u.pv.slack_memkb = 8 * 1024;
+        b_info->u.pv.slack_memkb = 0;
         break;
     default:
         abort();

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gel-0000Cd-1Y; Sat, 03 Mar 2012 04:33: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 1S3gej-0000B5-Gd
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:17 +0000
Received: from [85.158.143.35:62719] by server-1.bemta-4.messagelabs.com id
	4A/B9-20925-C0F915F4; Sat, 03 Mar 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1330749194!9946764!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27146 invoked from network); 3 Mar 2012 04:33:15 -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;
	3 Mar 2012 04:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gef-0004fu-MF
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gef-0003Mx-Ek
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:13 +0000
Message-Id: <E1S3gef-0003Mx-Ek@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: use an explicit
	LIBXL_TIMER_MODE_DEFAULT value
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID 2d194ff3b459c9e5a8d2adc499f69fd840814bd7
# Parent  f791c5db01a89f205cda78cf868e2889caa52ed2
libxl: use an explicit LIBXL_TIMER_MODE_DEFAULT value

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


diff -r f791c5db01a8 -r 2d194ff3b459 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
@@ -245,7 +245,7 @@
 
 typedef struct libxl__ctx libxl_ctx;
 
-#define LIBXL_TIMER_MODE_DEFAULT LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS
+#define LIBXL_TIMER_MODE_DEFAULT -1
 
 #include "_libxl_types.h"
 
diff -r f791c5db01a8 -r 2d194ff3b459 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:13 2012 +0000
@@ -94,7 +94,7 @@
         b_info->u.hvm.viridian = 0;
         b_info->u.hvm.hpet = 1;
         b_info->u.hvm.vpt_align = 1;
-        b_info->u.hvm.timer_mode = 1;
+        b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
         b_info->u.hvm.nested_hvm = 0;
         b_info->u.hvm.no_incr_generationid = 0;
 
@@ -135,6 +135,10 @@
 
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
+        if (b_info->u.hvm.timer_mode == LIBXL_TIMER_MODE_DEFAULT)
+            b_info->u.hvm.timer_mode =
+                LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS;
+
         if (!b_info->u.hvm.boot) {
             b_info->u.hvm.boot = strdup("cda");
             if (!b_info->u.hvm.boot) return ERROR_NOMEM;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gem-0000E5-FL; Sat, 03 Mar 2012 04:33:20 +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 1S3gel-0000AS-Dj
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:19 +0000
Received: from [85.158.139.83:61887] by server-4.bemta-5.messagelabs.com id
	69/FB-10788-F0F915F4; Sat, 03 Mar 2012 04:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1330749196!17673479!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12374 invoked from network); 3 Mar 2012 04:33:17 -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;
	3 Mar 2012 04:33: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 1S3gei-0004g9-Cr
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gei-0003PZ-Ba
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:16 +0000
Message-Id: <E1S3gei-0003PZ-Ba@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: vfb/vkb: use _init/_setdefault
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID e5bc6847f24882143b71318e2683772f4f34251e
# Parent  bc49dfa119baa61a9fa22d44e26191f8d0fc24f6
libxl: vfb/vkb: use _init/_setdefault

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r bc49dfa119ba -r e5bc6847f248 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -2101,9 +2101,13 @@
 }
 
 /******************************************************************************/
-int libxl_device_vkb_init(libxl_ctx *ctx, libxl_device_vkb *vkb)
+void libxl_device_vkb_init(libxl_device_vkb *vkb)
 {
     memset(vkb, 0x00, sizeof(libxl_device_vkb));
+}
+
+int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb)
+{
     return 0;
 }
 
@@ -2129,6 +2133,9 @@
     libxl__device device;
     int rc;
 
+    rc = libxl__device_vkb_setdefault(gc, vkb);
+    if (rc) goto out;
+
     front = flexarray_make(16, 1);
     if (!front) {
         rc = ERROR_NOMEM;
@@ -2206,12 +2213,11 @@
 }
 
 /******************************************************************************/
-int libxl_device_vfb_init(libxl_ctx *ctx, libxl_device_vfb *vfb)
+void libxl_device_vfb_init(libxl_device_vfb *vfb)
 {
     memset(vfb, 0x00, sizeof(libxl_device_vfb));
     vfb->vnc.enable = 1;
     vfb->vnc.passwd = NULL;
-    vfb->vnc.listen = strdup("127.0.0.1");
     vfb->vnc.display = 0;
     vfb->vnc.findunused = 1;
     vfb->keymap = NULL;
@@ -2219,6 +2225,15 @@
     vfb->sdl.opengl = 0;
     vfb->sdl.display = NULL;
     vfb->sdl.xauthority = NULL;
+}
+
+int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb)
+{
+    if (!vfb->vnc.listen) {
+        vfb->vnc.listen = strdup("127.0.0.1");
+        if (!vfb->vnc.listen) return ERROR_NOMEM;
+    }
+
     return 0;
 }
 
@@ -2243,6 +2258,9 @@
     libxl__device device;
     int rc;
 
+    rc = libxl__device_vfb_setdefault(gc, vfb);
+    if (rc) goto out;
+
     front = flexarray_make(16, 1);
     if (!front) {
         rc = ERROR_NOMEM;
diff -r bc49dfa119ba -r e5bc6847f248 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
@@ -536,7 +536,7 @@
                               libxl_device_nic *nic, libxl_nicinfo *nicinfo);
 
 /* Keyboard */
-int libxl_device_vkb_init(libxl_ctx *ctx, libxl_device_vkb *vkb);
+void libxl_device_vkb_init(libxl_device_vkb *vkb);
 int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
 int libxl_device_vkb_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_vkb *vkb,
@@ -544,7 +544,7 @@
 int libxl_device_vkb_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
 
 /* Framebuffer */
-int libxl_device_vfb_init(libxl_ctx *ctx, libxl_device_vfb *vfb);
+void libxl_device_vfb_init(libxl_device_vfb *vfb);
 int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb);
 int libxl_device_vfb_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_vfb *vfb,
diff -r bc49dfa119ba -r e5bc6847f248 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
@@ -595,9 +595,7 @@
         libxl__device_console_add(gc, domid, &console, &state);
         libxl_device_console_dispose(&console);
 
-        ret = libxl_device_vkb_init(ctx, &vkb);
-        if ( ret )
-            goto error_out;
+        libxl_device_vkb_init(&vkb);
         libxl_device_vkb_add(ctx, domid, &vkb);
         libxl_device_vkb_dispose(&vkb);
 
diff -r bc49dfa119ba -r e5bc6847f248 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:14 2012 +0000
@@ -616,8 +616,8 @@
     if (b_info->type != LIBXL_DOMAIN_TYPE_HVM)
         return ERROR_INVAL;
 
-    memset(vfb, 0x00, sizeof(libxl_device_vfb));
-    memset(vkb, 0x00, sizeof(libxl_device_vkb));
+    libxl_device_vfb_init(vfb);
+    libxl_device_vkb_init(vkb);
 
     vfb->backend_domid = 0;
     vfb->devid = 0;
diff -r bc49dfa119ba -r e5bc6847f248 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
@@ -194,6 +194,8 @@
 _hidden int libxl__device_disk_setdefault(libxl__gc *gc,
                                           libxl_device_disk *disk);
 _hidden int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic);
+_hidden int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb);
+_hidden int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb);
 
 struct libxl__evgen_domain_death {
     uint32_t domid;
diff -r bc49dfa119ba -r e5bc6847f248 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -940,12 +940,12 @@
 
             d_config->vfbs = (libxl_device_vfb *) realloc(d_config->vfbs, sizeof(libxl_device_vfb) * (d_config->num_vfbs + 1));
             vfb = d_config->vfbs + d_config->num_vfbs;
-            libxl_device_vfb_init(ctx, vfb);
+            libxl_device_vfb_init(vfb);
             vfb->devid = d_config->num_vfbs;
 
             d_config->vkbs = (libxl_device_vkb *) realloc(d_config->vkbs, sizeof(libxl_device_vkb) * (d_config->num_vkbs + 1));
             vkb = d_config->vkbs + d_config->num_vkbs;
-            libxl_device_vkb_init(ctx, vkb);
+            libxl_device_vkb_init(vkb);
             vkb->devid = d_config->num_vkbs;
 
             p = strtok(buf2, ",");

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gen-0000Eo-IU; Sat, 03 Mar 2012 04:33:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gem-0000B5-D1
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:20 +0000
Received: from [85.158.143.99:30597] by server-1.bemta-4.messagelabs.com id
	6F/B9-20925-01F915F4; Sat, 03 Mar 2012 04:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1330749197!17391916!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2762 invoked from network); 3 Mar 2012 04:33:18 -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;
	3 Mar 2012 04:33: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 1S3gej-0004gF-Gj
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gej-0003Qa-FT
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:17 +0000
Message-Id: <E1S3gej-0003Qa-FT@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: pci: use _init/_setdefault
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID a207b589a972a9168ef53d24035ce48b6adffa49
# Parent  d36443bc098c28c2649f3e494ae6f44722870261
libxl: pci: use _init/_setdefault

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d36443bc098c -r a207b589a972 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
@@ -552,7 +552,7 @@
 int libxl_device_vfb_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb);
 
 /* PCI Passthrough */
-int libxl_device_pci_init(libxl_ctx *ctx, libxl_device_pci *pci);
+void libxl_device_pci_init(libxl_device_pci *pci);
 int libxl_device_pci_add(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
 int libxl_device_pci_remove(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
 int libxl_device_pci_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
diff -r d36443bc098c -r a207b589a972 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
@@ -196,6 +196,7 @@
 _hidden int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic);
 _hidden int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb);
 _hidden int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb);
+_hidden int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci);
 
 struct libxl__evgen_domain_death {
     uint32_t domid;
diff -r d36443bc098c -r a207b589a972 tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_pci.c	Thu Mar 01 12:26:14 2012 +0000
@@ -765,6 +765,16 @@
     return -1;
 }
 
+void libxl_device_pci_init(libxl_device_pci *pci)
+{
+    memset(pci, '\0', sizeof(*pci));
+}
+
+int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci)
+{
+    return 0;
+}
+
 int libxl_device_pci_add(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev)
 {
     GC_INIT(ctx);
@@ -782,6 +792,9 @@
     int num_assigned, i, rc;
     int stubdomid = 0;
 
+    rc = libxl__device_pci_setdefault(gc, pcidev);
+    if (rc) goto out;
+
     rc = get_all_assigned_devices(gc, &assigned, &num_assigned);
     if ( rc ) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot determine if device is assigned, refusing to continue");
diff -r d36443bc098c -r a207b589a972 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -1021,7 +1021,7 @@
 
             d_config->pcidevs = (libxl_device_pci *) realloc(d_config->pcidevs, sizeof (libxl_device_pci) * (d_config->num_pcidevs + 1));
             pcidev = d_config->pcidevs + d_config->num_pcidevs;
-            memset(pcidev, 0x00, sizeof(libxl_device_pci));
+            libxl_device_pci_init(pcidev);
 
             pcidev->msitranslate = pci_msitranslate;
             pcidev->power_mgmt = pci_power_mgmt;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gem-0000E5-FL; Sat, 03 Mar 2012 04:33:20 +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 1S3gel-0000AS-Dj
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:19 +0000
Received: from [85.158.139.83:61887] by server-4.bemta-5.messagelabs.com id
	69/FB-10788-F0F915F4; Sat, 03 Mar 2012 04:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1330749196!17673479!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12374 invoked from network); 3 Mar 2012 04:33:17 -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;
	3 Mar 2012 04:33: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 1S3gei-0004g9-Cr
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gei-0003PZ-Ba
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:16 +0000
Message-Id: <E1S3gei-0003PZ-Ba@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: vfb/vkb: use _init/_setdefault
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID e5bc6847f24882143b71318e2683772f4f34251e
# Parent  bc49dfa119baa61a9fa22d44e26191f8d0fc24f6
libxl: vfb/vkb: use _init/_setdefault

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r bc49dfa119ba -r e5bc6847f248 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -2101,9 +2101,13 @@
 }
 
 /******************************************************************************/
-int libxl_device_vkb_init(libxl_ctx *ctx, libxl_device_vkb *vkb)
+void libxl_device_vkb_init(libxl_device_vkb *vkb)
 {
     memset(vkb, 0x00, sizeof(libxl_device_vkb));
+}
+
+int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb)
+{
     return 0;
 }
 
@@ -2129,6 +2133,9 @@
     libxl__device device;
     int rc;
 
+    rc = libxl__device_vkb_setdefault(gc, vkb);
+    if (rc) goto out;
+
     front = flexarray_make(16, 1);
     if (!front) {
         rc = ERROR_NOMEM;
@@ -2206,12 +2213,11 @@
 }
 
 /******************************************************************************/
-int libxl_device_vfb_init(libxl_ctx *ctx, libxl_device_vfb *vfb)
+void libxl_device_vfb_init(libxl_device_vfb *vfb)
 {
     memset(vfb, 0x00, sizeof(libxl_device_vfb));
     vfb->vnc.enable = 1;
     vfb->vnc.passwd = NULL;
-    vfb->vnc.listen = strdup("127.0.0.1");
     vfb->vnc.display = 0;
     vfb->vnc.findunused = 1;
     vfb->keymap = NULL;
@@ -2219,6 +2225,15 @@
     vfb->sdl.opengl = 0;
     vfb->sdl.display = NULL;
     vfb->sdl.xauthority = NULL;
+}
+
+int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb)
+{
+    if (!vfb->vnc.listen) {
+        vfb->vnc.listen = strdup("127.0.0.1");
+        if (!vfb->vnc.listen) return ERROR_NOMEM;
+    }
+
     return 0;
 }
 
@@ -2243,6 +2258,9 @@
     libxl__device device;
     int rc;
 
+    rc = libxl__device_vfb_setdefault(gc, vfb);
+    if (rc) goto out;
+
     front = flexarray_make(16, 1);
     if (!front) {
         rc = ERROR_NOMEM;
diff -r bc49dfa119ba -r e5bc6847f248 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
@@ -536,7 +536,7 @@
                               libxl_device_nic *nic, libxl_nicinfo *nicinfo);
 
 /* Keyboard */
-int libxl_device_vkb_init(libxl_ctx *ctx, libxl_device_vkb *vkb);
+void libxl_device_vkb_init(libxl_device_vkb *vkb);
 int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
 int libxl_device_vkb_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_vkb *vkb,
@@ -544,7 +544,7 @@
 int libxl_device_vkb_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
 
 /* Framebuffer */
-int libxl_device_vfb_init(libxl_ctx *ctx, libxl_device_vfb *vfb);
+void libxl_device_vfb_init(libxl_device_vfb *vfb);
 int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb);
 int libxl_device_vfb_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_vfb *vfb,
diff -r bc49dfa119ba -r e5bc6847f248 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
@@ -595,9 +595,7 @@
         libxl__device_console_add(gc, domid, &console, &state);
         libxl_device_console_dispose(&console);
 
-        ret = libxl_device_vkb_init(ctx, &vkb);
-        if ( ret )
-            goto error_out;
+        libxl_device_vkb_init(&vkb);
         libxl_device_vkb_add(ctx, domid, &vkb);
         libxl_device_vkb_dispose(&vkb);
 
diff -r bc49dfa119ba -r e5bc6847f248 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:14 2012 +0000
@@ -616,8 +616,8 @@
     if (b_info->type != LIBXL_DOMAIN_TYPE_HVM)
         return ERROR_INVAL;
 
-    memset(vfb, 0x00, sizeof(libxl_device_vfb));
-    memset(vkb, 0x00, sizeof(libxl_device_vkb));
+    libxl_device_vfb_init(vfb);
+    libxl_device_vkb_init(vkb);
 
     vfb->backend_domid = 0;
     vfb->devid = 0;
diff -r bc49dfa119ba -r e5bc6847f248 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
@@ -194,6 +194,8 @@
 _hidden int libxl__device_disk_setdefault(libxl__gc *gc,
                                           libxl_device_disk *disk);
 _hidden int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic);
+_hidden int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb);
+_hidden int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb);
 
 struct libxl__evgen_domain_death {
     uint32_t domid;
diff -r bc49dfa119ba -r e5bc6847f248 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -940,12 +940,12 @@
 
             d_config->vfbs = (libxl_device_vfb *) realloc(d_config->vfbs, sizeof(libxl_device_vfb) * (d_config->num_vfbs + 1));
             vfb = d_config->vfbs + d_config->num_vfbs;
-            libxl_device_vfb_init(ctx, vfb);
+            libxl_device_vfb_init(vfb);
             vfb->devid = d_config->num_vfbs;
 
             d_config->vkbs = (libxl_device_vkb *) realloc(d_config->vkbs, sizeof(libxl_device_vkb) * (d_config->num_vkbs + 1));
             vkb = d_config->vkbs + d_config->num_vkbs;
-            libxl_device_vkb_init(ctx, vkb);
+            libxl_device_vkb_init(vkb);
             vkb->devid = d_config->num_vkbs;
 
             p = strtok(buf2, ",");

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gel-0000Cd-1Y; Sat, 03 Mar 2012 04:33: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 1S3gej-0000B5-Gd
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:17 +0000
Received: from [85.158.143.35:62719] by server-1.bemta-4.messagelabs.com id
	4A/B9-20925-C0F915F4; Sat, 03 Mar 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1330749194!9946764!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27146 invoked from network); 3 Mar 2012 04:33:15 -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;
	3 Mar 2012 04:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gef-0004fu-MF
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gef-0003Mx-Ek
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:13 +0000
Message-Id: <E1S3gef-0003Mx-Ek@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: use an explicit
	LIBXL_TIMER_MODE_DEFAULT value
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604773 0
# Node ID 2d194ff3b459c9e5a8d2adc499f69fd840814bd7
# Parent  f791c5db01a89f205cda78cf868e2889caa52ed2
libxl: use an explicit LIBXL_TIMER_MODE_DEFAULT value

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


diff -r f791c5db01a8 -r 2d194ff3b459 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:13 2012 +0000
@@ -245,7 +245,7 @@
 
 typedef struct libxl__ctx libxl_ctx;
 
-#define LIBXL_TIMER_MODE_DEFAULT LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS
+#define LIBXL_TIMER_MODE_DEFAULT -1
 
 #include "_libxl_types.h"
 
diff -r f791c5db01a8 -r 2d194ff3b459 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:13 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:13 2012 +0000
@@ -94,7 +94,7 @@
         b_info->u.hvm.viridian = 0;
         b_info->u.hvm.hpet = 1;
         b_info->u.hvm.vpt_align = 1;
-        b_info->u.hvm.timer_mode = 1;
+        b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
         b_info->u.hvm.nested_hvm = 0;
         b_info->u.hvm.no_incr_generationid = 0;
 
@@ -135,6 +135,10 @@
 
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
+        if (b_info->u.hvm.timer_mode == LIBXL_TIMER_MODE_DEFAULT)
+            b_info->u.hvm.timer_mode =
+                LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS;
+
         if (!b_info->u.hvm.boot) {
             b_info->u.hvm.boot = strdup("cda");
             if (!b_info->u.hvm.boot) return ERROR_NOMEM;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gen-0000Eo-IU; Sat, 03 Mar 2012 04:33:21 +0000
Received: from mail6.bemta4.messagelabs.com ([85.158.143.247])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gem-0000B5-D1
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:20 +0000
Received: from [85.158.143.99:30597] by server-1.bemta-4.messagelabs.com id
	6F/B9-20925-01F915F4; Sat, 03 Mar 2012 04:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1330749197!17391916!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2762 invoked from network); 3 Mar 2012 04:33:18 -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;
	3 Mar 2012 04:33: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 1S3gej-0004gF-Gj
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gej-0003Qa-FT
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:17 +0000
Message-Id: <E1S3gej-0003Qa-FT@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: pci: use _init/_setdefault
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID a207b589a972a9168ef53d24035ce48b6adffa49
# Parent  d36443bc098c28c2649f3e494ae6f44722870261
libxl: pci: use _init/_setdefault

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d36443bc098c -r a207b589a972 tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
@@ -552,7 +552,7 @@
 int libxl_device_vfb_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb);
 
 /* PCI Passthrough */
-int libxl_device_pci_init(libxl_ctx *ctx, libxl_device_pci *pci);
+void libxl_device_pci_init(libxl_device_pci *pci);
 int libxl_device_pci_add(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
 int libxl_device_pci_remove(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
 int libxl_device_pci_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
diff -r d36443bc098c -r a207b589a972 tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:26:14 2012 +0000
@@ -196,6 +196,7 @@
 _hidden int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic);
 _hidden int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb);
 _hidden int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb);
+_hidden int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci);
 
 struct libxl__evgen_domain_death {
     uint32_t domid;
diff -r d36443bc098c -r a207b589a972 tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_pci.c	Thu Mar 01 12:26:14 2012 +0000
@@ -765,6 +765,16 @@
     return -1;
 }
 
+void libxl_device_pci_init(libxl_device_pci *pci)
+{
+    memset(pci, '\0', sizeof(*pci));
+}
+
+int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci)
+{
+    return 0;
+}
+
 int libxl_device_pci_add(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev)
 {
     GC_INIT(ctx);
@@ -782,6 +792,9 @@
     int num_assigned, i, rc;
     int stubdomid = 0;
 
+    rc = libxl__device_pci_setdefault(gc, pcidev);
+    if (rc) goto out;
+
     rc = get_all_assigned_devices(gc, &assigned, &num_assigned);
     if ( rc ) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot determine if device is assigned, refusing to continue");
diff -r d36443bc098c -r a207b589a972 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -1021,7 +1021,7 @@
 
             d_config->pcidevs = (libxl_device_pci *) realloc(d_config->pcidevs, sizeof (libxl_device_pci) * (d_config->num_pcidevs + 1));
             pcidev = d_config->pcidevs + d_config->num_pcidevs;
-            memset(pcidev, 0x00, sizeof(libxl_device_pci));
+            libxl_device_pci_init(pcidev);
 
             pcidev->msitranslate = pci_msitranslate;
             pcidev->power_mgmt = pci_power_mgmt;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gep-0000JB-Tv; Sat, 03 Mar 2012 04:33: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 1S3gen-0000ET-Ic
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:21 +0000
Received: from [85.158.143.35:28736] by server-2.bemta-4.messagelabs.com id
	C4/8D-17550-01F915F4; Sat, 03 Mar 2012 04:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1330749198!9946770!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27232 invoked from network); 3 Mar 2012 04:33:19 -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;
	3 Mar 2012 04:33: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 1S3gek-0004gI-3c
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gek-0003R6-2G
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:18 +0000
Message-Id: <E1S3gek-0003R6-2G@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: add new "defbool" built in
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID 2aae04f3240cfc43ab31073ac6f5a4f2a702b80c
# Parent  a207b589a972a9168ef53d24035ce48b6adffa49
libxl: add new "defbool" built in type.

This type is a but like a "boolean" but with a third state "default" (so really
I suppose it's a tristate).

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


diff -r a207b589a972 -r 2aae04f3240c tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/gentest.py	Thu Mar 01 12:26:14 2012 +0000
@@ -20,7 +20,8 @@
 def randomize_enum(e):
     return random.choice([v.name for v in e.values])
 
-handcoded = ["libxl_cpumap", "libxl_key_value_list",
+handcoded = ["libxl_defbool", # Temp until a user appears in the next patch
+             "libxl_cpumap", "libxl_key_value_list",
              "libxl_cpuid_policy_list", "libxl_file_reference",
              "libxl_string_list"]
 
@@ -55,6 +56,8 @@
               ty.pass_arg(v, parent is None))
     elif ty.typename in ["bool"]:
         s += "%s = rand() %% 2;\n" % v
+    elif ty.typename in ["libxl_defbool"]:
+        s += "libxl_defbool_set(%s, !!rand() %% 1);\n" % v
     elif ty.typename in ["char *"]:
         s += "%s = rand_str();\n" % v
     elif ty.private:
diff -r a207b589a972 -r 2aae04f3240c tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -184,6 +184,47 @@
     free(kvl);
 }
 
+#define LIBXL__DEFBOOL_DEFAULT (0)
+#define LIBXL__DEFBOOL_FALSE (-1)
+#define LIBXL__DEFBOOL_TRUE (1)
+
+void libxl_defbool_set(libxl_defbool *db, bool b)
+{
+    db->val = b ? LIBXL__DEFBOOL_TRUE : LIBXL__DEFBOOL_FALSE;
+}
+
+void libxl_defbool_unset(libxl_defbool *db)
+{
+    db->val = LIBXL__DEFBOOL_DEFAULT;
+}
+
+bool libxl_defbool_is_default(libxl_defbool db)
+{
+    return !db.val;
+}
+
+void libxl_defbool_setdefault(libxl_defbool *db, bool b)
+{
+    if (libxl_defbool_is_default(*db))
+        libxl_defbool_set(db, b);
+}
+
+bool libxl_defbool_val(libxl_defbool db)
+{
+    assert(!libxl_defbool_is_default(db));
+    return db.val > 0;
+}
+
+const char *libxl_defbool_to_string(libxl_defbool b)
+{
+    if (b.val < 0)
+        return "False";
+    else if (b.val > 0)
+        return "True";
+    else
+        return "<default>";
+}
+
 /******************************************************************************/
 
 
diff -r a207b589a972 -r 2aae04f3240c tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
@@ -243,6 +243,30 @@
 struct libxl_event;
 typedef LIBXL_TAILQ_ENTRY(struct libxl_event) libxl_ev_link;
 
+/*
+ * A boolean variable with an explicit default state.
+ *
+ * Users should treat this struct as opaque and use the following
+ * defined macros and accessor functions.
+ *
+ * To allow users of the library to naively select all defaults this
+ * state is represented as 0. False is < 0 and True is > 0.
+ */
+typedef struct {
+    int val;
+} libxl_defbool;
+
+void libxl_defbool_set(libxl_defbool *db, bool b);
+/* Resets to default */
+void libxl_defbool_unset(libxl_defbool *db);
+/* Sets db only if it is currently == default */
+void libxl_defbool_setdefault(libxl_defbool *db, bool b);
+bool libxl_defbool_is_default(libxl_defbool db);
+/* db must not be == default */
+bool libxl_defbool_val(libxl_defbool db);
+
+const char *libxl_defbool_to_string(libxl_defbool b);
+
 typedef struct libxl__ctx libxl_ctx;
 
 #define LIBXL_TIMER_MODE_DEFAULT -1
diff -r a207b589a972 -r 2aae04f3240c tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_json.c	Thu Mar 01 12:26:14 2012 +0000
@@ -85,6 +85,12 @@
 /*
  * YAJL generators for builtin libxl types.
  */
+yajl_gen_status libxl_defbool_gen_json(yajl_gen hand,
+                                       libxl_defbool *db)
+{
+    return libxl__yajl_gen_asciiz(hand, libxl_defbool_to_string(*db));
+}
+
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand,
                                     libxl_uuid *uuid)
 {
diff -r a207b589a972 -r 2aae04f3240c tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
@@ -5,6 +5,8 @@
 
 namespace("libxl_")
 
+libxl_defbool = Builtin("defbool", passby=PASS_BY_REFERENCE)
+
 libxl_domid = Builtin("domid", json_fn = "yajl_gen_integer", autogenerate_json = False)
 libxl_uuid = Builtin("uuid", passby=PASS_BY_REFERENCE)
 libxl_mac = Builtin("mac", passby=PASS_BY_REFERENCE)
diff -r a207b589a972 -r 2aae04f3240c tools/libxl/libxlu_cfg.c
--- a/tools/libxl/libxlu_cfg.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxlu_cfg.c	Thu Mar 01 12:26:14 2012 +0000
@@ -237,6 +237,17 @@
     return 0;
 }
 
+int xlu_cfg_get_defbool(const XLU_Config *cfg, const char *n, libxl_defbool *b,
+                     int dont_warn)
+{
+    int ret;
+    long l;
+
+    ret = xlu_cfg_get_long(cfg, n, &l, dont_warn);
+    if (ret) return ret;
+    libxl_defbool_set(b, !!l);
+    return 0;
+}
 
 int xlu_cfg_get_list(const XLU_Config *cfg, const char *n,
                      XLU_ConfigList **list_r, int *entries_r, int dont_warn) {
diff -r a207b589a972 -r 2aae04f3240c tools/libxl/libxlutil.h
--- a/tools/libxl/libxlutil.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxlutil.h	Thu Mar 01 12:26:14 2012 +0000
@@ -52,6 +52,8 @@
                            char **value_r, int dont_warn);
 int xlu_cfg_get_long(const XLU_Config*, const char *n, long *value_r,
                      int dont_warn);
+int xlu_cfg_get_defbool(const XLU_Config*, const char *n, libxl_defbool *b,
+                     int dont_warn);
 
 int xlu_cfg_get_list(const XLU_Config*, const char *n,
                      XLU_ConfigList **list_r /* may be 0 */,
diff -r a207b589a972 -r 2aae04f3240c tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Thu Mar 01 12:26:14 2012 +0000
@@ -10,6 +10,7 @@
     "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_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),
     "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",    "Val_mac(&%(c)s)"),
diff -r a207b589a972 -r 2aae04f3240c tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Thu Mar 01 12:26:14 2012 +0000
@@ -195,6 +195,33 @@
 	CAMLreturn(0);
 }
 
+static value Val_defbool(libxl_defbool c_val)
+{
+	CAMLparam0();
+	CAMLlocal1(v);
+
+	if (libxl_defbool_is_default(c_val))
+		v = Val_none;
+	else {
+		bool b = libxl_defbool_val(c_val);
+		v = Val_some(b ? Val_bool(true) : Val_bool(false));
+	}
+	CAMLreturn(v);
+}
+
+static libxl_defbool Defbool_val(value v)
+{
+	CAMLparam1(v);
+	libxl_defbool db;
+	if (v == Val_none)
+		libxl_defbool_unset(&db);
+	else {
+		bool b = Bool_val(Some_val(v));
+		libxl_defbool_set(&db, b);
+	}
+	return db;
+}
+
 static value Val_hwcap(libxl_hwcap *c_val)
 {
 	CAMLparam0();
diff -r a207b589a972 -r 2aae04f3240c tools/python/genwrap.py
--- a/tools/python/genwrap.py	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/python/genwrap.py	Thu Mar 01 12:26:14 2012 +0000
@@ -4,11 +4,13 @@
 
 import idl
 
-(TYPE_BOOL, TYPE_INT, TYPE_UINT, TYPE_STRING, TYPE_AGGREGATE) = range(5)
+(TYPE_DEFBOOL, TYPE_BOOL, TYPE_INT, TYPE_UINT, TYPE_STRING, TYPE_AGGREGATE) = range(6)
 
 def py_type(ty):
     if ty == idl.bool:
         return TYPE_BOOL
+    if ty.typename == "libxl_defbool":
+        return TYPE_DEFBOOL
     if isinstance(ty, idl.Enumeration):
         return TYPE_UINT
     if isinstance(ty, idl.Number):
@@ -44,6 +46,8 @@
         for f in ty.fields:
             if py_type(f.type) is not None:
                 continue
+            if py_type(f.type) == TYPE_DEFBOOL:
+                continue
             if ty.marshal_out():
                 l.append('_hidden PyObject *attrib__%s_get(%s *%s);'%(\
                     fsanitize(f.type.typename), f.type.typename, f.name))
@@ -62,6 +66,8 @@
         l.append('    ret = (self->obj.%s) ? Py_True : Py_False;'%f.name)
         l.append('    Py_INCREF(ret);')
         l.append('    return ret;')
+    elif t == TYPE_DEFBOOL:
+        l.append('    return genwrap__defbool_get(&self->obj.%s);'%f.name)
     elif t == TYPE_INT:
         l.append('    return genwrap__ll_get(self->obj.%s);'%f.name)
     elif t == TYPE_UINT:
@@ -85,6 +91,8 @@
     if t == TYPE_BOOL:
         l.append('    self->obj.%s = (NULL == v || Py_None == v || Py_False == v) ? 0 : 1;'%f.name)
         l.append('    return 0;')
+    elif t == TYPE_DEFBOOL:
+        l.append('    return genwrap__defbool_set(v, &self->obj.%s);'%f.name)
     elif t == TYPE_UINT or t == TYPE_INT:
         l.append('    %slong long tmp;'%(t == TYPE_UINT and 'unsigned ' or ''))
         l.append('    int ret;')
@@ -275,6 +283,8 @@
 _hidden int genwrap__ull_set(PyObject *v, unsigned long long *val, unsigned long long mask);
 _hidden PyObject *genwrap__ll_get(long long val);
 _hidden int genwrap__ll_set(PyObject *v, long long *val, long long mask);
+_hidden PyObject *genwrap__defbool_get(libxl_defbool *db);
+_hidden int genwrap__defbool_set(PyObject *v, libxl_defbool *db);
 
 """ % " ".join(sys.argv))
     for ty in [ty for ty in types if isinstance(ty, idl.Aggregate)]:
diff -r a207b589a972 -r 2aae04f3240c tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/python/xen/lowlevel/xl/xl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -156,6 +156,21 @@
     return 0;
 }
 
+PyObject *genwrap__defbool_get(libxl_defbool *db)
+{
+    PyObject *ret;
+    ret = libxl_defbool_val(*db) ? Py_True : Py_False;
+    Py_INCREF(ret);
+    return ret;
+}
+
+int genwrap__defbool_set(PyObject *v, libxl_defbool *db)
+{
+    bool val = !(NULL == v || Py_None == v || Py_False == v);
+    libxl_defbool_set(db, val);
+    return 0;
+}
+
 static int fixed_bytearray_set(PyObject *v, uint8_t *ptr, size_t len)
 {
     char *tmp;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gep-0000JB-Tv; Sat, 03 Mar 2012 04:33: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 1S3gen-0000ET-Ic
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:21 +0000
Received: from [85.158.143.35:28736] by server-2.bemta-4.messagelabs.com id
	C4/8D-17550-01F915F4; Sat, 03 Mar 2012 04:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1330749198!9946770!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27232 invoked from network); 3 Mar 2012 04:33:19 -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;
	3 Mar 2012 04:33: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 1S3gek-0004gI-3c
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gek-0003R6-2G
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:18 +0000
Message-Id: <E1S3gek-0003R6-2G@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: add new "defbool" built in
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID 2aae04f3240cfc43ab31073ac6f5a4f2a702b80c
# Parent  a207b589a972a9168ef53d24035ce48b6adffa49
libxl: add new "defbool" built in type.

This type is a but like a "boolean" but with a third state "default" (so really
I suppose it's a tristate).

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


diff -r a207b589a972 -r 2aae04f3240c tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/gentest.py	Thu Mar 01 12:26:14 2012 +0000
@@ -20,7 +20,8 @@
 def randomize_enum(e):
     return random.choice([v.name for v in e.values])
 
-handcoded = ["libxl_cpumap", "libxl_key_value_list",
+handcoded = ["libxl_defbool", # Temp until a user appears in the next patch
+             "libxl_cpumap", "libxl_key_value_list",
              "libxl_cpuid_policy_list", "libxl_file_reference",
              "libxl_string_list"]
 
@@ -55,6 +56,8 @@
               ty.pass_arg(v, parent is None))
     elif ty.typename in ["bool"]:
         s += "%s = rand() %% 2;\n" % v
+    elif ty.typename in ["libxl_defbool"]:
+        s += "libxl_defbool_set(%s, !!rand() %% 1);\n" % v
     elif ty.typename in ["char *"]:
         s += "%s = rand_str();\n" % v
     elif ty.private:
diff -r a207b589a972 -r 2aae04f3240c tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -184,6 +184,47 @@
     free(kvl);
 }
 
+#define LIBXL__DEFBOOL_DEFAULT (0)
+#define LIBXL__DEFBOOL_FALSE (-1)
+#define LIBXL__DEFBOOL_TRUE (1)
+
+void libxl_defbool_set(libxl_defbool *db, bool b)
+{
+    db->val = b ? LIBXL__DEFBOOL_TRUE : LIBXL__DEFBOOL_FALSE;
+}
+
+void libxl_defbool_unset(libxl_defbool *db)
+{
+    db->val = LIBXL__DEFBOOL_DEFAULT;
+}
+
+bool libxl_defbool_is_default(libxl_defbool db)
+{
+    return !db.val;
+}
+
+void libxl_defbool_setdefault(libxl_defbool *db, bool b)
+{
+    if (libxl_defbool_is_default(*db))
+        libxl_defbool_set(db, b);
+}
+
+bool libxl_defbool_val(libxl_defbool db)
+{
+    assert(!libxl_defbool_is_default(db));
+    return db.val > 0;
+}
+
+const char *libxl_defbool_to_string(libxl_defbool b)
+{
+    if (b.val < 0)
+        return "False";
+    else if (b.val > 0)
+        return "True";
+    else
+        return "<default>";
+}
+
 /******************************************************************************/
 
 
diff -r a207b589a972 -r 2aae04f3240c tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:14 2012 +0000
@@ -243,6 +243,30 @@
 struct libxl_event;
 typedef LIBXL_TAILQ_ENTRY(struct libxl_event) libxl_ev_link;
 
+/*
+ * A boolean variable with an explicit default state.
+ *
+ * Users should treat this struct as opaque and use the following
+ * defined macros and accessor functions.
+ *
+ * To allow users of the library to naively select all defaults this
+ * state is represented as 0. False is < 0 and True is > 0.
+ */
+typedef struct {
+    int val;
+} libxl_defbool;
+
+void libxl_defbool_set(libxl_defbool *db, bool b);
+/* Resets to default */
+void libxl_defbool_unset(libxl_defbool *db);
+/* Sets db only if it is currently == default */
+void libxl_defbool_setdefault(libxl_defbool *db, bool b);
+bool libxl_defbool_is_default(libxl_defbool db);
+/* db must not be == default */
+bool libxl_defbool_val(libxl_defbool db);
+
+const char *libxl_defbool_to_string(libxl_defbool b);
+
 typedef struct libxl__ctx libxl_ctx;
 
 #define LIBXL_TIMER_MODE_DEFAULT -1
diff -r a207b589a972 -r 2aae04f3240c tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_json.c	Thu Mar 01 12:26:14 2012 +0000
@@ -85,6 +85,12 @@
 /*
  * YAJL generators for builtin libxl types.
  */
+yajl_gen_status libxl_defbool_gen_json(yajl_gen hand,
+                                       libxl_defbool *db)
+{
+    return libxl__yajl_gen_asciiz(hand, libxl_defbool_to_string(*db));
+}
+
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand,
                                     libxl_uuid *uuid)
 {
diff -r a207b589a972 -r 2aae04f3240c tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
@@ -5,6 +5,8 @@
 
 namespace("libxl_")
 
+libxl_defbool = Builtin("defbool", passby=PASS_BY_REFERENCE)
+
 libxl_domid = Builtin("domid", json_fn = "yajl_gen_integer", autogenerate_json = False)
 libxl_uuid = Builtin("uuid", passby=PASS_BY_REFERENCE)
 libxl_mac = Builtin("mac", passby=PASS_BY_REFERENCE)
diff -r a207b589a972 -r 2aae04f3240c tools/libxl/libxlu_cfg.c
--- a/tools/libxl/libxlu_cfg.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxlu_cfg.c	Thu Mar 01 12:26:14 2012 +0000
@@ -237,6 +237,17 @@
     return 0;
 }
 
+int xlu_cfg_get_defbool(const XLU_Config *cfg, const char *n, libxl_defbool *b,
+                     int dont_warn)
+{
+    int ret;
+    long l;
+
+    ret = xlu_cfg_get_long(cfg, n, &l, dont_warn);
+    if (ret) return ret;
+    libxl_defbool_set(b, !!l);
+    return 0;
+}
 
 int xlu_cfg_get_list(const XLU_Config *cfg, const char *n,
                      XLU_ConfigList **list_r, int *entries_r, int dont_warn) {
diff -r a207b589a972 -r 2aae04f3240c tools/libxl/libxlutil.h
--- a/tools/libxl/libxlutil.h	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxlutil.h	Thu Mar 01 12:26:14 2012 +0000
@@ -52,6 +52,8 @@
                            char **value_r, int dont_warn);
 int xlu_cfg_get_long(const XLU_Config*, const char *n, long *value_r,
                      int dont_warn);
+int xlu_cfg_get_defbool(const XLU_Config*, const char *n, libxl_defbool *b,
+                     int dont_warn);
 
 int xlu_cfg_get_list(const XLU_Config*, const char *n,
                      XLU_ConfigList **list_r /* may be 0 */,
diff -r a207b589a972 -r 2aae04f3240c tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Thu Mar 01 12:26:14 2012 +0000
@@ -10,6 +10,7 @@
     "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_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),
     "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",    "Val_mac(&%(c)s)"),
diff -r a207b589a972 -r 2aae04f3240c tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Thu Mar 01 12:26:14 2012 +0000
@@ -195,6 +195,33 @@
 	CAMLreturn(0);
 }
 
+static value Val_defbool(libxl_defbool c_val)
+{
+	CAMLparam0();
+	CAMLlocal1(v);
+
+	if (libxl_defbool_is_default(c_val))
+		v = Val_none;
+	else {
+		bool b = libxl_defbool_val(c_val);
+		v = Val_some(b ? Val_bool(true) : Val_bool(false));
+	}
+	CAMLreturn(v);
+}
+
+static libxl_defbool Defbool_val(value v)
+{
+	CAMLparam1(v);
+	libxl_defbool db;
+	if (v == Val_none)
+		libxl_defbool_unset(&db);
+	else {
+		bool b = Bool_val(Some_val(v));
+		libxl_defbool_set(&db, b);
+	}
+	return db;
+}
+
 static value Val_hwcap(libxl_hwcap *c_val)
 {
 	CAMLparam0();
diff -r a207b589a972 -r 2aae04f3240c tools/python/genwrap.py
--- a/tools/python/genwrap.py	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/python/genwrap.py	Thu Mar 01 12:26:14 2012 +0000
@@ -4,11 +4,13 @@
 
 import idl
 
-(TYPE_BOOL, TYPE_INT, TYPE_UINT, TYPE_STRING, TYPE_AGGREGATE) = range(5)
+(TYPE_DEFBOOL, TYPE_BOOL, TYPE_INT, TYPE_UINT, TYPE_STRING, TYPE_AGGREGATE) = range(6)
 
 def py_type(ty):
     if ty == idl.bool:
         return TYPE_BOOL
+    if ty.typename == "libxl_defbool":
+        return TYPE_DEFBOOL
     if isinstance(ty, idl.Enumeration):
         return TYPE_UINT
     if isinstance(ty, idl.Number):
@@ -44,6 +46,8 @@
         for f in ty.fields:
             if py_type(f.type) is not None:
                 continue
+            if py_type(f.type) == TYPE_DEFBOOL:
+                continue
             if ty.marshal_out():
                 l.append('_hidden PyObject *attrib__%s_get(%s *%s);'%(\
                     fsanitize(f.type.typename), f.type.typename, f.name))
@@ -62,6 +66,8 @@
         l.append('    ret = (self->obj.%s) ? Py_True : Py_False;'%f.name)
         l.append('    Py_INCREF(ret);')
         l.append('    return ret;')
+    elif t == TYPE_DEFBOOL:
+        l.append('    return genwrap__defbool_get(&self->obj.%s);'%f.name)
     elif t == TYPE_INT:
         l.append('    return genwrap__ll_get(self->obj.%s);'%f.name)
     elif t == TYPE_UINT:
@@ -85,6 +91,8 @@
     if t == TYPE_BOOL:
         l.append('    self->obj.%s = (NULL == v || Py_None == v || Py_False == v) ? 0 : 1;'%f.name)
         l.append('    return 0;')
+    elif t == TYPE_DEFBOOL:
+        l.append('    return genwrap__defbool_set(v, &self->obj.%s);'%f.name)
     elif t == TYPE_UINT or t == TYPE_INT:
         l.append('    %slong long tmp;'%(t == TYPE_UINT and 'unsigned ' or ''))
         l.append('    int ret;')
@@ -275,6 +283,8 @@
 _hidden int genwrap__ull_set(PyObject *v, unsigned long long *val, unsigned long long mask);
 _hidden PyObject *genwrap__ll_get(long long val);
 _hidden int genwrap__ll_set(PyObject *v, long long *val, long long mask);
+_hidden PyObject *genwrap__defbool_get(libxl_defbool *db);
+_hidden int genwrap__defbool_set(PyObject *v, libxl_defbool *db);
 
 """ % " ".join(sys.argv))
     for ty in [ty for ty in types if isinstance(ty, idl.Aggregate)]:
diff -r a207b589a972 -r 2aae04f3240c tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/python/xen/lowlevel/xl/xl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -156,6 +156,21 @@
     return 0;
 }
 
+PyObject *genwrap__defbool_get(libxl_defbool *db)
+{
+    PyObject *ret;
+    ret = libxl_defbool_val(*db) ? Py_True : Py_False;
+    Py_INCREF(ret);
+    return ret;
+}
+
+int genwrap__defbool_set(PyObject *v, libxl_defbool *db)
+{
+    bool val = !(NULL == v || Py_None == v || Py_False == v);
+    libxl_defbool_set(db, val);
+    return 0;
+}
+
 static int fixed_bytearray_set(PyObject *v, uint8_t *ptr, size_t len)
 {
     char *tmp;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3geq-0000Jb-2z; Sat, 03 Mar 2012 04:33: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 1S3geo-0000B5-G2
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:22 +0000
Received: from [85.158.143.35:62815] by server-1.bemta-4.messagelabs.com id
	34/C9-20925-21F915F4; Sat, 03 Mar 2012 04:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1330749200!3136132!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10560 invoked from network); 3 Mar 2012 04:33:21 -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;
	3 Mar 2012 04:33: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 1S3gel-0004gR-RB
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gel-0003Sc-Pb
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:19 +0000
Message-Id: <E1S3gel-0003Sc-Pb@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: switch generation id control
	to libxl_defbool.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID d78d760a678d39fe2c34b4b0331d3ebe7bb6aefb
# Parent  53ea53663b48ea752905ab7b9addd2dd043852cc
libxl: switch generation id control to libxl_defbool.

This allows it to be set via the _init/_setdefault methods.

Also switch the sense of the variable in the libxl API, since once you add
defbool to the mix the double negatives become even more confusing.

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


diff -r 53ea53663b48 -r d78d760a678d tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -89,7 +89,6 @@
         b_info->u.hvm.firmware = NULL;
         b_info->u.hvm.bios = 0;
         b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
-        b_info->u.hvm.no_incr_generationid = 0;
 
         b_info->u.hvm.stdvga = 0;
         b_info->u.hvm.vnc.enable = 1;
@@ -151,6 +150,7 @@
         libxl_defbool_setdefault(&b_info->u.hvm.hpet,               true);
         libxl_defbool_setdefault(&b_info->u.hvm.vpt_align,          true);
         libxl_defbool_setdefault(&b_info->u.hvm.nested_hvm,         false);
+        libxl_defbool_setdefault(&b_info->u.hvm.incr_generationid,  false);
         libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
         libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
 
diff -r 53ea53663b48 -r d78d760a678d tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_dom.c	Thu Mar 01 12:26:15 2012 +0000
@@ -406,7 +406,7 @@
         hvm = 1;
         superpages = 1;
         pae = libxl_defbool_val(info->u.hvm.pae);
-        no_incr_generationid = info->u.hvm.no_incr_generationid;
+        no_incr_generationid = !libxl_defbool_val(info->u.hvm.incr_generationid);
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         hvm = 0;
diff -r 53ea53663b48 -r d78d760a678d tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
@@ -267,7 +267,7 @@
                                        ("vpt_align",        libxl_defbool),
                                        ("timer_mode",       libxl_timer_mode),
                                        ("nested_hvm",       libxl_defbool),
-                                       ("no_incr_generationid", bool),
+                                       ("incr_generationid",libxl_defbool),
                                        ("nographic",        bool),
                                        ("stdvga",           bool),
                                        ("vnc",              libxl_vnc_info),
diff -r 53ea53663b48 -r d78d760a678d tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -1357,7 +1357,7 @@
     const char *restore_file;
     int migrate_fd; /* -1 means none */
     char **migration_domname_r; /* from malloc */
-    int no_incr_generationid;
+    int incr_generationid;
 };
 
 static int freemem(libxl_domain_build_info *b_info)
@@ -1608,8 +1608,8 @@
     }
 
     if (d_config.c_info.type == LIBXL_DOMAIN_TYPE_HVM)
-        d_config.b_info.u.hvm.no_incr_generationid =
-            dom_info->no_incr_generationid;
+        libxl_defbool_set(&d_config.b_info.u.hvm.incr_generationid,
+                          dom_info->incr_generationid);
 
     if (debug || dom_info->dryrun)
         printf_info(default_output_format, -1, &d_config);
@@ -2884,7 +2884,7 @@
     dom_info.restore_file = "incoming migration stream";
     dom_info.migrate_fd = 0; /* stdin */
     dom_info.migration_domname_r = &migration_domname;
-    dom_info.no_incr_generationid = 1;
+    dom_info.incr_generationid = 0;
 
     rc = create_domain(&dom_info);
     if (rc < 0) {
@@ -3009,6 +3009,7 @@
     dom_info.restore_file = checkpoint_file;
     dom_info.migrate_fd = -1;
     dom_info.console_autoconnect = console_autoconnect;
+    dom_info.incr_generationid = 1;
 
     rc = create_domain(&dom_info);
     if (rc < 0)
@@ -3394,6 +3395,7 @@
     dom_info.extra_config = extra_config;
     dom_info.migrate_fd = -1;
     dom_info.console_autoconnect = console_autoconnect;
+    dom_info.incr_generationid = 0;
 
     rc = create_domain(&dom_info);
     if (rc < 0)
diff -r 53ea53663b48 -r d78d760a678d tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:15 2012 +0000
@@ -108,8 +108,8 @@
                libxl_timer_mode_to_string(b_info->u.hvm.timer_mode));
         printf("\t\t\t(nestedhvm %s)\n",
                libxl_defbool_to_string(b_info->u.hvm.nested_hvm));
-        printf("\t\t\t(no_incr_generationid %d)\n",
-                    b_info->u.hvm.no_incr_generationid);
+        printf("\t\t\t(no_incr_generationid %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.incr_generationid));
 
         printf("\t\t\t(stdvga %d)\n", b_info->u.hvm.stdvga);
         printf("\t\t\t(vnc %d)\n", b_info->u.hvm.vnc.enable);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3geq-0000Jb-2z; Sat, 03 Mar 2012 04:33: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 1S3geo-0000B5-G2
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:22 +0000
Received: from [85.158.143.35:62815] by server-1.bemta-4.messagelabs.com id
	34/C9-20925-21F915F4; Sat, 03 Mar 2012 04:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1330749200!3136132!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10560 invoked from network); 3 Mar 2012 04:33:21 -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;
	3 Mar 2012 04:33: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 1S3gel-0004gR-RB
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gel-0003Sc-Pb
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:19 +0000
Message-Id: <E1S3gel-0003Sc-Pb@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: switch generation id control
	to libxl_defbool.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID d78d760a678d39fe2c34b4b0331d3ebe7bb6aefb
# Parent  53ea53663b48ea752905ab7b9addd2dd043852cc
libxl: switch generation id control to libxl_defbool.

This allows it to be set via the _init/_setdefault methods.

Also switch the sense of the variable in the libxl API, since once you add
defbool to the mix the double negatives become even more confusing.

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


diff -r 53ea53663b48 -r d78d760a678d tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -89,7 +89,6 @@
         b_info->u.hvm.firmware = NULL;
         b_info->u.hvm.bios = 0;
         b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
-        b_info->u.hvm.no_incr_generationid = 0;
 
         b_info->u.hvm.stdvga = 0;
         b_info->u.hvm.vnc.enable = 1;
@@ -151,6 +150,7 @@
         libxl_defbool_setdefault(&b_info->u.hvm.hpet,               true);
         libxl_defbool_setdefault(&b_info->u.hvm.vpt_align,          true);
         libxl_defbool_setdefault(&b_info->u.hvm.nested_hvm,         false);
+        libxl_defbool_setdefault(&b_info->u.hvm.incr_generationid,  false);
         libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
         libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
 
diff -r 53ea53663b48 -r d78d760a678d tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_dom.c	Thu Mar 01 12:26:15 2012 +0000
@@ -406,7 +406,7 @@
         hvm = 1;
         superpages = 1;
         pae = libxl_defbool_val(info->u.hvm.pae);
-        no_incr_generationid = info->u.hvm.no_incr_generationid;
+        no_incr_generationid = !libxl_defbool_val(info->u.hvm.incr_generationid);
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         hvm = 0;
diff -r 53ea53663b48 -r d78d760a678d tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
@@ -267,7 +267,7 @@
                                        ("vpt_align",        libxl_defbool),
                                        ("timer_mode",       libxl_timer_mode),
                                        ("nested_hvm",       libxl_defbool),
-                                       ("no_incr_generationid", bool),
+                                       ("incr_generationid",libxl_defbool),
                                        ("nographic",        bool),
                                        ("stdvga",           bool),
                                        ("vnc",              libxl_vnc_info),
diff -r 53ea53663b48 -r d78d760a678d tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -1357,7 +1357,7 @@
     const char *restore_file;
     int migrate_fd; /* -1 means none */
     char **migration_domname_r; /* from malloc */
-    int no_incr_generationid;
+    int incr_generationid;
 };
 
 static int freemem(libxl_domain_build_info *b_info)
@@ -1608,8 +1608,8 @@
     }
 
     if (d_config.c_info.type == LIBXL_DOMAIN_TYPE_HVM)
-        d_config.b_info.u.hvm.no_incr_generationid =
-            dom_info->no_incr_generationid;
+        libxl_defbool_set(&d_config.b_info.u.hvm.incr_generationid,
+                          dom_info->incr_generationid);
 
     if (debug || dom_info->dryrun)
         printf_info(default_output_format, -1, &d_config);
@@ -2884,7 +2884,7 @@
     dom_info.restore_file = "incoming migration stream";
     dom_info.migrate_fd = 0; /* stdin */
     dom_info.migration_domname_r = &migration_domname;
-    dom_info.no_incr_generationid = 1;
+    dom_info.incr_generationid = 0;
 
     rc = create_domain(&dom_info);
     if (rc < 0) {
@@ -3009,6 +3009,7 @@
     dom_info.restore_file = checkpoint_file;
     dom_info.migrate_fd = -1;
     dom_info.console_autoconnect = console_autoconnect;
+    dom_info.incr_generationid = 1;
 
     rc = create_domain(&dom_info);
     if (rc < 0)
@@ -3394,6 +3395,7 @@
     dom_info.extra_config = extra_config;
     dom_info.migrate_fd = -1;
     dom_info.console_autoconnect = console_autoconnect;
+    dom_info.incr_generationid = 0;
 
     rc = create_domain(&dom_info);
     if (rc < 0)
diff -r 53ea53663b48 -r d78d760a678d tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:15 2012 +0000
@@ -108,8 +108,8 @@
                libxl_timer_mode_to_string(b_info->u.hvm.timer_mode));
         printf("\t\t\t(nestedhvm %s)\n",
                libxl_defbool_to_string(b_info->u.hvm.nested_hvm));
-        printf("\t\t\t(no_incr_generationid %d)\n",
-                    b_info->u.hvm.no_incr_generationid);
+        printf("\t\t\t(no_incr_generationid %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.incr_generationid));
 
         printf("\t\t\t(stdvga %d)\n", b_info->u.hvm.stdvga);
         printf("\t\t\t(vnc %d)\n", b_info->u.hvm.vnc.enable);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3geq-0000JP-0V; Sat, 03 Mar 2012 04:33: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 1S3gen-0000Ek-TD
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:22 +0000
Received: from [85.158.139.83:61909] by server-8.bemta-5.messagelabs.com id
	9D/3E-07862-11F915F4; Sat, 03 Mar 2012 04:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1330749199!17010010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4750 invoked from network); 3 Mar 2012 04:33:20 -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;
	3 Mar 2012 04:33: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 1S3gek-0004gL-Ml
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gek-0003Rb-KS
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:18 +0000
Message-Id: <E1S3gek-0003Rb-KS@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: make boolean members of
	libxl_domain_create_info into libxl_defbool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID 5c9077a5722c4edf87b298dcd192632f031200ae
# Parent  2aae04f3240cfc43ab31073ac6f5a4f2a702b80c
libxl: make boolean members of libxl_domain_create_info into libxl_defbool

This allows them to be set via the _init/_setdefault methods.

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


diff -r 2aae04f3240c -r 5c9077a5722c tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/gentest.py	Thu Mar 01 12:26:14 2012 +0000
@@ -20,8 +20,7 @@
 def randomize_enum(e):
     return random.choice([v.name for v in e.values])
 
-handcoded = ["libxl_defbool", # Temp until a user appears in the next patch
-             "libxl_cpumap", "libxl_key_value_list",
+handcoded = ["libxl_cpumap", "libxl_key_value_list",
              "libxl_cpuid_policy_list", "libxl_file_reference",
              "libxl_string_list"]
 
diff -r 2aae04f3240c -r 5c9077a5722c tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
@@ -53,8 +53,6 @@
 void libxl_domain_create_info_init(libxl_domain_create_info *c_info)
 {
     memset(c_info, '\0', sizeof(*c_info));
-    c_info->hap = 1;
-    c_info->oos = 1;
 }
 
 int libxl__domain_create_info_setdefault(libxl__gc *gc,
@@ -63,6 +61,11 @@
     if (!c_info->type)
         return ERROR_INVAL;
 
+    if (c_info->type == LIBXL_DOMAIN_TYPE_HVM) {
+        libxl_defbool_setdefault(&c_info->hap, true);
+        libxl_defbool_setdefault(&c_info->oos, true);
+    }
+
     return 0;
 }
 
@@ -366,8 +369,8 @@
     flags = 0;
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
         flags |= XEN_DOMCTL_CDF_hvm_guest;
-        flags |= info->hap ? XEN_DOMCTL_CDF_hap : 0;
-        flags |= info->oos ? 0 : XEN_DOMCTL_CDF_oos_off;
+        flags |= libxl_defbool_val(info->hap) ? XEN_DOMCTL_CDF_hap : 0;
+        flags |= libxl_defbool_val(info->oos) ? 0 : XEN_DOMCTL_CDF_oos_off;
     }
     *domid = -1;
 
@@ -519,6 +522,9 @@
     ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info);
     if (ret) goto error_out;
 
+    ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info);
+    if (ret) goto error_out;
+
     ret = libxl__domain_make(gc, &d_config->c_info, &domid);
     if (ret) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot make domain: %d", ret);
diff -r 2aae04f3240c -r 5c9077a5722c tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
@@ -211,8 +211,8 @@
 
 libxl_domain_create_info = Struct("domain_create_info",[
     ("type",         libxl_domain_type),
-    ("hap",          bool),
-    ("oos",          bool),
+    ("hap",          libxl_defbool),
+    ("oos",          libxl_defbool),
     ("ssidref",      uint32),
     ("name",         string),
     ("uuid",         libxl_uuid),
diff -r 2aae04f3240c -r 5c9077a5722c tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -555,8 +555,7 @@
         !strncmp(buf, "hvm", strlen(buf)))
         c_info->type = LIBXL_DOMAIN_TYPE_HVM;
 
-    if (!xlu_cfg_get_long (config, "hap", &l, 0))
-        c_info->hap = l;
+    xlu_cfg_get_defbool(config, "hap", &c_info->hap, 0);
 
     if (xlu_cfg_replace_string (config, "name", &c_info->name, 0)) {
         fprintf(stderr, "Domain name must be specified.\n");
@@ -572,8 +571,7 @@
         libxl_uuid_generate(&c_info->uuid);
     }
 
-    if (!xlu_cfg_get_long(config, "oos", &l, 0))
-        c_info->oos = l;
+    xlu_cfg_get_defbool(config, "oos", &c_info->oos, 0);
 
     if (!xlu_cfg_get_string (config, "pool", &buf, 0)) {
         c_info->poolid = -1;
diff -r 2aae04f3240c -r 5c9077a5722c tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:14 2012 +0000
@@ -41,8 +41,8 @@
     printf("(domain\n\t(domid %d)\n", domid);
     printf("\t(create_info)\n");
     printf("\t(hvm %d)\n", c_info->type == LIBXL_DOMAIN_TYPE_HVM);
-    printf("\t(hap %d)\n", c_info->hap);
-    printf("\t(oos %d)\n", c_info->oos);
+    printf("\t(hap %s)\n", libxl_defbool_to_string(c_info->hap));
+    printf("\t(oos %s)\n", libxl_defbool_to_string(c_info->oos));
     printf("\t(ssidref %d)\n", c_info->ssidref);
     printf("\t(name %s)\n", c_info->name);
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3geq-0000JP-0V; Sat, 03 Mar 2012 04:33: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 1S3gen-0000Ek-TD
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:22 +0000
Received: from [85.158.139.83:61909] by server-8.bemta-5.messagelabs.com id
	9D/3E-07862-11F915F4; Sat, 03 Mar 2012 04:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1330749199!17010010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4750 invoked from network); 3 Mar 2012 04:33:20 -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;
	3 Mar 2012 04:33: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 1S3gek-0004gL-Ml
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gek-0003Rb-KS
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:18 +0000
Message-Id: <E1S3gek-0003Rb-KS@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: make boolean members of
	libxl_domain_create_info into libxl_defbool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604774 0
# Node ID 5c9077a5722c4edf87b298dcd192632f031200ae
# Parent  2aae04f3240cfc43ab31073ac6f5a4f2a702b80c
libxl: make boolean members of libxl_domain_create_info into libxl_defbool

This allows them to be set via the _init/_setdefault methods.

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


diff -r 2aae04f3240c -r 5c9077a5722c tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/gentest.py	Thu Mar 01 12:26:14 2012 +0000
@@ -20,8 +20,7 @@
 def randomize_enum(e):
     return random.choice([v.name for v in e.values])
 
-handcoded = ["libxl_defbool", # Temp until a user appears in the next patch
-             "libxl_cpumap", "libxl_key_value_list",
+handcoded = ["libxl_cpumap", "libxl_key_value_list",
              "libxl_cpuid_policy_list", "libxl_file_reference",
              "libxl_string_list"]
 
diff -r 2aae04f3240c -r 5c9077a5722c tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
@@ -53,8 +53,6 @@
 void libxl_domain_create_info_init(libxl_domain_create_info *c_info)
 {
     memset(c_info, '\0', sizeof(*c_info));
-    c_info->hap = 1;
-    c_info->oos = 1;
 }
 
 int libxl__domain_create_info_setdefault(libxl__gc *gc,
@@ -63,6 +61,11 @@
     if (!c_info->type)
         return ERROR_INVAL;
 
+    if (c_info->type == LIBXL_DOMAIN_TYPE_HVM) {
+        libxl_defbool_setdefault(&c_info->hap, true);
+        libxl_defbool_setdefault(&c_info->oos, true);
+    }
+
     return 0;
 }
 
@@ -366,8 +369,8 @@
     flags = 0;
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
         flags |= XEN_DOMCTL_CDF_hvm_guest;
-        flags |= info->hap ? XEN_DOMCTL_CDF_hap : 0;
-        flags |= info->oos ? 0 : XEN_DOMCTL_CDF_oos_off;
+        flags |= libxl_defbool_val(info->hap) ? XEN_DOMCTL_CDF_hap : 0;
+        flags |= libxl_defbool_val(info->oos) ? 0 : XEN_DOMCTL_CDF_oos_off;
     }
     *domid = -1;
 
@@ -519,6 +522,9 @@
     ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info);
     if (ret) goto error_out;
 
+    ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info);
+    if (ret) goto error_out;
+
     ret = libxl__domain_make(gc, &d_config->c_info, &domid);
     if (ret) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot make domain: %d", ret);
diff -r 2aae04f3240c -r 5c9077a5722c tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
@@ -211,8 +211,8 @@
 
 libxl_domain_create_info = Struct("domain_create_info",[
     ("type",         libxl_domain_type),
-    ("hap",          bool),
-    ("oos",          bool),
+    ("hap",          libxl_defbool),
+    ("oos",          libxl_defbool),
     ("ssidref",      uint32),
     ("name",         string),
     ("uuid",         libxl_uuid),
diff -r 2aae04f3240c -r 5c9077a5722c tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
@@ -555,8 +555,7 @@
         !strncmp(buf, "hvm", strlen(buf)))
         c_info->type = LIBXL_DOMAIN_TYPE_HVM;
 
-    if (!xlu_cfg_get_long (config, "hap", &l, 0))
-        c_info->hap = l;
+    xlu_cfg_get_defbool(config, "hap", &c_info->hap, 0);
 
     if (xlu_cfg_replace_string (config, "name", &c_info->name, 0)) {
         fprintf(stderr, "Domain name must be specified.\n");
@@ -572,8 +571,7 @@
         libxl_uuid_generate(&c_info->uuid);
     }
 
-    if (!xlu_cfg_get_long(config, "oos", &l, 0))
-        c_info->oos = l;
+    xlu_cfg_get_defbool(config, "oos", &c_info->oos, 0);
 
     if (!xlu_cfg_get_string (config, "pool", &buf, 0)) {
         c_info->poolid = -1;
diff -r 2aae04f3240c -r 5c9077a5722c tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:14 2012 +0000
@@ -41,8 +41,8 @@
     printf("(domain\n\t(domid %d)\n", domid);
     printf("\t(create_info)\n");
     printf("\t(hvm %d)\n", c_info->type == LIBXL_DOMAIN_TYPE_HVM);
-    printf("\t(hap %d)\n", c_info->hap);
-    printf("\t(oos %d)\n", c_info->oos);
+    printf("\t(hap %s)\n", libxl_defbool_to_string(c_info->hap));
+    printf("\t(oos %s)\n", libxl_defbool_to_string(c_info->oos));
     printf("\t(ssidref %d)\n", c_info->ssidref);
     printf("\t(name %s)\n", c_info->name);
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3ger-0000Ls-Ah; Sat, 03 Mar 2012 04:33: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 1S3geq-0000ET-0y
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:24 +0000
Received: from [85.158.143.99:30632] by server-2.bemta-4.messagelabs.com id
	AA/8D-17550-31F915F4; Sat, 03 Mar 2012 04:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1330749201!16892033!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9150 invoked from network); 3 Mar 2012 04:33: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;
	3 Mar 2012 04:33: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 1S3gen-0004ga-GD
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gen-0003U8-F2
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:21 +0000
Message-Id: <E1S3gen-0003U8-F2@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: do not explicitly initialise
	members of build info to zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID f7be24bb62dbb7acef843f95cddd68988953f18f
# Parent  6eac4a1ee6464e294c5c7310eb54f2566db4cf5e
libxl: do not explicitly initialise members of build info to zero

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


diff -r 6eac4a1ee646 -r f7be24bb62db tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -73,7 +73,6 @@
                                   const libxl_domain_create_info *c_info)
 {
     memset(b_info, '\0', sizeof(*b_info));
-    b_info->cpuid = NULL;
     b_info->type = c_info->type;
 
     b_info->max_memkb = LIBXL_MEMKB_DEFAULT;
@@ -86,13 +85,7 @@
 
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
-        b_info->u.hvm.firmware = NULL;
-        b_info->u.hvm.bios = 0;
         b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
-
-        b_info->u.hvm.vnc.display = 0;
-        b_info->u.hvm.serial = NULL;
-        b_info->u.hvm.usbdevice = NULL;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         b_info->u.pv.slack_memkb = 0;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3ger-0000Ls-Ah; Sat, 03 Mar 2012 04:33: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 1S3geq-0000ET-0y
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:24 +0000
Received: from [85.158.143.99:30632] by server-2.bemta-4.messagelabs.com id
	AA/8D-17550-31F915F4; Sat, 03 Mar 2012 04:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1330749201!16892033!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9150 invoked from network); 3 Mar 2012 04:33: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;
	3 Mar 2012 04:33: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 1S3gen-0004ga-GD
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gen-0003U8-F2
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:21 +0000
Message-Id: <E1S3gen-0003U8-F2@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: do not explicitly initialise
	members of build info to zero
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID f7be24bb62dbb7acef843f95cddd68988953f18f
# Parent  6eac4a1ee6464e294c5c7310eb54f2566db4cf5e
libxl: do not explicitly initialise members of build info to zero

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


diff -r 6eac4a1ee646 -r f7be24bb62db tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -73,7 +73,6 @@
                                   const libxl_domain_create_info *c_info)
 {
     memset(b_info, '\0', sizeof(*b_info));
-    b_info->cpuid = NULL;
     b_info->type = c_info->type;
 
     b_info->max_memkb = LIBXL_MEMKB_DEFAULT;
@@ -86,13 +85,7 @@
 
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
-        b_info->u.hvm.firmware = NULL;
-        b_info->u.hvm.bios = 0;
         b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
-
-        b_info->u.hvm.vnc.display = 0;
-        b_info->u.hvm.serial = NULL;
-        b_info->u.hvm.usbdevice = NULL;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         b_info->u.pv.slack_memkb = 0;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3ger-0000Le-6n; Sat, 03 Mar 2012 04:33: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 1S3gep-0000Ia-F5
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:23 +0000
Received: from [85.158.139.83:18907] by server-1.bemta-5.messagelabs.com id
	31/23-28458-21F915F4; Sat, 03 Mar 2012 04:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1330749199!17592081!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12434 invoked from network); 3 Mar 2012 04:33:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33: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 1S3gel-0004gO-8t
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gel-0003S8-7b
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:19 +0000
Message-Id: <E1S3gel-0003S8-7b@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: make boolean members of
	libxl_domain_build_info into libxl_defbool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID 53ea53663b48ea752905ab7b9addd2dd043852cc
# Parent  5c9077a5722c4edf87b298dcd192632f031200ae
libxl: make boolean members of libxl_domain_build_info into libxl_defbool

This allows them to be set via the _init/_setdefault methods.

This just covers the obvious ones.

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


diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_bootloader.c	Thu Mar 01 12:26:15 2012 +0000
@@ -352,6 +352,9 @@
     if (info->type != LIBXL_DOMAIN_TYPE_PV || !info->u.pv.bootloader)
         goto out;
 
+    rc = libxl__domain_build_info_setdefault(gc, info);
+    if (rc) goto out;
+
     rc = ERROR_INVAL;
     if (!disk)
         goto out;
diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -73,7 +73,6 @@
                                   const libxl_domain_create_info *c_info)
 {
     memset(b_info, '\0', sizeof(*b_info));
-    b_info->disable_migrate = 0;
     b_info->cpuid = NULL;
     b_info->type = c_info->type;
 
@@ -89,17 +88,7 @@
     case LIBXL_DOMAIN_TYPE_HVM:
         b_info->u.hvm.firmware = NULL;
         b_info->u.hvm.bios = 0;
-        b_info->u.hvm.pae = 1;
-        b_info->u.hvm.apic = 1;
-        b_info->u.hvm.acpi = 1;
-        b_info->u.hvm.acpi_s3 = 1;
-        b_info->u.hvm.acpi_s4 = 1;
-        b_info->u.hvm.nx = 1;
-        b_info->u.hvm.viridian = 0;
-        b_info->u.hvm.hpet = 1;
-        b_info->u.hvm.vpt_align = 1;
         b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
-        b_info->u.hvm.nested_hvm = 0;
         b_info->u.hvm.no_incr_generationid = 0;
 
         b_info->u.hvm.stdvga = 0;
@@ -107,9 +96,7 @@
         b_info->u.hvm.vnc.display = 0;
         b_info->u.hvm.vnc.findunused = 1;
         b_info->u.hvm.serial = NULL;
-        b_info->u.hvm.usb = 0;
         b_info->u.hvm.usbdevice = NULL;
-        b_info->u.hvm.xen_platform_pci = 1;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         b_info->u.pv.slack_memkb = 0;
@@ -142,6 +129,8 @@
     if (b_info->target_memkb == LIBXL_MEMKB_DEFAULT)
         b_info->target_memkb = b_info->max_memkb;
 
+    libxl_defbool_setdefault(&b_info->disable_migrate, false);
+
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
@@ -152,6 +141,19 @@
             b_info->u.hvm.timer_mode =
                 LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS;
 
+        libxl_defbool_setdefault(&b_info->u.hvm.pae,                true);
+        libxl_defbool_setdefault(&b_info->u.hvm.apic,               true);
+        libxl_defbool_setdefault(&b_info->u.hvm.acpi,               true);
+        libxl_defbool_setdefault(&b_info->u.hvm.acpi_s3,            true);
+        libxl_defbool_setdefault(&b_info->u.hvm.acpi_s4,            true);
+        libxl_defbool_setdefault(&b_info->u.hvm.nx,                 true);
+        libxl_defbool_setdefault(&b_info->u.hvm.viridian,           false);
+        libxl_defbool_setdefault(&b_info->u.hvm.hpet,               true);
+        libxl_defbool_setdefault(&b_info->u.hvm.vpt_align,          true);
+        libxl_defbool_setdefault(&b_info->u.hvm.nested_hvm,         false);
+        libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
+        libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
+
         if (!b_info->u.hvm.boot) {
             b_info->u.hvm.boot = strdup("cda");
             if (!b_info->u.hvm.boot) return ERROR_NOMEM;
@@ -166,6 +168,7 @@
 
         break;
     case LIBXL_DOMAIN_TYPE_PV:
+        libxl_defbool_setdefault(&b_info->u.pv.e820_host, false);
         if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
             b_info->shadow_memkb = 0;
         if (b_info->u.pv.slack_memkb == LIBXL_MEMKB_DEFAULT)
@@ -221,11 +224,11 @@
 
         localents = libxl__calloc(gc, 7, sizeof(char *));
         localents[0] = "platform/acpi";
-        localents[1] = (info->u.hvm.acpi) ? "1" : "0";
+        localents[1] = libxl_defbool_val(info->u.hvm.acpi) ? "1" : "0";
         localents[2] = "platform/acpi_s3";
-        localents[3] = (info->u.hvm.acpi_s3) ? "1" : "0";
+        localents[3] = libxl_defbool_val(info->u.hvm.acpi_s3) ? "1" : "0";
         localents[4] = "platform/acpi_s4";
-        localents[5] = (info->u.hvm.acpi_s4) ? "1" : "0";
+        localents[5] = libxl_defbool_val(info->u.hvm.acpi_s4) ? "1" : "0";
 
         break;
     case LIBXL_DOMAIN_TYPE_PV:
@@ -427,7 +430,6 @@
     xs_rm(ctx->xsh, t, dom_path);
     libxl__xs_mkdir(gc, t, dom_path, roperm, ARRAY_SIZE(roperm));
 
-
     xs_rm(ctx->xsh, t, vm_path);
     libxl__xs_mkdir(gc, t, vm_path, roperm, ARRAY_SIZE(roperm));
 
@@ -674,7 +676,7 @@
     }
 
     if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV &&
-        d_config->b_info.u.pv.e820_host) {
+        libxl_defbool_val(d_config->b_info.u.pv.e820_host)) {
         int rc;
         rc = libxl__e820_alloc(gc, domid, d_config);
         if (rc)
diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
@@ -194,7 +194,7 @@
         if (b_info->u.hvm.boot) {
             flexarray_vappend(dm_args, "-boot", b_info->u.hvm.boot, NULL);
         }
-        if (b_info->u.hvm.usb || b_info->u.hvm.usbdevice) {
+        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
@@ -204,7 +204,7 @@
         if (b_info->u.hvm.soundhw) {
             flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
         }
-        if (b_info->u.hvm.acpi) {
+        if (libxl_defbool_val(b_info->u.hvm.acpi)) {
             flexarray_append(dm_args, "-acpi");
         }
         if (b_info->max_vcpus > 1) {
@@ -433,7 +433,7 @@
             flexarray_vappend(dm_args, "-boot",
                     libxl__sprintf(gc, "order=%s", b_info->u.hvm.boot), NULL);
         }
-        if (b_info->u.hvm.usb || b_info->u.hvm.usbdevice) {
+        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
@@ -443,7 +443,7 @@
         if (b_info->u.hvm.soundhw) {
             flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
         }
-        if (!b_info->u.hvm.acpi) {
+        if (!libxl_defbool_val(b_info->u.hvm.acpi)) {
             flexarray_append(dm_args, "-no-acpi");
         }
         if (b_info->max_vcpus > 1) {
@@ -945,7 +945,7 @@
         b_info->device_model_version
         == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL)
         libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/disable_pf", path),
-                        "%d", !b_info->u.hvm.xen_platform_pci);
+                    "%d", !libxl_defbool_val(b_info->u.hvm.xen_platform_pci));
 
     libxl_create_logfile(ctx,
                          libxl__sprintf(gc, "qemu-dm-%s", c_info->name),
diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_dom.c	Thu Mar 01 12:26:15 2012 +0000
@@ -88,7 +88,7 @@
         abort();
     }
     xc_domain_set_tsc_info(ctx->xch, domid, tsc_mode, 0, 0, 0);
-    if ( info->disable_migrate )
+    if (libxl_defbool_val(info->disable_migrate))
         xc_domain_disable_migrate(ctx->xch, domid);
 
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
@@ -292,7 +292,7 @@
         return -1;
 
     va_hvm = (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET);
-    va_hvm->apic_mode = info->u.hvm.apic;
+    va_hvm->apic_mode = libxl_defbool_val(info->u.hvm.apic);
     va_hvm->nr_vcpus = info->max_vcpus;
     memcpy(va_hvm->vcpu_online, &info->cur_vcpus, sizeof(info->cur_vcpus));
     for (i = 0, sum = 0; i < va_hvm->length; i++)
@@ -302,14 +302,19 @@
 
     xc_get_hvm_param(handle, domid, HVM_PARAM_STORE_PFN, store_mfn);
     xc_get_hvm_param(handle, domid, HVM_PARAM_CONSOLE_PFN, console_mfn);
-    xc_set_hvm_param(handle, domid, HVM_PARAM_PAE_ENABLED, info->u.hvm.pae);
+    xc_set_hvm_param(handle, domid, HVM_PARAM_PAE_ENABLED,
+                     libxl_defbool_val(info->u.hvm.pae));
 #if defined(__i386__) || defined(__x86_64__)
-    xc_set_hvm_param(handle, domid, HVM_PARAM_VIRIDIAN, info->u.hvm.viridian);
-    xc_set_hvm_param(handle, domid, HVM_PARAM_HPET_ENABLED, (unsigned long) info->u.hvm.hpet);
+    xc_set_hvm_param(handle, domid, HVM_PARAM_VIRIDIAN,
+                     libxl_defbool_val(info->u.hvm.viridian));
+    xc_set_hvm_param(handle, domid, HVM_PARAM_HPET_ENABLED,
+                     libxl_defbool_val(info->u.hvm.hpet));
 #endif
     xc_set_hvm_param(handle, domid, HVM_PARAM_TIMER_MODE, timer_mode(info));
-    xc_set_hvm_param(handle, domid, HVM_PARAM_VPT_ALIGN, (unsigned long) info->u.hvm.vpt_align);
-    xc_set_hvm_param(handle, domid, HVM_PARAM_NESTEDHVM, info->u.hvm.nested_hvm);
+    xc_set_hvm_param(handle, domid, HVM_PARAM_VPT_ALIGN,
+                     libxl_defbool_val(info->u.hvm.vpt_align));
+    xc_set_hvm_param(handle, domid, HVM_PARAM_NESTEDHVM,
+                     libxl_defbool_val(info->u.hvm.nested_hvm));
     xc_set_hvm_param(handle, domid, HVM_PARAM_STORE_EVTCHN, store_evtchn);
     xc_set_hvm_param(handle, domid, HVM_PARAM_CONSOLE_EVTCHN, console_evtchn);
 
@@ -400,7 +405,7 @@
     case LIBXL_DOMAIN_TYPE_HVM:
         hvm = 1;
         superpages = 1;
-        pae = info->u.hvm.pae;
+        pae = libxl_defbool_val(info->u.hvm.pae);
         no_incr_generationid = info->u.hvm.no_incr_generationid;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_pci.c	Thu Mar 01 12:26:15 2012 +0000
@@ -1378,7 +1378,7 @@
         return ERROR_INVAL;
 
     b_info = &d_config->b_info;
-    if (!b_info->u.pv.e820_host)
+    if (!libxl_defbool_val(b_info->u.pv.e820_host))
         return ERROR_INVAL;
 
     rc = xc_get_machine_memory_map(ctx->xch, map, E820MAX);
diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
@@ -235,7 +235,7 @@
     ("target_memkb",    MemKB),
     ("video_memkb",     MemKB),
     ("shadow_memkb",    MemKB),
-    ("disable_migrate", bool),
+    ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
     ("type",            libxl_domain_type),
     
@@ -253,20 +253,20 @@
     ("extra_hvm",        libxl_string_list),
 
     ("u", KeyedUnion(None, libxl_domain_type, "type",
-                [("hvm", Struct(None, [("firmware", string),
-                                       ("bios", libxl_bios_type),
-                                       ("pae", bool),
-                                       ("apic", bool),
-                                       ("acpi", bool),
-                                       ("acpi_s3", bool),
-                                       ("acpi_s4", bool),
-                                       ("nx", bool),
-                                       ("viridian", bool),
-                                       ("timeoffset", string),
-                                       ("hpet", bool),
-                                       ("vpt_align", bool),
-                                       ("timer_mode", libxl_timer_mode),
-                                       ("nested_hvm", bool),
+                [("hvm", Struct(None, [("firmware",         string),
+                                       ("bios",             libxl_bios_type),
+                                       ("pae",              libxl_defbool),
+                                       ("apic",             libxl_defbool),
+                                       ("acpi",             libxl_defbool),
+                                       ("acpi_s3",          libxl_defbool),
+                                       ("acpi_s4",          libxl_defbool),
+                                       ("nx",               libxl_defbool),
+                                       ("viridian",         libxl_defbool),
+                                       ("timeoffset",       string),
+                                       ("hpet",             libxl_defbool),
+                                       ("vpt_align",        libxl_defbool),
+                                       ("timer_mode",       libxl_timer_mode),
+                                       ("nested_hvm",       libxl_defbool),
                                        ("no_incr_generationid", bool),
                                        ("nographic",        bool),
                                        ("stdvga",           bool),
@@ -280,13 +280,13 @@
                                        
                                        ("serial",           string),
                                        ("boot",             string),
-                                       ("usb",              bool),
+                                       ("usb",              libxl_defbool),
                                        # usbdevice:
                                        # - "tablet" for absolute mouse,
                                        # - "mouse" for PS/2 protocol relative mouse
                                        ("usbdevice",        string),
                                        ("soundhw",          string),
-                                       ("xen_platform_pci", bool),
+                                       ("xen_platform_pci", libxl_defbool),
                                        ])),
                  ("pv", Struct(None, [("kernel", libxl_file_reference),
                                       ("slack_memkb", MemKB),
@@ -296,7 +296,7 @@
                                       ("ramdisk", libxl_file_reference),
                                       ("features", string, {'const': True}),
                                       # Use host's E820 for PCI passthrough.
-                                      ("e820_host", bool),
+                                      ("e820_host", libxl_defbool),
                                       ])),
                  ])),
     ],
diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -671,8 +671,7 @@
         : libxl_get_required_shadow_memory(b_info->max_memkb,
                                            b_info->max_vcpus);
 
-    if (!xlu_cfg_get_long (config, "nomigrate", &l, 0))
-        b_info->disable_migrate = l;
+    xlu_cfg_get_defbool(config, "nomigrate", &b_info->disable_migrate, 0);
 
     if (!xlu_cfg_get_long(config, "tsc_mode", &l, 1)) {
         const char *s = libxl_tsc_mode_to_string(l);
@@ -714,24 +713,16 @@
                     buf);
                 exit (1);
         }
-        if (!xlu_cfg_get_long (config, "pae", &l, 0))
-            b_info->u.hvm.pae = l;
-        if (!xlu_cfg_get_long (config, "apic", &l, 0))
-            b_info->u.hvm.apic = l;
-        if (!xlu_cfg_get_long (config, "acpi", &l, 0))
-            b_info->u.hvm.acpi = l;
-        if (!xlu_cfg_get_long (config, "acpi_s3", &l, 0))
-            b_info->u.hvm.acpi_s3 = l;
-        if (!xlu_cfg_get_long (config, "acpi_s4", &l, 0))
-            b_info->u.hvm.acpi_s4 = l;
-        if (!xlu_cfg_get_long (config, "nx", &l, 0))
-            b_info->u.hvm.nx = l;
-        if (!xlu_cfg_get_long (config, "viridian", &l, 0))
-            b_info->u.hvm.viridian = l;
-        if (!xlu_cfg_get_long (config, "hpet", &l, 0))
-            b_info->u.hvm.hpet = l;
-        if (!xlu_cfg_get_long (config, "vpt_align", &l, 0))
-            b_info->u.hvm.vpt_align = l;
+
+        xlu_cfg_get_defbool(config, "pae", &b_info->u.hvm.pae, 0);
+        xlu_cfg_get_defbool(config, "apic", &b_info->u.hvm.apic, 0);
+        xlu_cfg_get_defbool(config, "acpi", &b_info->u.hvm.acpi, 0);
+        xlu_cfg_get_defbool(config, "acpi_s3", &b_info->u.hvm.acpi_s3, 0);
+        xlu_cfg_get_defbool(config, "acpi_s4", &b_info->u.hvm.acpi_s4, 0);
+        xlu_cfg_get_defbool(config, "nx", &b_info->u.hvm.nx, 0);
+        xlu_cfg_get_defbool(config, "viridian", &b_info->u.hvm.viridian, 0);
+        xlu_cfg_get_defbool(config, "hpet", &b_info->u.hvm.hpet, 0);
+        xlu_cfg_get_defbool(config, "vpt_align", &b_info->u.hvm.vpt_align, 0);
 
         if (!xlu_cfg_get_long(config, "timer_mode", &l, 1)) {
             const char *s = libxl_timer_mode_to_string(l);
@@ -756,8 +747,7 @@
             }
         }
 
-        if (!xlu_cfg_get_long (config, "nestedhvm", &l, 0))
-            b_info->u.hvm.nested_hvm = l;
+        xlu_cfg_get_defbool(config, "nestedhvm", &b_info->u.hvm.nested_hvm, 0);
         break;
     case LIBXL_DOMAIN_TYPE_PV:
     {
@@ -997,19 +987,10 @@
 
     /* To be reworked (automatically enabled) once the auto ballooning
      * after guest starts is done (with PCI devices passed in). */
-    if (!xlu_cfg_get_long (config, "e820_host", &l, 0)) {
-        switch (c_info->type) {
-        case LIBXL_DOMAIN_TYPE_HVM:
-            fprintf(stderr, "Can't do e820_host in HVM mode!");
-            break;
-        case LIBXL_DOMAIN_TYPE_PV:
-            if (l)
-                b_info->u.pv.e820_host = true;
-            break;
-        default:
-            abort();
-        }
-    }
+    if (c_info->type == LIBXL_DOMAIN_TYPE_PV) {
+        xlu_cfg_get_defbool(config, "e820_host", &b_info->u.pv.e820_host, 0);
+    }
+
     if (!xlu_cfg_get_list (config, "pci", &pcis, 0, 0)) {
         int i;
         d_config->num_pcidevs = 0;
@@ -1027,7 +1008,7 @@
                 d_config->num_pcidevs++;
         }
         if (d_config->num_pcidevs && c_info->type == LIBXL_DOMAIN_TYPE_PV)
-            b_info->u.pv.e820_host = true;
+            libxl_defbool_set(&b_info->u.pv.e820_host, true);
     }
 
     switch (xlu_cfg_get_list(config, "cpuid", &cpuids, 0, 1)) {
@@ -1219,12 +1200,12 @@
             b_info->u.hvm.gfx_passthru = l;
         xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
         xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
-        if (!xlu_cfg_get_long (config, "usb", &l, 0))
-            b_info->u.hvm.usb = l;
-        xlu_cfg_replace_string (config, "usbdevice", &b_info->u.hvm.usbdevice, 0);
+        xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
+        xlu_cfg_replace_string (config, "usbdevice",
+                                &b_info->u.hvm.usbdevice, 0);
         xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
-        if (!xlu_cfg_get_long (config, "xen_platform_pci", &l, 0))
-            b_info->u.hvm.xen_platform_pci = l;
+        xlu_cfg_get_defbool(config, "xen_platform_pci",
+                            &b_info->u.hvm.xen_platform_pci, 0);
     }
 
     xlu_cfg_destroy(config);
diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:15 2012 +0000
@@ -71,7 +71,8 @@
     printf("\t(tsc_mode %s)\n", libxl_tsc_mode_to_string(b_info->tsc_mode));
     printf("\t(max_memkb %"PRId64")\n", b_info->max_memkb);
     printf("\t(target_memkb %"PRId64")\n", b_info->target_memkb);
-    printf("\t(nomigrate %d)\n", b_info->disable_migrate);
+    printf("\t(nomigrate %s)\n",
+           libxl_defbool_to_string(b_info->disable_migrate));
 
     if (c_info->type == LIBXL_DOMAIN_TYPE_PV && b_info->u.pv.bootloader) {
         int i;
@@ -91,16 +92,22 @@
         printf("\t\t\t(firmware %s)\n", b_info->u.hvm.firmware);
         printf("\t\t\t(video_memkb %"PRId64")\n", b_info->video_memkb);
         printf("\t\t\t(shadow_memkb %"PRId64")\n", b_info->shadow_memkb);
-        printf("\t\t\t(pae %d)\n", b_info->u.hvm.pae);
-        printf("\t\t\t(apic %d)\n", b_info->u.hvm.apic);
-        printf("\t\t\t(acpi %d)\n", b_info->u.hvm.acpi);
-        printf("\t\t\t(nx %d)\n", b_info->u.hvm.nx);
-        printf("\t\t\t(viridian %d)\n", b_info->u.hvm.viridian);
-        printf("\t\t\t(hpet %d)\n", b_info->u.hvm.hpet);
-        printf("\t\t\t(vpt_align %d)\n", b_info->u.hvm.vpt_align);
+        printf("\t\t\t(pae %s)\n", libxl_defbool_to_string(b_info->u.hvm.pae));
+        printf("\t\t\t(apic %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.apic));
+        printf("\t\t\t(acpi %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.acpi));
+        printf("\t\t\t(nx %s)\n", libxl_defbool_to_string(b_info->u.hvm.nx));
+        printf("\t\t\t(viridian %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.viridian));
+        printf("\t\t\t(hpet %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.hpet));
+        printf("\t\t\t(vpt_align %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.vpt_align));
         printf("\t\t\t(timer_mode %s)\n",
                libxl_timer_mode_to_string(b_info->u.hvm.timer_mode));
-        printf("\t\t\t(nestedhvm %d)\n", b_info->u.hvm.nested_hvm);
+        printf("\t\t\t(nestedhvm %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.nested_hvm));
         printf("\t\t\t(no_incr_generationid %d)\n",
                     b_info->u.hvm.no_incr_generationid);
 
@@ -125,7 +132,7 @@
         printf("\t\t\t(gfx_passthru %d)\n", b_info->u.hvm.gfx_passthru);
         printf("\t\t\t(serial %s)\n", b_info->u.hvm.serial);
         printf("\t\t\t(boot %s)\n", b_info->u.hvm.boot);
-        printf("\t\t\t(usb %d)\n", b_info->u.hvm.usb);
+        printf("\t\t\t(usb %s)\n", libxl_defbool_to_string(b_info->u.hvm.usb));
         printf("\t\t\t(usbdevice %s)\n", b_info->u.hvm.usbdevice);
         printf("\t\t)\n");
         break;
@@ -134,7 +141,8 @@
         printf("\t\t\t(kernel %s)\n", b_info->u.pv.kernel.path);
         printf("\t\t\t(cmdline %s)\n", b_info->u.pv.cmdline);
         printf("\t\t\t(ramdisk %s)\n", b_info->u.pv.ramdisk.path);
-        printf("\t\t\t(e820_host %d)\n", b_info->u.pv.e820_host);
+        printf("\t\t\t(e820_host %s)\n",
+               libxl_defbool_to_string(b_info->u.pv.e820_host));
         printf("\t\t)\n");
         break;
     default:

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3ger-0000Le-6n; Sat, 03 Mar 2012 04:33: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 1S3gep-0000Ia-F5
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:23 +0000
Received: from [85.158.139.83:18907] by server-1.bemta-5.messagelabs.com id
	31/23-28458-21F915F4; Sat, 03 Mar 2012 04:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1330749199!17592081!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12434 invoked from network); 3 Mar 2012 04:33:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33: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 1S3gel-0004gO-8t
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gel-0003S8-7b
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:19 +0000
Message-Id: <E1S3gel-0003S8-7b@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: make boolean members of
	libxl_domain_build_info into libxl_defbool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID 53ea53663b48ea752905ab7b9addd2dd043852cc
# Parent  5c9077a5722c4edf87b298dcd192632f031200ae
libxl: make boolean members of libxl_domain_build_info into libxl_defbool

This allows them to be set via the _init/_setdefault methods.

This just covers the obvious ones.

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


diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_bootloader.c	Thu Mar 01 12:26:15 2012 +0000
@@ -352,6 +352,9 @@
     if (info->type != LIBXL_DOMAIN_TYPE_PV || !info->u.pv.bootloader)
         goto out;
 
+    rc = libxl__domain_build_info_setdefault(gc, info);
+    if (rc) goto out;
+
     rc = ERROR_INVAL;
     if (!disk)
         goto out;
diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -73,7 +73,6 @@
                                   const libxl_domain_create_info *c_info)
 {
     memset(b_info, '\0', sizeof(*b_info));
-    b_info->disable_migrate = 0;
     b_info->cpuid = NULL;
     b_info->type = c_info->type;
 
@@ -89,17 +88,7 @@
     case LIBXL_DOMAIN_TYPE_HVM:
         b_info->u.hvm.firmware = NULL;
         b_info->u.hvm.bios = 0;
-        b_info->u.hvm.pae = 1;
-        b_info->u.hvm.apic = 1;
-        b_info->u.hvm.acpi = 1;
-        b_info->u.hvm.acpi_s3 = 1;
-        b_info->u.hvm.acpi_s4 = 1;
-        b_info->u.hvm.nx = 1;
-        b_info->u.hvm.viridian = 0;
-        b_info->u.hvm.hpet = 1;
-        b_info->u.hvm.vpt_align = 1;
         b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
-        b_info->u.hvm.nested_hvm = 0;
         b_info->u.hvm.no_incr_generationid = 0;
 
         b_info->u.hvm.stdvga = 0;
@@ -107,9 +96,7 @@
         b_info->u.hvm.vnc.display = 0;
         b_info->u.hvm.vnc.findunused = 1;
         b_info->u.hvm.serial = NULL;
-        b_info->u.hvm.usb = 0;
         b_info->u.hvm.usbdevice = NULL;
-        b_info->u.hvm.xen_platform_pci = 1;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         b_info->u.pv.slack_memkb = 0;
@@ -142,6 +129,8 @@
     if (b_info->target_memkb == LIBXL_MEMKB_DEFAULT)
         b_info->target_memkb = b_info->max_memkb;
 
+    libxl_defbool_setdefault(&b_info->disable_migrate, false);
+
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
@@ -152,6 +141,19 @@
             b_info->u.hvm.timer_mode =
                 LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS;
 
+        libxl_defbool_setdefault(&b_info->u.hvm.pae,                true);
+        libxl_defbool_setdefault(&b_info->u.hvm.apic,               true);
+        libxl_defbool_setdefault(&b_info->u.hvm.acpi,               true);
+        libxl_defbool_setdefault(&b_info->u.hvm.acpi_s3,            true);
+        libxl_defbool_setdefault(&b_info->u.hvm.acpi_s4,            true);
+        libxl_defbool_setdefault(&b_info->u.hvm.nx,                 true);
+        libxl_defbool_setdefault(&b_info->u.hvm.viridian,           false);
+        libxl_defbool_setdefault(&b_info->u.hvm.hpet,               true);
+        libxl_defbool_setdefault(&b_info->u.hvm.vpt_align,          true);
+        libxl_defbool_setdefault(&b_info->u.hvm.nested_hvm,         false);
+        libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
+        libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
+
         if (!b_info->u.hvm.boot) {
             b_info->u.hvm.boot = strdup("cda");
             if (!b_info->u.hvm.boot) return ERROR_NOMEM;
@@ -166,6 +168,7 @@
 
         break;
     case LIBXL_DOMAIN_TYPE_PV:
+        libxl_defbool_setdefault(&b_info->u.pv.e820_host, false);
         if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
             b_info->shadow_memkb = 0;
         if (b_info->u.pv.slack_memkb == LIBXL_MEMKB_DEFAULT)
@@ -221,11 +224,11 @@
 
         localents = libxl__calloc(gc, 7, sizeof(char *));
         localents[0] = "platform/acpi";
-        localents[1] = (info->u.hvm.acpi) ? "1" : "0";
+        localents[1] = libxl_defbool_val(info->u.hvm.acpi) ? "1" : "0";
         localents[2] = "platform/acpi_s3";
-        localents[3] = (info->u.hvm.acpi_s3) ? "1" : "0";
+        localents[3] = libxl_defbool_val(info->u.hvm.acpi_s3) ? "1" : "0";
         localents[4] = "platform/acpi_s4";
-        localents[5] = (info->u.hvm.acpi_s4) ? "1" : "0";
+        localents[5] = libxl_defbool_val(info->u.hvm.acpi_s4) ? "1" : "0";
 
         break;
     case LIBXL_DOMAIN_TYPE_PV:
@@ -427,7 +430,6 @@
     xs_rm(ctx->xsh, t, dom_path);
     libxl__xs_mkdir(gc, t, dom_path, roperm, ARRAY_SIZE(roperm));
 
-
     xs_rm(ctx->xsh, t, vm_path);
     libxl__xs_mkdir(gc, t, vm_path, roperm, ARRAY_SIZE(roperm));
 
@@ -674,7 +676,7 @@
     }
 
     if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV &&
-        d_config->b_info.u.pv.e820_host) {
+        libxl_defbool_val(d_config->b_info.u.pv.e820_host)) {
         int rc;
         rc = libxl__e820_alloc(gc, domid, d_config);
         if (rc)
diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
@@ -194,7 +194,7 @@
         if (b_info->u.hvm.boot) {
             flexarray_vappend(dm_args, "-boot", b_info->u.hvm.boot, NULL);
         }
-        if (b_info->u.hvm.usb || b_info->u.hvm.usbdevice) {
+        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
@@ -204,7 +204,7 @@
         if (b_info->u.hvm.soundhw) {
             flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
         }
-        if (b_info->u.hvm.acpi) {
+        if (libxl_defbool_val(b_info->u.hvm.acpi)) {
             flexarray_append(dm_args, "-acpi");
         }
         if (b_info->max_vcpus > 1) {
@@ -433,7 +433,7 @@
             flexarray_vappend(dm_args, "-boot",
                     libxl__sprintf(gc, "order=%s", b_info->u.hvm.boot), NULL);
         }
-        if (b_info->u.hvm.usb || b_info->u.hvm.usbdevice) {
+        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
@@ -443,7 +443,7 @@
         if (b_info->u.hvm.soundhw) {
             flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
         }
-        if (!b_info->u.hvm.acpi) {
+        if (!libxl_defbool_val(b_info->u.hvm.acpi)) {
             flexarray_append(dm_args, "-no-acpi");
         }
         if (b_info->max_vcpus > 1) {
@@ -945,7 +945,7 @@
         b_info->device_model_version
         == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL)
         libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/disable_pf", path),
-                        "%d", !b_info->u.hvm.xen_platform_pci);
+                    "%d", !libxl_defbool_val(b_info->u.hvm.xen_platform_pci));
 
     libxl_create_logfile(ctx,
                          libxl__sprintf(gc, "qemu-dm-%s", c_info->name),
diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_dom.c	Thu Mar 01 12:26:15 2012 +0000
@@ -88,7 +88,7 @@
         abort();
     }
     xc_domain_set_tsc_info(ctx->xch, domid, tsc_mode, 0, 0, 0);
-    if ( info->disable_migrate )
+    if (libxl_defbool_val(info->disable_migrate))
         xc_domain_disable_migrate(ctx->xch, domid);
 
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
@@ -292,7 +292,7 @@
         return -1;
 
     va_hvm = (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET);
-    va_hvm->apic_mode = info->u.hvm.apic;
+    va_hvm->apic_mode = libxl_defbool_val(info->u.hvm.apic);
     va_hvm->nr_vcpus = info->max_vcpus;
     memcpy(va_hvm->vcpu_online, &info->cur_vcpus, sizeof(info->cur_vcpus));
     for (i = 0, sum = 0; i < va_hvm->length; i++)
@@ -302,14 +302,19 @@
 
     xc_get_hvm_param(handle, domid, HVM_PARAM_STORE_PFN, store_mfn);
     xc_get_hvm_param(handle, domid, HVM_PARAM_CONSOLE_PFN, console_mfn);
-    xc_set_hvm_param(handle, domid, HVM_PARAM_PAE_ENABLED, info->u.hvm.pae);
+    xc_set_hvm_param(handle, domid, HVM_PARAM_PAE_ENABLED,
+                     libxl_defbool_val(info->u.hvm.pae));
 #if defined(__i386__) || defined(__x86_64__)
-    xc_set_hvm_param(handle, domid, HVM_PARAM_VIRIDIAN, info->u.hvm.viridian);
-    xc_set_hvm_param(handle, domid, HVM_PARAM_HPET_ENABLED, (unsigned long) info->u.hvm.hpet);
+    xc_set_hvm_param(handle, domid, HVM_PARAM_VIRIDIAN,
+                     libxl_defbool_val(info->u.hvm.viridian));
+    xc_set_hvm_param(handle, domid, HVM_PARAM_HPET_ENABLED,
+                     libxl_defbool_val(info->u.hvm.hpet));
 #endif
     xc_set_hvm_param(handle, domid, HVM_PARAM_TIMER_MODE, timer_mode(info));
-    xc_set_hvm_param(handle, domid, HVM_PARAM_VPT_ALIGN, (unsigned long) info->u.hvm.vpt_align);
-    xc_set_hvm_param(handle, domid, HVM_PARAM_NESTEDHVM, info->u.hvm.nested_hvm);
+    xc_set_hvm_param(handle, domid, HVM_PARAM_VPT_ALIGN,
+                     libxl_defbool_val(info->u.hvm.vpt_align));
+    xc_set_hvm_param(handle, domid, HVM_PARAM_NESTEDHVM,
+                     libxl_defbool_val(info->u.hvm.nested_hvm));
     xc_set_hvm_param(handle, domid, HVM_PARAM_STORE_EVTCHN, store_evtchn);
     xc_set_hvm_param(handle, domid, HVM_PARAM_CONSOLE_EVTCHN, console_evtchn);
 
@@ -400,7 +405,7 @@
     case LIBXL_DOMAIN_TYPE_HVM:
         hvm = 1;
         superpages = 1;
-        pae = info->u.hvm.pae;
+        pae = libxl_defbool_val(info->u.hvm.pae);
         no_incr_generationid = info->u.hvm.no_incr_generationid;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_pci.c	Thu Mar 01 12:26:15 2012 +0000
@@ -1378,7 +1378,7 @@
         return ERROR_INVAL;
 
     b_info = &d_config->b_info;
-    if (!b_info->u.pv.e820_host)
+    if (!libxl_defbool_val(b_info->u.pv.e820_host))
         return ERROR_INVAL;
 
     rc = xc_get_machine_memory_map(ctx->xch, map, E820MAX);
diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
@@ -235,7 +235,7 @@
     ("target_memkb",    MemKB),
     ("video_memkb",     MemKB),
     ("shadow_memkb",    MemKB),
-    ("disable_migrate", bool),
+    ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
     ("type",            libxl_domain_type),
     
@@ -253,20 +253,20 @@
     ("extra_hvm",        libxl_string_list),
 
     ("u", KeyedUnion(None, libxl_domain_type, "type",
-                [("hvm", Struct(None, [("firmware", string),
-                                       ("bios", libxl_bios_type),
-                                       ("pae", bool),
-                                       ("apic", bool),
-                                       ("acpi", bool),
-                                       ("acpi_s3", bool),
-                                       ("acpi_s4", bool),
-                                       ("nx", bool),
-                                       ("viridian", bool),
-                                       ("timeoffset", string),
-                                       ("hpet", bool),
-                                       ("vpt_align", bool),
-                                       ("timer_mode", libxl_timer_mode),
-                                       ("nested_hvm", bool),
+                [("hvm", Struct(None, [("firmware",         string),
+                                       ("bios",             libxl_bios_type),
+                                       ("pae",              libxl_defbool),
+                                       ("apic",             libxl_defbool),
+                                       ("acpi",             libxl_defbool),
+                                       ("acpi_s3",          libxl_defbool),
+                                       ("acpi_s4",          libxl_defbool),
+                                       ("nx",               libxl_defbool),
+                                       ("viridian",         libxl_defbool),
+                                       ("timeoffset",       string),
+                                       ("hpet",             libxl_defbool),
+                                       ("vpt_align",        libxl_defbool),
+                                       ("timer_mode",       libxl_timer_mode),
+                                       ("nested_hvm",       libxl_defbool),
                                        ("no_incr_generationid", bool),
                                        ("nographic",        bool),
                                        ("stdvga",           bool),
@@ -280,13 +280,13 @@
                                        
                                        ("serial",           string),
                                        ("boot",             string),
-                                       ("usb",              bool),
+                                       ("usb",              libxl_defbool),
                                        # usbdevice:
                                        # - "tablet" for absolute mouse,
                                        # - "mouse" for PS/2 protocol relative mouse
                                        ("usbdevice",        string),
                                        ("soundhw",          string),
-                                       ("xen_platform_pci", bool),
+                                       ("xen_platform_pci", libxl_defbool),
                                        ])),
                  ("pv", Struct(None, [("kernel", libxl_file_reference),
                                       ("slack_memkb", MemKB),
@@ -296,7 +296,7 @@
                                       ("ramdisk", libxl_file_reference),
                                       ("features", string, {'const': True}),
                                       # Use host's E820 for PCI passthrough.
-                                      ("e820_host", bool),
+                                      ("e820_host", libxl_defbool),
                                       ])),
                  ])),
     ],
diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -671,8 +671,7 @@
         : libxl_get_required_shadow_memory(b_info->max_memkb,
                                            b_info->max_vcpus);
 
-    if (!xlu_cfg_get_long (config, "nomigrate", &l, 0))
-        b_info->disable_migrate = l;
+    xlu_cfg_get_defbool(config, "nomigrate", &b_info->disable_migrate, 0);
 
     if (!xlu_cfg_get_long(config, "tsc_mode", &l, 1)) {
         const char *s = libxl_tsc_mode_to_string(l);
@@ -714,24 +713,16 @@
                     buf);
                 exit (1);
         }
-        if (!xlu_cfg_get_long (config, "pae", &l, 0))
-            b_info->u.hvm.pae = l;
-        if (!xlu_cfg_get_long (config, "apic", &l, 0))
-            b_info->u.hvm.apic = l;
-        if (!xlu_cfg_get_long (config, "acpi", &l, 0))
-            b_info->u.hvm.acpi = l;
-        if (!xlu_cfg_get_long (config, "acpi_s3", &l, 0))
-            b_info->u.hvm.acpi_s3 = l;
-        if (!xlu_cfg_get_long (config, "acpi_s4", &l, 0))
-            b_info->u.hvm.acpi_s4 = l;
-        if (!xlu_cfg_get_long (config, "nx", &l, 0))
-            b_info->u.hvm.nx = l;
-        if (!xlu_cfg_get_long (config, "viridian", &l, 0))
-            b_info->u.hvm.viridian = l;
-        if (!xlu_cfg_get_long (config, "hpet", &l, 0))
-            b_info->u.hvm.hpet = l;
-        if (!xlu_cfg_get_long (config, "vpt_align", &l, 0))
-            b_info->u.hvm.vpt_align = l;
+
+        xlu_cfg_get_defbool(config, "pae", &b_info->u.hvm.pae, 0);
+        xlu_cfg_get_defbool(config, "apic", &b_info->u.hvm.apic, 0);
+        xlu_cfg_get_defbool(config, "acpi", &b_info->u.hvm.acpi, 0);
+        xlu_cfg_get_defbool(config, "acpi_s3", &b_info->u.hvm.acpi_s3, 0);
+        xlu_cfg_get_defbool(config, "acpi_s4", &b_info->u.hvm.acpi_s4, 0);
+        xlu_cfg_get_defbool(config, "nx", &b_info->u.hvm.nx, 0);
+        xlu_cfg_get_defbool(config, "viridian", &b_info->u.hvm.viridian, 0);
+        xlu_cfg_get_defbool(config, "hpet", &b_info->u.hvm.hpet, 0);
+        xlu_cfg_get_defbool(config, "vpt_align", &b_info->u.hvm.vpt_align, 0);
 
         if (!xlu_cfg_get_long(config, "timer_mode", &l, 1)) {
             const char *s = libxl_timer_mode_to_string(l);
@@ -756,8 +747,7 @@
             }
         }
 
-        if (!xlu_cfg_get_long (config, "nestedhvm", &l, 0))
-            b_info->u.hvm.nested_hvm = l;
+        xlu_cfg_get_defbool(config, "nestedhvm", &b_info->u.hvm.nested_hvm, 0);
         break;
     case LIBXL_DOMAIN_TYPE_PV:
     {
@@ -997,19 +987,10 @@
 
     /* To be reworked (automatically enabled) once the auto ballooning
      * after guest starts is done (with PCI devices passed in). */
-    if (!xlu_cfg_get_long (config, "e820_host", &l, 0)) {
-        switch (c_info->type) {
-        case LIBXL_DOMAIN_TYPE_HVM:
-            fprintf(stderr, "Can't do e820_host in HVM mode!");
-            break;
-        case LIBXL_DOMAIN_TYPE_PV:
-            if (l)
-                b_info->u.pv.e820_host = true;
-            break;
-        default:
-            abort();
-        }
-    }
+    if (c_info->type == LIBXL_DOMAIN_TYPE_PV) {
+        xlu_cfg_get_defbool(config, "e820_host", &b_info->u.pv.e820_host, 0);
+    }
+
     if (!xlu_cfg_get_list (config, "pci", &pcis, 0, 0)) {
         int i;
         d_config->num_pcidevs = 0;
@@ -1027,7 +1008,7 @@
                 d_config->num_pcidevs++;
         }
         if (d_config->num_pcidevs && c_info->type == LIBXL_DOMAIN_TYPE_PV)
-            b_info->u.pv.e820_host = true;
+            libxl_defbool_set(&b_info->u.pv.e820_host, true);
     }
 
     switch (xlu_cfg_get_list(config, "cpuid", &cpuids, 0, 1)) {
@@ -1219,12 +1200,12 @@
             b_info->u.hvm.gfx_passthru = l;
         xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
         xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
-        if (!xlu_cfg_get_long (config, "usb", &l, 0))
-            b_info->u.hvm.usb = l;
-        xlu_cfg_replace_string (config, "usbdevice", &b_info->u.hvm.usbdevice, 0);
+        xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
+        xlu_cfg_replace_string (config, "usbdevice",
+                                &b_info->u.hvm.usbdevice, 0);
         xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
-        if (!xlu_cfg_get_long (config, "xen_platform_pci", &l, 0))
-            b_info->u.hvm.xen_platform_pci = l;
+        xlu_cfg_get_defbool(config, "xen_platform_pci",
+                            &b_info->u.hvm.xen_platform_pci, 0);
     }
 
     xlu_cfg_destroy(config);
diff -r 5c9077a5722c -r 53ea53663b48 tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:14 2012 +0000
+++ b/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:15 2012 +0000
@@ -71,7 +71,8 @@
     printf("\t(tsc_mode %s)\n", libxl_tsc_mode_to_string(b_info->tsc_mode));
     printf("\t(max_memkb %"PRId64")\n", b_info->max_memkb);
     printf("\t(target_memkb %"PRId64")\n", b_info->target_memkb);
-    printf("\t(nomigrate %d)\n", b_info->disable_migrate);
+    printf("\t(nomigrate %s)\n",
+           libxl_defbool_to_string(b_info->disable_migrate));
 
     if (c_info->type == LIBXL_DOMAIN_TYPE_PV && b_info->u.pv.bootloader) {
         int i;
@@ -91,16 +92,22 @@
         printf("\t\t\t(firmware %s)\n", b_info->u.hvm.firmware);
         printf("\t\t\t(video_memkb %"PRId64")\n", b_info->video_memkb);
         printf("\t\t\t(shadow_memkb %"PRId64")\n", b_info->shadow_memkb);
-        printf("\t\t\t(pae %d)\n", b_info->u.hvm.pae);
-        printf("\t\t\t(apic %d)\n", b_info->u.hvm.apic);
-        printf("\t\t\t(acpi %d)\n", b_info->u.hvm.acpi);
-        printf("\t\t\t(nx %d)\n", b_info->u.hvm.nx);
-        printf("\t\t\t(viridian %d)\n", b_info->u.hvm.viridian);
-        printf("\t\t\t(hpet %d)\n", b_info->u.hvm.hpet);
-        printf("\t\t\t(vpt_align %d)\n", b_info->u.hvm.vpt_align);
+        printf("\t\t\t(pae %s)\n", libxl_defbool_to_string(b_info->u.hvm.pae));
+        printf("\t\t\t(apic %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.apic));
+        printf("\t\t\t(acpi %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.acpi));
+        printf("\t\t\t(nx %s)\n", libxl_defbool_to_string(b_info->u.hvm.nx));
+        printf("\t\t\t(viridian %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.viridian));
+        printf("\t\t\t(hpet %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.hpet));
+        printf("\t\t\t(vpt_align %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.vpt_align));
         printf("\t\t\t(timer_mode %s)\n",
                libxl_timer_mode_to_string(b_info->u.hvm.timer_mode));
-        printf("\t\t\t(nestedhvm %d)\n", b_info->u.hvm.nested_hvm);
+        printf("\t\t\t(nestedhvm %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.nested_hvm));
         printf("\t\t\t(no_incr_generationid %d)\n",
                     b_info->u.hvm.no_incr_generationid);
 
@@ -125,7 +132,7 @@
         printf("\t\t\t(gfx_passthru %d)\n", b_info->u.hvm.gfx_passthru);
         printf("\t\t\t(serial %s)\n", b_info->u.hvm.serial);
         printf("\t\t\t(boot %s)\n", b_info->u.hvm.boot);
-        printf("\t\t\t(usb %d)\n", b_info->u.hvm.usb);
+        printf("\t\t\t(usb %s)\n", libxl_defbool_to_string(b_info->u.hvm.usb));
         printf("\t\t\t(usbdevice %s)\n", b_info->u.hvm.usbdevice);
         printf("\t\t)\n");
         break;
@@ -134,7 +141,8 @@
         printf("\t\t\t(kernel %s)\n", b_info->u.pv.kernel.path);
         printf("\t\t\t(cmdline %s)\n", b_info->u.pv.cmdline);
         printf("\t\t\t(ramdisk %s)\n", b_info->u.pv.ramdisk.path);
-        printf("\t\t\t(e820_host %d)\n", b_info->u.pv.e820_host);
+        printf("\t\t\t(e820_host %s)\n",
+               libxl_defbool_to_string(b_info->u.pv.e820_host));
         printf("\t\t)\n");
         break;
     default:

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3ges-0000O4-Hi; Sat, 03 Mar 2012 04:33:26 +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 1S3geq-0000JT-J2
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Received: from [85.158.139.83:61946] by server-7.bemta-5.messagelabs.com id
	42/8A-16195-31F915F4; Sat, 03 Mar 2012 04:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1330749200!10325835!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13374 invoked from network); 3 Mar 2012 04:33:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33: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 1S3gem-0004gU-EA
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gem-0003T7-C6
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:20 +0000
Message-Id: <E1S3gem-0003T7-C6@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: use defbool for graphics
	related 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID cb25f8d90f5f963a24b69dbb7e72dd3b33d7eb2b
# Parent  d78d760a678d39fe2c34b4b0331d3ebe7bb6aefb
libxl: use defbool for graphics related options

This allows them to be set via the _init/_setdefault methods.

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


diff -r d78d760a678d -r cb25f8d90f5f tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -2257,22 +2257,23 @@
 void libxl_device_vfb_init(libxl_device_vfb *vfb)
 {
     memset(vfb, 0x00, sizeof(libxl_device_vfb));
-    vfb->vnc.enable = 1;
-    vfb->vnc.passwd = NULL;
-    vfb->vnc.display = 0;
-    vfb->vnc.findunused = 1;
-    vfb->keymap = NULL;
-    vfb->sdl.enable = 0;
-    vfb->sdl.opengl = 0;
-    vfb->sdl.display = NULL;
-    vfb->sdl.xauthority = NULL;
 }
 
 int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb)
 {
-    if (!vfb->vnc.listen) {
-        vfb->vnc.listen = strdup("127.0.0.1");
-        if (!vfb->vnc.listen) return ERROR_NOMEM;
+    libxl_defbool_setdefault(&vfb->vnc.enable, true);
+    if (libxl_defbool_val(vfb->vnc.enable)) {
+        if (!vfb->vnc.listen) {
+            vfb->vnc.listen = strdup("127.0.0.1");
+            if (!vfb->vnc.listen) return ERROR_NOMEM;
+        }
+
+        libxl_defbool_setdefault(&vfb->vnc.findunused, true);
+    }
+
+    libxl_defbool_setdefault(&vfb->sdl.enable, false);
+    if (libxl_defbool_val(vfb->sdl.enable)) {
+        libxl_defbool_setdefault(&vfb->sdl.opengl, false);
     }
 
     return 0;
@@ -2321,17 +2322,17 @@
     flexarray_append_pair(back, "state", libxl__sprintf(gc, "%d", 1));
     flexarray_append_pair(back, "domain", libxl__domid_to_name(gc, domid));
     flexarray_append_pair(back, "vnc",
-                          libxl__sprintf(gc, "%d", vfb->vnc.enable));
+                          libxl_defbool_val(vfb->vnc.enable) ? "1" : "0");
     flexarray_append_pair(back, "vnclisten", vfb->vnc.listen);
     flexarray_append_pair(back, "vncpasswd", vfb->vnc.passwd);
     flexarray_append_pair(back, "vncdisplay",
                           libxl__sprintf(gc, "%d", vfb->vnc.display));
     flexarray_append_pair(back, "vncunused",
-                          libxl__sprintf(gc, "%d", vfb->vnc.findunused));
+                          libxl_defbool_val(vfb->vnc.findunused) ? "1" : "0");
     flexarray_append_pair(back, "sdl",
-                          libxl__sprintf(gc, "%d", vfb->sdl.enable));
+                          libxl_defbool_val(vfb->sdl.enable) ? "1" : "0");
     flexarray_append_pair(back, "opengl",
-                          libxl__sprintf(gc, "%d", vfb->sdl.opengl));
+                          libxl_defbool_val(vfb->sdl.opengl) ? "1" : "0");
     if (vfb->sdl.xauthority) {
         flexarray_append_pair(back, "xauthority", vfb->sdl.xauthority);
     }
diff -r d78d760a678d -r cb25f8d90f5f tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -90,10 +90,7 @@
         b_info->u.hvm.bios = 0;
         b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
 
-        b_info->u.hvm.stdvga = 0;
-        b_info->u.hvm.vnc.enable = 1;
         b_info->u.hvm.vnc.display = 0;
-        b_info->u.hvm.vnc.findunused = 1;
         b_info->u.hvm.serial = NULL;
         b_info->u.hvm.usbdevice = NULL;
         break;
@@ -159,13 +156,32 @@
             if (!b_info->u.hvm.boot) return ERROR_NOMEM;
         }
 
-        if (b_info->u.hvm.vnc.enable) {
+        libxl_defbool_setdefault(&b_info->u.hvm.stdvga, false);
+        libxl_defbool_setdefault(&b_info->u.hvm.vnc.enable, true);
+        if (libxl_defbool_val(b_info->u.hvm.vnc.enable)) {
+            libxl_defbool_setdefault(&b_info->u.hvm.vnc.findunused, true);
             if (!b_info->u.hvm.vnc.listen) {
                 b_info->u.hvm.vnc.listen = strdup("127.0.0.1");
                 if (!b_info->u.hvm.vnc.listen) return ERROR_NOMEM;
             }
         }
 
+        libxl_defbool_setdefault(&b_info->u.hvm.sdl.enable, false);
+        if (libxl_defbool_val(b_info->u.hvm.sdl.enable)) {
+            libxl_defbool_setdefault(&b_info->u.hvm.sdl.opengl, false);
+        }
+
+        libxl_defbool_setdefault(&b_info->u.hvm.spice.enable, false);
+        if (libxl_defbool_val(b_info->u.hvm.spice.enable)) {
+            libxl_defbool_setdefault(&b_info->u.hvm.spice.disable_ticketing,
+                                     false);
+            libxl_defbool_setdefault(&b_info->u.hvm.spice.agent_mouse, true);
+        }
+
+        libxl_defbool_setdefault(&b_info->u.hvm.nographic, false);
+
+        libxl_defbool_setdefault(&b_info->u.hvm.gfx_passthru, false);
+
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         libxl_defbool_setdefault(&b_info->u.pv.e820_host, false);
diff -r d78d760a678d -r cb25f8d90f5f tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
@@ -83,7 +83,7 @@
     } else if (guest_config->num_vfbs > 0) {
         vnc = &guest_config->vfbs[0].vnc;
     }
-    return vnc && vnc->enable ? vnc : NULL;
+    return vnc && libxl_defbool_val(vnc->enable) ? vnc : NULL;
 }
 
 static const libxl_sdl_info *dm_sdl(const libxl_domain_config *guest_config)
@@ -94,7 +94,7 @@
     } else if (guest_config->num_vfbs > 0) {
         sdl = &guest_config->vfbs[0].sdl;
     }
-    return sdl && sdl->enable ? sdl : NULL;
+    return sdl && libxl_defbool_val(sdl->enable) ? sdl : NULL;
 }
 
 static const char *dm_keymap(const libxl_domain_config *guest_config)
@@ -156,13 +156,13 @@
         flexarray_append(dm_args, "-vnc");
         flexarray_append(dm_args, vncarg);
 
-        if (vnc->findunused) {
+        if (libxl_defbool_val(vnc->findunused)) {
             flexarray_append(dm_args, "-vncunused");
         }
     }
     if (sdl) {
         flexarray_append(dm_args, "-sdl");
-        if (!sdl->opengl) {
+        if (!libxl_defbool_val(sdl->opengl)) {
             flexarray_append(dm_args, "-disable-opengl");
         }
         /* XXX sdl->{display,xauthority} into $DISPLAY/$XAUTHORITY */
@@ -177,7 +177,7 @@
             flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, NULL);
         }
 
-        if (b_info->u.hvm.nographic && (!sdl && !vnc)) {
+        if (libxl_defbool_val(b_info->u.hvm.nographic) && (!sdl && !vnc)) {
             flexarray_append(dm_args, "-nographic");
         }
 
@@ -187,7 +187,7 @@
                                    libxl__sizekb_to_mb(b_info->video_memkb)),
                     NULL);
         }
-        if (b_info->u.hvm.stdvga) {
+        if (libxl_defbool_val(b_info->u.hvm.stdvga)) {
             flexarray_append(dm_args, "-std-vga");
         }
 
@@ -240,7 +240,7 @@
         if ( ioemu_vifs == 0 ) {
             flexarray_vappend(dm_args, "-net", "none", NULL);
         }
-        if (b_info->u.hvm.gfx_passthru) {
+        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
             flexarray_append(dm_args, "-gfx_passthru");
         }
     } else {
@@ -293,7 +293,7 @@
         return NULL;
     }
 
-    if (!spice->disable_ticketing) {
+    if (!libxl_defbool_val(spice->disable_ticketing)) {
         if (!spice->passwd) {
             LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
                        "spice ticketing is enabled but missing password");
@@ -309,12 +309,12 @@
                          spice->port, spice->tls_port);
     if (spice->host)
         opt = libxl__sprintf(gc, "%s,addr=%s", opt, spice->host);
-    if (spice->disable_ticketing)
+    if (libxl_defbool_val(spice->disable_ticketing))
         opt = libxl__sprintf(gc, "%s,disable-ticketing", opt);
     else
         opt = libxl__sprintf(gc, "%s,password=%s", opt, spice->passwd);
     opt = libxl__sprintf(gc, "%s,agent-mouse=%s", opt,
-                         spice->agent_mouse ? "on" : "off");
+                         libxl_defbool_val(spice->agent_mouse) ? "on" : "off");
     return opt;
 }
 
@@ -383,7 +383,7 @@
         if (vnc->passwd && vnc->passwd[0]) {
             vncarg = libxl__sprintf(gc, "%s,password", vncarg);
         }
-        if (vnc->findunused) {
+        if (libxl_defbool_val(vnc->findunused)) {
             /* This option asks to QEMU to try this number of port before to
              * give up.  So QEMU will try ports between $display and $display +
              * 99.  This option needs to be the last one of the vnc options. */
@@ -411,11 +411,11 @@
             flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, NULL);
         }
 
-        if (b_info->u.hvm.nographic && (!sdl && !vnc)) {
+        if (libxl_defbool_val(b_info->u.hvm.nographic) && (!sdl && !vnc)) {
             flexarray_append(dm_args, "-nographic");
         }
 
-        if (b_info->u.hvm.spice.enable) {
+        if (libxl_defbool_val(b_info->u.hvm.spice.enable)) {
             const libxl_spice_info *spice = &b_info->u.hvm.spice;
             char *spiceoptions = dm_spice_options(gc, spice);
             if (!spiceoptions)
@@ -425,7 +425,7 @@
             flexarray_append(dm_args, spiceoptions);
         }
 
-        if (b_info->u.hvm.stdvga) {
+        if (libxl_defbool_val(b_info->u.hvm.stdvga)) {
                 flexarray_vappend(dm_args, "-vga", "std", NULL);
         }
 
@@ -485,7 +485,7 @@
             flexarray_append(dm_args, "-net");
             flexarray_append(dm_args, "none");
         }
-        if (b_info->u.hvm.gfx_passthru) {
+        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
             flexarray_append(dm_args, "-gfx_passthru");
         }
     } else {
diff -r d78d760a678d -r cb25f8d90f5f tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
@@ -129,31 +129,31 @@
 # Complex libxl types
 #
 libxl_vnc_info = Struct("vnc_info", [
-    ("enable",        bool),
+    ("enable",        libxl_defbool),
     # "address:port" that should be listened on
     ("listen",        string),
     ("passwd",        string),
     ("display",       integer),
     # If set then try to find an unused port
-    ("findunused",    bool),
+    ("findunused",    libxl_defbool),
     ])
 
 libxl_spice_info = Struct("spice_info", [
-    ("enable",            bool),
+    ("enable",      libxl_defbool),
     # At least one of spice port or spicetls_post must be given
     ("port",        integer),
     ("tls_port",    integer),
     # Interface to bind to
     ("host",        string),
     # enable client connection with no password
-    ("disable_ticketing", bool),
+    ("disable_ticketing", libxl_defbool),
     ("passwd",      string),
-    ("agent_mouse", bool),
+    ("agent_mouse", libxl_defbool),
     ])
 
 libxl_sdl_info = Struct("sdl_info", [
-    ("enable",        bool),
-    ("opengl",        bool),
+    ("enable",        libxl_defbool),
+    ("opengl",        libxl_defbool),
     ("display",       string),
     ("xauthority",    string),
     ])
@@ -268,15 +268,15 @@
                                        ("timer_mode",       libxl_timer_mode),
                                        ("nested_hvm",       libxl_defbool),
                                        ("incr_generationid",libxl_defbool),
-                                       ("nographic",        bool),
-                                       ("stdvga",           bool),
+                                       ("nographic",        libxl_defbool),
+                                       ("stdvga",           libxl_defbool),
                                        ("vnc",              libxl_vnc_info),
                                        # keyboard layout, default is en-us keyboard
                                        ("keymap",           string),
                                        ("sdl",              libxl_sdl_info),
                                        ("spice",            libxl_spice_info),
                                        
-                                       ("gfx_passthru",     bool),
+                                       ("gfx_passthru",     libxl_defbool),
                                        
                                        ("serial",           string),
                                        ("boot",             string),
diff -r d78d760a678d -r cb25f8d90f5f tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -946,7 +946,7 @@
                     break;
                 *p2 = '\0';
                 if (!strcmp(p, "vnc")) {
-                    vfb->vnc.enable = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->vnc.enable, atoi(p2 + 1));
                 } else if (!strcmp(p, "vnclisten")) {
                     free(vfb->vnc.listen);
                     vfb->vnc.listen = strdup(p2 + 1);
@@ -956,14 +956,14 @@
                 } else if (!strcmp(p, "vncdisplay")) {
                     vfb->vnc.display = atoi(p2 + 1);
                 } else if (!strcmp(p, "vncunused")) {
-                    vfb->vnc.findunused = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->vnc.findunused, atoi(p2 + 1));
                 } else if (!strcmp(p, "keymap")) {
                     free(vfb->keymap);
                     vfb->keymap = strdup(p2 + 1);
                 } else if (!strcmp(p, "sdl")) {
-                    vfb->sdl.enable = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->sdl.enable, atoi(p2 + 1));
                 } else if (!strcmp(p, "opengl")) {
-                    vfb->sdl.opengl = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->sdl.opengl, atoi(p2 + 1));
                 } else if (!strcmp(p, "display")) {
                     free(vfb->sdl.display);
                     vfb->sdl.display = strdup(p2 + 1);
@@ -1163,41 +1163,35 @@
 #undef parse_extra_args
 
     if (c_info->type == LIBXL_DOMAIN_TYPE_HVM) {
-        if (!xlu_cfg_get_long (config, "stdvga", &l, 0))
-            b_info->u.hvm.stdvga = l;
-        if (!xlu_cfg_get_long (config, "vnc", &l, 0))
-            b_info->u.hvm.vnc.enable = l;
-        xlu_cfg_replace_string (config, "vnclisten", &b_info->u.hvm.vnc.listen, 0);
-        xlu_cfg_replace_string (config, "vncpasswd", &b_info->u.hvm.vnc.passwd, 0);
+        xlu_cfg_get_defbool(config, "stdvga", &b_info->u.hvm.stdvga, 0);
+        xlu_cfg_get_defbool(config, "vnc", &b_info->u.hvm.vnc.enable, 0);
+        xlu_cfg_replace_string (config, "vnclisten",
+                                &b_info->u.hvm.vnc.listen, 0);
+        xlu_cfg_replace_string (config, "vncpasswd",
+                                &b_info->u.hvm.vnc.passwd, 0);
         if (!xlu_cfg_get_long (config, "vncdisplay", &l, 0))
             b_info->u.hvm.vnc.display = l;
-        if (!xlu_cfg_get_long (config, "vncunused", &l, 0))
-            b_info->u.hvm.vnc.findunused = l;
+        xlu_cfg_get_defbool(config, "vncunused",
+                            &b_info->u.hvm.vnc.findunused, 0);
         xlu_cfg_replace_string (config, "keymap", &b_info->u.hvm.keymap, 0);
-        if (!xlu_cfg_get_long (config, "sdl", &l, 0))
-            b_info->u.hvm.sdl.enable = l;
-        if (!xlu_cfg_get_long (config, "opengl", &l, 0))
-            b_info->u.hvm.sdl.opengl = l;
-        if (!xlu_cfg_get_long (config, "spice", &l, 0))
-            b_info->u.hvm.spice.enable = l;
+        xlu_cfg_get_defbool(config, "sdl", &b_info->u.hvm.sdl.enable, 0);
+        xlu_cfg_get_defbool(config, "opengl", &b_info->u.hvm.sdl.opengl, 0);
+        xlu_cfg_get_defbool (config, "spice", &b_info->u.hvm.spice.enable, 0);
         if (!xlu_cfg_get_long (config, "spiceport", &l, 0))
             b_info->u.hvm.spice.port = l;
         if (!xlu_cfg_get_long (config, "spicetls_port", &l, 0))
             b_info->u.hvm.spice.tls_port = l;
         xlu_cfg_replace_string (config, "spicehost",
                                 &b_info->u.hvm.spice.host, 0);
-        if (!xlu_cfg_get_long (config, "spicedisable_ticketing", &l, 0))
-            b_info->u.hvm.spice.disable_ticketing = l;
+        xlu_cfg_get_defbool(config, "spicedisable_ticketing",
+                            &b_info->u.hvm.spice.disable_ticketing, 0);
         xlu_cfg_replace_string (config, "spicepasswd",
                                 &b_info->u.hvm.spice.passwd, 0);
-        if (!xlu_cfg_get_long (config, "spiceagent_mouse", &l, 0))
-            b_info->u.hvm.spice.agent_mouse = l;
-        else
-            b_info->u.hvm.spice.agent_mouse = 1;
-        if (!xlu_cfg_get_long (config, "nographic", &l, 0))
-            b_info->u.hvm.nographic = l;
-        if (!xlu_cfg_get_long (config, "gfx_passthru", &l, 0))
-            b_info->u.hvm.gfx_passthru = l;
+        xlu_cfg_get_defbool(config, "spiceagent_mouse",
+                            &b_info->u.hvm.spice.agent_mouse, 0);
+        xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
+        xlu_cfg_get_defbool(config, "gfx_passthru", 
+                            &b_info->u.hvm.gfx_passthru, 0);
         xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
         xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
         xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
diff -r d78d760a678d -r cb25f8d90f5f tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:15 2012 +0000
@@ -110,26 +110,34 @@
                libxl_defbool_to_string(b_info->u.hvm.nested_hvm));
         printf("\t\t\t(no_incr_generationid %s)\n",
                libxl_defbool_to_string(b_info->u.hvm.incr_generationid));
-
-        printf("\t\t\t(stdvga %d)\n", b_info->u.hvm.stdvga);
-        printf("\t\t\t(vnc %d)\n", b_info->u.hvm.vnc.enable);
+        printf("\t\t\t(stdvga %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.stdvga));
+        printf("\t\t\t(vnc %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.vnc.enable));
         printf("\t\t\t(vnclisten %s)\n", b_info->u.hvm.vnc.listen);
         printf("\t\t\t(vncdisplay %d)\n", b_info->u.hvm.vnc.display);
-        printf("\t\t\t(vncunused %d)\n", b_info->u.hvm.vnc.findunused);
+        printf("\t\t\t(vncunused %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.vnc.findunused));
         printf("\t\t\t(keymap %s)\n", b_info->u.hvm.keymap);
-        printf("\t\t\t(sdl %d)\n", b_info->u.hvm.sdl.enable);
-        printf("\t\t\t(opengl %d)\n", b_info->u.hvm.sdl.opengl);
-        printf("\t\t\t(nographic %d)\n", b_info->u.hvm.nographic);
-        printf("\t\t\t(spice %d)\n", b_info->u.hvm.spice.enable);
+        printf("\t\t\t(sdl %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.sdl.enable));
+        printf("\t\t\t(opengl %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.sdl.opengl));
+        printf("\t\t\t(nographic %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.nographic));
+        printf("\t\t\t(spice %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.spice.enable));
         printf("\t\t\t(spiceport %d)\n", b_info->u.hvm.spice.port);
         printf("\t\t\t(spicetls_port %d)\n", b_info->u.hvm.spice.tls_port);
         printf("\t\t\t(spicehost %s)\n", b_info->u.hvm.spice.host);
-        printf("\t\t\t(spicedisable_ticketing %d)\n",
-                    b_info->u.hvm.spice.disable_ticketing);
-        printf("\t\t\t(spiceagent_mouse %d)\n", b_info->u.hvm.spice.agent_mouse);
+        printf("\t\t\t(spicedisable_ticketing %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.spice.disable_ticketing));
+        printf("\t\t\t(spiceagent_mouse %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.spice.agent_mouse));
 
         printf("\t\t\t(device_model %s)\n", b_info->device_model ? : "default");
-        printf("\t\t\t(gfx_passthru %d)\n", b_info->u.hvm.gfx_passthru);
+        printf("\t\t\t(gfx_passthru %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.gfx_passthru));
         printf("\t\t\t(serial %s)\n", b_info->u.hvm.serial);
         printf("\t\t\t(boot %s)\n", b_info->u.hvm.boot);
         printf("\t\t\t(usb %s)\n", libxl_defbool_to_string(b_info->u.hvm.usb));
@@ -204,13 +212,17 @@
         printf("\t\t\t(backend_domid %d)\n", d_config->vfbs[i].backend_domid);
         printf("\t\t\t(frontend_domid %d)\n", domid);
         printf("\t\t\t(devid %d)\n", d_config->vfbs[i].devid);
-        printf("\t\t\t(vnc %d)\n", d_config->vfbs[i].vnc.enable);
+        printf("\t\t\t(vnc %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].vnc.enable));
         printf("\t\t\t(vnclisten %s)\n", d_config->vfbs[i].vnc.listen);
         printf("\t\t\t(vncdisplay %d)\n", d_config->vfbs[i].vnc.display);
-        printf("\t\t\t(vncunused %d)\n", d_config->vfbs[i].vnc.findunused);
+        printf("\t\t\t(vncunused %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].vnc.findunused));
         printf("\t\t\t(keymap %s)\n", d_config->vfbs[i].keymap);
-        printf("\t\t\t(sdl %d)\n", d_config->vfbs[i].sdl.enable);
-        printf("\t\t\t(opengl %d)\n", d_config->vfbs[i].sdl.opengl);
+        printf("\t\t\t(sdl %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].sdl.enable));
+        printf("\t\t\t(opengl %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].sdl.opengl));
         printf("\t\t\t(display %s)\n", d_config->vfbs[i].sdl.display);
         printf("\t\t\t(xauthority %s)\n", d_config->vfbs[i].sdl.xauthority);
         printf("\t\t)\n");

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:26 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3ges-0000O4-Hi; Sat, 03 Mar 2012 04:33:26 +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 1S3geq-0000JT-J2
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Received: from [85.158.139.83:61946] by server-7.bemta-5.messagelabs.com id
	42/8A-16195-31F915F4; Sat, 03 Mar 2012 04:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1330749200!10325835!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13374 invoked from network); 3 Mar 2012 04:33:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33: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 1S3gem-0004gU-EA
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gem-0003T7-C6
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:20 +0000
Message-Id: <E1S3gem-0003T7-C6@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: use defbool for graphics
	related 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID cb25f8d90f5f963a24b69dbb7e72dd3b33d7eb2b
# Parent  d78d760a678d39fe2c34b4b0331d3ebe7bb6aefb
libxl: use defbool for graphics related options

This allows them to be set via the _init/_setdefault methods.

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


diff -r d78d760a678d -r cb25f8d90f5f tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -2257,22 +2257,23 @@
 void libxl_device_vfb_init(libxl_device_vfb *vfb)
 {
     memset(vfb, 0x00, sizeof(libxl_device_vfb));
-    vfb->vnc.enable = 1;
-    vfb->vnc.passwd = NULL;
-    vfb->vnc.display = 0;
-    vfb->vnc.findunused = 1;
-    vfb->keymap = NULL;
-    vfb->sdl.enable = 0;
-    vfb->sdl.opengl = 0;
-    vfb->sdl.display = NULL;
-    vfb->sdl.xauthority = NULL;
 }
 
 int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb)
 {
-    if (!vfb->vnc.listen) {
-        vfb->vnc.listen = strdup("127.0.0.1");
-        if (!vfb->vnc.listen) return ERROR_NOMEM;
+    libxl_defbool_setdefault(&vfb->vnc.enable, true);
+    if (libxl_defbool_val(vfb->vnc.enable)) {
+        if (!vfb->vnc.listen) {
+            vfb->vnc.listen = strdup("127.0.0.1");
+            if (!vfb->vnc.listen) return ERROR_NOMEM;
+        }
+
+        libxl_defbool_setdefault(&vfb->vnc.findunused, true);
+    }
+
+    libxl_defbool_setdefault(&vfb->sdl.enable, false);
+    if (libxl_defbool_val(vfb->sdl.enable)) {
+        libxl_defbool_setdefault(&vfb->sdl.opengl, false);
     }
 
     return 0;
@@ -2321,17 +2322,17 @@
     flexarray_append_pair(back, "state", libxl__sprintf(gc, "%d", 1));
     flexarray_append_pair(back, "domain", libxl__domid_to_name(gc, domid));
     flexarray_append_pair(back, "vnc",
-                          libxl__sprintf(gc, "%d", vfb->vnc.enable));
+                          libxl_defbool_val(vfb->vnc.enable) ? "1" : "0");
     flexarray_append_pair(back, "vnclisten", vfb->vnc.listen);
     flexarray_append_pair(back, "vncpasswd", vfb->vnc.passwd);
     flexarray_append_pair(back, "vncdisplay",
                           libxl__sprintf(gc, "%d", vfb->vnc.display));
     flexarray_append_pair(back, "vncunused",
-                          libxl__sprintf(gc, "%d", vfb->vnc.findunused));
+                          libxl_defbool_val(vfb->vnc.findunused) ? "1" : "0");
     flexarray_append_pair(back, "sdl",
-                          libxl__sprintf(gc, "%d", vfb->sdl.enable));
+                          libxl_defbool_val(vfb->sdl.enable) ? "1" : "0");
     flexarray_append_pair(back, "opengl",
-                          libxl__sprintf(gc, "%d", vfb->sdl.opengl));
+                          libxl_defbool_val(vfb->sdl.opengl) ? "1" : "0");
     if (vfb->sdl.xauthority) {
         flexarray_append_pair(back, "xauthority", vfb->sdl.xauthority);
     }
diff -r d78d760a678d -r cb25f8d90f5f tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -90,10 +90,7 @@
         b_info->u.hvm.bios = 0;
         b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
 
-        b_info->u.hvm.stdvga = 0;
-        b_info->u.hvm.vnc.enable = 1;
         b_info->u.hvm.vnc.display = 0;
-        b_info->u.hvm.vnc.findunused = 1;
         b_info->u.hvm.serial = NULL;
         b_info->u.hvm.usbdevice = NULL;
         break;
@@ -159,13 +156,32 @@
             if (!b_info->u.hvm.boot) return ERROR_NOMEM;
         }
 
-        if (b_info->u.hvm.vnc.enable) {
+        libxl_defbool_setdefault(&b_info->u.hvm.stdvga, false);
+        libxl_defbool_setdefault(&b_info->u.hvm.vnc.enable, true);
+        if (libxl_defbool_val(b_info->u.hvm.vnc.enable)) {
+            libxl_defbool_setdefault(&b_info->u.hvm.vnc.findunused, true);
             if (!b_info->u.hvm.vnc.listen) {
                 b_info->u.hvm.vnc.listen = strdup("127.0.0.1");
                 if (!b_info->u.hvm.vnc.listen) return ERROR_NOMEM;
             }
         }
 
+        libxl_defbool_setdefault(&b_info->u.hvm.sdl.enable, false);
+        if (libxl_defbool_val(b_info->u.hvm.sdl.enable)) {
+            libxl_defbool_setdefault(&b_info->u.hvm.sdl.opengl, false);
+        }
+
+        libxl_defbool_setdefault(&b_info->u.hvm.spice.enable, false);
+        if (libxl_defbool_val(b_info->u.hvm.spice.enable)) {
+            libxl_defbool_setdefault(&b_info->u.hvm.spice.disable_ticketing,
+                                     false);
+            libxl_defbool_setdefault(&b_info->u.hvm.spice.agent_mouse, true);
+        }
+
+        libxl_defbool_setdefault(&b_info->u.hvm.nographic, false);
+
+        libxl_defbool_setdefault(&b_info->u.hvm.gfx_passthru, false);
+
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         libxl_defbool_setdefault(&b_info->u.pv.e820_host, false);
diff -r d78d760a678d -r cb25f8d90f5f tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
@@ -83,7 +83,7 @@
     } else if (guest_config->num_vfbs > 0) {
         vnc = &guest_config->vfbs[0].vnc;
     }
-    return vnc && vnc->enable ? vnc : NULL;
+    return vnc && libxl_defbool_val(vnc->enable) ? vnc : NULL;
 }
 
 static const libxl_sdl_info *dm_sdl(const libxl_domain_config *guest_config)
@@ -94,7 +94,7 @@
     } else if (guest_config->num_vfbs > 0) {
         sdl = &guest_config->vfbs[0].sdl;
     }
-    return sdl && sdl->enable ? sdl : NULL;
+    return sdl && libxl_defbool_val(sdl->enable) ? sdl : NULL;
 }
 
 static const char *dm_keymap(const libxl_domain_config *guest_config)
@@ -156,13 +156,13 @@
         flexarray_append(dm_args, "-vnc");
         flexarray_append(dm_args, vncarg);
 
-        if (vnc->findunused) {
+        if (libxl_defbool_val(vnc->findunused)) {
             flexarray_append(dm_args, "-vncunused");
         }
     }
     if (sdl) {
         flexarray_append(dm_args, "-sdl");
-        if (!sdl->opengl) {
+        if (!libxl_defbool_val(sdl->opengl)) {
             flexarray_append(dm_args, "-disable-opengl");
         }
         /* XXX sdl->{display,xauthority} into $DISPLAY/$XAUTHORITY */
@@ -177,7 +177,7 @@
             flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, NULL);
         }
 
-        if (b_info->u.hvm.nographic && (!sdl && !vnc)) {
+        if (libxl_defbool_val(b_info->u.hvm.nographic) && (!sdl && !vnc)) {
             flexarray_append(dm_args, "-nographic");
         }
 
@@ -187,7 +187,7 @@
                                    libxl__sizekb_to_mb(b_info->video_memkb)),
                     NULL);
         }
-        if (b_info->u.hvm.stdvga) {
+        if (libxl_defbool_val(b_info->u.hvm.stdvga)) {
             flexarray_append(dm_args, "-std-vga");
         }
 
@@ -240,7 +240,7 @@
         if ( ioemu_vifs == 0 ) {
             flexarray_vappend(dm_args, "-net", "none", NULL);
         }
-        if (b_info->u.hvm.gfx_passthru) {
+        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
             flexarray_append(dm_args, "-gfx_passthru");
         }
     } else {
@@ -293,7 +293,7 @@
         return NULL;
     }
 
-    if (!spice->disable_ticketing) {
+    if (!libxl_defbool_val(spice->disable_ticketing)) {
         if (!spice->passwd) {
             LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
                        "spice ticketing is enabled but missing password");
@@ -309,12 +309,12 @@
                          spice->port, spice->tls_port);
     if (spice->host)
         opt = libxl__sprintf(gc, "%s,addr=%s", opt, spice->host);
-    if (spice->disable_ticketing)
+    if (libxl_defbool_val(spice->disable_ticketing))
         opt = libxl__sprintf(gc, "%s,disable-ticketing", opt);
     else
         opt = libxl__sprintf(gc, "%s,password=%s", opt, spice->passwd);
     opt = libxl__sprintf(gc, "%s,agent-mouse=%s", opt,
-                         spice->agent_mouse ? "on" : "off");
+                         libxl_defbool_val(spice->agent_mouse) ? "on" : "off");
     return opt;
 }
 
@@ -383,7 +383,7 @@
         if (vnc->passwd && vnc->passwd[0]) {
             vncarg = libxl__sprintf(gc, "%s,password", vncarg);
         }
-        if (vnc->findunused) {
+        if (libxl_defbool_val(vnc->findunused)) {
             /* This option asks to QEMU to try this number of port before to
              * give up.  So QEMU will try ports between $display and $display +
              * 99.  This option needs to be the last one of the vnc options. */
@@ -411,11 +411,11 @@
             flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, NULL);
         }
 
-        if (b_info->u.hvm.nographic && (!sdl && !vnc)) {
+        if (libxl_defbool_val(b_info->u.hvm.nographic) && (!sdl && !vnc)) {
             flexarray_append(dm_args, "-nographic");
         }
 
-        if (b_info->u.hvm.spice.enable) {
+        if (libxl_defbool_val(b_info->u.hvm.spice.enable)) {
             const libxl_spice_info *spice = &b_info->u.hvm.spice;
             char *spiceoptions = dm_spice_options(gc, spice);
             if (!spiceoptions)
@@ -425,7 +425,7 @@
             flexarray_append(dm_args, spiceoptions);
         }
 
-        if (b_info->u.hvm.stdvga) {
+        if (libxl_defbool_val(b_info->u.hvm.stdvga)) {
                 flexarray_vappend(dm_args, "-vga", "std", NULL);
         }
 
@@ -485,7 +485,7 @@
             flexarray_append(dm_args, "-net");
             flexarray_append(dm_args, "none");
         }
-        if (b_info->u.hvm.gfx_passthru) {
+        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
             flexarray_append(dm_args, "-gfx_passthru");
         }
     } else {
diff -r d78d760a678d -r cb25f8d90f5f tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
@@ -129,31 +129,31 @@
 # Complex libxl types
 #
 libxl_vnc_info = Struct("vnc_info", [
-    ("enable",        bool),
+    ("enable",        libxl_defbool),
     # "address:port" that should be listened on
     ("listen",        string),
     ("passwd",        string),
     ("display",       integer),
     # If set then try to find an unused port
-    ("findunused",    bool),
+    ("findunused",    libxl_defbool),
     ])
 
 libxl_spice_info = Struct("spice_info", [
-    ("enable",            bool),
+    ("enable",      libxl_defbool),
     # At least one of spice port or spicetls_post must be given
     ("port",        integer),
     ("tls_port",    integer),
     # Interface to bind to
     ("host",        string),
     # enable client connection with no password
-    ("disable_ticketing", bool),
+    ("disable_ticketing", libxl_defbool),
     ("passwd",      string),
-    ("agent_mouse", bool),
+    ("agent_mouse", libxl_defbool),
     ])
 
 libxl_sdl_info = Struct("sdl_info", [
-    ("enable",        bool),
-    ("opengl",        bool),
+    ("enable",        libxl_defbool),
+    ("opengl",        libxl_defbool),
     ("display",       string),
     ("xauthority",    string),
     ])
@@ -268,15 +268,15 @@
                                        ("timer_mode",       libxl_timer_mode),
                                        ("nested_hvm",       libxl_defbool),
                                        ("incr_generationid",libxl_defbool),
-                                       ("nographic",        bool),
-                                       ("stdvga",           bool),
+                                       ("nographic",        libxl_defbool),
+                                       ("stdvga",           libxl_defbool),
                                        ("vnc",              libxl_vnc_info),
                                        # keyboard layout, default is en-us keyboard
                                        ("keymap",           string),
                                        ("sdl",              libxl_sdl_info),
                                        ("spice",            libxl_spice_info),
                                        
-                                       ("gfx_passthru",     bool),
+                                       ("gfx_passthru",     libxl_defbool),
                                        
                                        ("serial",           string),
                                        ("boot",             string),
diff -r d78d760a678d -r cb25f8d90f5f tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -946,7 +946,7 @@
                     break;
                 *p2 = '\0';
                 if (!strcmp(p, "vnc")) {
-                    vfb->vnc.enable = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->vnc.enable, atoi(p2 + 1));
                 } else if (!strcmp(p, "vnclisten")) {
                     free(vfb->vnc.listen);
                     vfb->vnc.listen = strdup(p2 + 1);
@@ -956,14 +956,14 @@
                 } else if (!strcmp(p, "vncdisplay")) {
                     vfb->vnc.display = atoi(p2 + 1);
                 } else if (!strcmp(p, "vncunused")) {
-                    vfb->vnc.findunused = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->vnc.findunused, atoi(p2 + 1));
                 } else if (!strcmp(p, "keymap")) {
                     free(vfb->keymap);
                     vfb->keymap = strdup(p2 + 1);
                 } else if (!strcmp(p, "sdl")) {
-                    vfb->sdl.enable = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->sdl.enable, atoi(p2 + 1));
                 } else if (!strcmp(p, "opengl")) {
-                    vfb->sdl.opengl = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->sdl.opengl, atoi(p2 + 1));
                 } else if (!strcmp(p, "display")) {
                     free(vfb->sdl.display);
                     vfb->sdl.display = strdup(p2 + 1);
@@ -1163,41 +1163,35 @@
 #undef parse_extra_args
 
     if (c_info->type == LIBXL_DOMAIN_TYPE_HVM) {
-        if (!xlu_cfg_get_long (config, "stdvga", &l, 0))
-            b_info->u.hvm.stdvga = l;
-        if (!xlu_cfg_get_long (config, "vnc", &l, 0))
-            b_info->u.hvm.vnc.enable = l;
-        xlu_cfg_replace_string (config, "vnclisten", &b_info->u.hvm.vnc.listen, 0);
-        xlu_cfg_replace_string (config, "vncpasswd", &b_info->u.hvm.vnc.passwd, 0);
+        xlu_cfg_get_defbool(config, "stdvga", &b_info->u.hvm.stdvga, 0);
+        xlu_cfg_get_defbool(config, "vnc", &b_info->u.hvm.vnc.enable, 0);
+        xlu_cfg_replace_string (config, "vnclisten",
+                                &b_info->u.hvm.vnc.listen, 0);
+        xlu_cfg_replace_string (config, "vncpasswd",
+                                &b_info->u.hvm.vnc.passwd, 0);
         if (!xlu_cfg_get_long (config, "vncdisplay", &l, 0))
             b_info->u.hvm.vnc.display = l;
-        if (!xlu_cfg_get_long (config, "vncunused", &l, 0))
-            b_info->u.hvm.vnc.findunused = l;
+        xlu_cfg_get_defbool(config, "vncunused",
+                            &b_info->u.hvm.vnc.findunused, 0);
         xlu_cfg_replace_string (config, "keymap", &b_info->u.hvm.keymap, 0);
-        if (!xlu_cfg_get_long (config, "sdl", &l, 0))
-            b_info->u.hvm.sdl.enable = l;
-        if (!xlu_cfg_get_long (config, "opengl", &l, 0))
-            b_info->u.hvm.sdl.opengl = l;
-        if (!xlu_cfg_get_long (config, "spice", &l, 0))
-            b_info->u.hvm.spice.enable = l;
+        xlu_cfg_get_defbool(config, "sdl", &b_info->u.hvm.sdl.enable, 0);
+        xlu_cfg_get_defbool(config, "opengl", &b_info->u.hvm.sdl.opengl, 0);
+        xlu_cfg_get_defbool (config, "spice", &b_info->u.hvm.spice.enable, 0);
         if (!xlu_cfg_get_long (config, "spiceport", &l, 0))
             b_info->u.hvm.spice.port = l;
         if (!xlu_cfg_get_long (config, "spicetls_port", &l, 0))
             b_info->u.hvm.spice.tls_port = l;
         xlu_cfg_replace_string (config, "spicehost",
                                 &b_info->u.hvm.spice.host, 0);
-        if (!xlu_cfg_get_long (config, "spicedisable_ticketing", &l, 0))
-            b_info->u.hvm.spice.disable_ticketing = l;
+        xlu_cfg_get_defbool(config, "spicedisable_ticketing",
+                            &b_info->u.hvm.spice.disable_ticketing, 0);
         xlu_cfg_replace_string (config, "spicepasswd",
                                 &b_info->u.hvm.spice.passwd, 0);
-        if (!xlu_cfg_get_long (config, "spiceagent_mouse", &l, 0))
-            b_info->u.hvm.spice.agent_mouse = l;
-        else
-            b_info->u.hvm.spice.agent_mouse = 1;
-        if (!xlu_cfg_get_long (config, "nographic", &l, 0))
-            b_info->u.hvm.nographic = l;
-        if (!xlu_cfg_get_long (config, "gfx_passthru", &l, 0))
-            b_info->u.hvm.gfx_passthru = l;
+        xlu_cfg_get_defbool(config, "spiceagent_mouse",
+                            &b_info->u.hvm.spice.agent_mouse, 0);
+        xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
+        xlu_cfg_get_defbool(config, "gfx_passthru", 
+                            &b_info->u.hvm.gfx_passthru, 0);
         xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
         xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
         xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
diff -r d78d760a678d -r cb25f8d90f5f tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_sxp.c	Thu Mar 01 12:26:15 2012 +0000
@@ -110,26 +110,34 @@
                libxl_defbool_to_string(b_info->u.hvm.nested_hvm));
         printf("\t\t\t(no_incr_generationid %s)\n",
                libxl_defbool_to_string(b_info->u.hvm.incr_generationid));
-
-        printf("\t\t\t(stdvga %d)\n", b_info->u.hvm.stdvga);
-        printf("\t\t\t(vnc %d)\n", b_info->u.hvm.vnc.enable);
+        printf("\t\t\t(stdvga %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.stdvga));
+        printf("\t\t\t(vnc %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.vnc.enable));
         printf("\t\t\t(vnclisten %s)\n", b_info->u.hvm.vnc.listen);
         printf("\t\t\t(vncdisplay %d)\n", b_info->u.hvm.vnc.display);
-        printf("\t\t\t(vncunused %d)\n", b_info->u.hvm.vnc.findunused);
+        printf("\t\t\t(vncunused %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.vnc.findunused));
         printf("\t\t\t(keymap %s)\n", b_info->u.hvm.keymap);
-        printf("\t\t\t(sdl %d)\n", b_info->u.hvm.sdl.enable);
-        printf("\t\t\t(opengl %d)\n", b_info->u.hvm.sdl.opengl);
-        printf("\t\t\t(nographic %d)\n", b_info->u.hvm.nographic);
-        printf("\t\t\t(spice %d)\n", b_info->u.hvm.spice.enable);
+        printf("\t\t\t(sdl %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.sdl.enable));
+        printf("\t\t\t(opengl %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.sdl.opengl));
+        printf("\t\t\t(nographic %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.nographic));
+        printf("\t\t\t(spice %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.spice.enable));
         printf("\t\t\t(spiceport %d)\n", b_info->u.hvm.spice.port);
         printf("\t\t\t(spicetls_port %d)\n", b_info->u.hvm.spice.tls_port);
         printf("\t\t\t(spicehost %s)\n", b_info->u.hvm.spice.host);
-        printf("\t\t\t(spicedisable_ticketing %d)\n",
-                    b_info->u.hvm.spice.disable_ticketing);
-        printf("\t\t\t(spiceagent_mouse %d)\n", b_info->u.hvm.spice.agent_mouse);
+        printf("\t\t\t(spicedisable_ticketing %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.spice.disable_ticketing));
+        printf("\t\t\t(spiceagent_mouse %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.spice.agent_mouse));
 
         printf("\t\t\t(device_model %s)\n", b_info->device_model ? : "default");
-        printf("\t\t\t(gfx_passthru %d)\n", b_info->u.hvm.gfx_passthru);
+        printf("\t\t\t(gfx_passthru %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.gfx_passthru));
         printf("\t\t\t(serial %s)\n", b_info->u.hvm.serial);
         printf("\t\t\t(boot %s)\n", b_info->u.hvm.boot);
         printf("\t\t\t(usb %s)\n", libxl_defbool_to_string(b_info->u.hvm.usb));
@@ -204,13 +212,17 @@
         printf("\t\t\t(backend_domid %d)\n", d_config->vfbs[i].backend_domid);
         printf("\t\t\t(frontend_domid %d)\n", domid);
         printf("\t\t\t(devid %d)\n", d_config->vfbs[i].devid);
-        printf("\t\t\t(vnc %d)\n", d_config->vfbs[i].vnc.enable);
+        printf("\t\t\t(vnc %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].vnc.enable));
         printf("\t\t\t(vnclisten %s)\n", d_config->vfbs[i].vnc.listen);
         printf("\t\t\t(vncdisplay %d)\n", d_config->vfbs[i].vnc.display);
-        printf("\t\t\t(vncunused %d)\n", d_config->vfbs[i].vnc.findunused);
+        printf("\t\t\t(vncunused %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].vnc.findunused));
         printf("\t\t\t(keymap %s)\n", d_config->vfbs[i].keymap);
-        printf("\t\t\t(sdl %d)\n", d_config->vfbs[i].sdl.enable);
-        printf("\t\t\t(opengl %d)\n", d_config->vfbs[i].sdl.opengl);
+        printf("\t\t\t(sdl %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].sdl.enable));
+        printf("\t\t\t(opengl %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].sdl.opengl));
         printf("\t\t\t(display %s)\n", d_config->vfbs[i].sdl.display);
         printf("\t\t\t(xauthority %s)\n", d_config->vfbs[i].sdl.xauthority);
         printf("\t\t)\n");

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3ges-0000OU-M1; Sat, 03 Mar 2012 04:33: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 1S3geq-0000ET-Th
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Received: from [85.158.143.99:62672] by server-2.bemta-4.messagelabs.com id
	AB/8D-17550-41F915F4; Sat, 03 Mar 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1330749202!16892034!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9171 invoked from network); 3 Mar 2012 04:33:23 -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;
	3 Mar 2012 04:33: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 1S3gem-0004gX-V5
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gem-0003Td-Tt
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:20 +0000
Message-Id: <E1S3gem-0003Td-Tt@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Select BIOS using
	libxl_domain_build_info_setdefaults
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID 6eac4a1ee6464e294c5c7310eb54f2566db4cf5e
# Parent  cb25f8d90f5f963a24b69dbb7e72dd3b33d7eb2b
libxl: Select BIOS using libxl_domain_build_info_setdefaults

Remove libxl__domain_bios -- it is no longer necessary.

Also we appear to have been setting the xenstore key even for device models for
PV guests -- stop doing that.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r cb25f8d90f5f -r 6eac4a1ee646 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -109,6 +109,26 @@
         b_info->device_model_version =
             LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
 
+    if (!b_info->u.hvm.bios)
+        switch (b_info->device_model_version) {
+        case 1: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_ROMBIOS; break;
+        case 2: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_SEABIOS; break;
+        default:return ERROR_INVAL;
+    }
+
+    /* Enforce BIOS<->Device Model version relationship */
+    switch (b_info->device_model_version) {
+    case 1:
+        if (b_info->u.hvm.bios != LIBXL_BIOS_TYPE_ROMBIOS)
+            return ERROR_INVAL;
+        break;
+    case 2:
+        if (b_info->u.hvm.bios == LIBXL_BIOS_TYPE_ROMBIOS)
+            return ERROR_INVAL;
+        break;
+    default:abort();
+    }
+
     if (!b_info->max_vcpus)
         b_info->max_vcpus = 1;
     if (!b_info->cur_vcpus)
diff -r cb25f8d90f5f -r 6eac4a1ee646 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
@@ -63,18 +63,6 @@
     return dm;
 }
 
-static const char *libxl__domain_bios(libxl__gc *gc,
-                                const libxl_domain_build_info *info)
-{
-    if (info->u.hvm.bios)
-       return libxl_bios_type_to_string(info->u.hvm.bios);
-    switch (info->device_model_version) {
-    case 1: return "rombios";
-    case 2: return "seabios";
-    default:return NULL;
-    }
-}
-
 const libxl_vnc_info *libxl__dm_vnc(const libxl_domain_config *guest_config)
 {
     const libxl_vnc_info *vnc = NULL;
@@ -933,10 +921,13 @@
         goto out;
     }
 
-    path = xs_get_domain_path(ctx->xsh, domid);
-    libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/hvmloader/bios", path),
-                    "%s", libxl__domain_bios(gc, b_info));
-    free(path);
+    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
+        path = xs_get_domain_path(ctx->xsh, domid);
+        libxl__xs_write(gc, XBT_NULL,
+                        libxl__sprintf(gc, "%s/hvmloader/bios", path),
+                        "%s", libxl_bios_type_to_string(b_info->u.hvm.bios));
+        free(path);
+    }
 
     path = libxl__sprintf(gc, "/local/domain/0/device-model/%d", domid);
     xs_mkdir(ctx->xsh, XBT_NULL, path);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3ges-0000OU-M1; Sat, 03 Mar 2012 04:33: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 1S3geq-0000ET-Th
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Received: from [85.158.143.99:62672] by server-2.bemta-4.messagelabs.com id
	AB/8D-17550-41F915F4; Sat, 03 Mar 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1330749202!16892034!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9171 invoked from network); 3 Mar 2012 04:33:23 -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;
	3 Mar 2012 04:33: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 1S3gem-0004gX-V5
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gem-0003Td-Tt
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:20 +0000
Message-Id: <E1S3gem-0003Td-Tt@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Select BIOS using
	libxl_domain_build_info_setdefaults
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID 6eac4a1ee6464e294c5c7310eb54f2566db4cf5e
# Parent  cb25f8d90f5f963a24b69dbb7e72dd3b33d7eb2b
libxl: Select BIOS using libxl_domain_build_info_setdefaults

Remove libxl__domain_bios -- it is no longer necessary.

Also we appear to have been setting the xenstore key even for device models for
PV guests -- stop doing that.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r cb25f8d90f5f -r 6eac4a1ee646 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -109,6 +109,26 @@
         b_info->device_model_version =
             LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
 
+    if (!b_info->u.hvm.bios)
+        switch (b_info->device_model_version) {
+        case 1: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_ROMBIOS; break;
+        case 2: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_SEABIOS; break;
+        default:return ERROR_INVAL;
+    }
+
+    /* Enforce BIOS<->Device Model version relationship */
+    switch (b_info->device_model_version) {
+    case 1:
+        if (b_info->u.hvm.bios != LIBXL_BIOS_TYPE_ROMBIOS)
+            return ERROR_INVAL;
+        break;
+    case 2:
+        if (b_info->u.hvm.bios == LIBXL_BIOS_TYPE_ROMBIOS)
+            return ERROR_INVAL;
+        break;
+    default:abort();
+    }
+
     if (!b_info->max_vcpus)
         b_info->max_vcpus = 1;
     if (!b_info->cur_vcpus)
diff -r cb25f8d90f5f -r 6eac4a1ee646 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
@@ -63,18 +63,6 @@
     return dm;
 }
 
-static const char *libxl__domain_bios(libxl__gc *gc,
-                                const libxl_domain_build_info *info)
-{
-    if (info->u.hvm.bios)
-       return libxl_bios_type_to_string(info->u.hvm.bios);
-    switch (info->device_model_version) {
-    case 1: return "rombios";
-    case 2: return "seabios";
-    default:return NULL;
-    }
-}
-
 const libxl_vnc_info *libxl__dm_vnc(const libxl_domain_config *guest_config)
 {
     const libxl_vnc_info *vnc = NULL;
@@ -933,10 +921,13 @@
         goto out;
     }
 
-    path = xs_get_domain_path(ctx->xsh, domid);
-    libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/hvmloader/bios", path),
-                    "%s", libxl__domain_bios(gc, b_info));
-    free(path);
+    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
+        path = xs_get_domain_path(ctx->xsh, domid);
+        libxl__xs_write(gc, XBT_NULL,
+                        libxl__sprintf(gc, "%s/hvmloader/bios", path),
+                        "%s", libxl_bios_type_to_string(b_info->u.hvm.bios));
+        free(path);
+    }
 
     path = libxl__sprintf(gc, "/local/domain/0/device-model/%d", domid);
     xs_mkdir(ctx->xsh, XBT_NULL, path);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3ges-0000Or-SE; Sat, 03 Mar 2012 04:33: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 1S3ger-0000B5-7A
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Received: from [85.158.143.35:28835] by server-1.bemta-4.messagelabs.com id
	6A/C9-20925-41F915F4; Sat, 03 Mar 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1330749203!3136136!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10608 invoked from network); 3 Mar 2012 04:33:24 -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;
	3 Mar 2012 04:33: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 1S3geo-0004gg-NY
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geo-0003V7-J6
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:22 +0000
Message-Id: <E1S3geo-0003V7-J6@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: add
	libxl_domain_build_info_init_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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID 8dcccb97371f266174a91434264f3643d6ffde0e
# Parent  8e0512bc1b474709ed3cc8961f3d17590f7f8d8d
libxl: add libxl_domain_build_info_init_type

Use instead of parameterising libxl_domain_build_info_init. This allows callers
to initialise a libxl_domain_build_info but not to commit to a particular type
later on (e.g. after they've parsed the domain config)

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


diff -r 8e0512bc1b47 -r 8dcccb97371f tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:15 2012 +0000
@@ -382,8 +382,9 @@
 
 /* domain related functions */
 void libxl_domain_create_info_init(libxl_domain_create_info *c_info);
-void libxl_domain_build_info_init(libxl_domain_build_info *b_info,
-                          const libxl_domain_create_info *c_info);
+void libxl_domain_build_info_init(libxl_domain_build_info *b_info);
+void libxl_domain_build_info_init_type(libxl_domain_build_info *b_info,
+                                       libxl_domain_type type);
 typedef int (*libxl_console_ready)(libxl_ctx *ctx, uint32_t domid, void *priv);
 int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid);
 int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid, int restore_fd);
diff -r 8e0512bc1b47 -r 8dcccb97371f tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -69,23 +69,29 @@
     return 0;
 }
 
-void libxl_domain_build_info_init(libxl_domain_build_info *b_info,
-                                  const libxl_domain_create_info *c_info)
+void libxl_domain_build_info_init(libxl_domain_build_info *b_info)
 {
     memset(b_info, '\0', sizeof(*b_info));
-    b_info->type = c_info->type;
+    b_info->type = -1;
 
     b_info->max_memkb = LIBXL_MEMKB_DEFAULT;
     b_info->target_memkb = LIBXL_MEMKB_DEFAULT;
     b_info->shadow_memkb = LIBXL_MEMKB_DEFAULT;
     b_info->video_memkb =  LIBXL_MEMKB_DEFAULT;
 
+}
+
+void libxl_domain_build_info_init_type(libxl_domain_build_info *b_info,
+                                       libxl_domain_type type)
+{
+    assert(b_info->type == -1);
+    b_info->type = type;
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
-        b_info->u.pv.slack_memkb = 0;
+        b_info->u.pv.slack_memkb = LIBXL_MEMKB_DEFAULT;
         break;
     default:
         abort();
diff -r 8e0512bc1b47 -r 8dcccb97371f tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
@@ -701,7 +701,8 @@
 
     libxl_uuid_generate(&dm_config.c_info.uuid);
 
-    libxl_domain_build_info_init(&dm_config.b_info, &dm_config.c_info);
+    libxl_domain_build_info_init(&dm_config.b_info);
+    libxl_domain_build_info_init_type(&dm_config.b_info, LIBXL_DOMAIN_TYPE_PV);
 
     dm_config.b_info.max_vcpus = 1;
     dm_config.b_info.max_memkb = 32 * 1024;
diff -r 8e0512bc1b47 -r 8dcccb97371f tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -582,7 +582,8 @@
         exit(1);
     }
 
-    libxl_domain_build_info_init(b_info, c_info);
+    libxl_domain_build_info_init(b_info);
+    libxl_domain_build_info_init_type(b_info, c_info->type);
 
     /* the following is the actual config parsing with overriding values in the structures */
     if (!xlu_cfg_get_long (config, "vcpus", &l, 0)) {
@@ -699,7 +700,7 @@
     if (!xlu_cfg_get_long (config, "videoram", &l, 0))
         b_info->video_memkb = l * 1024;
 
-    switch(c_info->type) {
+    switch(b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         if (!xlu_cfg_get_string (config, "kernel", &buf, 0))
             fprintf(stderr, "WARNING: ignoring \"kernel\" directive for HVM guest. "

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3get-0000PJ-07; Sat, 03 Mar 2012 04:33: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 1S3ger-0000JT-Aq
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Received: from [85.158.139.83:18939] by server-7.bemta-5.messagelabs.com id
	44/8A-16195-41F915F4; Sat, 03 Mar 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1330749202!17625929!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12417 invoked from network); 3 Mar 2012 04:33:23 -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;
	3 Mar 2012 04:33: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 1S3geo-0004gd-2X
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geo-0003Uc-1K
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:22 +0000
Message-Id: <E1S3geo-0003Uc-1K@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: switch device model selection
	over to libxl_defbool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID 8e0512bc1b474709ed3cc8961f3d17590f7f8d8d
# Parent  f7be24bb62dbb7acef843f95cddd68988953f18f
libxl: switch device model selection over to libxl_defbool

This allows it to be set via the _init/_setdefault methods.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[since last v -- ERROR_INVAL on stubdomains + !traditional qemu]
---


diff -r f7be24bb62db -r 8e0512bc1b47 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -2714,7 +2714,7 @@
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         *need_memkb += b_info->shadow_memkb + LIBXL_HVM_EXTRA_MEMORY;
-        if (b_info->device_model_stubdomain)
+        if (libxl_defbool_val(b_info->device_model_stubdomain))
             *need_memkb += 32 * 1024;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
diff -r f7be24bb62db -r 8e0512bc1b47 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -80,9 +80,6 @@
     b_info->shadow_memkb = LIBXL_MEMKB_DEFAULT;
     b_info->video_memkb =  LIBXL_MEMKB_DEFAULT;
 
-    b_info->device_model_stubdomain = false;
-    b_info->device_model = NULL;
-
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
@@ -122,6 +119,17 @@
     default:abort();
     }
 
+    libxl_defbool_setdefault(&b_info->device_model_stubdomain, false);
+
+    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM &&
+        b_info->device_model_version !=
+            LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL &&
+        libxl_defbool_val(b_info->device_model_stubdomain)) {
+        LIBXL__LOG(CTX, XTL_ERROR,
+            "device model stubdomains require \"qemu-xen-traditional\"");
+        return ERROR_INVAL;
+    }
+
     if (!b_info->max_vcpus)
         b_info->max_vcpus = 1;
     if (!b_info->cur_vcpus)
diff -r f7be24bb62db -r 8e0512bc1b47 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
@@ -39,7 +39,7 @@
     libxl_ctx *ctx = libxl__gc_owner(gc);
     const char *dm;
 
-    if (info->device_model_stubdomain)
+    if (libxl_defbool_val(info->device_model_stubdomain))
         return NULL;
 
     if (info->device_model) {
@@ -899,7 +899,7 @@
     char **pass_stuff;
     const char *dm;
 
-    if (b_info->device_model_stubdomain) {
+    if (libxl_defbool_val(b_info->device_model_stubdomain)) {
         rc = libxl__create_stubdom(gc, domid, guest_config, state, starting_r);
         goto out;
     }
diff -r f7be24bb62db -r 8e0512bc1b47 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
@@ -240,8 +240,8 @@
     ("type",            libxl_domain_type),
     
     ("device_model_version", libxl_device_model_version),
-    ("device_model_stubdomain", bool),
-    # you set device_model you must set device_model_version too
+    ("device_model_stubdomain", libxl_defbool),
+    # if you set device_model you must set device_model_version too
     ("device_model",     string),
     ("device_model_ssidref", uint32),
 
diff -r f7be24bb62db -r 8e0512bc1b47 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -1125,8 +1125,8 @@
         }
     } else if (b_info->device_model)
         fprintf(stderr, "WARNING: device model override given without specific DM version\n");
-    if (!xlu_cfg_get_long (config, "device_model_stubdomain_override", &l, 0))
-        b_info->device_model_stubdomain = l;
+    xlu_cfg_get_defbool (config, "device_model_stubdomain_override",
+                         &b_info->device_model_stubdomain, 0);
 
     if (!xlu_cfg_get_string (config, "device_model_stubdomain_seclabel",
                              &buf, 0)) {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3ges-0000Or-SE; Sat, 03 Mar 2012 04:33: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 1S3ger-0000B5-7A
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Received: from [85.158.143.35:28835] by server-1.bemta-4.messagelabs.com id
	6A/C9-20925-41F915F4; Sat, 03 Mar 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1330749203!3136136!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10608 invoked from network); 3 Mar 2012 04:33:24 -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;
	3 Mar 2012 04:33: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 1S3geo-0004gg-NY
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geo-0003V7-J6
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:22 +0000
Message-Id: <E1S3geo-0003V7-J6@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: add
	libxl_domain_build_info_init_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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID 8dcccb97371f266174a91434264f3643d6ffde0e
# Parent  8e0512bc1b474709ed3cc8961f3d17590f7f8d8d
libxl: add libxl_domain_build_info_init_type

Use instead of parameterising libxl_domain_build_info_init. This allows callers
to initialise a libxl_domain_build_info but not to commit to a particular type
later on (e.g. after they've parsed the domain config)

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


diff -r 8e0512bc1b47 -r 8dcccb97371f tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:15 2012 +0000
@@ -382,8 +382,9 @@
 
 /* domain related functions */
 void libxl_domain_create_info_init(libxl_domain_create_info *c_info);
-void libxl_domain_build_info_init(libxl_domain_build_info *b_info,
-                          const libxl_domain_create_info *c_info);
+void libxl_domain_build_info_init(libxl_domain_build_info *b_info);
+void libxl_domain_build_info_init_type(libxl_domain_build_info *b_info,
+                                       libxl_domain_type type);
 typedef int (*libxl_console_ready)(libxl_ctx *ctx, uint32_t domid, void *priv);
 int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid);
 int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid, int restore_fd);
diff -r 8e0512bc1b47 -r 8dcccb97371f tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -69,23 +69,29 @@
     return 0;
 }
 
-void libxl_domain_build_info_init(libxl_domain_build_info *b_info,
-                                  const libxl_domain_create_info *c_info)
+void libxl_domain_build_info_init(libxl_domain_build_info *b_info)
 {
     memset(b_info, '\0', sizeof(*b_info));
-    b_info->type = c_info->type;
+    b_info->type = -1;
 
     b_info->max_memkb = LIBXL_MEMKB_DEFAULT;
     b_info->target_memkb = LIBXL_MEMKB_DEFAULT;
     b_info->shadow_memkb = LIBXL_MEMKB_DEFAULT;
     b_info->video_memkb =  LIBXL_MEMKB_DEFAULT;
 
+}
+
+void libxl_domain_build_info_init_type(libxl_domain_build_info *b_info,
+                                       libxl_domain_type type)
+{
+    assert(b_info->type == -1);
+    b_info->type = type;
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
-        b_info->u.pv.slack_memkb = 0;
+        b_info->u.pv.slack_memkb = LIBXL_MEMKB_DEFAULT;
         break;
     default:
         abort();
diff -r 8e0512bc1b47 -r 8dcccb97371f tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
@@ -701,7 +701,8 @@
 
     libxl_uuid_generate(&dm_config.c_info.uuid);
 
-    libxl_domain_build_info_init(&dm_config.b_info, &dm_config.c_info);
+    libxl_domain_build_info_init(&dm_config.b_info);
+    libxl_domain_build_info_init_type(&dm_config.b_info, LIBXL_DOMAIN_TYPE_PV);
 
     dm_config.b_info.max_vcpus = 1;
     dm_config.b_info.max_memkb = 32 * 1024;
diff -r 8e0512bc1b47 -r 8dcccb97371f tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -582,7 +582,8 @@
         exit(1);
     }
 
-    libxl_domain_build_info_init(b_info, c_info);
+    libxl_domain_build_info_init(b_info);
+    libxl_domain_build_info_init_type(b_info, c_info->type);
 
     /* the following is the actual config parsing with overriding values in the structures */
     if (!xlu_cfg_get_long (config, "vcpus", &l, 0)) {
@@ -699,7 +700,7 @@
     if (!xlu_cfg_get_long (config, "videoram", &l, 0))
         b_info->video_memkb = l * 1024;
 
-    switch(c_info->type) {
+    switch(b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         if (!xlu_cfg_get_string (config, "kernel", &buf, 0))
             fprintf(stderr, "WARNING: ignoring \"kernel\" directive for HVM guest. "

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3get-0000PJ-07; Sat, 03 Mar 2012 04:33: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 1S3ger-0000JT-Aq
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Received: from [85.158.139.83:18939] by server-7.bemta-5.messagelabs.com id
	44/8A-16195-41F915F4; Sat, 03 Mar 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1330749202!17625929!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12417 invoked from network); 3 Mar 2012 04:33:23 -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;
	3 Mar 2012 04:33: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 1S3geo-0004gd-2X
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geo-0003Uc-1K
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:22 +0000
Message-Id: <E1S3geo-0003Uc-1K@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: switch device model selection
	over to libxl_defbool
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID 8e0512bc1b474709ed3cc8961f3d17590f7f8d8d
# Parent  f7be24bb62dbb7acef843f95cddd68988953f18f
libxl: switch device model selection over to libxl_defbool

This allows it to be set via the _init/_setdefault methods.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[since last v -- ERROR_INVAL on stubdomains + !traditional qemu]
---


diff -r f7be24bb62db -r 8e0512bc1b47 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -2714,7 +2714,7 @@
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         *need_memkb += b_info->shadow_memkb + LIBXL_HVM_EXTRA_MEMORY;
-        if (b_info->device_model_stubdomain)
+        if (libxl_defbool_val(b_info->device_model_stubdomain))
             *need_memkb += 32 * 1024;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
diff -r f7be24bb62db -r 8e0512bc1b47 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -80,9 +80,6 @@
     b_info->shadow_memkb = LIBXL_MEMKB_DEFAULT;
     b_info->video_memkb =  LIBXL_MEMKB_DEFAULT;
 
-    b_info->device_model_stubdomain = false;
-    b_info->device_model = NULL;
-
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
@@ -122,6 +119,17 @@
     default:abort();
     }
 
+    libxl_defbool_setdefault(&b_info->device_model_stubdomain, false);
+
+    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM &&
+        b_info->device_model_version !=
+            LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL &&
+        libxl_defbool_val(b_info->device_model_stubdomain)) {
+        LIBXL__LOG(CTX, XTL_ERROR,
+            "device model stubdomains require \"qemu-xen-traditional\"");
+        return ERROR_INVAL;
+    }
+
     if (!b_info->max_vcpus)
         b_info->max_vcpus = 1;
     if (!b_info->cur_vcpus)
diff -r f7be24bb62db -r 8e0512bc1b47 tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:26:15 2012 +0000
@@ -39,7 +39,7 @@
     libxl_ctx *ctx = libxl__gc_owner(gc);
     const char *dm;
 
-    if (info->device_model_stubdomain)
+    if (libxl_defbool_val(info->device_model_stubdomain))
         return NULL;
 
     if (info->device_model) {
@@ -899,7 +899,7 @@
     char **pass_stuff;
     const char *dm;
 
-    if (b_info->device_model_stubdomain) {
+    if (libxl_defbool_val(b_info->device_model_stubdomain)) {
         rc = libxl__create_stubdom(gc, domid, guest_config, state, starting_r);
         goto out;
     }
diff -r f7be24bb62db -r 8e0512bc1b47 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
@@ -240,8 +240,8 @@
     ("type",            libxl_domain_type),
     
     ("device_model_version", libxl_device_model_version),
-    ("device_model_stubdomain", bool),
-    # you set device_model you must set device_model_version too
+    ("device_model_stubdomain", libxl_defbool),
+    # if you set device_model you must set device_model_version too
     ("device_model",     string),
     ("device_model_ssidref", uint32),
 
diff -r f7be24bb62db -r 8e0512bc1b47 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -1125,8 +1125,8 @@
         }
     } else if (b_info->device_model)
         fprintf(stderr, "WARNING: device model override given without specific DM version\n");
-    if (!xlu_cfg_get_long (config, "device_model_stubdomain_override", &l, 0))
-        b_info->device_model_stubdomain = l;
+    xlu_cfg_get_defbool (config, "device_model_stubdomain_override",
+                         &b_info->device_model_stubdomain, 0);
 
     if (!xlu_cfg_get_string (config, "device_model_stubdomain_seclabel",
                              &buf, 0)) {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3get-0000Pl-5n; Sat, 03 Mar 2012 04:33:27 +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 1S3ges-0000ET-0f
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:26 +0000
Received: from [85.158.143.35:28859] by server-2.bemta-4.messagelabs.com id
	4D/8D-17550-51F915F4; Sat, 03 Mar 2012 04:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1330749203!8629768!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6307 invoked from network); 3 Mar 2012 04:33:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33: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 1S3gep-0004gj-5L
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gep-0003Ve-43
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:23 +0000
Message-Id: <E1S3gep-0003Ve-43@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Make IDL KeyedUnion keyvar an
	idl.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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID 5b850e935e37845ed0a7571447b81a5f0567861a
# Parent  8dcccb97371f266174a91434264f3643d6ffde0e
libxl: Make IDL KeyedUnion keyvar an idl.Field

This is more logical than having keyvar_name and keyvar_type members.

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


diff -r 8dcccb97371f -r 5b850e935e37 tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/gentest.py	Thu Mar 01 12:26:15 2012 +0000
@@ -31,7 +31,7 @@
     elif isinstance(ty, idl.KeyedUnion):
         if parent is None:
             raise Exception("KeyedUnion type must have a parent")
-        s += "switch (%s) {\n" % (parent + ty.keyvar_name)
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
diff -r 8dcccb97371f -r 5b850e935e37 tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/gentypes.py	Thu Mar 01 12:26:15 2012 +0000
@@ -56,7 +56,7 @@
     if isinstance(ty, idl.KeyedUnion):
         if parent is None:
             raise Exception("KeyedUnion type must have a parent")
-        s += "switch (%s) {\n" % (parent + ty.keyvar_name)
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
@@ -86,7 +86,7 @@
     elif isinstance(ty, idl.KeyedUnion):
         if parent is None:
             raise Exception("KeyedUnion type must have a parent")
-        s += "switch (%s) {\n" % (parent + ty.keyvar_name)
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
diff -r 8dcccb97371f -r 5b850e935e37 tools/libxl/idl.py
--- a/tools/libxl/idl.py	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/idl.py	Thu Mar 01 12:26:15 2012 +0000
@@ -206,8 +206,9 @@
         if not isinstance(keyvar_type, Enumeration):
             raise ValueError
 
-        self.keyvar_name = keyvar_name
-        self.keyvar_type = keyvar_type
+        kv_kwargs = dict([(x.lstrip('keyvar_'),y) for (x,y) in kwargs.items() if x.startswith('keyvar_')])
+        
+        self.keyvar = Field(keyvar_type, keyvar_name, **kv_kwargs)
 
         for f in fields:
             # (name, enum, type)
diff -r 8dcccb97371f -r 5b850e935e37 tools/libxl/idl.txt
--- a/tools/libxl/idl.txt	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/idl.txt	Thu Mar 01 12:26:15 2012 +0000
@@ -128,10 +128,9 @@
  where the currently valid member of the union can be determined based
  upon another member in the containing type.
 
- The KeyedUnion.keyvar_name must contain the name of the member of the
+ The KeyedUnion.keyvar contains an idl.type the member of the
  containing type which determines the valid member of the union. The
- member referenced by KeyedUnion.keyvar_name has type
- KeyedUnion.keyvar_type which must be an instance of the Enumeration type.
+ must be an instance of the Enumeration type.
 
 Standard Types
 --------------

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3get-0000Pl-5n; Sat, 03 Mar 2012 04:33:27 +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 1S3ges-0000ET-0f
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:26 +0000
Received: from [85.158.143.35:28859] by server-2.bemta-4.messagelabs.com id
	4D/8D-17550-51F915F4; Sat, 03 Mar 2012 04:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1330749203!8629768!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6307 invoked from network); 3 Mar 2012 04:33:24 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33: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 1S3gep-0004gj-5L
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gep-0003Ve-43
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:23 +0000
Message-Id: <E1S3gep-0003Ve-43@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Make IDL KeyedUnion keyvar an
	idl.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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID 5b850e935e37845ed0a7571447b81a5f0567861a
# Parent  8dcccb97371f266174a91434264f3643d6ffde0e
libxl: Make IDL KeyedUnion keyvar an idl.Field

This is more logical than having keyvar_name and keyvar_type members.

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


diff -r 8dcccb97371f -r 5b850e935e37 tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/gentest.py	Thu Mar 01 12:26:15 2012 +0000
@@ -31,7 +31,7 @@
     elif isinstance(ty, idl.KeyedUnion):
         if parent is None:
             raise Exception("KeyedUnion type must have a parent")
-        s += "switch (%s) {\n" % (parent + ty.keyvar_name)
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
diff -r 8dcccb97371f -r 5b850e935e37 tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/gentypes.py	Thu Mar 01 12:26:15 2012 +0000
@@ -56,7 +56,7 @@
     if isinstance(ty, idl.KeyedUnion):
         if parent is None:
             raise Exception("KeyedUnion type must have a parent")
-        s += "switch (%s) {\n" % (parent + ty.keyvar_name)
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
@@ -86,7 +86,7 @@
     elif isinstance(ty, idl.KeyedUnion):
         if parent is None:
             raise Exception("KeyedUnion type must have a parent")
-        s += "switch (%s) {\n" % (parent + ty.keyvar_name)
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
diff -r 8dcccb97371f -r 5b850e935e37 tools/libxl/idl.py
--- a/tools/libxl/idl.py	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/idl.py	Thu Mar 01 12:26:15 2012 +0000
@@ -206,8 +206,9 @@
         if not isinstance(keyvar_type, Enumeration):
             raise ValueError
 
-        self.keyvar_name = keyvar_name
-        self.keyvar_type = keyvar_type
+        kv_kwargs = dict([(x.lstrip('keyvar_'),y) for (x,y) in kwargs.items() if x.startswith('keyvar_')])
+        
+        self.keyvar = Field(keyvar_type, keyvar_name, **kv_kwargs)
 
         for f in fields:
             # (name, enum, type)
diff -r 8dcccb97371f -r 5b850e935e37 tools/libxl/idl.txt
--- a/tools/libxl/idl.txt	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/idl.txt	Thu Mar 01 12:26:15 2012 +0000
@@ -128,10 +128,9 @@
  where the currently valid member of the union can be determined based
  upon another member in the containing type.
 
- The KeyedUnion.keyvar_name must contain the name of the member of the
+ The KeyedUnion.keyvar contains an idl.type the member of the
  containing type which determines the valid member of the union. The
- member referenced by KeyedUnion.keyvar_name has type
- KeyedUnion.keyvar_type which must be an instance of the Enumeration type.
+ must be an instance of the Enumeration type.
 
 Standard Types
 --------------

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3geu-0000SB-AZ; Sat, 03 Mar 2012 04:33: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 1S3ges-0000JT-Iu
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:26 +0000
Received: from [85.158.139.83:18985] by server-7.bemta-5.messagelabs.com id
	F5/8A-16195-61F915F4; Sat, 03 Mar 2012 04:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1330749204!17592084!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12479 invoked from network); 3 Mar 2012 04:33:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33: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 1S3gep-0004gm-MB
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gep-0003W9-Kj
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:23 +0000
Message-Id: <E1S3gep-0003W9-Kj@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: idl: generate KeyedUnion key
	member as part of the KeyedUnion
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID aa30f4cfde89eba61ee43fe3a15c1823d5880cad
# Parent  5b850e935e37845ed0a7571447b81a5f0567861a
libxl: idl: generate KeyedUnion key member as part of the KeyedUnion

Rather than specifying it twice in the IDL.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 5b850e935e37 -r aa30f4cfde89 tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/gentypes.py	Thu Mar 01 12:26:15 2012 +0000
@@ -32,6 +32,9 @@
             s += "} %s" % ty.typename
 
     elif isinstance(ty, idl.Aggregate):
+        if isinstance(ty, idl.KeyedUnion):
+            s += libxl_C_instance_of(ty.keyvar.type, ty.keyvar.name) + ";\n"
+            
         if ty.typename is None:
             s += "%s {\n" % ty.kind
         else:
diff -r 5b850e935e37 -r aa30f4cfde89 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
@@ -237,7 +237,6 @@
     ("shadow_memkb",    MemKB),
     ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
-    ("type",            libxl_domain_type),
     
     ("device_model_version", libxl_device_model_version),
     ("device_model_stubdomain", libxl_defbool),
@@ -447,7 +446,6 @@
     ("domid",    libxl_domid),
     ("domuuid",  libxl_uuid),
     ("for_user", libxl_ev_user),
-    ("type",     libxl_event_type),
     ("u", KeyedUnion(None, libxl_event_type, "type",
           [("domain_shutdown", Struct(None, [
                                              ("shutdown_reason", uint8),

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3geu-0000SB-AZ; Sat, 03 Mar 2012 04:33: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 1S3ges-0000JT-Iu
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:26 +0000
Received: from [85.158.139.83:18985] by server-7.bemta-5.messagelabs.com id
	F5/8A-16195-61F915F4; Sat, 03 Mar 2012 04:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1330749204!17592084!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12479 invoked from network); 3 Mar 2012 04:33:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33: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 1S3gep-0004gm-MB
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gep-0003W9-Kj
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:23 +0000
Message-Id: <E1S3gep-0003W9-Kj@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: idl: generate KeyedUnion key
	member as part of the KeyedUnion
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID aa30f4cfde89eba61ee43fe3a15c1823d5880cad
# Parent  5b850e935e37845ed0a7571447b81a5f0567861a
libxl: idl: generate KeyedUnion key member as part of the KeyedUnion

Rather than specifying it twice in the IDL.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 5b850e935e37 -r aa30f4cfde89 tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/gentypes.py	Thu Mar 01 12:26:15 2012 +0000
@@ -32,6 +32,9 @@
             s += "} %s" % ty.typename
 
     elif isinstance(ty, idl.Aggregate):
+        if isinstance(ty, idl.KeyedUnion):
+            s += libxl_C_instance_of(ty.keyvar.type, ty.keyvar.name) + ";\n"
+            
         if ty.typename is None:
             s += "%s {\n" % ty.kind
         else:
diff -r 5b850e935e37 -r aa30f4cfde89 tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
@@ -237,7 +237,6 @@
     ("shadow_memkb",    MemKB),
     ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
-    ("type",            libxl_domain_type),
     
     ("device_model_version", libxl_device_model_version),
     ("device_model_stubdomain", libxl_defbool),
@@ -447,7 +446,6 @@
     ("domid",    libxl_domid),
     ("domuuid",  libxl_uuid),
     ("for_user", libxl_ev_user),
-    ("type",     libxl_event_type),
     ("u", KeyedUnion(None, libxl_event_type, "type",
           [("domain_shutdown", Struct(None, [
                                              ("shutdown_reason", uint8),

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gew-0000Vk-Dx; Sat, 03 Mar 2012 04:33:30 +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 1S3geu-0000RW-Fd
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:28 +0000
Received: from [85.158.139.83:19014] by server-9.bemta-5.messagelabs.com id
	FF/9F-09826-71F915F4; Sat, 03 Mar 2012 04:33:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1330749204!17673487!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.6 required=7.0 tests=DIET_1
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12474 invoked from network); 3 Mar 2012 04:33:25 -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;
	3 Mar 2012 04:33: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 1S3geq-0004gr-8q
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geq-0003Wc-7W
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:24 +0000
Message-Id: <E1S3geq-0003Wc-7W@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: autogenerate libxl_FOO_init
	and libxl_FOO_init_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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID 17bfd4d2ffce56b65e7849a5779471ef4f5e4aea
# Parent  aa30f4cfde89eba61ee43fe3a15c1823d5880cad
libxl: autogenerate libxl_FOO_init and libxl_FOO_init_FIELD

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/gentypes.py	Thu Mar 01 12:26:15 2012 +0000
@@ -78,6 +78,88 @@
         s = indent + s
     return s.replace("\n", "\n%s" % indent).rstrip(indent)
 
+def libxl_init_members(ty, nesting = 0):
+    """Returns a list of members of ty which require a separate init"""
+
+    if isinstance(ty, idl.Aggregate):
+        return [f for f in ty.fields if not f.const and isinstance(f.type,idl.KeyedUnion)]
+    else:
+        return []
+    
+def _libxl_C_type_init(ty, v, indent = "    ", parent = None, subinit=False):
+    s = ""
+    if isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        if subinit:
+            s += "switch (%s) {\n" % (parent + ty.keyvar.name)
+            for f in ty.fields:
+                (nparent,fexpr) = ty.member(v, f, parent is None)
+                s += "case %s:\n" % f.enumname
+                s += _libxl_C_type_init(f.type, fexpr, "    ", nparent)
+                s += "    break;\n"
+            s += "}\n"
+        else:
+            if ty.keyvar.init_val:
+                s += "%s = %s;\n" % (parent + ty.keyvar.name, ty.keyvar.init_val)
+            elif ty.keyvar.type.init_val:
+                s += "%s = %s;\n" % (parent + ty.keyvar.name, ty.keyvar.type.init_val)
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.init_fn is None):
+        for f in [f for f in ty.fields if not f.const]:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            if f.init_val is not None:
+                s += "%s = %s;\n" % (fexpr, f.init_val)
+            else:
+                s += _libxl_C_type_init(f.type, fexpr, "", nparent)
+    else:
+        if ty.init_val is not None:
+            s += "%s = %s;\n" % (ty.pass_arg(v, parent is None), ty.init_val)
+        elif ty.init_fn is not None:
+            s += "%s(%s);\n" % (ty.init_fn, ty.pass_arg(v, parent is None))
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_init(ty):
+    s = ""
+    s += "void %s(%s)\n" % (ty.init_fn, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE))
+    s += "{\n"
+    s += "    memset(p, '\\0', sizeof(*p));\n"
+    s += _libxl_C_type_init(ty, "p")
+    s += "}\n"
+    s += "\n"
+    return s
+
+def libxl_C_type_member_init(ty, field):
+    if not isinstance(field.type, idl.KeyedUnion):
+        raise Exception("Only KeyedUnion is supported for member init")
+
+    ku = field.type
+    
+    s = ""
+    s += "void %s(%s, %s)\n" % (ty.init_fn + "_" + ku.keyvar.name,
+                                ty.make_arg("p", passby=idl.PASS_BY_REFERENCE),
+                                ku.keyvar.type.make_arg(ku.keyvar.name))
+    s += "{\n"
+    
+    if ku.keyvar.init_val:
+        init_val = ku.keyvar.init_val
+    elif ku.keyvar.type.init_val:
+        init_val = ku.keyvar.type.init_val
+    else:
+        init_val = None
+        
+    if init_val is not None:
+        (nparent,fexpr) = ty.member(ty.pass_arg("p"), ku.keyvar, isref=True)
+        s += "    assert(%s == %s);\n" % (fexpr, init_val)
+        s += "    %s = %s;\n" % (fexpr, ku.keyvar.name)
+    (nparent,fexpr) = ty.member(ty.pass_arg("p"), field, isref=True)
+    s += _libxl_C_type_init(ku, fexpr, parent=nparent, subinit=True)
+    s += "}\n"
+    s += "\n"
+    return s
+
 def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
     s = ""
     if parent is None:
@@ -199,6 +281,15 @@
         f.write(libxl_C_type_define(ty) + ";\n")
         if ty.dispose_fn is not None:
             f.write("void %s(%s);\n" % (ty.dispose_fn, ty.make_arg("p")))
+        if ty.init_fn is not None:
+            f.write("void %s(%s);\n" % (ty.init_fn, ty.make_arg("p")))
+            for field in libxl_init_members(ty):
+                if not isinstance(field.type, idl.KeyedUnion):
+                    raise Exception("Only KeyedUnion is supported for member init")
+                ku = field.type
+                f.write("void %s(%s, %s);\n" % (ty.init_fn + "_" + ku.keyvar.name,
+                                               ty.make_arg("p"),
+                                               ku.keyvar.type.make_arg(ku.keyvar.name)))
         if ty.json_fn is not None:
             f.write("char *%s_to_json(libxl_ctx *ctx, %s);\n" % (ty.typename, ty.make_arg("p")))
         if isinstance(ty, idl.Enumeration):
@@ -227,7 +318,7 @@
 
 """ % (header_json_define, header_json_define, " ".join(sys.argv)))
 
-    for ty in [ty for ty in types+builtins if ty.json_fn is not None]:
+    for ty in [ty for ty in types if ty.json_fn is not None]:
         f.write("yajl_gen_status %s_gen_json(yajl_gen hand, %s);\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
 
     f.write("\n")
@@ -264,6 +355,11 @@
         f.write("    memset(p, LIBXL_DTOR_POISON, sizeof(*p));\n")
         f.write("}\n")
         f.write("\n")
+        
+    for ty in [t for t in types if t.init_fn is not None and t.autogenerate_init_fn]:
+        f.write(libxl_C_type_init(ty))
+        for field in libxl_init_members(ty):
+            f.write(libxl_C_type_member_init(ty, field))
 
     for ty in [t for t in types if isinstance(t,idl.Enumeration)]:
         f.write("const char *%s_to_string(%s e)\n" % (ty.typename, ty.typename))
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/idl.py
--- a/tools/libxl/idl.py	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/idl.py	Thu Mar 01 12:26:15 2012 +0000
@@ -51,6 +51,10 @@
 
         self.autogenerate_dispose_fn = kwargs.setdefault('autogenerate_dispose_fn', True)
 
+        self.init_fn = kwargs.setdefault('init_fn', None)
+        self.init_val = kwargs.setdefault('init_val', None)
+        self.autogenerate_init_fn = kwargs.setdefault('autogenerate_init_fn', False)
+
         if self.typename is not None and not self.private:
             self.json_fn = kwargs.setdefault('json_fn', self.typename + "_gen_json")
         else:
@@ -144,12 +148,20 @@
         self.name = name
         self.const = kwargs.setdefault('const', False)
         self.enumname = kwargs.setdefault('enumname', None)
+        self.init_val = kwargs.setdefault('init_val', None)
 
 class Aggregate(Type):
     """A type containing a collection of other types"""
     def __init__(self, kind, typename, fields, **kwargs):
         Type.__init__(self, typename, **kwargs)
 
+        if self.typename is not None:
+            self.init_fn = kwargs.setdefault('init_fn', self.typename + "_init")
+        else:
+            self.init_fn = kwargs.setdefault('init_fn', None)
+
+        self.autogenerate_init_fn = kwargs.setdefault('autogenerate_init_fn', True)
+
         self.kind = kind
 
         self.fields = []
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/idl.txt
--- a/tools/libxl/idl.txt	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/idl.txt	Thu Mar 01 12:26:15 2012 +0000
@@ -44,6 +44,22 @@
  Indicates if the above named Type.dispose_fn should be
  autogenerated.
 
+Type.init_val: (default: None)
+
+ C expression for the value to initialise instances of this type to.
+
+ If present takes precendence over init_fn (see below).
+
+Type.init_fn: (default: typename + "_init" if dir in [IN, BOTH] and
+                        type != None)
+
+ The name of the C function which will initialist Type.
+
+Type.autogenerate_init_fn: (default: True if dir in [IN, BOTH])
+
+ Indicates if the above named Type.init_fn should be
+ autogenerated.
+
 Type.json_fn: (default: typename + "_gen_json" or None if type == None)
 
  The name of the C function which will generate a YAJL data structure
@@ -105,10 +121,13 @@
 
  Each field has the following properties:
 
-  Field.type    The type of the member (a idl.Type).
-  Field.name    The name of the member (can be None for anonymous
-                fields).
-  Field.const   Boolean, true if the member is const.
+  Field.type     The type of the member (a idl.Type).
+  Field.name     The name of the member (can be None for anonymous
+                 fields).
+  Field.const    Boolean, true if the member is const.
+  Field.init_val The initialisation value for this field. Takes
+                 precendence over both Field.type.init_val and
+                 Field.type.init_fn.
 
 idl.Struct
 
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -1227,11 +1227,6 @@
 
 /******************************************************************************/
 
-void libxl_device_disk_init(libxl_device_disk *disk)
-{
-    memset(disk, 0x00, sizeof(libxl_device_disk));
-}
-
 int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
 {
     int rc;
@@ -1718,10 +1713,6 @@
 }
 
 /******************************************************************************/
-void libxl_device_nic_init(libxl_device_nic *nic)
-{
-    memset(nic, '\0', sizeof(*nic));
-}
 
 int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic)
 {
@@ -2142,10 +2133,6 @@
 }
 
 /******************************************************************************/
-void libxl_device_vkb_init(libxl_device_vkb *vkb)
-{
-    memset(vkb, 0x00, sizeof(libxl_device_vkb));
-}
 
 int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb)
 {
@@ -2254,10 +2241,6 @@
 }
 
 /******************************************************************************/
-void libxl_device_vfb_init(libxl_device_vfb *vfb)
-{
-    memset(vfb, 0x00, sizeof(libxl_device_vfb));
-}
 
 int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb)
 {
@@ -3067,6 +3050,8 @@
     struct xen_domctl_sched_credit sdom;
     int rc;
 
+    libxl_sched_credit_domain_init(scinfo);
+
     rc = xc_sched_credit_domain_get(ctx->xch, domid, &sdom);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain sched credit");
@@ -3126,6 +3111,8 @@
     struct xen_domctl_sched_credit2 sdom;
     int rc;
 
+    libxl_sched_credit2_domain_init(scinfo);
+
     rc = xc_sched_credit2_domain_get(ctx->xch, domid, &sdom);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
@@ -3183,6 +3170,8 @@
     uint16_t weight;
     int rc;
 
+    libxl_sched_sedf_domain_init(scinfo);
+
     rc = xc_sedf_domain_get(ctx->xch, domid, &period, &slice, &latency,
                             &extratime, &weight);
     if (rc != 0) {
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:15 2012 +0000
@@ -381,10 +381,6 @@
 int libxl_ctx_postfork(libxl_ctx *ctx);
 
 /* domain related functions */
-void libxl_domain_create_info_init(libxl_domain_create_info *c_info);
-void libxl_domain_build_info_init(libxl_domain_build_info *b_info);
-void libxl_domain_build_info_init_type(libxl_domain_build_info *b_info,
-                                       libxl_domain_type type);
 typedef int (*libxl_console_ready)(libxl_ctx *ctx, uint32_t domid, void *priv);
 int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid);
 int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid, int restore_fd);
@@ -523,7 +519,6 @@
  */
 
 /* Disks */
-void libxl_device_disk_init(libxl_device_disk *disk);
 int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk);
 int libxl_device_disk_remove(libxl_ctx *ctx, uint32_t domid,
                              libxl_device_disk *disk,
@@ -549,7 +544,6 @@
 int libxl_device_disk_local_detach(libxl_ctx *ctx, libxl_device_disk *disk);
 
 /* Network Interfaces */
-void libxl_device_nic_init(libxl_device_nic *nic);
 int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic);
 int libxl_device_nic_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_nic *nic,
@@ -561,7 +555,6 @@
                               libxl_device_nic *nic, libxl_nicinfo *nicinfo);
 
 /* Keyboard */
-void libxl_device_vkb_init(libxl_device_vkb *vkb);
 int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
 int libxl_device_vkb_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_vkb *vkb,
@@ -569,7 +562,6 @@
 int libxl_device_vkb_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
 
 /* Framebuffer */
-void libxl_device_vfb_init(libxl_device_vfb *vfb);
 int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb);
 int libxl_device_vfb_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_vfb *vfb,
@@ -577,7 +569,6 @@
 int libxl_device_vfb_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb);
 
 /* PCI Passthrough */
-void libxl_device_pci_init(libxl_device_pci *pci);
 int libxl_device_pci_add(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
 int libxl_device_pci_remove(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
 int libxl_device_pci_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -50,11 +50,6 @@
     libxl_domain_build_info_dispose(&d_config->b_info);
 }
 
-void libxl_domain_create_info_init(libxl_domain_create_info *c_info)
-{
-    memset(c_info, '\0', sizeof(*c_info));
-}
-
 int libxl__domain_create_info_setdefault(libxl__gc *gc,
                                          libxl_domain_create_info *c_info)
 {
@@ -69,35 +64,6 @@
     return 0;
 }
 
-void libxl_domain_build_info_init(libxl_domain_build_info *b_info)
-{
-    memset(b_info, '\0', sizeof(*b_info));
-    b_info->type = -1;
-
-    b_info->max_memkb = LIBXL_MEMKB_DEFAULT;
-    b_info->target_memkb = LIBXL_MEMKB_DEFAULT;
-    b_info->shadow_memkb = LIBXL_MEMKB_DEFAULT;
-    b_info->video_memkb =  LIBXL_MEMKB_DEFAULT;
-
-}
-
-void libxl_domain_build_info_init_type(libxl_domain_build_info *b_info,
-                                       libxl_domain_type type)
-{
-    assert(b_info->type == -1);
-    b_info->type = type;
-    switch (b_info->type) {
-    case LIBXL_DOMAIN_TYPE_HVM:
-        b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
-        break;
-    case LIBXL_DOMAIN_TYPE_PV:
-        b_info->u.pv.slack_memkb = LIBXL_MEMKB_DEFAULT;
-        break;
-    default:
-        abort();
-    }
-}
-
 int libxl__domain_build_info_setdefault(libxl__gc *gc,
                                         libxl_domain_build_info *b_info)
 {
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/libxl_json.h
--- a/tools/libxl/libxl_json.h	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_json.h	Thu Mar 01 12:26:15 2012 +0000
@@ -22,6 +22,20 @@
 #  include <yajl/yajl_version.h>
 #endif
 
+yajl_gen_status libxl_defbool_gen_json(yajl_gen hand, libxl_defbool *p);
+yajl_gen_status libxl_domid_gen_json(yajl_gen hand, libxl_domid *p);
+yajl_gen_status libxl_uuid_gen_json(yajl_gen hand, libxl_uuid *p);
+yajl_gen_status libxl_mac_gen_json(yajl_gen hand, libxl_mac *p);
+yajl_gen_status libxl_cpumap_gen_json(yajl_gen hand, libxl_cpumap *p);
+yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
+                                                 libxl_cpuid_policy_list *p);
+yajl_gen_status libxl_string_list_gen_json(yajl_gen hand, libxl_string_list *p);
+yajl_gen_status libxl_key_value_list_gen_json(yajl_gen hand,
+                                              libxl_key_value_list *p);
+yajl_gen_status libxl_file_reference_gen_json(yajl_gen hand,
+                                              libxl_file_reference *p);
+yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand, libxl_hwcap *p);
+
 #include <_libxl_types_json.h>
 
 /* YAJL version check */
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_pci.c	Thu Mar 01 12:26:15 2012 +0000
@@ -765,11 +765,6 @@
     return -1;
 }
 
-void libxl_device_pci_init(libxl_device_pci *pci)
-{
-    memset(pci, '\0', sizeof(*pci));
-}
-
 int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci)
 {
     return 0;
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
@@ -100,7 +100,7 @@
     (1, "no_delay_for_missed_ticks"),
     (2, "no_missed_ticks_pending"),
     (3, "one_missed_tick_pending"),
-    ])
+    ], init_val = "LIBXL_TIMER_MODE_DEFAULT")
 
 libxl_bios_type = Enumeration("bios_type", [
     (1, "rombios"),
@@ -180,19 +180,19 @@
     ("vcpu_max_id", uint32),
     ("vcpu_online", uint32),
     ("cpupool",     uint32),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_cpupoolinfo = Struct("cpupoolinfo", [
     ("poolid",      uint32),
     ("sched",       libxl_scheduler),
     ("n_dom",       uint32),
     ("cpumap",      libxl_cpumap)
-    ])
+    ], dir=DIR_OUT)
 
 libxl_vminfo = Struct("vminfo", [
     ("uuid", libxl_uuid),
     ("domid", libxl_domid),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_version_info = Struct("version_info", [
     ("xen_version_major", integer),
@@ -207,7 +207,7 @@
     ("virt_start",        uint64),
     ("pagesize",          integer),
     ("commandline",       string),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_domain_create_info = Struct("domain_create_info",[
     ("type",         libxl_domain_type),
@@ -219,7 +219,9 @@
     ("xsdata",       libxl_key_value_list),
     ("platformdata", libxl_key_value_list),
     ("poolid",       uint32),
-    ])
+    ], dir=DIR_IN)
+
+MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
 
 # Instances of libxl_file_reference contained in this struct which
 # have been mapped (with libxl_file_reference_map) will be unmapped
@@ -297,8 +299,8 @@
                                       # Use host's E820 for PCI passthrough.
                                       ("e820_host", libxl_defbool),
                                       ])),
-                 ])),
-    ],
+                 ], keyvar_init_val = "-1")),
+    ], dir=DIR_IN
 )
 
 libxl_device_vfb = Struct("device_vfb", [
@@ -360,7 +362,7 @@
     ("state", integer),
     ("evtch", integer),
     ("rref", integer),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_nicinfo = Struct("nicinfo", [
     ("backend", string),
@@ -372,7 +374,7 @@
     ("evtch", integer),
     ("rref_tx", integer),
     ("rref_rx", integer),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_vcpuinfo = Struct("vcpuinfo", [
     ("vcpuid", uint32),
@@ -382,7 +384,7 @@
     ("running", bool),
     ("vcpu_time", uint64), # total vcpu time ran (ns)
     ("cpumap", libxl_cpumap), # current cpu's affinities
-    ])
+    ], dir=DIR_OUT)
 
 libxl_physinfo = Struct("physinfo", [
     ("threads_per_core", uint32),
@@ -409,7 +411,7 @@
     ("core", uint32),
     ("socket", uint32),
     ("node", uint32),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_sched_credit_domain = Struct("sched_credit_domain", [
     ("weight", integer),
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -3922,6 +3922,7 @@
 {
     int rc;
 
+    
     rc = libxl_sched_credit_domain_set(ctx, domid, scinfo);
     if (rc)
         fprintf(stderr, "libxl_sched_credit_domain_set failed.\n");
@@ -3950,6 +3951,7 @@
         scinfo.weight,
         scinfo.cap);
     free(domname);
+    libxl_sched_credit_domain_dispose(&scinfo);
     return 0;
 }
 
@@ -3997,6 +3999,7 @@
         domid,
         scinfo.weight);
     free(domname);
+    libxl_sched_credit2_domain_dispose(&scinfo);
     return 0;
 }
 
@@ -4020,7 +4023,6 @@
     rc = libxl_sched_sedf_domain_set(ctx, domid, scinfo);
     if (rc)
         fprintf(stderr, "libxl_sched_sedf_domain_set failed.\n");
-
     return rc;
 }
 
@@ -4049,6 +4051,7 @@
         scinfo.extratime,
         scinfo.weight);
     free(domname);
+    libxl_sched_sedf_domain_dispose(&scinfo);
     return 0;
 }
 
@@ -4181,6 +4184,7 @@
             if (opt_c)
                 scinfo.cap = cap;
             rc = sched_credit_domain_set(domid, &scinfo);
+            libxl_sched_credit_domain_dispose(&scinfo);
             if (rc)
                 return -rc;
         }
@@ -4255,6 +4259,7 @@
             if (opt_w)
                 scinfo.weight = weight;
             rc = sched_credit2_domain_set(domid, &scinfo);
+            libxl_sched_credit2_domain_dispose(&scinfo);
             if (rc)
                 return -rc;
         }
@@ -4373,6 +4378,7 @@
                 scinfo.slice = 0;
             }
             rc = sched_sedf_domain_set(domid, &scinfo);
+            libxl_sched_sedf_domain_dispose(&scinfo);
             if (rc)
                 return -rc;
         }

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gew-0000Vk-Dx; Sat, 03 Mar 2012 04:33:30 +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 1S3geu-0000RW-Fd
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:28 +0000
Received: from [85.158.139.83:19014] by server-9.bemta-5.messagelabs.com id
	FF/9F-09826-71F915F4; Sat, 03 Mar 2012 04:33:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1330749204!17673487!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.6 required=7.0 tests=DIET_1
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12474 invoked from network); 3 Mar 2012 04:33:25 -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;
	3 Mar 2012 04:33: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 1S3geq-0004gr-8q
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geq-0003Wc-7W
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:24 +0000
Message-Id: <E1S3geq-0003Wc-7W@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: autogenerate libxl_FOO_init
	and libxl_FOO_init_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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330604775 0
# Node ID 17bfd4d2ffce56b65e7849a5779471ef4f5e4aea
# Parent  aa30f4cfde89eba61ee43fe3a15c1823d5880cad
libxl: autogenerate libxl_FOO_init and libxl_FOO_init_FIELD

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/gentypes.py	Thu Mar 01 12:26:15 2012 +0000
@@ -78,6 +78,88 @@
         s = indent + s
     return s.replace("\n", "\n%s" % indent).rstrip(indent)
 
+def libxl_init_members(ty, nesting = 0):
+    """Returns a list of members of ty which require a separate init"""
+
+    if isinstance(ty, idl.Aggregate):
+        return [f for f in ty.fields if not f.const and isinstance(f.type,idl.KeyedUnion)]
+    else:
+        return []
+    
+def _libxl_C_type_init(ty, v, indent = "    ", parent = None, subinit=False):
+    s = ""
+    if isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        if subinit:
+            s += "switch (%s) {\n" % (parent + ty.keyvar.name)
+            for f in ty.fields:
+                (nparent,fexpr) = ty.member(v, f, parent is None)
+                s += "case %s:\n" % f.enumname
+                s += _libxl_C_type_init(f.type, fexpr, "    ", nparent)
+                s += "    break;\n"
+            s += "}\n"
+        else:
+            if ty.keyvar.init_val:
+                s += "%s = %s;\n" % (parent + ty.keyvar.name, ty.keyvar.init_val)
+            elif ty.keyvar.type.init_val:
+                s += "%s = %s;\n" % (parent + ty.keyvar.name, ty.keyvar.type.init_val)
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.init_fn is None):
+        for f in [f for f in ty.fields if not f.const]:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            if f.init_val is not None:
+                s += "%s = %s;\n" % (fexpr, f.init_val)
+            else:
+                s += _libxl_C_type_init(f.type, fexpr, "", nparent)
+    else:
+        if ty.init_val is not None:
+            s += "%s = %s;\n" % (ty.pass_arg(v, parent is None), ty.init_val)
+        elif ty.init_fn is not None:
+            s += "%s(%s);\n" % (ty.init_fn, ty.pass_arg(v, parent is None))
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_init(ty):
+    s = ""
+    s += "void %s(%s)\n" % (ty.init_fn, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE))
+    s += "{\n"
+    s += "    memset(p, '\\0', sizeof(*p));\n"
+    s += _libxl_C_type_init(ty, "p")
+    s += "}\n"
+    s += "\n"
+    return s
+
+def libxl_C_type_member_init(ty, field):
+    if not isinstance(field.type, idl.KeyedUnion):
+        raise Exception("Only KeyedUnion is supported for member init")
+
+    ku = field.type
+    
+    s = ""
+    s += "void %s(%s, %s)\n" % (ty.init_fn + "_" + ku.keyvar.name,
+                                ty.make_arg("p", passby=idl.PASS_BY_REFERENCE),
+                                ku.keyvar.type.make_arg(ku.keyvar.name))
+    s += "{\n"
+    
+    if ku.keyvar.init_val:
+        init_val = ku.keyvar.init_val
+    elif ku.keyvar.type.init_val:
+        init_val = ku.keyvar.type.init_val
+    else:
+        init_val = None
+        
+    if init_val is not None:
+        (nparent,fexpr) = ty.member(ty.pass_arg("p"), ku.keyvar, isref=True)
+        s += "    assert(%s == %s);\n" % (fexpr, init_val)
+        s += "    %s = %s;\n" % (fexpr, ku.keyvar.name)
+    (nparent,fexpr) = ty.member(ty.pass_arg("p"), field, isref=True)
+    s += _libxl_C_type_init(ku, fexpr, parent=nparent, subinit=True)
+    s += "}\n"
+    s += "\n"
+    return s
+
 def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
     s = ""
     if parent is None:
@@ -199,6 +281,15 @@
         f.write(libxl_C_type_define(ty) + ";\n")
         if ty.dispose_fn is not None:
             f.write("void %s(%s);\n" % (ty.dispose_fn, ty.make_arg("p")))
+        if ty.init_fn is not None:
+            f.write("void %s(%s);\n" % (ty.init_fn, ty.make_arg("p")))
+            for field in libxl_init_members(ty):
+                if not isinstance(field.type, idl.KeyedUnion):
+                    raise Exception("Only KeyedUnion is supported for member init")
+                ku = field.type
+                f.write("void %s(%s, %s);\n" % (ty.init_fn + "_" + ku.keyvar.name,
+                                               ty.make_arg("p"),
+                                               ku.keyvar.type.make_arg(ku.keyvar.name)))
         if ty.json_fn is not None:
             f.write("char *%s_to_json(libxl_ctx *ctx, %s);\n" % (ty.typename, ty.make_arg("p")))
         if isinstance(ty, idl.Enumeration):
@@ -227,7 +318,7 @@
 
 """ % (header_json_define, header_json_define, " ".join(sys.argv)))
 
-    for ty in [ty for ty in types+builtins if ty.json_fn is not None]:
+    for ty in [ty for ty in types if ty.json_fn is not None]:
         f.write("yajl_gen_status %s_gen_json(yajl_gen hand, %s);\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
 
     f.write("\n")
@@ -264,6 +355,11 @@
         f.write("    memset(p, LIBXL_DTOR_POISON, sizeof(*p));\n")
         f.write("}\n")
         f.write("\n")
+        
+    for ty in [t for t in types if t.init_fn is not None and t.autogenerate_init_fn]:
+        f.write(libxl_C_type_init(ty))
+        for field in libxl_init_members(ty):
+            f.write(libxl_C_type_member_init(ty, field))
 
     for ty in [t for t in types if isinstance(t,idl.Enumeration)]:
         f.write("const char *%s_to_string(%s e)\n" % (ty.typename, ty.typename))
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/idl.py
--- a/tools/libxl/idl.py	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/idl.py	Thu Mar 01 12:26:15 2012 +0000
@@ -51,6 +51,10 @@
 
         self.autogenerate_dispose_fn = kwargs.setdefault('autogenerate_dispose_fn', True)
 
+        self.init_fn = kwargs.setdefault('init_fn', None)
+        self.init_val = kwargs.setdefault('init_val', None)
+        self.autogenerate_init_fn = kwargs.setdefault('autogenerate_init_fn', False)
+
         if self.typename is not None and not self.private:
             self.json_fn = kwargs.setdefault('json_fn', self.typename + "_gen_json")
         else:
@@ -144,12 +148,20 @@
         self.name = name
         self.const = kwargs.setdefault('const', False)
         self.enumname = kwargs.setdefault('enumname', None)
+        self.init_val = kwargs.setdefault('init_val', None)
 
 class Aggregate(Type):
     """A type containing a collection of other types"""
     def __init__(self, kind, typename, fields, **kwargs):
         Type.__init__(self, typename, **kwargs)
 
+        if self.typename is not None:
+            self.init_fn = kwargs.setdefault('init_fn', self.typename + "_init")
+        else:
+            self.init_fn = kwargs.setdefault('init_fn', None)
+
+        self.autogenerate_init_fn = kwargs.setdefault('autogenerate_init_fn', True)
+
         self.kind = kind
 
         self.fields = []
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/idl.txt
--- a/tools/libxl/idl.txt	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/idl.txt	Thu Mar 01 12:26:15 2012 +0000
@@ -44,6 +44,22 @@
  Indicates if the above named Type.dispose_fn should be
  autogenerated.
 
+Type.init_val: (default: None)
+
+ C expression for the value to initialise instances of this type to.
+
+ If present takes precendence over init_fn (see below).
+
+Type.init_fn: (default: typename + "_init" if dir in [IN, BOTH] and
+                        type != None)
+
+ The name of the C function which will initialist Type.
+
+Type.autogenerate_init_fn: (default: True if dir in [IN, BOTH])
+
+ Indicates if the above named Type.init_fn should be
+ autogenerated.
+
 Type.json_fn: (default: typename + "_gen_json" or None if type == None)
 
  The name of the C function which will generate a YAJL data structure
@@ -105,10 +121,13 @@
 
  Each field has the following properties:
 
-  Field.type    The type of the member (a idl.Type).
-  Field.name    The name of the member (can be None for anonymous
-                fields).
-  Field.const   Boolean, true if the member is const.
+  Field.type     The type of the member (a idl.Type).
+  Field.name     The name of the member (can be None for anonymous
+                 fields).
+  Field.const    Boolean, true if the member is const.
+  Field.init_val The initialisation value for this field. Takes
+                 precendence over both Field.type.init_val and
+                 Field.type.init_fn.
 
 idl.Struct
 
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -1227,11 +1227,6 @@
 
 /******************************************************************************/
 
-void libxl_device_disk_init(libxl_device_disk *disk)
-{
-    memset(disk, 0x00, sizeof(libxl_device_disk));
-}
-
 int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
 {
     int rc;
@@ -1718,10 +1713,6 @@
 }
 
 /******************************************************************************/
-void libxl_device_nic_init(libxl_device_nic *nic)
-{
-    memset(nic, '\0', sizeof(*nic));
-}
 
 int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic)
 {
@@ -2142,10 +2133,6 @@
 }
 
 /******************************************************************************/
-void libxl_device_vkb_init(libxl_device_vkb *vkb)
-{
-    memset(vkb, 0x00, sizeof(libxl_device_vkb));
-}
 
 int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb)
 {
@@ -2254,10 +2241,6 @@
 }
 
 /******************************************************************************/
-void libxl_device_vfb_init(libxl_device_vfb *vfb)
-{
-    memset(vfb, 0x00, sizeof(libxl_device_vfb));
-}
 
 int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb)
 {
@@ -3067,6 +3050,8 @@
     struct xen_domctl_sched_credit sdom;
     int rc;
 
+    libxl_sched_credit_domain_init(scinfo);
+
     rc = xc_sched_credit_domain_get(ctx->xch, domid, &sdom);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain sched credit");
@@ -3126,6 +3111,8 @@
     struct xen_domctl_sched_credit2 sdom;
     int rc;
 
+    libxl_sched_credit2_domain_init(scinfo);
+
     rc = xc_sched_credit2_domain_get(ctx->xch, domid, &sdom);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
@@ -3183,6 +3170,8 @@
     uint16_t weight;
     int rc;
 
+    libxl_sched_sedf_domain_init(scinfo);
+
     rc = xc_sedf_domain_get(ctx->xch, domid, &period, &slice, &latency,
                             &extratime, &weight);
     if (rc != 0) {
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:26:15 2012 +0000
@@ -381,10 +381,6 @@
 int libxl_ctx_postfork(libxl_ctx *ctx);
 
 /* domain related functions */
-void libxl_domain_create_info_init(libxl_domain_create_info *c_info);
-void libxl_domain_build_info_init(libxl_domain_build_info *b_info);
-void libxl_domain_build_info_init_type(libxl_domain_build_info *b_info,
-                                       libxl_domain_type type);
 typedef int (*libxl_console_ready)(libxl_ctx *ctx, uint32_t domid, void *priv);
 int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid);
 int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid, int restore_fd);
@@ -523,7 +519,6 @@
  */
 
 /* Disks */
-void libxl_device_disk_init(libxl_device_disk *disk);
 int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk);
 int libxl_device_disk_remove(libxl_ctx *ctx, uint32_t domid,
                              libxl_device_disk *disk,
@@ -549,7 +544,6 @@
 int libxl_device_disk_local_detach(libxl_ctx *ctx, libxl_device_disk *disk);
 
 /* Network Interfaces */
-void libxl_device_nic_init(libxl_device_nic *nic);
 int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic);
 int libxl_device_nic_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_nic *nic,
@@ -561,7 +555,6 @@
                               libxl_device_nic *nic, libxl_nicinfo *nicinfo);
 
 /* Keyboard */
-void libxl_device_vkb_init(libxl_device_vkb *vkb);
 int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
 int libxl_device_vkb_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_vkb *vkb,
@@ -569,7 +562,6 @@
 int libxl_device_vkb_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
 
 /* Framebuffer */
-void libxl_device_vfb_init(libxl_device_vfb *vfb);
 int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb);
 int libxl_device_vfb_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_vfb *vfb,
@@ -577,7 +569,6 @@
 int libxl_device_vfb_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb);
 
 /* PCI Passthrough */
-void libxl_device_pci_init(libxl_device_pci *pci);
 int libxl_device_pci_add(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
 int libxl_device_pci_remove(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
 int libxl_device_pci_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:26:15 2012 +0000
@@ -50,11 +50,6 @@
     libxl_domain_build_info_dispose(&d_config->b_info);
 }
 
-void libxl_domain_create_info_init(libxl_domain_create_info *c_info)
-{
-    memset(c_info, '\0', sizeof(*c_info));
-}
-
 int libxl__domain_create_info_setdefault(libxl__gc *gc,
                                          libxl_domain_create_info *c_info)
 {
@@ -69,35 +64,6 @@
     return 0;
 }
 
-void libxl_domain_build_info_init(libxl_domain_build_info *b_info)
-{
-    memset(b_info, '\0', sizeof(*b_info));
-    b_info->type = -1;
-
-    b_info->max_memkb = LIBXL_MEMKB_DEFAULT;
-    b_info->target_memkb = LIBXL_MEMKB_DEFAULT;
-    b_info->shadow_memkb = LIBXL_MEMKB_DEFAULT;
-    b_info->video_memkb =  LIBXL_MEMKB_DEFAULT;
-
-}
-
-void libxl_domain_build_info_init_type(libxl_domain_build_info *b_info,
-                                       libxl_domain_type type)
-{
-    assert(b_info->type == -1);
-    b_info->type = type;
-    switch (b_info->type) {
-    case LIBXL_DOMAIN_TYPE_HVM:
-        b_info->u.hvm.timer_mode = LIBXL_TIMER_MODE_DEFAULT;
-        break;
-    case LIBXL_DOMAIN_TYPE_PV:
-        b_info->u.pv.slack_memkb = LIBXL_MEMKB_DEFAULT;
-        break;
-    default:
-        abort();
-    }
-}
-
 int libxl__domain_build_info_setdefault(libxl__gc *gc,
                                         libxl_domain_build_info *b_info)
 {
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/libxl_json.h
--- a/tools/libxl/libxl_json.h	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_json.h	Thu Mar 01 12:26:15 2012 +0000
@@ -22,6 +22,20 @@
 #  include <yajl/yajl_version.h>
 #endif
 
+yajl_gen_status libxl_defbool_gen_json(yajl_gen hand, libxl_defbool *p);
+yajl_gen_status libxl_domid_gen_json(yajl_gen hand, libxl_domid *p);
+yajl_gen_status libxl_uuid_gen_json(yajl_gen hand, libxl_uuid *p);
+yajl_gen_status libxl_mac_gen_json(yajl_gen hand, libxl_mac *p);
+yajl_gen_status libxl_cpumap_gen_json(yajl_gen hand, libxl_cpumap *p);
+yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
+                                                 libxl_cpuid_policy_list *p);
+yajl_gen_status libxl_string_list_gen_json(yajl_gen hand, libxl_string_list *p);
+yajl_gen_status libxl_key_value_list_gen_json(yajl_gen hand,
+                                              libxl_key_value_list *p);
+yajl_gen_status libxl_file_reference_gen_json(yajl_gen hand,
+                                              libxl_file_reference *p);
+yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand, libxl_hwcap *p);
+
 #include <_libxl_types_json.h>
 
 /* YAJL version check */
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_pci.c	Thu Mar 01 12:26:15 2012 +0000
@@ -765,11 +765,6 @@
     return -1;
 }
 
-void libxl_device_pci_init(libxl_device_pci *pci)
-{
-    memset(pci, '\0', sizeof(*pci));
-}
-
 int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci)
 {
     return 0;
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:26:15 2012 +0000
@@ -100,7 +100,7 @@
     (1, "no_delay_for_missed_ticks"),
     (2, "no_missed_ticks_pending"),
     (3, "one_missed_tick_pending"),
-    ])
+    ], init_val = "LIBXL_TIMER_MODE_DEFAULT")
 
 libxl_bios_type = Enumeration("bios_type", [
     (1, "rombios"),
@@ -180,19 +180,19 @@
     ("vcpu_max_id", uint32),
     ("vcpu_online", uint32),
     ("cpupool",     uint32),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_cpupoolinfo = Struct("cpupoolinfo", [
     ("poolid",      uint32),
     ("sched",       libxl_scheduler),
     ("n_dom",       uint32),
     ("cpumap",      libxl_cpumap)
-    ])
+    ], dir=DIR_OUT)
 
 libxl_vminfo = Struct("vminfo", [
     ("uuid", libxl_uuid),
     ("domid", libxl_domid),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_version_info = Struct("version_info", [
     ("xen_version_major", integer),
@@ -207,7 +207,7 @@
     ("virt_start",        uint64),
     ("pagesize",          integer),
     ("commandline",       string),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_domain_create_info = Struct("domain_create_info",[
     ("type",         libxl_domain_type),
@@ -219,7 +219,9 @@
     ("xsdata",       libxl_key_value_list),
     ("platformdata", libxl_key_value_list),
     ("poolid",       uint32),
-    ])
+    ], dir=DIR_IN)
+
+MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
 
 # Instances of libxl_file_reference contained in this struct which
 # have been mapped (with libxl_file_reference_map) will be unmapped
@@ -297,8 +299,8 @@
                                       # Use host's E820 for PCI passthrough.
                                       ("e820_host", libxl_defbool),
                                       ])),
-                 ])),
-    ],
+                 ], keyvar_init_val = "-1")),
+    ], dir=DIR_IN
 )
 
 libxl_device_vfb = Struct("device_vfb", [
@@ -360,7 +362,7 @@
     ("state", integer),
     ("evtch", integer),
     ("rref", integer),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_nicinfo = Struct("nicinfo", [
     ("backend", string),
@@ -372,7 +374,7 @@
     ("evtch", integer),
     ("rref_tx", integer),
     ("rref_rx", integer),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_vcpuinfo = Struct("vcpuinfo", [
     ("vcpuid", uint32),
@@ -382,7 +384,7 @@
     ("running", bool),
     ("vcpu_time", uint64), # total vcpu time ran (ns)
     ("cpumap", libxl_cpumap), # current cpu's affinities
-    ])
+    ], dir=DIR_OUT)
 
 libxl_physinfo = Struct("physinfo", [
     ("threads_per_core", uint32),
@@ -409,7 +411,7 @@
     ("core", uint32),
     ("socket", uint32),
     ("node", uint32),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_sched_credit_domain = Struct("sched_credit_domain", [
     ("weight", integer),
diff -r aa30f4cfde89 -r 17bfd4d2ffce tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:26:15 2012 +0000
@@ -3922,6 +3922,7 @@
 {
     int rc;
 
+    
     rc = libxl_sched_credit_domain_set(ctx, domid, scinfo);
     if (rc)
         fprintf(stderr, "libxl_sched_credit_domain_set failed.\n");
@@ -3950,6 +3951,7 @@
         scinfo.weight,
         scinfo.cap);
     free(domname);
+    libxl_sched_credit_domain_dispose(&scinfo);
     return 0;
 }
 
@@ -3997,6 +3999,7 @@
         domid,
         scinfo.weight);
     free(domname);
+    libxl_sched_credit2_domain_dispose(&scinfo);
     return 0;
 }
 
@@ -4020,7 +4023,6 @@
     rc = libxl_sched_sedf_domain_set(ctx, domid, scinfo);
     if (rc)
         fprintf(stderr, "libxl_sched_sedf_domain_set failed.\n");
-
     return rc;
 }
 
@@ -4049,6 +4051,7 @@
         scinfo.extratime,
         scinfo.weight);
     free(domname);
+    libxl_sched_sedf_domain_dispose(&scinfo);
     return 0;
 }
 
@@ -4181,6 +4184,7 @@
             if (opt_c)
                 scinfo.cap = cap;
             rc = sched_credit_domain_set(domid, &scinfo);
+            libxl_sched_credit_domain_dispose(&scinfo);
             if (rc)
                 return -rc;
         }
@@ -4255,6 +4259,7 @@
             if (opt_w)
                 scinfo.weight = weight;
             rc = sched_credit2_domain_set(domid, &scinfo);
+            libxl_sched_credit2_domain_dispose(&scinfo);
             if (rc)
                 return -rc;
         }
@@ -4373,6 +4378,7 @@
                 scinfo.slice = 0;
             }
             rc = sched_sedf_domain_set(domid, &scinfo);
+            libxl_sched_sedf_domain_dispose(&scinfo);
             if (rc)
                 return -rc;
         }

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gew-0000WY-M9; Sat, 03 Mar 2012 04:33: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 1S3gev-0000ET-HC
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:29 +0000
Received: from [85.158.143.99:62736] by server-2.bemta-4.messagelabs.com id
	D3/9D-17550-91F915F4; Sat, 03 Mar 2012 04:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1330749207!16904934!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4452 invoked from network); 3 Mar 2012 04:33:28 -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;
	3 Mar 2012 04:33: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 1S3ges-0004ha-VD
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3ges-0003Yn-TP
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:26 +0000
Message-Id: <E1S3ges-0003Yn-TP@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: remove hypervisor-only
	configuration from tools/configure
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330615329 0
# Node ID d70b4a1155e3afa6827abb77f554166d70d9cec2
# Parent  d21b8aabe2954798034eabc563f0bdecfaaa17fe
build: remove hypervisor-only configuration from tools/configure

When adding autoconf support, the configuration options for XSM and
FLASK_ENABLE were incorrectly removed from Config.mk and added to the
tools configuration. Since these are hypervisor configuration options,
they should not depend on running tools configuration.

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


diff -r d21b8aabe295 -r d70b4a1155e3 Config.mk
--- a/Config.mk	Thu Mar 01 15:18:08 2012 +0000
+++ b/Config.mk	Thu Mar 01 15:22:09 2012 +0000
@@ -175,6 +175,10 @@
 EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
+# Enable XSM security module (by default, Flask).
+XSM_ENABLE ?= n
+FLASK_ENABLE ?= $(XSM_ENABLE)
+
 XEN_EXTFILES_URL=http://xenbits.xensource.com/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
 # the internet.  The original download URL is preserved as a comment
diff -r d21b8aabe295 -r d70b4a1155e3 config/Tools.mk.in
--- a/config/Tools.mk.in	Thu Mar 01 15:18:08 2012 +0000
+++ b/config/Tools.mk.in	Thu Mar 01 15:22:09 2012 +0000
@@ -24,10 +24,6 @@
 APPEND_INCLUDES     := @APPEND_INCLUDES@
 APPEND_LIB          := @APPEND_LIB@
 
-# Enable XSM security module (by default, Flask).
-XSM_ENABLE          := @xsm@
-FLASK_ENABLE        := @xsm@
-
 # Download GIT repositories via HTTP or GIT's own protocol?
 # GIT's protocol is faster and more robust, when it works at all (firewalls
 # may block it). We make it the default, but if your GIT repository downloads
diff -r d21b8aabe295 -r d70b4a1155e3 tools/configure.ac
--- a/tools/configure.ac	Thu Mar 01 15:18:08 2012 +0000
+++ b/tools/configure.ac	Thu Mar 01 15:22:09 2012 +0000
@@ -36,8 +36,6 @@
 m4_include([m4/pkg.m4])
 
 # Enable/disable options
-AX_ARG_ENABLE_AND_EXPORT([xsm],
-    [Enable XSM security module (by default, Flask)])
 AX_ARG_ENABLE_AND_EXPORT([githttp], [Download GIT repositories via HTTP])
 AX_ARG_DISABLE_AND_EXPORT([monitors],
     [Disable xenstat and xentop monitoring tools])
@@ -47,7 +45,7 @@
 AX_ARG_DISABLE_AND_EXPORT([ocamltools], [Disable Ocaml tools])
 AX_ARG_ENABLE_AND_EXPORT([miniterm], [Enable miniterm])
 AX_ARG_ENABLE_AND_EXPORT([lomount], [Enable lomount])
-AX_ARG_DISABLE_AND_EXPORT([debug], [Disable debug build of Xen and tools])
+AX_ARG_DISABLE_AND_EXPORT([debug], [Disable debug build of tools])
 
 AC_ARG_VAR([PREPEND_INCLUDES],
     [List of include folders to prepend to CFLAGS (without -I)])

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gew-0000W7-Ho; Sat, 03 Mar 2012 04:33: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 1S3gev-0000ET-0d
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:29 +0000
Received: from [85.158.143.35:28901] by server-2.bemta-4.messagelabs.com id
	D2/9D-17550-81F915F4; Sat, 03 Mar 2012 04:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1330749206!3136142!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10684 invoked from network); 3 Mar 2012 04:33:27 -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;
	3 Mar 2012 04:33: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 1S3ges-0004hS-DI
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3ges-0003YI-Bz
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:26 +0000
Message-Id: <E1S3ges-0003YI-Bz@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc: add MMIO hole size parameter
	to xc_hvm_build()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330615088 0
# Node ID d21b8aabe2954798034eabc563f0bdecfaaa17fe
# Parent  7e1fd8012ca3e5b091b2597aca3377af51feacb3
libxc: add MMIO hole size parameter to xc_hvm_build()

Add a parameter for the MMIO hole size when building a HVM domain.

This is useful for specifying a larger than normal MMIO hole to ensure
that no PCIe device's MMIO region overlaps with RAM in a guest's
physical address space.  This is needed on certain systems with PCIe
switches with a broken ACS capability.  On these systems, if a device
downstream of the switch attempts a DMA to a guest physical address
that overlaps with the MMIO region of another downstream device, then
the switch routes the transfer directly to the device and the read or
write never hits RAM.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 7e1fd8012ca3 -r d21b8aabe295 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c	Thu Mar 01 15:16:22 2012 +0000
+++ b/tools/libxc/xc_hvm_build.c	Thu Mar 01 15:18:08 2012 +0000
@@ -46,7 +46,8 @@
 #define NR_SPECIAL_PAGES     5
 #define special_pfn(x) (0xff000u - NR_SPECIAL_PAGES + (x))
 
-static void build_hvm_info(void *hvm_info_page, uint64_t mem_size)
+static void build_hvm_info(void *hvm_info_page, uint64_t mem_size,
+                           uint64_t mmio_start, uint64_t mmio_size)
 {
     struct hvm_info_table *hvm_info = (struct hvm_info_table *)
         (((unsigned char *)hvm_info_page) + HVM_INFO_OFFSET);
@@ -54,10 +55,10 @@
     uint8_t sum;
     int i;
 
-    if ( lowmem_end > HVM_BELOW_4G_RAM_END )
+    if ( lowmem_end > mmio_start )
     {
-        highmem_end = lowmem_end + (1ull<<32) - HVM_BELOW_4G_RAM_END;
-        lowmem_end = HVM_BELOW_4G_RAM_END;
+        highmem_end = (1ull<<32) + (lowmem_end - mmio_start);
+        lowmem_end = mmio_start;
     }
 
     memset(hvm_info_page, 0, PAGE_SIZE);
@@ -126,10 +127,10 @@
  * Check whether there exists mmio hole in the specified memory range.
  * Returns 1 if exists, else returns 0.
  */
-static int check_mmio_hole(uint64_t start, uint64_t memsize)
+static int check_mmio_hole(uint64_t start, uint64_t memsize,
+                           uint64_t mmio_start, uint64_t mmio_size)
 {
-    if ( start + memsize <= HVM_BELOW_4G_MMIO_START ||
-         start >= HVM_BELOW_4G_MMIO_START + HVM_BELOW_4G_MMIO_LENGTH )
+    if ( start + memsize <= mmio_start || start >= mmio_start + mmio_size )
         return 0;
     else
         return 1;
@@ -142,6 +143,8 @@
     xen_pfn_t *page_array = NULL;
     unsigned long i, nr_pages = args->mem_size >> PAGE_SHIFT;
     unsigned long target_pages = args->mem_target >> PAGE_SHIFT;
+    uint64_t mmio_start = (1ull << 32) - args->mmio_size;
+    uint64_t mmio_size = args->mmio_size;
     unsigned long entry_eip, cur_pages, cur_pfn;
     void *hvm_info_page;
     uint32_t *ident_pt;
@@ -188,8 +191,8 @@
 
     for ( i = 0; i < nr_pages; i++ )
         page_array[i] = i;
-    for ( i = HVM_BELOW_4G_RAM_END >> PAGE_SHIFT; i < nr_pages; i++ )
-        page_array[i] += HVM_BELOW_4G_MMIO_LENGTH >> PAGE_SHIFT;
+    for ( i = mmio_start >> PAGE_SHIFT; i < nr_pages; i++ )
+        page_array[i] += mmio_size >> PAGE_SHIFT;
 
     /*
      * Allocate memory for HVM guest, skipping VGA hole 0xA0000-0xC0000.
@@ -230,7 +233,8 @@
         if ( ((count | cur_pfn) & (SUPERPAGE_1GB_NR_PFNS - 1)) == 0 &&
              /* Check if there exists MMIO hole in the 1GB memory range */
              !check_mmio_hole(cur_pfn << PAGE_SHIFT,
-                              SUPERPAGE_1GB_NR_PFNS << PAGE_SHIFT) )
+                              SUPERPAGE_1GB_NR_PFNS << PAGE_SHIFT,
+                              mmio_start, mmio_size) )
         {
             long done;
             unsigned long nr_extents = count >> SUPERPAGE_1GB_SHIFT;
@@ -327,7 +331,7 @@
               xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE,
               HVM_INFO_PFN)) == NULL )
         goto error_out;
-    build_hvm_info(hvm_info_page, v_end);
+    build_hvm_info(hvm_info_page, v_end, mmio_start, mmio_size);
     munmap(hvm_info_page, PAGE_SIZE);
 
     /* Allocate and clear special pages. */
@@ -408,6 +412,9 @@
     if ( args.mem_target == 0 )
         args.mem_target = args.mem_size;
 
+    if ( args.mmio_size == 0 )
+        args.mmio_size = HVM_BELOW_4G_MMIO_LENGTH;
+
     /* An HVM guest must be initialised with at least 2MB memory. */
     if ( args.mem_size < (2ull << 20) || args.mem_target < (2ull << 20) )
         return -1;
diff -r 7e1fd8012ca3 -r d21b8aabe295 tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h	Thu Mar 01 15:16:22 2012 +0000
+++ b/tools/libxc/xenguest.h	Thu Mar 01 15:18:08 2012 +0000
@@ -174,6 +174,7 @@
 struct xc_hvm_build_args {
     uint64_t mem_size;           /* Memory size in bytes. */
     uint64_t mem_target;         /* Memory target in bytes. */
+    uint64_t mmio_size;          /* Size of the MMIO hole in bytes. */
     const char *image_file_name; /* File name of the image to load. */
 };
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gew-0000WY-M9; Sat, 03 Mar 2012 04:33: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 1S3gev-0000ET-HC
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:29 +0000
Received: from [85.158.143.99:62736] by server-2.bemta-4.messagelabs.com id
	D3/9D-17550-91F915F4; Sat, 03 Mar 2012 04:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1330749207!16904934!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4452 invoked from network); 3 Mar 2012 04:33:28 -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;
	3 Mar 2012 04:33: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 1S3ges-0004ha-VD
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3ges-0003Yn-TP
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:26 +0000
Message-Id: <E1S3ges-0003Yn-TP@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: remove hypervisor-only
	configuration from tools/configure
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330615329 0
# Node ID d70b4a1155e3afa6827abb77f554166d70d9cec2
# Parent  d21b8aabe2954798034eabc563f0bdecfaaa17fe
build: remove hypervisor-only configuration from tools/configure

When adding autoconf support, the configuration options for XSM and
FLASK_ENABLE were incorrectly removed from Config.mk and added to the
tools configuration. Since these are hypervisor configuration options,
they should not depend on running tools configuration.

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


diff -r d21b8aabe295 -r d70b4a1155e3 Config.mk
--- a/Config.mk	Thu Mar 01 15:18:08 2012 +0000
+++ b/Config.mk	Thu Mar 01 15:22:09 2012 +0000
@@ -175,6 +175,10 @@
 EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all
 EMBEDDED_EXTRA_CFLAGS += -fno-exceptions
 
+# Enable XSM security module (by default, Flask).
+XSM_ENABLE ?= n
+FLASK_ENABLE ?= $(XSM_ENABLE)
+
 XEN_EXTFILES_URL=http://xenbits.xensource.com/xen-extfiles
 # All the files at that location were downloaded from elsewhere on
 # the internet.  The original download URL is preserved as a comment
diff -r d21b8aabe295 -r d70b4a1155e3 config/Tools.mk.in
--- a/config/Tools.mk.in	Thu Mar 01 15:18:08 2012 +0000
+++ b/config/Tools.mk.in	Thu Mar 01 15:22:09 2012 +0000
@@ -24,10 +24,6 @@
 APPEND_INCLUDES     := @APPEND_INCLUDES@
 APPEND_LIB          := @APPEND_LIB@
 
-# Enable XSM security module (by default, Flask).
-XSM_ENABLE          := @xsm@
-FLASK_ENABLE        := @xsm@
-
 # Download GIT repositories via HTTP or GIT's own protocol?
 # GIT's protocol is faster and more robust, when it works at all (firewalls
 # may block it). We make it the default, but if your GIT repository downloads
diff -r d21b8aabe295 -r d70b4a1155e3 tools/configure.ac
--- a/tools/configure.ac	Thu Mar 01 15:18:08 2012 +0000
+++ b/tools/configure.ac	Thu Mar 01 15:22:09 2012 +0000
@@ -36,8 +36,6 @@
 m4_include([m4/pkg.m4])
 
 # Enable/disable options
-AX_ARG_ENABLE_AND_EXPORT([xsm],
-    [Enable XSM security module (by default, Flask)])
 AX_ARG_ENABLE_AND_EXPORT([githttp], [Download GIT repositories via HTTP])
 AX_ARG_DISABLE_AND_EXPORT([monitors],
     [Disable xenstat and xentop monitoring tools])
@@ -47,7 +45,7 @@
 AX_ARG_DISABLE_AND_EXPORT([ocamltools], [Disable Ocaml tools])
 AX_ARG_ENABLE_AND_EXPORT([miniterm], [Enable miniterm])
 AX_ARG_ENABLE_AND_EXPORT([lomount], [Enable lomount])
-AX_ARG_DISABLE_AND_EXPORT([debug], [Disable debug build of Xen and tools])
+AX_ARG_DISABLE_AND_EXPORT([debug], [Disable debug build of tools])
 
 AC_ARG_VAR([PREPEND_INCLUDES],
     [List of include folders to prepend to CFLAGS (without -I)])

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gew-0000W7-Ho; Sat, 03 Mar 2012 04:33: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 1S3gev-0000ET-0d
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:29 +0000
Received: from [85.158.143.35:28901] by server-2.bemta-4.messagelabs.com id
	D2/9D-17550-81F915F4; Sat, 03 Mar 2012 04:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1330749206!3136142!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10684 invoked from network); 3 Mar 2012 04:33:27 -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;
	3 Mar 2012 04:33: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 1S3ges-0004hS-DI
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:26 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3ges-0003YI-Bz
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:26 +0000
Message-Id: <E1S3ges-0003YI-Bz@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc: add MMIO hole size parameter
	to xc_hvm_build()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330615088 0
# Node ID d21b8aabe2954798034eabc563f0bdecfaaa17fe
# Parent  7e1fd8012ca3e5b091b2597aca3377af51feacb3
libxc: add MMIO hole size parameter to xc_hvm_build()

Add a parameter for the MMIO hole size when building a HVM domain.

This is useful for specifying a larger than normal MMIO hole to ensure
that no PCIe device's MMIO region overlaps with RAM in a guest's
physical address space.  This is needed on certain systems with PCIe
switches with a broken ACS capability.  On these systems, if a device
downstream of the switch attempts a DMA to a guest physical address
that overlaps with the MMIO region of another downstream device, then
the switch routes the transfer directly to the device and the read or
write never hits RAM.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 7e1fd8012ca3 -r d21b8aabe295 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c	Thu Mar 01 15:16:22 2012 +0000
+++ b/tools/libxc/xc_hvm_build.c	Thu Mar 01 15:18:08 2012 +0000
@@ -46,7 +46,8 @@
 #define NR_SPECIAL_PAGES     5
 #define special_pfn(x) (0xff000u - NR_SPECIAL_PAGES + (x))
 
-static void build_hvm_info(void *hvm_info_page, uint64_t mem_size)
+static void build_hvm_info(void *hvm_info_page, uint64_t mem_size,
+                           uint64_t mmio_start, uint64_t mmio_size)
 {
     struct hvm_info_table *hvm_info = (struct hvm_info_table *)
         (((unsigned char *)hvm_info_page) + HVM_INFO_OFFSET);
@@ -54,10 +55,10 @@
     uint8_t sum;
     int i;
 
-    if ( lowmem_end > HVM_BELOW_4G_RAM_END )
+    if ( lowmem_end > mmio_start )
     {
-        highmem_end = lowmem_end + (1ull<<32) - HVM_BELOW_4G_RAM_END;
-        lowmem_end = HVM_BELOW_4G_RAM_END;
+        highmem_end = (1ull<<32) + (lowmem_end - mmio_start);
+        lowmem_end = mmio_start;
     }
 
     memset(hvm_info_page, 0, PAGE_SIZE);
@@ -126,10 +127,10 @@
  * Check whether there exists mmio hole in the specified memory range.
  * Returns 1 if exists, else returns 0.
  */
-static int check_mmio_hole(uint64_t start, uint64_t memsize)
+static int check_mmio_hole(uint64_t start, uint64_t memsize,
+                           uint64_t mmio_start, uint64_t mmio_size)
 {
-    if ( start + memsize <= HVM_BELOW_4G_MMIO_START ||
-         start >= HVM_BELOW_4G_MMIO_START + HVM_BELOW_4G_MMIO_LENGTH )
+    if ( start + memsize <= mmio_start || start >= mmio_start + mmio_size )
         return 0;
     else
         return 1;
@@ -142,6 +143,8 @@
     xen_pfn_t *page_array = NULL;
     unsigned long i, nr_pages = args->mem_size >> PAGE_SHIFT;
     unsigned long target_pages = args->mem_target >> PAGE_SHIFT;
+    uint64_t mmio_start = (1ull << 32) - args->mmio_size;
+    uint64_t mmio_size = args->mmio_size;
     unsigned long entry_eip, cur_pages, cur_pfn;
     void *hvm_info_page;
     uint32_t *ident_pt;
@@ -188,8 +191,8 @@
 
     for ( i = 0; i < nr_pages; i++ )
         page_array[i] = i;
-    for ( i = HVM_BELOW_4G_RAM_END >> PAGE_SHIFT; i < nr_pages; i++ )
-        page_array[i] += HVM_BELOW_4G_MMIO_LENGTH >> PAGE_SHIFT;
+    for ( i = mmio_start >> PAGE_SHIFT; i < nr_pages; i++ )
+        page_array[i] += mmio_size >> PAGE_SHIFT;
 
     /*
      * Allocate memory for HVM guest, skipping VGA hole 0xA0000-0xC0000.
@@ -230,7 +233,8 @@
         if ( ((count | cur_pfn) & (SUPERPAGE_1GB_NR_PFNS - 1)) == 0 &&
              /* Check if there exists MMIO hole in the 1GB memory range */
              !check_mmio_hole(cur_pfn << PAGE_SHIFT,
-                              SUPERPAGE_1GB_NR_PFNS << PAGE_SHIFT) )
+                              SUPERPAGE_1GB_NR_PFNS << PAGE_SHIFT,
+                              mmio_start, mmio_size) )
         {
             long done;
             unsigned long nr_extents = count >> SUPERPAGE_1GB_SHIFT;
@@ -327,7 +331,7 @@
               xch, dom, PAGE_SIZE, PROT_READ | PROT_WRITE,
               HVM_INFO_PFN)) == NULL )
         goto error_out;
-    build_hvm_info(hvm_info_page, v_end);
+    build_hvm_info(hvm_info_page, v_end, mmio_start, mmio_size);
     munmap(hvm_info_page, PAGE_SIZE);
 
     /* Allocate and clear special pages. */
@@ -408,6 +412,9 @@
     if ( args.mem_target == 0 )
         args.mem_target = args.mem_size;
 
+    if ( args.mmio_size == 0 )
+        args.mmio_size = HVM_BELOW_4G_MMIO_LENGTH;
+
     /* An HVM guest must be initialised with at least 2MB memory. */
     if ( args.mem_size < (2ull << 20) || args.mem_target < (2ull << 20) )
         return -1;
diff -r 7e1fd8012ca3 -r d21b8aabe295 tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h	Thu Mar 01 15:16:22 2012 +0000
+++ b/tools/libxc/xenguest.h	Thu Mar 01 15:18:08 2012 +0000
@@ -174,6 +174,7 @@
 struct xc_hvm_build_args {
     uint64_t mem_size;           /* Memory size in bytes. */
     uint64_t mem_target;         /* Memory target in bytes. */
+    uint64_t mmio_size;          /* Size of the MMIO hole in bytes. */
     const char *image_file_name; /* File name of the image to load. */
 };
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gex-0000ZZ-Sv; Sat, 03 Mar 2012 04:33:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gev-0000T7-Ny
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:30 +0000
Received: from [85.158.139.83:62038] by server-8.bemta-5.messagelabs.com id
	39/4E-07862-81F915F4; Sat, 03 Mar 2012 04:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1330749206!17673491!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12517 invoked from network); 3 Mar 2012 04:33:27 -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;
	3 Mar 2012 04:33: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 1S3ger-0004hI-SK
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3ger-0003Xk-R1
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Message-Id: <E1S3ger-0003Xk-R1@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc: pass arguments to
	xc_hvm_build() in a structure
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330614982 0
# Node ID 7e1fd8012ca3e5b091b2597aca3377af51feacb3
# Parent  d64aa013a82e591f628abd7a2cac7cc82da41a4f
libxc: pass arguments to xc_hvm_build() in a structure

To allow new parameters to be added to the xc_hvm_build*() family of
functions, pass them in a structure.  Make the other variants fill in
the structure and call xc_hvm_build() (except for xc_hvm_build_mem()
which had no users and is removed).

The units of the mem_size and mem_target arguments are in bytes (not
MiB like the old functions).

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r d64aa013a82e -r 7e1fd8012ca3 tools/libxc/ia64/xc_ia64_hvm_build.c
--- a/tools/libxc/ia64/xc_ia64_hvm_build.c	Thu Mar 01 12:31:15 2012 +0000
+++ b/tools/libxc/ia64/xc_ia64_hvm_build.c	Thu Mar 01 15:16:22 2012 +0000
@@ -912,8 +912,8 @@
             char *image, unsigned long image_size)
 {
     xen_pfn_t *pfn_list;
-    unsigned long dom_memsize = memsize << 20;
-    unsigned long nr_pages = memsize << (20 - PAGE_SHIFT);
+    unsigned long dom_memsize = memsize;
+    unsigned long nr_pages = memsize >> PAGE_SHIFT;
     unsigned long vcpus;
     unsigned long nr_special_pages;
     unsigned long memmap_info_pfn;
@@ -1072,14 +1072,14 @@
 }
 
 int
-xc_hvm_build(xc_interface *xch, uint32_t domid, int memsize, const char *image_name)
+xc_hvm_build(xc_interface *xch, uint32_t domid, const struct xc_hvm_build_args *args)
 {
     vcpu_guest_context_any_t st_ctxt_any;
     vcpu_guest_context_t *ctxt = &st_ctxt_any.c;
     char *image = NULL;
     unsigned long image_size;
 
-    image = xc_read_image(xch, image_name, &image_size);
+    image = xc_read_image(xch, args->image_file_name, &image_size);
     if (image == NULL) {
         PERROR("Could not read guest firmware image %s", image_name);
         goto error_out;
@@ -1087,7 +1087,7 @@
 
     image_size = (image_size + PAGE_SIZE - 1) & PAGE_MASK;
 
-    if (setup_guest(xch, domid, (unsigned long)memsize, image,
+    if (setup_guest(xch, domid, (unsigned long)args->mem_size, image,
                     image_size) < 0) {
         ERROR("Error constructing guest OS");
         goto error_out;
@@ -1114,6 +1114,8 @@
  * files/filenames.  If target < memsize, domain is created with
  * memsize pages marked populate-on-demand, and with a PoD cache size
  * of target.  If target == memsize, pages are populated normally.
+ *
+ * XXX:PoD isn't supported yet so setting target does nothing.
  */
 int xc_hvm_build_target_mem(xc_interface *xch,
                             uint32_t domid,
@@ -1121,8 +1123,13 @@
                             int target,
                             const char *image_name)
 {
-    /* XXX:PoD isn't supported yet */
-    return xc_hvm_build(xch, domid, target, image_name);
+    struct xc_hvm_build_args args;
+
+    args.mem_size = (uint64_t)memsize << 20;
+    args.mem_target = (uint64_t)target << 20;
+    args.image_file_name = image_name;
+
+    return xc_hvm_build(xch, domid, &args);
 }
 
 /*
diff -r d64aa013a82e -r 7e1fd8012ca3 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c	Thu Mar 01 12:31:15 2012 +0000
+++ b/tools/libxc/xc_hvm_build.c	Thu Mar 01 15:16:22 2012 +0000
@@ -136,12 +136,12 @@
 }
 
 static int setup_guest(xc_interface *xch,
-                       uint32_t dom, int memsize, int target,
+                       uint32_t dom, const struct xc_hvm_build_args *args,
                        char *image, unsigned long image_size)
 {
     xen_pfn_t *page_array = NULL;
-    unsigned long i, nr_pages = (unsigned long)memsize << (20 - PAGE_SHIFT);
-    unsigned long target_pages = (unsigned long)target << (20 - PAGE_SHIFT);
+    unsigned long i, nr_pages = args->mem_size >> PAGE_SHIFT;
+    unsigned long target_pages = args->mem_target >> PAGE_SHIFT;
     unsigned long entry_eip, cur_pages, cur_pfn;
     void *hvm_info_page;
     uint32_t *ident_pt;
@@ -153,11 +153,7 @@
         stat_1gb_pages = 0;
     int pod_mode = 0;
 
-    /* An HVM guest must be initialised with at least 2MB memory. */
-    if ( memsize < 2 || target < 2 )
-        goto error_out;
-
-    if ( memsize > target )
+    if ( nr_pages > target_pages )
         pod_mode = 1;
 
     memset(&elf, 0, sizeof(elf));
@@ -168,7 +164,7 @@
 
     elf_parse_binary(&elf);
     v_start = 0;
-    v_end = (unsigned long long)memsize << 20;
+    v_end = args->mem_size;
 
     if ( xc_version(xch, XENVER_capabilities, &caps) != 0 )
     {
@@ -393,39 +389,34 @@
     return -1;
 }
 
-static int xc_hvm_build_internal(xc_interface *xch,
-                                 uint32_t domid,
-                                 int memsize,
-                                 int target,
-                                 char *image,
-                                 unsigned long image_size)
-{
-    if ( (image == NULL) || (image_size == 0) )
-    {
-        ERROR("Image required");
-        return -1;
-    }
-
-    return setup_guest(xch, domid, memsize, target, image, image_size);
-}
-
 /* xc_hvm_build:
  * Create a domain for a virtualized Linux, using files/filenames.
  */
-int xc_hvm_build(xc_interface *xch,
-                 uint32_t domid,
-                 int memsize,
-                 const char *image_name)
+int xc_hvm_build(xc_interface *xch, uint32_t domid,
+                 const struct xc_hvm_build_args *hvm_args)
 {
-    char *image;
-    int  sts;
+    struct xc_hvm_build_args args = *hvm_args;
+    void *image;
     unsigned long image_size;
+    int sts;
 
-    if ( (image_name == NULL) ||
-         ((image = xc_read_image(xch, image_name, &image_size)) == NULL) )
+    if ( domid == 0 )
+        return -1;
+    if ( args.image_file_name == NULL )
         return -1;
 
-    sts = xc_hvm_build_internal(xch, domid, memsize, memsize, image, image_size);
+    if ( args.mem_target == 0 )
+        args.mem_target = args.mem_size;
+
+    /* An HVM guest must be initialised with at least 2MB memory. */
+    if ( args.mem_size < (2ull << 20) || args.mem_target < (2ull << 20) )
+        return -1;
+
+    image = xc_read_image(xch, args.image_file_name, &image_size);
+    if ( image == NULL )
+        return -1;
+
+    sts = setup_guest(xch, domid, &args, image, image_size);
 
     free(image);
 
@@ -445,59 +436,13 @@
                            int target,
                            const char *image_name)
 {
-    char *image;
-    int  sts;
-    unsigned long image_size;
+    struct xc_hvm_build_args args = {};
 
-    if ( (image_name == NULL) ||
-         ((image = xc_read_image(xch, image_name, &image_size)) == NULL) )
-        return -1;
+    args.mem_size = (uint64_t)memsize << 20;
+    args.mem_target = (uint64_t)target << 20;
+    args.image_file_name = image_name;
 
-    sts = xc_hvm_build_internal(xch, domid, memsize, target, image, image_size);
-
-    free(image);
-
-    return sts;
-}
-
-/* xc_hvm_build_mem:
- * Create a domain for a virtualized Linux, using memory buffers.
- */
-int xc_hvm_build_mem(xc_interface *xch,
-                     uint32_t domid,
-                     int memsize,
-                     const char *image_buffer,
-                     unsigned long image_size)
-{
-    int           sts;
-    unsigned long img_len;
-    char         *img;
-
-    /* Validate that there is a kernel buffer */
-
-    if ( (image_buffer == NULL) || (image_size == 0) )
-    {
-        ERROR("kernel image buffer not present");
-        return -1;
-    }
-
-    img = xc_inflate_buffer(xch, image_buffer, image_size, &img_len);
-    if ( img == NULL )
-    {
-        ERROR("unable to inflate ram disk buffer");
-        return -1;
-    }
-
-    sts = xc_hvm_build_internal(xch, domid, memsize, memsize,
-                                img, img_len);
-
-    /* xc_inflate_buffer may return the original buffer pointer (for
-       for already inflated buffers), so exercise some care in freeing */
-
-    if ( (img != NULL) && (img != image_buffer) )
-        free(img);
-
-    return sts;
+    return xc_hvm_build(xch, domid, &args);
 }
 
 /*
diff -r d64aa013a82e -r 7e1fd8012ca3 tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h	Thu Mar 01 12:31:15 2012 +0000
+++ b/tools/libxc/xenguest.h	Thu Mar 01 15:16:22 2012 +0000
@@ -171,10 +171,23 @@
                        unsigned int console_evtchn,
                        unsigned long *console_mfn);
 
-int xc_hvm_build(xc_interface *xch,
-                 uint32_t domid,
-                 int memsize,
-                 const char *image_name);
+struct xc_hvm_build_args {
+    uint64_t mem_size;           /* Memory size in bytes. */
+    uint64_t mem_target;         /* Memory target in bytes. */
+    const char *image_file_name; /* File name of the image to load. */
+};
+
+/**
+ * Build a HVM domain.
+ * @parm xch      libxc context handle.
+ * @parm domid    domain ID for the new domain.
+ * @parm hvm_args parameters for the new domain.
+ *
+ * The memory size and image file parameters are required, the rest
+ * are optional.
+ */
+int xc_hvm_build(xc_interface *xch, uint32_t domid,
+                 const struct xc_hvm_build_args *hvm_args);
 
 int xc_hvm_build_target_mem(xc_interface *xch,
                             uint32_t domid,
@@ -182,12 +195,6 @@
                             int target,
                             const char *image_name);
 
-int xc_hvm_build_mem(xc_interface *xch,
-                     uint32_t domid,
-                     int memsize,
-                     const char *image_buffer,
-                     unsigned long image_size);
-
 int xc_suspend_evtchn_release(xc_interface *xch, xc_evtchn *xce, int domid, int suspend_evtchn);
 
 int xc_suspend_evtchn_init(xc_interface *xch, xc_evtchn *xce, int domid, int port);
diff -r d64aa013a82e -r 7e1fd8012ca3 tools/libxc/xg_private.c
--- a/tools/libxc/xg_private.c	Thu Mar 01 12:31:15 2012 +0000
+++ b/tools/libxc/xg_private.c	Thu Mar 01 15:16:22 2012 +0000
@@ -192,8 +192,7 @@
 __attribute__((weak)) 
     int xc_hvm_build(xc_interface *xch,
                      uint32_t domid,
-                     int memsize,
-                     const char *image_name)
+                     const struct xc_hvm_build_args *hvm_args)
 {
     errno = ENOSYS;
     return -1;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gex-0000ZZ-Sv; Sat, 03 Mar 2012 04:33:31 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gev-0000T7-Ny
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:30 +0000
Received: from [85.158.139.83:62038] by server-8.bemta-5.messagelabs.com id
	39/4E-07862-81F915F4; Sat, 03 Mar 2012 04:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1330749206!17673491!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12517 invoked from network); 3 Mar 2012 04:33:27 -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;
	3 Mar 2012 04:33: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 1S3ger-0004hI-SK
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3ger-0003Xk-R1
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Message-Id: <E1S3ger-0003Xk-R1@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:25 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxc: pass arguments to
	xc_hvm_build() in a structure
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330614982 0
# Node ID 7e1fd8012ca3e5b091b2597aca3377af51feacb3
# Parent  d64aa013a82e591f628abd7a2cac7cc82da41a4f
libxc: pass arguments to xc_hvm_build() in a structure

To allow new parameters to be added to the xc_hvm_build*() family of
functions, pass them in a structure.  Make the other variants fill in
the structure and call xc_hvm_build() (except for xc_hvm_build_mem()
which had no users and is removed).

The units of the mem_size and mem_target arguments are in bytes (not
MiB like the old functions).

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r d64aa013a82e -r 7e1fd8012ca3 tools/libxc/ia64/xc_ia64_hvm_build.c
--- a/tools/libxc/ia64/xc_ia64_hvm_build.c	Thu Mar 01 12:31:15 2012 +0000
+++ b/tools/libxc/ia64/xc_ia64_hvm_build.c	Thu Mar 01 15:16:22 2012 +0000
@@ -912,8 +912,8 @@
             char *image, unsigned long image_size)
 {
     xen_pfn_t *pfn_list;
-    unsigned long dom_memsize = memsize << 20;
-    unsigned long nr_pages = memsize << (20 - PAGE_SHIFT);
+    unsigned long dom_memsize = memsize;
+    unsigned long nr_pages = memsize >> PAGE_SHIFT;
     unsigned long vcpus;
     unsigned long nr_special_pages;
     unsigned long memmap_info_pfn;
@@ -1072,14 +1072,14 @@
 }
 
 int
-xc_hvm_build(xc_interface *xch, uint32_t domid, int memsize, const char *image_name)
+xc_hvm_build(xc_interface *xch, uint32_t domid, const struct xc_hvm_build_args *args)
 {
     vcpu_guest_context_any_t st_ctxt_any;
     vcpu_guest_context_t *ctxt = &st_ctxt_any.c;
     char *image = NULL;
     unsigned long image_size;
 
-    image = xc_read_image(xch, image_name, &image_size);
+    image = xc_read_image(xch, args->image_file_name, &image_size);
     if (image == NULL) {
         PERROR("Could not read guest firmware image %s", image_name);
         goto error_out;
@@ -1087,7 +1087,7 @@
 
     image_size = (image_size + PAGE_SIZE - 1) & PAGE_MASK;
 
-    if (setup_guest(xch, domid, (unsigned long)memsize, image,
+    if (setup_guest(xch, domid, (unsigned long)args->mem_size, image,
                     image_size) < 0) {
         ERROR("Error constructing guest OS");
         goto error_out;
@@ -1114,6 +1114,8 @@
  * files/filenames.  If target < memsize, domain is created with
  * memsize pages marked populate-on-demand, and with a PoD cache size
  * of target.  If target == memsize, pages are populated normally.
+ *
+ * XXX:PoD isn't supported yet so setting target does nothing.
  */
 int xc_hvm_build_target_mem(xc_interface *xch,
                             uint32_t domid,
@@ -1121,8 +1123,13 @@
                             int target,
                             const char *image_name)
 {
-    /* XXX:PoD isn't supported yet */
-    return xc_hvm_build(xch, domid, target, image_name);
+    struct xc_hvm_build_args args;
+
+    args.mem_size = (uint64_t)memsize << 20;
+    args.mem_target = (uint64_t)target << 20;
+    args.image_file_name = image_name;
+
+    return xc_hvm_build(xch, domid, &args);
 }
 
 /*
diff -r d64aa013a82e -r 7e1fd8012ca3 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c	Thu Mar 01 12:31:15 2012 +0000
+++ b/tools/libxc/xc_hvm_build.c	Thu Mar 01 15:16:22 2012 +0000
@@ -136,12 +136,12 @@
 }
 
 static int setup_guest(xc_interface *xch,
-                       uint32_t dom, int memsize, int target,
+                       uint32_t dom, const struct xc_hvm_build_args *args,
                        char *image, unsigned long image_size)
 {
     xen_pfn_t *page_array = NULL;
-    unsigned long i, nr_pages = (unsigned long)memsize << (20 - PAGE_SHIFT);
-    unsigned long target_pages = (unsigned long)target << (20 - PAGE_SHIFT);
+    unsigned long i, nr_pages = args->mem_size >> PAGE_SHIFT;
+    unsigned long target_pages = args->mem_target >> PAGE_SHIFT;
     unsigned long entry_eip, cur_pages, cur_pfn;
     void *hvm_info_page;
     uint32_t *ident_pt;
@@ -153,11 +153,7 @@
         stat_1gb_pages = 0;
     int pod_mode = 0;
 
-    /* An HVM guest must be initialised with at least 2MB memory. */
-    if ( memsize < 2 || target < 2 )
-        goto error_out;
-
-    if ( memsize > target )
+    if ( nr_pages > target_pages )
         pod_mode = 1;
 
     memset(&elf, 0, sizeof(elf));
@@ -168,7 +164,7 @@
 
     elf_parse_binary(&elf);
     v_start = 0;
-    v_end = (unsigned long long)memsize << 20;
+    v_end = args->mem_size;
 
     if ( xc_version(xch, XENVER_capabilities, &caps) != 0 )
     {
@@ -393,39 +389,34 @@
     return -1;
 }
 
-static int xc_hvm_build_internal(xc_interface *xch,
-                                 uint32_t domid,
-                                 int memsize,
-                                 int target,
-                                 char *image,
-                                 unsigned long image_size)
-{
-    if ( (image == NULL) || (image_size == 0) )
-    {
-        ERROR("Image required");
-        return -1;
-    }
-
-    return setup_guest(xch, domid, memsize, target, image, image_size);
-}
-
 /* xc_hvm_build:
  * Create a domain for a virtualized Linux, using files/filenames.
  */
-int xc_hvm_build(xc_interface *xch,
-                 uint32_t domid,
-                 int memsize,
-                 const char *image_name)
+int xc_hvm_build(xc_interface *xch, uint32_t domid,
+                 const struct xc_hvm_build_args *hvm_args)
 {
-    char *image;
-    int  sts;
+    struct xc_hvm_build_args args = *hvm_args;
+    void *image;
     unsigned long image_size;
+    int sts;
 
-    if ( (image_name == NULL) ||
-         ((image = xc_read_image(xch, image_name, &image_size)) == NULL) )
+    if ( domid == 0 )
+        return -1;
+    if ( args.image_file_name == NULL )
         return -1;
 
-    sts = xc_hvm_build_internal(xch, domid, memsize, memsize, image, image_size);
+    if ( args.mem_target == 0 )
+        args.mem_target = args.mem_size;
+
+    /* An HVM guest must be initialised with at least 2MB memory. */
+    if ( args.mem_size < (2ull << 20) || args.mem_target < (2ull << 20) )
+        return -1;
+
+    image = xc_read_image(xch, args.image_file_name, &image_size);
+    if ( image == NULL )
+        return -1;
+
+    sts = setup_guest(xch, domid, &args, image, image_size);
 
     free(image);
 
@@ -445,59 +436,13 @@
                            int target,
                            const char *image_name)
 {
-    char *image;
-    int  sts;
-    unsigned long image_size;
+    struct xc_hvm_build_args args = {};
 
-    if ( (image_name == NULL) ||
-         ((image = xc_read_image(xch, image_name, &image_size)) == NULL) )
-        return -1;
+    args.mem_size = (uint64_t)memsize << 20;
+    args.mem_target = (uint64_t)target << 20;
+    args.image_file_name = image_name;
 
-    sts = xc_hvm_build_internal(xch, domid, memsize, target, image, image_size);
-
-    free(image);
-
-    return sts;
-}
-
-/* xc_hvm_build_mem:
- * Create a domain for a virtualized Linux, using memory buffers.
- */
-int xc_hvm_build_mem(xc_interface *xch,
-                     uint32_t domid,
-                     int memsize,
-                     const char *image_buffer,
-                     unsigned long image_size)
-{
-    int           sts;
-    unsigned long img_len;
-    char         *img;
-
-    /* Validate that there is a kernel buffer */
-
-    if ( (image_buffer == NULL) || (image_size == 0) )
-    {
-        ERROR("kernel image buffer not present");
-        return -1;
-    }
-
-    img = xc_inflate_buffer(xch, image_buffer, image_size, &img_len);
-    if ( img == NULL )
-    {
-        ERROR("unable to inflate ram disk buffer");
-        return -1;
-    }
-
-    sts = xc_hvm_build_internal(xch, domid, memsize, memsize,
-                                img, img_len);
-
-    /* xc_inflate_buffer may return the original buffer pointer (for
-       for already inflated buffers), so exercise some care in freeing */
-
-    if ( (img != NULL) && (img != image_buffer) )
-        free(img);
-
-    return sts;
+    return xc_hvm_build(xch, domid, &args);
 }
 
 /*
diff -r d64aa013a82e -r 7e1fd8012ca3 tools/libxc/xenguest.h
--- a/tools/libxc/xenguest.h	Thu Mar 01 12:31:15 2012 +0000
+++ b/tools/libxc/xenguest.h	Thu Mar 01 15:16:22 2012 +0000
@@ -171,10 +171,23 @@
                        unsigned int console_evtchn,
                        unsigned long *console_mfn);
 
-int xc_hvm_build(xc_interface *xch,
-                 uint32_t domid,
-                 int memsize,
-                 const char *image_name);
+struct xc_hvm_build_args {
+    uint64_t mem_size;           /* Memory size in bytes. */
+    uint64_t mem_target;         /* Memory target in bytes. */
+    const char *image_file_name; /* File name of the image to load. */
+};
+
+/**
+ * Build a HVM domain.
+ * @parm xch      libxc context handle.
+ * @parm domid    domain ID for the new domain.
+ * @parm hvm_args parameters for the new domain.
+ *
+ * The memory size and image file parameters are required, the rest
+ * are optional.
+ */
+int xc_hvm_build(xc_interface *xch, uint32_t domid,
+                 const struct xc_hvm_build_args *hvm_args);
 
 int xc_hvm_build_target_mem(xc_interface *xch,
                             uint32_t domid,
@@ -182,12 +195,6 @@
                             int target,
                             const char *image_name);
 
-int xc_hvm_build_mem(xc_interface *xch,
-                     uint32_t domid,
-                     int memsize,
-                     const char *image_buffer,
-                     unsigned long image_size);
-
 int xc_suspend_evtchn_release(xc_interface *xch, xc_evtchn *xce, int domid, int suspend_evtchn);
 
 int xc_suspend_evtchn_init(xc_interface *xch, xc_evtchn *xce, int domid, int port);
diff -r d64aa013a82e -r 7e1fd8012ca3 tools/libxc/xg_private.c
--- a/tools/libxc/xg_private.c	Thu Mar 01 12:31:15 2012 +0000
+++ b/tools/libxc/xg_private.c	Thu Mar 01 15:16:22 2012 +0000
@@ -192,8 +192,7 @@
 __attribute__((weak)) 
     int xc_hvm_build(xc_interface *xch,
                      uint32_t domid,
-                     int memsize,
-                     const char *image_name)
+                     const struct xc_hvm_build_args *hvm_args)
 {
     errno = ENOSYS;
     return -1;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gex-0000Zo-Vr; Sat, 03 Mar 2012 04:33:31 +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 1S3gev-0000B5-Vx
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:30 +0000
Received: from [85.158.143.99:30718] by server-1.bemta-4.messagelabs.com id
	32/D9-20925-91F915F4; Sat, 03 Mar 2012 04:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1330749207!14056522!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11954 invoked from network); 3 Mar 2012 04:33:28 -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;
	3 Mar 2012 04:33: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 1S3get-0004hj-KY
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3get-0003ZI-F9
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:27 +0000
Message-Id: <E1S3get-0003ZI-F9@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: rerun autoconf
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330615411 0
# Node ID f6ccd81028b7631e53a4f1d929f12f709de2f708
# Parent  d70b4a1155e3afa6827abb77f554166d70d9cec2
build: rerun autoconf

24942:d70b4a1155e3 contains changes to configure.in and thus we need
to rerun autogen.sh.

Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r d70b4a1155e3 -r f6ccd81028b7 tools/configure
--- a/tools/configure	Thu Mar 01 15:22:09 2012 +0000
+++ b/tools/configure	Thu Mar 01 15:23:31 2012 +0000
@@ -653,7 +653,6 @@
 vtpm
 monitors
 githttp
-xsm
 host_os
 host_vendor
 host_cpu
@@ -713,7 +712,6 @@
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
-enable_xsm
 enable_githttp
 enable_monitors
 enable_vtpm
@@ -1366,7 +1364,6 @@
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-xsm            Enable XSM security module (by default, Flask)
   --enable-githttp        Download GIT repositories via HTTP
   --disable-monitors      Disable xenstat and xentop monitoring tools
   --enable-vtpm           Enable Virtual Trusted Platform Module
@@ -1375,7 +1372,7 @@
   --disable-ocamltools    Disable Ocaml tools
   --enable-miniterm       Enable miniterm
   --enable-lomount        Enable lomount
-  --disable-debug         Disable debug build of Xen and tools
+  --disable-debug         Disable debug build of tools
 
 Some influential environment variables:
   CC          C compiler command
@@ -3914,27 +3911,6 @@
 
 
 # Enable/disable options
-# Check whether --enable-xsm was given.
-if test "${enable_xsm+set}" = set; then :
-  enableval=$enable_xsm;
-fi
-
-
-if test "x$enable_xsm" = "xyes"; then :
-
-    ax_cv_xsm="y"
-
-elif test "x$enable_xsm" = "xno"; then :
-
-    ax_cv_xsm="n"
-
-elif test -z $ax_cv_xsm; then :
-
-    ax_cv_xsm="n"
-
-fi
-xsm=$ax_cv_xsm
-
 # Check whether --enable-githttp was given.
 if test "${enable_githttp+set}" = set; then :
   enableval=$enable_githttp;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:32 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:32 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gex-0000Zo-Vr; Sat, 03 Mar 2012 04:33:31 +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 1S3gev-0000B5-Vx
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:30 +0000
Received: from [85.158.143.99:30718] by server-1.bemta-4.messagelabs.com id
	32/D9-20925-91F915F4; Sat, 03 Mar 2012 04:33:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1330749207!14056522!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11954 invoked from network); 3 Mar 2012 04:33:28 -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;
	3 Mar 2012 04:33: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 1S3get-0004hj-KY
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:27 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3get-0003ZI-F9
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:27 +0000
Message-Id: <E1S3get-0003ZI-F9@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:26 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: rerun autoconf
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330615411 0
# Node ID f6ccd81028b7631e53a4f1d929f12f709de2f708
# Parent  d70b4a1155e3afa6827abb77f554166d70d9cec2
build: rerun autoconf

24942:d70b4a1155e3 contains changes to configure.in and thus we need
to rerun autogen.sh.

Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r d70b4a1155e3 -r f6ccd81028b7 tools/configure
--- a/tools/configure	Thu Mar 01 15:22:09 2012 +0000
+++ b/tools/configure	Thu Mar 01 15:23:31 2012 +0000
@@ -653,7 +653,6 @@
 vtpm
 monitors
 githttp
-xsm
 host_os
 host_vendor
 host_cpu
@@ -713,7 +712,6 @@
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
-enable_xsm
 enable_githttp
 enable_monitors
 enable_vtpm
@@ -1366,7 +1364,6 @@
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
-  --enable-xsm            Enable XSM security module (by default, Flask)
   --enable-githttp        Download GIT repositories via HTTP
   --disable-monitors      Disable xenstat and xentop monitoring tools
   --enable-vtpm           Enable Virtual Trusted Platform Module
@@ -1375,7 +1372,7 @@
   --disable-ocamltools    Disable Ocaml tools
   --enable-miniterm       Enable miniterm
   --enable-lomount        Enable lomount
-  --disable-debug         Disable debug build of Xen and tools
+  --disable-debug         Disable debug build of tools
 
 Some influential environment variables:
   CC          C compiler command
@@ -3914,27 +3911,6 @@
 
 
 # Enable/disable options
-# Check whether --enable-xsm was given.
-if test "${enable_xsm+set}" = set; then :
-  enableval=$enable_xsm;
-fi
-
-
-if test "x$enable_xsm" = "xyes"; then :
-
-    ax_cv_xsm="y"
-
-elif test "x$enable_xsm" = "xno"; then :
-
-    ax_cv_xsm="n"
-
-elif test -z $ax_cv_xsm; then :
-
-    ax_cv_xsm="n"
-
-fi
-xsm=$ax_cv_xsm
-
 # Check whether --enable-githttp was given.
 if test "${enable_githttp+set}" = set; then :
   enableval=$enable_githttp;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gez-0000c2-3h; Sat, 03 Mar 2012 04:33:33 +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 1S3gew-0000ET-Tm
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:31 +0000
Received: from [85.158.143.99:30726] by server-2.bemta-4.messagelabs.com id
	95/9D-17550-A1F915F4; Sat, 03 Mar 2012 04:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1330749208!16554468!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1992 invoked from network); 3 Mar 2012 04:33:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33: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 1S3geu-0004hs-2d
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geu-0003Zm-19
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:28 +0000
Message-Id: <E1S3geu-0003Zm-19@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: remove obsolete
	XENMEM_paging_op_resume
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330617482 0
# Node ID b11d27240542cc876e6f06d78014eb86d127e158
# Parent  f6ccd81028b7631e53a4f1d929f12f709de2f708
xenpaging: remove obsolete XENMEM_paging_op_resume

With changeset 24364:0964341efd65 an event channel based notification of
new responses in the ringbuffer is implemented. This makes the memevent
interface obsolete. Currently a call to p2m_mem_paging_resume() is
triggered twice by xenpaging, once per memevent and once per even
channel. In practice this double call does not lead to issues because
p2m_mem_paging_resume() processes only available events.

xenpaging used the event channel notification since the beginning, but
it was a no-op until changeset mentioned above. This change removes the
unneeded XENMEM_paging_op_resume functionality. Pagers are notified via
an event channel of new requests, and now they are required to notify
the hypervisor about their responses also with an event channel.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r f6ccd81028b7 -r b11d27240542 tools/libxc/xc_mem_paging.c
--- a/tools/libxc/xc_mem_paging.c	Thu Mar 01 15:23:31 2012 +0000
+++ b/tools/libxc/xc_mem_paging.c	Thu Mar 01 15:58:02 2012 +0000
@@ -93,14 +93,6 @@
     return rc;
 }
 
-int xc_mem_paging_resume(xc_interface *xch, domid_t domain_id, unsigned long gfn)
-{
-    return xc_mem_event_memop(xch, domain_id,
-                                XENMEM_paging_op_resume,
-                                XENMEM_paging_op,
-                                gfn, NULL);
-}
-
 
 /*
  * Local variables:
diff -r f6ccd81028b7 -r b11d27240542 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Mar 01 15:23:31 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Mar 01 15:58:02 2012 +0000
@@ -1902,8 +1902,6 @@
 int xc_mem_paging_prep(xc_interface *xch, domid_t domain_id, unsigned long gfn);
 int xc_mem_paging_load(xc_interface *xch, domid_t domain_id, 
                         unsigned long gfn, void *buffer);
-int xc_mem_paging_resume(xc_interface *xch, domid_t domain_id,
-                         unsigned long gfn);
 
 int xc_mem_access_enable(xc_interface *xch, domid_t domain_id,
                         void *shared_page, void *ring_page);
diff -r f6ccd81028b7 -r b11d27240542 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Thu Mar 01 15:23:31 2012 +0000
+++ b/tools/xenpaging/xenpaging.c	Thu Mar 01 15:58:02 2012 +0000
@@ -656,8 +656,6 @@
 
 static int xenpaging_resume_page(struct xenpaging *paging, mem_event_response_t *rsp, int notify_policy)
 {
-    int ret;
-
     /* Put the page info on the ring */
     put_response(&paging->mem_event, rsp);
 
@@ -678,14 +676,7 @@
     }
 
     /* Tell Xen page is ready */
-    ret = xc_mem_paging_resume(paging->xc_handle, paging->mem_event.domain_id,
-                               rsp->gfn);
-    if ( ret == 0 ) 
-        ret = xc_evtchn_notify(paging->mem_event.xce_handle,
-                               paging->mem_event.port);
-
- out:
-    return ret;
+    return xc_evtchn_notify(paging->mem_event.xce_handle, paging->mem_event.port);
 }
 
 static int xenpaging_populate_page(struct xenpaging *paging, unsigned long gfn, int i)
diff -r f6ccd81028b7 -r b11d27240542 xen/arch/x86/mm/mem_paging.c
--- a/xen/arch/x86/mm/mem_paging.c	Thu Mar 01 15:23:31 2012 +0000
+++ b/xen/arch/x86/mm/mem_paging.c	Thu Mar 01 15:58:02 2012 +0000
@@ -53,13 +53,6 @@
     }
     break;
 
-    case XENMEM_paging_op_resume:
-    {
-        p2m_mem_paging_resume(d);
-        return 0;
-    }
-    break;
-
     default:
         return -ENOSYS;
         break;
diff -r f6ccd81028b7 -r b11d27240542 xen/include/public/memory.h
--- a/xen/include/public/memory.h	Thu Mar 01 15:23:31 2012 +0000
+++ b/xen/include/public/memory.h	Thu Mar 01 15:58:02 2012 +0000
@@ -322,7 +322,6 @@
 #define XENMEM_paging_op_nominate           0
 #define XENMEM_paging_op_evict              1
 #define XENMEM_paging_op_prep               2
-#define XENMEM_paging_op_resume             3
 
 #define XENMEM_access_op                    21
 #define XENMEM_access_op_resume             0

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gez-0000c2-3h; Sat, 03 Mar 2012 04:33:33 +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 1S3gew-0000ET-Tm
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:31 +0000
Received: from [85.158.143.99:30726] by server-2.bemta-4.messagelabs.com id
	95/9D-17550-A1F915F4; Sat, 03 Mar 2012 04:33:30 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1330749208!16554468!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1992 invoked from network); 3 Mar 2012 04:33:29 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33: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 1S3geu-0004hs-2d
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geu-0003Zm-19
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:28 +0000
Message-Id: <E1S3geu-0003Zm-19@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:27 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenpaging: remove obsolete
	XENMEM_paging_op_resume
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330617482 0
# Node ID b11d27240542cc876e6f06d78014eb86d127e158
# Parent  f6ccd81028b7631e53a4f1d929f12f709de2f708
xenpaging: remove obsolete XENMEM_paging_op_resume

With changeset 24364:0964341efd65 an event channel based notification of
new responses in the ringbuffer is implemented. This makes the memevent
interface obsolete. Currently a call to p2m_mem_paging_resume() is
triggered twice by xenpaging, once per memevent and once per even
channel. In practice this double call does not lead to issues because
p2m_mem_paging_resume() processes only available events.

xenpaging used the event channel notification since the beginning, but
it was a no-op until changeset mentioned above. This change removes the
unneeded XENMEM_paging_op_resume functionality. Pagers are notified via
an event channel of new requests, and now they are required to notify
the hypervisor about their responses also with an event channel.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r f6ccd81028b7 -r b11d27240542 tools/libxc/xc_mem_paging.c
--- a/tools/libxc/xc_mem_paging.c	Thu Mar 01 15:23:31 2012 +0000
+++ b/tools/libxc/xc_mem_paging.c	Thu Mar 01 15:58:02 2012 +0000
@@ -93,14 +93,6 @@
     return rc;
 }
 
-int xc_mem_paging_resume(xc_interface *xch, domid_t domain_id, unsigned long gfn)
-{
-    return xc_mem_event_memop(xch, domain_id,
-                                XENMEM_paging_op_resume,
-                                XENMEM_paging_op,
-                                gfn, NULL);
-}
-
 
 /*
  * Local variables:
diff -r f6ccd81028b7 -r b11d27240542 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Mar 01 15:23:31 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Mar 01 15:58:02 2012 +0000
@@ -1902,8 +1902,6 @@
 int xc_mem_paging_prep(xc_interface *xch, domid_t domain_id, unsigned long gfn);
 int xc_mem_paging_load(xc_interface *xch, domid_t domain_id, 
                         unsigned long gfn, void *buffer);
-int xc_mem_paging_resume(xc_interface *xch, domid_t domain_id,
-                         unsigned long gfn);
 
 int xc_mem_access_enable(xc_interface *xch, domid_t domain_id,
                         void *shared_page, void *ring_page);
diff -r f6ccd81028b7 -r b11d27240542 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Thu Mar 01 15:23:31 2012 +0000
+++ b/tools/xenpaging/xenpaging.c	Thu Mar 01 15:58:02 2012 +0000
@@ -656,8 +656,6 @@
 
 static int xenpaging_resume_page(struct xenpaging *paging, mem_event_response_t *rsp, int notify_policy)
 {
-    int ret;
-
     /* Put the page info on the ring */
     put_response(&paging->mem_event, rsp);
 
@@ -678,14 +676,7 @@
     }
 
     /* Tell Xen page is ready */
-    ret = xc_mem_paging_resume(paging->xc_handle, paging->mem_event.domain_id,
-                               rsp->gfn);
-    if ( ret == 0 ) 
-        ret = xc_evtchn_notify(paging->mem_event.xce_handle,
-                               paging->mem_event.port);
-
- out:
-    return ret;
+    return xc_evtchn_notify(paging->mem_event.xce_handle, paging->mem_event.port);
 }
 
 static int xenpaging_populate_page(struct xenpaging *paging, unsigned long gfn, int i)
diff -r f6ccd81028b7 -r b11d27240542 xen/arch/x86/mm/mem_paging.c
--- a/xen/arch/x86/mm/mem_paging.c	Thu Mar 01 15:23:31 2012 +0000
+++ b/xen/arch/x86/mm/mem_paging.c	Thu Mar 01 15:58:02 2012 +0000
@@ -53,13 +53,6 @@
     }
     break;
 
-    case XENMEM_paging_op_resume:
-    {
-        p2m_mem_paging_resume(d);
-        return 0;
-    }
-    break;
-
     default:
         return -ENOSYS;
         break;
diff -r f6ccd81028b7 -r b11d27240542 xen/include/public/memory.h
--- a/xen/include/public/memory.h	Thu Mar 01 15:23:31 2012 +0000
+++ b/xen/include/public/memory.h	Thu Mar 01 15:58:02 2012 +0000
@@ -322,7 +322,6 @@
 #define XENMEM_paging_op_nominate           0
 #define XENMEM_paging_op_evict              1
 #define XENMEM_paging_op_prep               2
-#define XENMEM_paging_op_resume             3
 
 #define XENMEM_access_op                    21
 #define XENMEM_access_op_resume             0

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gez-0000cV-91; Sat, 03 Mar 2012 04:33:33 +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 1S3gey-0000B5-8U
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:32 +0000
Received: from [85.158.143.99:62763] by server-1.bemta-4.messagelabs.com id
	05/D9-20925-C1F915F4; Sat, 03 Mar 2012 04:33:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1330749210!16892045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9266 invoked from network); 3 Mar 2012 04:33:31 -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;
	3 Mar 2012 04:33:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gev-0004i7-N5
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gev-0003bL-M0
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:29 +0000
Message-Id: <E1S3gev-0003bL-M0@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvm: correct RTC time offset update
	error due to tm->tm_year
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Annie Li <annie.li@oracle.com>
# Date 1330619399 0
# Node ID b198ada9689daf31193743b236f819288750296c
# Parent  ed898c1d80881e9e3fb07ad7d9b30b70ac407543
hvm: correct RTC time offset update error due to tm->tm_year

tm->tm_year in rtc.c is year number offsetting from 1900. So it is
necessary to add the offset 1900 when calling mktime funtion in
Xen. Otherwise, the calculation result of mktime is incorrect.

Signed-off-by: Annie Li <annie.li@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r ed898c1d8088 -r b198ada9689d xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Thu Mar 01 16:19:29 2012 +0000
+++ b/xen/arch/x86/hvm/rtc.c	Thu Mar 01 16:29:59 2012 +0000
@@ -33,6 +33,8 @@
 #define vrtc_domain(x) (container_of((x), struct domain, \
                                      arch.hvm_domain.pl_time.vrtc))
 #define vrtc_vcpu(x)   (pt_global_vcpu_target(vrtc_domain(x)))
+#define epoch_year     1900
+#define get_year(x)    (x + epoch_year)
 
 static void rtc_periodic_cb(struct vcpu *v, void *opaque)
 {
@@ -165,7 +167,7 @@
       
     ASSERT(spin_is_locked(&s->lock));
 
-    before = mktime(tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
+    before = mktime(get_year(tm->tm_year), tm->tm_mon + 1, tm->tm_mday,
 		    tm->tm_hour, tm->tm_min, tm->tm_sec);
     
     tm->tm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
@@ -179,7 +181,7 @@
     tm->tm_mon = from_bcd(s, s->hw.cmos_data[RTC_MONTH]) - 1;
     tm->tm_year = from_bcd(s, s->hw.cmos_data[RTC_YEAR]) + 100;
 
-    after = mktime(tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
+    after = mktime(get_year(tm->tm_year), tm->tm_mon + 1, tm->tm_mday,
                    tm->tm_hour, tm->tm_min, tm->tm_sec);
 
     /* We use the guest's setting of the RTC to define the local-time 
@@ -257,7 +259,7 @@
                 if ( (unsigned)tm->tm_wday >= 7 )
                     tm->tm_wday = 0;
                 days_in_month = get_days_in_month(tm->tm_mon, 
-                                                  tm->tm_year + 1900);
+                                                  get_year(tm->tm_year));
                 tm->tm_mday++;
                 if ( tm->tm_mday < 1 )
                 {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gez-0000cV-91; Sat, 03 Mar 2012 04:33:33 +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 1S3gey-0000B5-8U
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:32 +0000
Received: from [85.158.143.99:62763] by server-1.bemta-4.messagelabs.com id
	05/D9-20925-C1F915F4; Sat, 03 Mar 2012 04:33:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1330749210!16892045!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9266 invoked from network); 3 Mar 2012 04:33:31 -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;
	3 Mar 2012 04:33:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gev-0004i7-N5
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gev-0003bL-M0
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:29 +0000
Message-Id: <E1S3gev-0003bL-M0@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvm: correct RTC time offset update
	error due to tm->tm_year
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Annie Li <annie.li@oracle.com>
# Date 1330619399 0
# Node ID b198ada9689daf31193743b236f819288750296c
# Parent  ed898c1d80881e9e3fb07ad7d9b30b70ac407543
hvm: correct RTC time offset update error due to tm->tm_year

tm->tm_year in rtc.c is year number offsetting from 1900. So it is
necessary to add the offset 1900 when calling mktime funtion in
Xen. Otherwise, the calculation result of mktime is incorrect.

Signed-off-by: Annie Li <annie.li@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r ed898c1d8088 -r b198ada9689d xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Thu Mar 01 16:19:29 2012 +0000
+++ b/xen/arch/x86/hvm/rtc.c	Thu Mar 01 16:29:59 2012 +0000
@@ -33,6 +33,8 @@
 #define vrtc_domain(x) (container_of((x), struct domain, \
                                      arch.hvm_domain.pl_time.vrtc))
 #define vrtc_vcpu(x)   (pt_global_vcpu_target(vrtc_domain(x)))
+#define epoch_year     1900
+#define get_year(x)    (x + epoch_year)
 
 static void rtc_periodic_cb(struct vcpu *v, void *opaque)
 {
@@ -165,7 +167,7 @@
       
     ASSERT(spin_is_locked(&s->lock));
 
-    before = mktime(tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
+    before = mktime(get_year(tm->tm_year), tm->tm_mon + 1, tm->tm_mday,
 		    tm->tm_hour, tm->tm_min, tm->tm_sec);
     
     tm->tm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
@@ -179,7 +181,7 @@
     tm->tm_mon = from_bcd(s, s->hw.cmos_data[RTC_MONTH]) - 1;
     tm->tm_year = from_bcd(s, s->hw.cmos_data[RTC_YEAR]) + 100;
 
-    after = mktime(tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
+    after = mktime(get_year(tm->tm_year), tm->tm_mon + 1, tm->tm_mday,
                    tm->tm_hour, tm->tm_min, tm->tm_sec);
 
     /* We use the guest's setting of the RTC to define the local-time 
@@ -257,7 +259,7 @@
                 if ( (unsigned)tm->tm_wday >= 7 )
                     tm->tm_wday = 0;
                 days_in_month = get_days_in_month(tm->tm_mon, 
-                                                  tm->tm_year + 1900);
+                                                  get_year(tm->tm_year));
                 tm->tm_mday++;
                 if ( tm->tm_mday < 1 )
                 {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gez-0000cm-Do; Sat, 03 Mar 2012 04:33:33 +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 1S3gey-0000Z5-6A
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:32 +0000
Received: from [85.158.139.83:19081] by server-4.bemta-5.messagelabs.com id
	BC/0C-10788-B1F915F4; Sat, 03 Mar 2012 04:33:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1330749208!17625937!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12522 invoked from network); 3 Mar 2012 04:33:30 -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;
	3 Mar 2012 04:33:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geu-0004hx-K1
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geu-0003aH-Is
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:28 +0000
Message-Id: <E1S3geu-0003aH-Is@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hcall: markup the event channel
	hypercalls to improve generated docs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330617801 0
# Node ID 2a9dd3b751d2f21f5ca6f9376121584d4b31165b
# Parent  b11d27240542cc876e6f06d78014eb86d127e158
hcall: markup the event channel hypercalls to improve generated docs

As part of this I looked through the relevant chapter from interfaces.tex (from
4.1, deleted in unstable) to ensure no critical information was missing.

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


diff -r b11d27240542 -r 2a9dd3b751d2 xen/include/public/event_channel.h
--- a/xen/include/public/event_channel.h	Thu Mar 01 15:58:02 2012 +0000
+++ b/xen/include/public/event_channel.h	Thu Mar 01 16:03:21 2012 +0000
@@ -1,8 +1,8 @@
 /******************************************************************************
  * event_channel.h
- * 
+ *
  * Event channels between domains.
- * 
+ *
  * 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,12 +30,49 @@
 #include "xen.h"
 
 /*
- * Prototype for this hypercall is:
- *  int event_channel_op(int cmd, void *args)
- * @cmd  == EVTCHNOP_??? (event-channel operation).
- * @args == Operation-specific extra arguments (NULL if none).
+ * `incontents 150 evtchn Event Channels
+ *
+ * Event channels are the basic primitive provided by Xen for event
+ * notifications. An event is the Xen equivalent of a hardware
+ * interrupt. They essentially store one bit of information, the event
+ * of interest is signalled by transitioning this bit from 0 to 1.
+ *
+ * Notifications are received by a guest via an upcall from Xen,
+ * indicating when an event arrives (setting the bit). Further
+ * notifications are masked until the bit is cleared again (therefore,
+ * guests must check the value of the bit after re-enabling event
+ * delivery to ensure no missed notifications).
+ *
+ * Event notifications can be masked by setting a flag; this is
+ * equivalent to disabling interrupts and can be used to ensure
+ * atomicity of certain operations in the guest kernel.
+ *
+ * Event channels are represented by the evtchn_* fields in
+ * struct shared_info and struct vcpu_info.
  */
 
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_event_channel_op(enum event_channel_op cmd, void *args)
+ * `
+ * @cmd  == EVTCHNOP_* (event-channel operation).
+ * @args == struct evtchn_* Operation-specific extra arguments (NULL if none).
+ */
+
+/* ` enum event_channel_op { // EVTCHNOP_* => struct evtchn_* */
+#define EVTCHNOP_bind_interdomain 0
+#define EVTCHNOP_bind_virq        1
+#define EVTCHNOP_bind_pirq        2
+#define EVTCHNOP_close            3
+#define EVTCHNOP_send             4
+#define EVTCHNOP_status           5
+#define EVTCHNOP_alloc_unbound    6
+#define EVTCHNOP_bind_ipi         7
+#define EVTCHNOP_bind_vcpu        8
+#define EVTCHNOP_unmask           9
+#define EVTCHNOP_reset           10
+/* ` } */
+
 typedef uint32_t evtchn_port_t;
 DEFINE_XEN_GUEST_HANDLE(evtchn_port_t);
 
@@ -47,7 +84,6 @@
  *  1. If the caller is unprivileged then <dom> must be DOMID_SELF.
  *  2. <rdom> may be DOMID_SELF, allowing loopback connections.
  */
-#define EVTCHNOP_alloc_unbound    6
 struct evtchn_alloc_unbound {
     /* IN parameters */
     domid_t dom, remote_dom;
@@ -63,9 +99,8 @@
  * domain. A fresh port is allocated in the calling domain and returned as
  * <local_port>.
  * NOTES:
- *  2. <remote_dom> may be DOMID_SELF, allowing loopback connections.
+ *  1. <remote_dom> may be DOMID_SELF, allowing loopback connections.
  */
-#define EVTCHNOP_bind_interdomain 0
 struct evtchn_bind_interdomain {
     /* IN parameters. */
     domid_t remote_dom;
@@ -87,10 +122,9 @@
  *     The allocated event channel is bound to the specified vcpu and the
  *     binding cannot be changed.
  */
-#define EVTCHNOP_bind_virq        1
 struct evtchn_bind_virq {
     /* IN parameters. */
-    uint32_t virq;
+    uint32_t virq; /* enum virq */
     uint32_t vcpu;
     /* OUT parameters. */
     evtchn_port_t port;
@@ -98,12 +132,11 @@
 typedef struct evtchn_bind_virq evtchn_bind_virq_t;
 
 /*
- * EVTCHNOP_bind_pirq: Bind a local event channel to PIRQ <irq>.
+ * EVTCHNOP_bind_pirq: Bind a local event channel to a real IRQ (PIRQ <irq>).
  * NOTES:
  *  1. A physical IRQ may be bound to at most one event channel per domain.
  *  2. Only a sufficiently-privileged domain may bind to a physical IRQ.
  */
-#define EVTCHNOP_bind_pirq        2
 struct evtchn_bind_pirq {
     /* IN parameters. */
     uint32_t pirq;
@@ -120,7 +153,6 @@
  *  1. The allocated event channel is bound to the specified vcpu. The binding
  *     may not be changed.
  */
-#define EVTCHNOP_bind_ipi         7
 struct evtchn_bind_ipi {
     uint32_t vcpu;
     /* OUT parameters. */
@@ -133,7 +165,6 @@
  * interdomain then the remote end is placed in the unbound state
  * (EVTCHNSTAT_unbound), awaiting a new connection.
  */
-#define EVTCHNOP_close            3
 struct evtchn_close {
     /* IN parameters. */
     evtchn_port_t port;
@@ -144,7 +175,6 @@
  * EVTCHNOP_send: Send an event to the remote end of the channel whose local
  * endpoint is <port>.
  */
-#define EVTCHNOP_send             4
 struct evtchn_send {
     /* IN parameters. */
     evtchn_port_t port;
@@ -159,7 +189,6 @@
  *  2. Only a sufficiently-privileged domain may obtain the status of an event
  *     channel for which <dom> is not DOMID_SELF.
  */
-#define EVTCHNOP_status           5
 struct evtchn_status {
     /* IN parameters */
     domid_t  dom;
@@ -176,13 +205,13 @@
     union {
         struct {
             domid_t dom;
-        } unbound; /* EVTCHNSTAT_unbound */
+        } unbound;                 /* EVTCHNSTAT_unbound */
         struct {
             domid_t dom;
             evtchn_port_t port;
-        } interdomain; /* EVTCHNSTAT_interdomain */
-        uint32_t pirq;      /* EVTCHNSTAT_pirq        */
-        uint32_t virq;      /* EVTCHNSTAT_virq        */
+        } interdomain;             /* EVTCHNSTAT_interdomain */
+        uint32_t pirq;             /* EVTCHNSTAT_pirq        */
+        uint32_t virq;             /* EVTCHNSTAT_virq        */
     } u;
 };
 typedef struct evtchn_status evtchn_status_t;
@@ -199,7 +228,6 @@
  *     the channel is allocated (a port that is freed and subsequently reused
  *     has its binding reset to vcpu0).
  */
-#define EVTCHNOP_bind_vcpu        8
 struct evtchn_bind_vcpu {
     /* IN parameters. */
     evtchn_port_t port;
@@ -211,7 +239,6 @@
  * EVTCHNOP_unmask: Unmask the specified local event-channel port and deliver
  * a notification to the appropriate VCPU if an event is pending.
  */
-#define EVTCHNOP_unmask           9
 struct evtchn_unmask {
     /* IN parameters. */
     evtchn_port_t port;
@@ -224,7 +251,6 @@
  *  1. <dom> may be specified as DOMID_SELF.
  *  2. Only a sufficiently-privileged domain may specify other than DOMID_SELF.
  */
-#define EVTCHNOP_reset           10
 struct evtchn_reset {
     /* IN parameters. */
     domid_t dom;
@@ -232,11 +258,13 @@
 typedef struct evtchn_reset evtchn_reset_t;
 
 /*
- * Argument to event_channel_op_compat() hypercall. Superceded by new
- * event_channel_op() hypercall since 0x00030202.
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_event_channel_op_compat(struct evtchn_op *op)
+ * `
+ * Superceded by new event_channel_op() hypercall since 0x00030202.
  */
 struct evtchn_op {
-    uint32_t cmd; /* EVTCHNOP_* */
+    uint32_t cmd; /* enum event_channel_op */
     union {
         struct evtchn_alloc_unbound    alloc_unbound;
         struct evtchn_bind_interdomain bind_interdomain;
diff -r b11d27240542 -r 2a9dd3b751d2 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Thu Mar 01 15:58:02 2012 +0000
+++ b/xen/include/public/xen.h	Thu Mar 01 16:03:21 2012 +0000
@@ -146,6 +146,7 @@
  * The latter can be allocated only once per guest: they must initially be
  * allocated to VCPU0 but can subsequently be re-bound.
  */
+/* ` enum virq { */
 #define VIRQ_TIMER      0  /* V. Timebase update, and/or requested timeout.  */
 #define VIRQ_DEBUG      1  /* V. Request guest to dump debug info.           */
 #define VIRQ_CONSOLE    2  /* G. (DOM0) Bytes received on emergency console. */
@@ -167,6 +168,7 @@
 #define VIRQ_ARCH_5    21
 #define VIRQ_ARCH_6    22
 #define VIRQ_ARCH_7    23
+/* ` } */
 
 #define NR_VIRQS       24
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:33 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gez-0000cm-Do; Sat, 03 Mar 2012 04:33:33 +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 1S3gey-0000Z5-6A
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:32 +0000
Received: from [85.158.139.83:19081] by server-4.bemta-5.messagelabs.com id
	BC/0C-10788-B1F915F4; Sat, 03 Mar 2012 04:33:31 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1330749208!17625937!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12522 invoked from network); 3 Mar 2012 04:33:30 -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;
	3 Mar 2012 04:33:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geu-0004hx-K1
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:28 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geu-0003aH-Is
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:28 +0000
Message-Id: <E1S3geu-0003aH-Is@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hcall: markup the event channel
	hypercalls to improve generated docs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330617801 0
# Node ID 2a9dd3b751d2f21f5ca6f9376121584d4b31165b
# Parent  b11d27240542cc876e6f06d78014eb86d127e158
hcall: markup the event channel hypercalls to improve generated docs

As part of this I looked through the relevant chapter from interfaces.tex (from
4.1, deleted in unstable) to ensure no critical information was missing.

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


diff -r b11d27240542 -r 2a9dd3b751d2 xen/include/public/event_channel.h
--- a/xen/include/public/event_channel.h	Thu Mar 01 15:58:02 2012 +0000
+++ b/xen/include/public/event_channel.h	Thu Mar 01 16:03:21 2012 +0000
@@ -1,8 +1,8 @@
 /******************************************************************************
  * event_channel.h
- * 
+ *
  * Event channels between domains.
- * 
+ *
  * 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,12 +30,49 @@
 #include "xen.h"
 
 /*
- * Prototype for this hypercall is:
- *  int event_channel_op(int cmd, void *args)
- * @cmd  == EVTCHNOP_??? (event-channel operation).
- * @args == Operation-specific extra arguments (NULL if none).
+ * `incontents 150 evtchn Event Channels
+ *
+ * Event channels are the basic primitive provided by Xen for event
+ * notifications. An event is the Xen equivalent of a hardware
+ * interrupt. They essentially store one bit of information, the event
+ * of interest is signalled by transitioning this bit from 0 to 1.
+ *
+ * Notifications are received by a guest via an upcall from Xen,
+ * indicating when an event arrives (setting the bit). Further
+ * notifications are masked until the bit is cleared again (therefore,
+ * guests must check the value of the bit after re-enabling event
+ * delivery to ensure no missed notifications).
+ *
+ * Event notifications can be masked by setting a flag; this is
+ * equivalent to disabling interrupts and can be used to ensure
+ * atomicity of certain operations in the guest kernel.
+ *
+ * Event channels are represented by the evtchn_* fields in
+ * struct shared_info and struct vcpu_info.
  */
 
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_event_channel_op(enum event_channel_op cmd, void *args)
+ * `
+ * @cmd  == EVTCHNOP_* (event-channel operation).
+ * @args == struct evtchn_* Operation-specific extra arguments (NULL if none).
+ */
+
+/* ` enum event_channel_op { // EVTCHNOP_* => struct evtchn_* */
+#define EVTCHNOP_bind_interdomain 0
+#define EVTCHNOP_bind_virq        1
+#define EVTCHNOP_bind_pirq        2
+#define EVTCHNOP_close            3
+#define EVTCHNOP_send             4
+#define EVTCHNOP_status           5
+#define EVTCHNOP_alloc_unbound    6
+#define EVTCHNOP_bind_ipi         7
+#define EVTCHNOP_bind_vcpu        8
+#define EVTCHNOP_unmask           9
+#define EVTCHNOP_reset           10
+/* ` } */
+
 typedef uint32_t evtchn_port_t;
 DEFINE_XEN_GUEST_HANDLE(evtchn_port_t);
 
@@ -47,7 +84,6 @@
  *  1. If the caller is unprivileged then <dom> must be DOMID_SELF.
  *  2. <rdom> may be DOMID_SELF, allowing loopback connections.
  */
-#define EVTCHNOP_alloc_unbound    6
 struct evtchn_alloc_unbound {
     /* IN parameters */
     domid_t dom, remote_dom;
@@ -63,9 +99,8 @@
  * domain. A fresh port is allocated in the calling domain and returned as
  * <local_port>.
  * NOTES:
- *  2. <remote_dom> may be DOMID_SELF, allowing loopback connections.
+ *  1. <remote_dom> may be DOMID_SELF, allowing loopback connections.
  */
-#define EVTCHNOP_bind_interdomain 0
 struct evtchn_bind_interdomain {
     /* IN parameters. */
     domid_t remote_dom;
@@ -87,10 +122,9 @@
  *     The allocated event channel is bound to the specified vcpu and the
  *     binding cannot be changed.
  */
-#define EVTCHNOP_bind_virq        1
 struct evtchn_bind_virq {
     /* IN parameters. */
-    uint32_t virq;
+    uint32_t virq; /* enum virq */
     uint32_t vcpu;
     /* OUT parameters. */
     evtchn_port_t port;
@@ -98,12 +132,11 @@
 typedef struct evtchn_bind_virq evtchn_bind_virq_t;
 
 /*
- * EVTCHNOP_bind_pirq: Bind a local event channel to PIRQ <irq>.
+ * EVTCHNOP_bind_pirq: Bind a local event channel to a real IRQ (PIRQ <irq>).
  * NOTES:
  *  1. A physical IRQ may be bound to at most one event channel per domain.
  *  2. Only a sufficiently-privileged domain may bind to a physical IRQ.
  */
-#define EVTCHNOP_bind_pirq        2
 struct evtchn_bind_pirq {
     /* IN parameters. */
     uint32_t pirq;
@@ -120,7 +153,6 @@
  *  1. The allocated event channel is bound to the specified vcpu. The binding
  *     may not be changed.
  */
-#define EVTCHNOP_bind_ipi         7
 struct evtchn_bind_ipi {
     uint32_t vcpu;
     /* OUT parameters. */
@@ -133,7 +165,6 @@
  * interdomain then the remote end is placed in the unbound state
  * (EVTCHNSTAT_unbound), awaiting a new connection.
  */
-#define EVTCHNOP_close            3
 struct evtchn_close {
     /* IN parameters. */
     evtchn_port_t port;
@@ -144,7 +175,6 @@
  * EVTCHNOP_send: Send an event to the remote end of the channel whose local
  * endpoint is <port>.
  */
-#define EVTCHNOP_send             4
 struct evtchn_send {
     /* IN parameters. */
     evtchn_port_t port;
@@ -159,7 +189,6 @@
  *  2. Only a sufficiently-privileged domain may obtain the status of an event
  *     channel for which <dom> is not DOMID_SELF.
  */
-#define EVTCHNOP_status           5
 struct evtchn_status {
     /* IN parameters */
     domid_t  dom;
@@ -176,13 +205,13 @@
     union {
         struct {
             domid_t dom;
-        } unbound; /* EVTCHNSTAT_unbound */
+        } unbound;                 /* EVTCHNSTAT_unbound */
         struct {
             domid_t dom;
             evtchn_port_t port;
-        } interdomain; /* EVTCHNSTAT_interdomain */
-        uint32_t pirq;      /* EVTCHNSTAT_pirq        */
-        uint32_t virq;      /* EVTCHNSTAT_virq        */
+        } interdomain;             /* EVTCHNSTAT_interdomain */
+        uint32_t pirq;             /* EVTCHNSTAT_pirq        */
+        uint32_t virq;             /* EVTCHNSTAT_virq        */
     } u;
 };
 typedef struct evtchn_status evtchn_status_t;
@@ -199,7 +228,6 @@
  *     the channel is allocated (a port that is freed and subsequently reused
  *     has its binding reset to vcpu0).
  */
-#define EVTCHNOP_bind_vcpu        8
 struct evtchn_bind_vcpu {
     /* IN parameters. */
     evtchn_port_t port;
@@ -211,7 +239,6 @@
  * EVTCHNOP_unmask: Unmask the specified local event-channel port and deliver
  * a notification to the appropriate VCPU if an event is pending.
  */
-#define EVTCHNOP_unmask           9
 struct evtchn_unmask {
     /* IN parameters. */
     evtchn_port_t port;
@@ -224,7 +251,6 @@
  *  1. <dom> may be specified as DOMID_SELF.
  *  2. Only a sufficiently-privileged domain may specify other than DOMID_SELF.
  */
-#define EVTCHNOP_reset           10
 struct evtchn_reset {
     /* IN parameters. */
     domid_t dom;
@@ -232,11 +258,13 @@
 typedef struct evtchn_reset evtchn_reset_t;
 
 /*
- * Argument to event_channel_op_compat() hypercall. Superceded by new
- * event_channel_op() hypercall since 0x00030202.
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_event_channel_op_compat(struct evtchn_op *op)
+ * `
+ * Superceded by new event_channel_op() hypercall since 0x00030202.
  */
 struct evtchn_op {
-    uint32_t cmd; /* EVTCHNOP_* */
+    uint32_t cmd; /* enum event_channel_op */
     union {
         struct evtchn_alloc_unbound    alloc_unbound;
         struct evtchn_bind_interdomain bind_interdomain;
diff -r b11d27240542 -r 2a9dd3b751d2 xen/include/public/xen.h
--- a/xen/include/public/xen.h	Thu Mar 01 15:58:02 2012 +0000
+++ b/xen/include/public/xen.h	Thu Mar 01 16:03:21 2012 +0000
@@ -146,6 +146,7 @@
  * The latter can be allocated only once per guest: they must initially be
  * allocated to VCPU0 but can subsequently be re-bound.
  */
+/* ` enum virq { */
 #define VIRQ_TIMER      0  /* V. Timebase update, and/or requested timeout.  */
 #define VIRQ_DEBUG      1  /* V. Request guest to dump debug info.           */
 #define VIRQ_CONSOLE    2  /* G. (DOM0) Bytes received on emergency console. */
@@ -167,6 +168,7 @@
 #define VIRQ_ARCH_5    21
 #define VIRQ_ARCH_6    22
 #define VIRQ_ARCH_7    23
+/* ` } */
 
 #define NR_VIRQS       24
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:34 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf0-0000fK-JC; Sat, 03 Mar 2012 04:33:34 +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 1S3gey-0000ET-Tl
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:33 +0000
Received: from [85.158.143.99:62773] by server-2.bemta-4.messagelabs.com id
	39/9D-17550-C1F915F4; Sat, 03 Mar 2012 04:33:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1330749210!17462421!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29565 invoked from network); 3 Mar 2012 04:33:31 -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;
	3 Mar 2012 04:33:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gew-0004iH-7k
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gew-0003bp-6U
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:30 +0000
Message-Id: <E1S3gew-0003bp-6U@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86,
	tools/libxc: expose HLE/RTM features to pv and 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330619512 0
# Node ID 2fbac9359e3b4fb61436e6e6653ec266b4f82ba9
# Parent  b198ada9689daf31193743b236f819288750296c
x86,tools/libxc: expose HLE/RTM features to pv and hvm

Intel recently release 2 new features, HLE and TRM.
Refer to http://software.intel.com/file/41417.
This patch expose them to pv and hvm

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r b198ada9689d -r 2fbac9359e3b tools/libxc/xc_cpufeature.h
--- a/tools/libxc/xc_cpufeature.h	Thu Mar 01 16:29:59 2012 +0000
+++ b/tools/libxc/xc_cpufeature.h	Thu Mar 01 16:31:52 2012 +0000
@@ -129,10 +129,12 @@
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx) */
 #define X86_FEATURE_FSGSBASE     0 /* {RD,WR}{FS,GS}BASE instructions */
 #define X86_FEATURE_BMI1         3 /* 1st group bit manipulation extensions */
+#define X86_FEATURE_HLE          4 /* Hardware Lock Elision */
 #define X86_FEATURE_AVX2         5 /* AVX2 instructions */
 #define X86_FEATURE_SMEP         7 /* Supervisor Mode Execution Protection */
 #define X86_FEATURE_BMI2         8 /* 2nd group bit manipulation extensions */
 #define X86_FEATURE_ERMS         9 /* Enhanced REP MOVSB/STOSB */
 #define X86_FEATURE_INVPCID     10 /* Invalidate Process Context ID */
+#define X86_FEATURE_RTM         11 /* Restricted Transactional Memory */
 
 #endif /* __LIBXC_CPUFEATURE_H */
diff -r b198ada9689d -r 2fbac9359e3b tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c	Thu Mar 01 16:29:59 2012 +0000
+++ b/tools/libxc/xc_cpuid_x86.c	Thu Mar 01 16:31:52 2012 +0000
@@ -363,11 +363,13 @@
     case 0x00000007: /* Intel-defined CPU features */
         if ( input[1] == 0 ) {
             regs[1] &= (bitmaskof(X86_FEATURE_BMI1) |
+                        bitmaskof(X86_FEATURE_HLE)  |
                         bitmaskof(X86_FEATURE_AVX2) |
                         bitmaskof(X86_FEATURE_SMEP) |
                         bitmaskof(X86_FEATURE_BMI2) |
                         bitmaskof(X86_FEATURE_ERMS) |
                         bitmaskof(X86_FEATURE_INVPCID) |
+                        bitmaskof(X86_FEATURE_RTM)  |
                         bitmaskof(X86_FEATURE_FSGSBASE));
         } else
             regs[1] = 0;
@@ -496,9 +498,11 @@
     case 0x00000007:
         if ( input[1] == 0 )
             regs[1] &= (bitmaskof(X86_FEATURE_BMI1) |
+                        bitmaskof(X86_FEATURE_HLE)  |
                         bitmaskof(X86_FEATURE_AVX2) |
                         bitmaskof(X86_FEATURE_BMI2) |
                         bitmaskof(X86_FEATURE_ERMS) |
+                        bitmaskof(X86_FEATURE_RTM)  |
                         bitmaskof(X86_FEATURE_FSGSBASE));
         else
             regs[1] = 0;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:34 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf0-0000fK-JC; Sat, 03 Mar 2012 04:33:34 +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 1S3gey-0000ET-Tl
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:33 +0000
Received: from [85.158.143.99:62773] by server-2.bemta-4.messagelabs.com id
	39/9D-17550-C1F915F4; Sat, 03 Mar 2012 04:33:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1330749210!17462421!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29565 invoked from network); 3 Mar 2012 04:33:31 -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;
	3 Mar 2012 04:33:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gew-0004iH-7k
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gew-0003bp-6U
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:30 +0000
Message-Id: <E1S3gew-0003bp-6U@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:29 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86,
	tools/libxc: expose HLE/RTM features to pv and 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330619512 0
# Node ID 2fbac9359e3b4fb61436e6e6653ec266b4f82ba9
# Parent  b198ada9689daf31193743b236f819288750296c
x86,tools/libxc: expose HLE/RTM features to pv and hvm

Intel recently release 2 new features, HLE and TRM.
Refer to http://software.intel.com/file/41417.
This patch expose them to pv and hvm

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r b198ada9689d -r 2fbac9359e3b tools/libxc/xc_cpufeature.h
--- a/tools/libxc/xc_cpufeature.h	Thu Mar 01 16:29:59 2012 +0000
+++ b/tools/libxc/xc_cpufeature.h	Thu Mar 01 16:31:52 2012 +0000
@@ -129,10 +129,12 @@
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx) */
 #define X86_FEATURE_FSGSBASE     0 /* {RD,WR}{FS,GS}BASE instructions */
 #define X86_FEATURE_BMI1         3 /* 1st group bit manipulation extensions */
+#define X86_FEATURE_HLE          4 /* Hardware Lock Elision */
 #define X86_FEATURE_AVX2         5 /* AVX2 instructions */
 #define X86_FEATURE_SMEP         7 /* Supervisor Mode Execution Protection */
 #define X86_FEATURE_BMI2         8 /* 2nd group bit manipulation extensions */
 #define X86_FEATURE_ERMS         9 /* Enhanced REP MOVSB/STOSB */
 #define X86_FEATURE_INVPCID     10 /* Invalidate Process Context ID */
+#define X86_FEATURE_RTM         11 /* Restricted Transactional Memory */
 
 #endif /* __LIBXC_CPUFEATURE_H */
diff -r b198ada9689d -r 2fbac9359e3b tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c	Thu Mar 01 16:29:59 2012 +0000
+++ b/tools/libxc/xc_cpuid_x86.c	Thu Mar 01 16:31:52 2012 +0000
@@ -363,11 +363,13 @@
     case 0x00000007: /* Intel-defined CPU features */
         if ( input[1] == 0 ) {
             regs[1] &= (bitmaskof(X86_FEATURE_BMI1) |
+                        bitmaskof(X86_FEATURE_HLE)  |
                         bitmaskof(X86_FEATURE_AVX2) |
                         bitmaskof(X86_FEATURE_SMEP) |
                         bitmaskof(X86_FEATURE_BMI2) |
                         bitmaskof(X86_FEATURE_ERMS) |
                         bitmaskof(X86_FEATURE_INVPCID) |
+                        bitmaskof(X86_FEATURE_RTM)  |
                         bitmaskof(X86_FEATURE_FSGSBASE));
         } else
             regs[1] = 0;
@@ -496,9 +498,11 @@
     case 0x00000007:
         if ( input[1] == 0 )
             regs[1] &= (bitmaskof(X86_FEATURE_BMI1) |
+                        bitmaskof(X86_FEATURE_HLE)  |
                         bitmaskof(X86_FEATURE_AVX2) |
                         bitmaskof(X86_FEATURE_BMI2) |
                         bitmaskof(X86_FEATURE_ERMS) |
+                        bitmaskof(X86_FEATURE_RTM)  |
                         bitmaskof(X86_FEATURE_FSGSBASE));
         else
             regs[1] = 0;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:34 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf0-0000fX-MC; Sat, 03 Mar 2012 04:33:34 +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 1S3gey-0000B5-MV
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:33 +0000
Received: from [85.158.143.99:30747] by server-1.bemta-4.messagelabs.com id
	65/D9-20925-C1F915F4; Sat, 03 Mar 2012 04:33:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1330749205!17391925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.1 required=7.0 tests=BODY_RANDOM_LONG,DIET_1
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2877 invoked from network); 3 Mar 2012 04:33:26 -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;
	3 Mar 2012 04:33: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 1S3ger-0004h5-B3
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geq-0003X9-S2
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Message-Id: <E1S3geq-0003X9-S2@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Merge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330605075 0
# Node ID d64aa013a82e591f628abd7a2cac7cc82da41a4f
# Parent  d7fe4cd831a0d8d7b3cd71ca302ca0280e3a5096
# Parent  17bfd4d2ffce56b65e7849a5779471ef4f5e4aea
Merge
---


diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/gentest.py	Thu Mar 01 12:31:15 2012 +0000
@@ -1,5 +1,6 @@
 #!/usr/bin/python
 
+import os
 import sys
 import re
 import random
@@ -30,7 +31,7 @@
     elif isinstance(ty, idl.KeyedUnion):
         if parent is None:
             raise Exception("KeyedUnion type must have a parent")
-        s += "switch (%s) {\n" % (parent + ty.keyvar_name)
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
@@ -54,6 +55,8 @@
               ty.pass_arg(v, parent is None))
     elif ty.typename in ["bool"]:
         s += "%s = rand() %% 2;\n" % v
+    elif ty.typename in ["libxl_defbool"]:
+        s += "libxl_defbool_set(%s, !!rand() %% 1);\n" % v
     elif ty.typename in ["char *"]:
         s += "%s = rand_str();\n" % v
     elif ty.private:
@@ -72,7 +75,7 @@
         print >>sys.stderr, "Usage: gentest.py <idl> <implementation>"
         sys.exit(1)
 
-    random.seed()
+    random.seed(os.getenv('LIBXL_TESTIDL_SEED'))
 
     (builtins,types) = idl.parse(sys.argv[1])
 
@@ -196,6 +199,7 @@
 }
 """)
     for ty in builtins + types:
+        if isinstance(ty, idl.Number): continue
         if ty.typename not in handcoded:
             f.write("static void %s_rand_init(%s);\n" % \
                     (ty.typename,
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/gentypes.py	Thu Mar 01 12:31:15 2012 +0000
@@ -32,6 +32,9 @@
             s += "} %s" % ty.typename
 
     elif isinstance(ty, idl.Aggregate):
+        if isinstance(ty, idl.KeyedUnion):
+            s += libxl_C_instance_of(ty.keyvar.type, ty.keyvar.name) + ";\n"
+            
         if ty.typename is None:
             s += "%s {\n" % ty.kind
         else:
@@ -56,7 +59,7 @@
     if isinstance(ty, idl.KeyedUnion):
         if parent is None:
             raise Exception("KeyedUnion type must have a parent")
-        s += "switch (%s) {\n" % (parent + ty.keyvar_name)
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
@@ -75,6 +78,88 @@
         s = indent + s
     return s.replace("\n", "\n%s" % indent).rstrip(indent)
 
+def libxl_init_members(ty, nesting = 0):
+    """Returns a list of members of ty which require a separate init"""
+
+    if isinstance(ty, idl.Aggregate):
+        return [f for f in ty.fields if not f.const and isinstance(f.type,idl.KeyedUnion)]
+    else:
+        return []
+    
+def _libxl_C_type_init(ty, v, indent = "    ", parent = None, subinit=False):
+    s = ""
+    if isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        if subinit:
+            s += "switch (%s) {\n" % (parent + ty.keyvar.name)
+            for f in ty.fields:
+                (nparent,fexpr) = ty.member(v, f, parent is None)
+                s += "case %s:\n" % f.enumname
+                s += _libxl_C_type_init(f.type, fexpr, "    ", nparent)
+                s += "    break;\n"
+            s += "}\n"
+        else:
+            if ty.keyvar.init_val:
+                s += "%s = %s;\n" % (parent + ty.keyvar.name, ty.keyvar.init_val)
+            elif ty.keyvar.type.init_val:
+                s += "%s = %s;\n" % (parent + ty.keyvar.name, ty.keyvar.type.init_val)
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.init_fn is None):
+        for f in [f for f in ty.fields if not f.const]:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            if f.init_val is not None:
+                s += "%s = %s;\n" % (fexpr, f.init_val)
+            else:
+                s += _libxl_C_type_init(f.type, fexpr, "", nparent)
+    else:
+        if ty.init_val is not None:
+            s += "%s = %s;\n" % (ty.pass_arg(v, parent is None), ty.init_val)
+        elif ty.init_fn is not None:
+            s += "%s(%s);\n" % (ty.init_fn, ty.pass_arg(v, parent is None))
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_init(ty):
+    s = ""
+    s += "void %s(%s)\n" % (ty.init_fn, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE))
+    s += "{\n"
+    s += "    memset(p, '\\0', sizeof(*p));\n"
+    s += _libxl_C_type_init(ty, "p")
+    s += "}\n"
+    s += "\n"
+    return s
+
+def libxl_C_type_member_init(ty, field):
+    if not isinstance(field.type, idl.KeyedUnion):
+        raise Exception("Only KeyedUnion is supported for member init")
+
+    ku = field.type
+    
+    s = ""
+    s += "void %s(%s, %s)\n" % (ty.init_fn + "_" + ku.keyvar.name,
+                                ty.make_arg("p", passby=idl.PASS_BY_REFERENCE),
+                                ku.keyvar.type.make_arg(ku.keyvar.name))
+    s += "{\n"
+    
+    if ku.keyvar.init_val:
+        init_val = ku.keyvar.init_val
+    elif ku.keyvar.type.init_val:
+        init_val = ku.keyvar.type.init_val
+    else:
+        init_val = None
+        
+    if init_val is not None:
+        (nparent,fexpr) = ty.member(ty.pass_arg("p"), ku.keyvar, isref=True)
+        s += "    assert(%s == %s);\n" % (fexpr, init_val)
+        s += "    %s = %s;\n" % (fexpr, ku.keyvar.name)
+    (nparent,fexpr) = ty.member(ty.pass_arg("p"), field, isref=True)
+    s += _libxl_C_type_init(ku, fexpr, parent=nparent, subinit=True)
+    s += "}\n"
+    s += "\n"
+    return s
+
 def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
     s = ""
     if parent is None:
@@ -86,7 +171,7 @@
     elif isinstance(ty, idl.KeyedUnion):
         if parent is None:
             raise Exception("KeyedUnion type must have a parent")
-        s += "switch (%s) {\n" % (parent + ty.keyvar_name)
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
@@ -196,6 +281,15 @@
         f.write(libxl_C_type_define(ty) + ";\n")
         if ty.dispose_fn is not None:
             f.write("void %s(%s);\n" % (ty.dispose_fn, ty.make_arg("p")))
+        if ty.init_fn is not None:
+            f.write("void %s(%s);\n" % (ty.init_fn, ty.make_arg("p")))
+            for field in libxl_init_members(ty):
+                if not isinstance(field.type, idl.KeyedUnion):
+                    raise Exception("Only KeyedUnion is supported for member init")
+                ku = field.type
+                f.write("void %s(%s, %s);\n" % (ty.init_fn + "_" + ku.keyvar.name,
+                                               ty.make_arg("p"),
+                                               ku.keyvar.type.make_arg(ku.keyvar.name)))
         if ty.json_fn is not None:
             f.write("char *%s_to_json(libxl_ctx *ctx, %s);\n" % (ty.typename, ty.make_arg("p")))
         if isinstance(ty, idl.Enumeration):
@@ -224,7 +318,7 @@
 
 """ % (header_json_define, header_json_define, " ".join(sys.argv)))
 
-    for ty in [ty for ty in types+builtins if ty.json_fn is not None]:
+    for ty in [ty for ty in types if ty.json_fn is not None]:
         f.write("yajl_gen_status %s_gen_json(yajl_gen hand, %s);\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
 
     f.write("\n")
@@ -261,6 +355,11 @@
         f.write("    memset(p, LIBXL_DTOR_POISON, sizeof(*p));\n")
         f.write("}\n")
         f.write("\n")
+        
+    for ty in [t for t in types if t.init_fn is not None and t.autogenerate_init_fn]:
+        f.write(libxl_C_type_init(ty))
+        for field in libxl_init_members(ty):
+            f.write(libxl_C_type_member_init(ty, field))
 
     for ty in [t for t in types if isinstance(t,idl.Enumeration)]:
         f.write("const char *%s_to_string(%s e)\n" % (ty.typename, ty.typename))
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/idl.py
--- a/tools/libxl/idl.py	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/idl.py	Thu Mar 01 12:31:15 2012 +0000
@@ -51,6 +51,10 @@
 
         self.autogenerate_dispose_fn = kwargs.setdefault('autogenerate_dispose_fn', True)
 
+        self.init_fn = kwargs.setdefault('init_fn', None)
+        self.init_val = kwargs.setdefault('init_val', None)
+        self.autogenerate_init_fn = kwargs.setdefault('autogenerate_init_fn', False)
+
         if self.typename is not None and not self.private:
             self.json_fn = kwargs.setdefault('json_fn', self.typename + "_gen_json")
         else:
@@ -144,12 +148,20 @@
         self.name = name
         self.const = kwargs.setdefault('const', False)
         self.enumname = kwargs.setdefault('enumname', None)
+        self.init_val = kwargs.setdefault('init_val', None)
 
 class Aggregate(Type):
     """A type containing a collection of other types"""
     def __init__(self, kind, typename, fields, **kwargs):
         Type.__init__(self, typename, **kwargs)
 
+        if self.typename is not None:
+            self.init_fn = kwargs.setdefault('init_fn', self.typename + "_init")
+        else:
+            self.init_fn = kwargs.setdefault('init_fn', None)
+
+        self.autogenerate_init_fn = kwargs.setdefault('autogenerate_init_fn', True)
+
         self.kind = kind
 
         self.fields = []
@@ -206,8 +218,9 @@
         if not isinstance(keyvar_type, Enumeration):
             raise ValueError
 
-        self.keyvar_name = keyvar_name
-        self.keyvar_type = keyvar_type
+        kv_kwargs = dict([(x.lstrip('keyvar_'),y) for (x,y) in kwargs.items() if x.startswith('keyvar_')])
+        
+        self.keyvar = Field(keyvar_type, keyvar_name, **kv_kwargs)
 
         for f in fields:
             # (name, enum, type)
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/idl.txt
--- a/tools/libxl/idl.txt	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/idl.txt	Thu Mar 01 12:31:15 2012 +0000
@@ -44,6 +44,22 @@
  Indicates if the above named Type.dispose_fn should be
  autogenerated.
 
+Type.init_val: (default: None)
+
+ C expression for the value to initialise instances of this type to.
+
+ If present takes precendence over init_fn (see below).
+
+Type.init_fn: (default: typename + "_init" if dir in [IN, BOTH] and
+                        type != None)
+
+ The name of the C function which will initialist Type.
+
+Type.autogenerate_init_fn: (default: True if dir in [IN, BOTH])
+
+ Indicates if the above named Type.init_fn should be
+ autogenerated.
+
 Type.json_fn: (default: typename + "_gen_json" or None if type == None)
 
  The name of the C function which will generate a YAJL data structure
@@ -105,10 +121,13 @@
 
  Each field has the following properties:
 
-  Field.type    The type of the member (a idl.Type).
-  Field.name    The name of the member (can be None for anonymous
-                fields).
-  Field.const   Boolean, true if the member is const.
+  Field.type     The type of the member (a idl.Type).
+  Field.name     The name of the member (can be None for anonymous
+                 fields).
+  Field.const    Boolean, true if the member is const.
+  Field.init_val The initialisation value for this field. Takes
+                 precendence over both Field.type.init_val and
+                 Field.type.init_fn.
 
 idl.Struct
 
@@ -128,10 +147,9 @@
  where the currently valid member of the union can be determined based
  upon another member in the containing type.
 
- The KeyedUnion.keyvar_name must contain the name of the member of the
+ The KeyedUnion.keyvar contains an idl.type the member of the
  containing type which determines the valid member of the union. The
- member referenced by KeyedUnion.keyvar_name has type
- KeyedUnion.keyvar_type which must be an instance of the Enumeration type.
+ must be an instance of the Enumeration type.
 
 Standard Types
 --------------
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:31:15 2012 +0000
@@ -184,6 +184,47 @@
     free(kvl);
 }
 
+#define LIBXL__DEFBOOL_DEFAULT (0)
+#define LIBXL__DEFBOOL_FALSE (-1)
+#define LIBXL__DEFBOOL_TRUE (1)
+
+void libxl_defbool_set(libxl_defbool *db, bool b)
+{
+    db->val = b ? LIBXL__DEFBOOL_TRUE : LIBXL__DEFBOOL_FALSE;
+}
+
+void libxl_defbool_unset(libxl_defbool *db)
+{
+    db->val = LIBXL__DEFBOOL_DEFAULT;
+}
+
+bool libxl_defbool_is_default(libxl_defbool db)
+{
+    return !db.val;
+}
+
+void libxl_defbool_setdefault(libxl_defbool *db, bool b)
+{
+    if (libxl_defbool_is_default(*db))
+        libxl_defbool_set(db, b);
+}
+
+bool libxl_defbool_val(libxl_defbool db)
+{
+    assert(!libxl_defbool_is_default(db));
+    return db.val > 0;
+}
+
+const char *libxl_defbool_to_string(libxl_defbool b)
+{
+    if (b.val < 0)
+        return "False";
+    else if (b.val > 0)
+        return "True";
+    else
+        return "<default>";
+}
+
 /******************************************************************************/
 
 
@@ -442,6 +483,7 @@
     ret = xc_domain_getinfolist(ctx->xch, 0, 1024, info);
     if (ret<0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting domain info list");
+        free(ptr);
         return NULL;
     }
 
@@ -464,7 +506,8 @@
     }
     if (ret==0 || xcinfo.domain != domid) return ERROR_INVAL;
 
-    xcinfo2xlinfo(&xcinfo, info_r);
+    if (info_r)
+        xcinfo2xlinfo(&xcinfo, info_r);
     return 0;
 }
 
@@ -491,7 +534,7 @@
         }
         ptr = tmp;
         ptr[i].poolid = info->cpupool_id;
-        ptr[i].sched_id = info->sched_id;
+        ptr[i].sched = info->sched_id;
         ptr[i].n_dom = info->n_dom;
         if (libxl_cpumap_alloc(ctx, &ptr[i].cpumap)) {
             xc_cpupool_infofree(ctx->xch, info);
@@ -986,13 +1029,12 @@
 int libxl_domain_destroy(libxl_ctx *ctx, uint32_t domid)
 {
     GC_INIT(ctx);
-    libxl_dominfo dominfo;
     char *dom_path;
     char *vm_path;
     char *pid;
     int rc, dm_present;
 
-    rc = libxl_domain_info(ctx, &dominfo, domid);
+    rc = libxl_domain_info(ctx, NULL, domid);
     switch(rc) {
     case 0:
         break;
@@ -1185,10 +1227,14 @@
 
 /******************************************************************************/
 
-int libxl_device_disk_init(libxl_ctx *ctx, libxl_device_disk *disk)
+int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
 {
-    memset(disk, 0x00, sizeof(libxl_device_disk));
-    return 0;
+    int rc;
+
+    rc = libxl__device_disk_set_backend(gc, disk);
+    if (rc) return rc;
+
+    return rc;
 }
 
 static int libxl__device_from_disk(libxl__gc *gc, uint32_t domid,
@@ -1240,10 +1286,7 @@
     libxl__device device;
     int major, minor, rc;
 
-    rc = libxl__device_disk_set_backend(gc, disk);
-    if (rc) goto out;
-
-    rc = libxl__device_disk_set_backend(gc, disk);
+    rc = libxl__device_disk_setdefault(gc, disk);
     if (rc) goto out;
 
     front = flexarray_make(16, 1);
@@ -1395,7 +1438,7 @@
     unsigned int len;
     char *tmp;
 
-    libxl_device_disk_init(ctx, disk);
+    libxl_device_disk_init(disk);
 
     tmp = xs_read(ctx->xsh, XBT_NULL,
                   libxl__sprintf(gc, "%s/params", be_path), &len);
@@ -1439,7 +1482,7 @@
     char *dompath, *path;
     int rc = ERROR_FAIL;
 
-    libxl_device_disk_init(ctx, disk);
+    libxl_device_disk_init(disk);
 
     dompath = libxl__xs_get_dompath(gc, domid);
     if (!dompath) {
@@ -1603,7 +1646,7 @@
     char *ret = NULL;
     int rc;
 
-    rc = libxl__device_disk_set_backend(gc, disk);
+    rc = libxl__device_disk_setdefault(gc, disk);
     if (rc) goto out;
 
     switch (disk->backend) {
@@ -1670,32 +1713,39 @@
 }
 
 /******************************************************************************/
-int libxl_device_nic_init(libxl_ctx *ctx, libxl_device_nic *nic)
+
+int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic)
 {
-    const uint8_t *r;
-    libxl_uuid uuid;
-
-    libxl_uuid_generate(&uuid);
-    r = libxl_uuid_bytearray(&uuid);
-    memset(nic, '\0', sizeof(*nic));
-
-    nic->backend_domid = 0;
-    nic->devid = -1;
-    nic->mtu = 1492;
-    nic->model = strdup("rtl8139");
-    nic->mac[0] = 0x00;
-    nic->mac[1] = 0x16;
-    nic->mac[2] = 0x3e;
-    nic->mac[3] = r[0] & 0x7f;
-    nic->mac[4] = r[1];
-    nic->mac[5] = r[2];
-    nic->ifname = NULL;
-    nic->bridge = strdup("xenbr0");
-    nic->ip = NULL;
-    if ( asprintf(&nic->script, "%s/vif-bridge",
-               libxl_xen_script_dir_path()) < 0 )
+    if (!nic->mtu)
+        nic->mtu = 1492;
+    if (!nic->model) {
+        nic->model = strdup("rtl8139");
+        if (!nic->model) return ERROR_NOMEM;
+    }
+    if (!nic->mac[0] && !nic->mac[1] && !nic->mac[2] &&
+        !nic->mac[3] && !nic->mac[4] && !nic->mac[5]) {
+        const uint8_t *r;
+        libxl_uuid uuid;
+
+        libxl_uuid_generate(&uuid);
+        r = libxl_uuid_bytearray(&uuid);
+
+        nic->mac[0] = 0x00;
+        nic->mac[1] = 0x16;
+        nic->mac[2] = 0x3e;
+        nic->mac[3] = r[0] & 0x7f;
+        nic->mac[4] = r[1];
+        nic->mac[5] = r[2];
+    }
+    if (!nic->bridge) {
+        nic->bridge = strdup("xenbr0");
+        if (!nic->bridge) return ERROR_NOMEM;
+    }
+    if ( !nic->script && asprintf(&nic->script, "%s/vif-bridge",
+                                  libxl_xen_script_dir_path()) < 0 )
         return ERROR_FAIL;
-    nic->nictype = LIBXL_NIC_TYPE_IOEMU;
+    if (!nic->nictype)
+        nic->nictype = LIBXL_NIC_TYPE_IOEMU;
     return 0;
 }
 
@@ -1722,6 +1772,9 @@
     char *dompath, **l;
     unsigned int nb, rc;
 
+    rc = libxl__device_nic_setdefault(gc, nic);
+    if (rc) goto out;
+
     front = flexarray_make(16, 1);
     if (!front) {
         rc = ERROR_NOMEM;
@@ -2002,7 +2055,7 @@
 
 /******************************************************************************/
 int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
-                              libxl_device_console *console,
+                              libxl__device_console *console,
                               libxl__domain_build_state *state)
 {
     flexarray_t *front;
@@ -2049,7 +2102,7 @@
     flexarray_append(front, "limit");
     flexarray_append(front, libxl__sprintf(gc, "%d", LIBXL_XENCONSOLE_LIMIT));
     flexarray_append(front, "type");
-    if (console->consback == LIBXL_CONSOLE_BACKEND_XENCONSOLED)
+    if (console->consback == LIBXL__CONSOLE_BACKEND_XENCONSOLED)
         flexarray_append(front, "xenconsoled");
     else
         flexarray_append(front, "ioemu");
@@ -2080,9 +2133,9 @@
 }
 
 /******************************************************************************/
-int libxl_device_vkb_init(libxl_ctx *ctx, libxl_device_vkb *vkb)
+
+int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb)
 {
-    memset(vkb, 0x00, sizeof(libxl_device_vkb));
     return 0;
 }
 
@@ -2108,6 +2161,9 @@
     libxl__device device;
     int rc;
 
+    rc = libxl__device_vkb_setdefault(gc, vkb);
+    if (rc) goto out;
+
     front = flexarray_make(16, 1);
     if (!front) {
         rc = ERROR_NOMEM;
@@ -2185,19 +2241,24 @@
 }
 
 /******************************************************************************/
-int libxl_device_vfb_init(libxl_ctx *ctx, libxl_device_vfb *vfb)
+
+int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb)
 {
-    memset(vfb, 0x00, sizeof(libxl_device_vfb));
-    vfb->vnc.enable = 1;
-    vfb->vnc.passwd = NULL;
-    vfb->vnc.listen = strdup("127.0.0.1");
-    vfb->vnc.display = 0;
-    vfb->vnc.findunused = 1;
-    vfb->keymap = NULL;
-    vfb->sdl.enable = 0;
-    vfb->sdl.opengl = 0;
-    vfb->sdl.display = NULL;
-    vfb->sdl.xauthority = NULL;
+    libxl_defbool_setdefault(&vfb->vnc.enable, true);
+    if (libxl_defbool_val(vfb->vnc.enable)) {
+        if (!vfb->vnc.listen) {
+            vfb->vnc.listen = strdup("127.0.0.1");
+            if (!vfb->vnc.listen) return ERROR_NOMEM;
+        }
+
+        libxl_defbool_setdefault(&vfb->vnc.findunused, true);
+    }
+
+    libxl_defbool_setdefault(&vfb->sdl.enable, false);
+    if (libxl_defbool_val(vfb->sdl.enable)) {
+        libxl_defbool_setdefault(&vfb->sdl.opengl, false);
+    }
+
     return 0;
 }
 
@@ -2222,6 +2283,9 @@
     libxl__device device;
     int rc;
 
+    rc = libxl__device_vfb_setdefault(gc, vfb);
+    if (rc) goto out;
+
     front = flexarray_make(16, 1);
     if (!front) {
         rc = ERROR_NOMEM;
@@ -2241,17 +2305,17 @@
     flexarray_append_pair(back, "state", libxl__sprintf(gc, "%d", 1));
     flexarray_append_pair(back, "domain", libxl__domid_to_name(gc, domid));
     flexarray_append_pair(back, "vnc",
-                          libxl__sprintf(gc, "%d", vfb->vnc.enable));
+                          libxl_defbool_val(vfb->vnc.enable) ? "1" : "0");
     flexarray_append_pair(back, "vnclisten", vfb->vnc.listen);
     flexarray_append_pair(back, "vncpasswd", vfb->vnc.passwd);
     flexarray_append_pair(back, "vncdisplay",
                           libxl__sprintf(gc, "%d", vfb->vnc.display));
     flexarray_append_pair(back, "vncunused",
-                          libxl__sprintf(gc, "%d", vfb->vnc.findunused));
+                          libxl_defbool_val(vfb->vnc.findunused) ? "1" : "0");
     flexarray_append_pair(back, "sdl",
-                          libxl__sprintf(gc, "%d", vfb->sdl.enable));
+                          libxl_defbool_val(vfb->sdl.enable) ? "1" : "0");
     flexarray_append_pair(back, "opengl",
-                          libxl__sprintf(gc, "%d", vfb->sdl.opengl));
+                          libxl_defbool_val(vfb->sdl.opengl) ? "1" : "0");
     if (vfb->sdl.xauthority) {
         flexarray_append_pair(back, "xauthority", vfb->sdl.xauthority);
     }
@@ -2624,18 +2688,23 @@
                              uint32_t *need_memkb)
 {
     GC_INIT(ctx);
-    int rc = ERROR_INVAL;
+    int rc;
+
+    rc = libxl__domain_build_info_setdefault(gc, b_info);
+    if (rc) goto out;
+
     *need_memkb = b_info->target_memkb;
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         *need_memkb += b_info->shadow_memkb + LIBXL_HVM_EXTRA_MEMORY;
-        if (b_info->device_model_stubdomain)
+        if (libxl_defbool_val(b_info->device_model_stubdomain))
             *need_memkb += 32 * 1024;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         *need_memkb += b_info->shadow_memkb + LIBXL_PV_EXTRA_MEMORY;
         break;
     default:
+        rc = ERROR_INVAL;
         goto out;
     }
     if (*need_memkb % (2 * 1024))
@@ -2750,7 +2819,10 @@
     physinfo->sharing_used_frames = xc_sharing_used_frames(ctx->xch);
     physinfo->nr_nodes = xcphysinfo.nr_nodes;
     memcpy(physinfo->hw_cap,xcphysinfo.hw_cap, sizeof(physinfo->hw_cap));
-    physinfo->phys_cap = xcphysinfo.capabilities;
+
+    physinfo->cap_hvm = !!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_hvm);
+    physinfo->cap_hvm_directio =
+        !!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_hvm_directio);
 
     return 0;
 }
@@ -2961,14 +3033,11 @@
     return rc;
 }
 
-/*
- * returns one of the XEN_SCHEDULER_* constants from public/domctl.h
- */
-int libxl_get_sched_id(libxl_ctx *ctx)
+libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx)
 {
-    int sched, ret;
-
-    if ((ret = xc_sched_id(ctx->xch, &sched)) != 0) {
+    libxl_scheduler sched, ret;
+
+    if ((ret = xc_sched_id(ctx->xch, (int *)&sched)) != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list");
         return ERROR_FAIL;
     }
@@ -2981,6 +3050,8 @@
     struct xen_domctl_sched_credit sdom;
     int rc;
 
+    libxl_sched_credit_domain_init(scinfo);
+
     rc = xc_sched_credit_domain_get(ctx->xch, domid, &sdom);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain sched credit");
@@ -3040,6 +3111,8 @@
     struct xen_domctl_sched_credit2 sdom;
     int rc;
 
+    libxl_sched_credit2_domain_init(scinfo);
+
     rc = xc_sched_credit2_domain_get(ctx->xch, domid, &sdom);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
@@ -3097,6 +3170,8 @@
     uint16_t weight;
     int rc;
 
+    libxl_sched_sedf_domain_init(scinfo);
+
     rc = xc_sedf_domain_get(ctx->xch, domid, &period, &slice, &latency,
                             &extratime, &weight);
     if (rc != 0) {
@@ -3443,7 +3518,8 @@
     return 0;
 }
 
-int libxl_cpupool_create(libxl_ctx *ctx, const char *name, int schedid,
+int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
+                         libxl_scheduler sched,
                          libxl_cpumap cpumap, libxl_uuid *uuid,
                          uint32_t *poolid)
 {
@@ -3459,7 +3535,7 @@
         return ERROR_NOMEM;
     }
 
-    rc = xc_cpupool_create(ctx->xch, poolid, schedid);
+    rc = xc_cpupool_create(ctx->xch, poolid, sched);
     if (rc) {
         LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
            "Could not create cpupool");
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:31:15 2012 +0000
@@ -124,6 +124,50 @@
  * Therefore public functions which initialize a libxl__gc MUST call
  * libxl__free_all() before returning.
  */
+/*
+ * libxl types
+ *
+ * Most libxl types are defined by the libxl IDL (see
+ * libxl_types.idl). The library provides a common set of methods for
+ * initialising and freeing these types.
+ *
+ * void libxl_<type>_init(<type> *p):
+ *
+ *    Initialises the members of "p" to all defaults. These may either
+ *    be special value which indicates to the library that it should
+ *    select an appropriate default when using this field or actual
+ *    default values.
+ *
+ *    Some fields within a data type (e.g. unions) cannot be sensibly
+ *    initialised without further information. In these cases a
+ *    separate subfield initialisation function is provided (see
+ *    below).
+ *
+ *    An instance which has been initialised using this method can
+ *    always be safely passed to the dispose function (see
+ *    below). This is true even if the data type contains fields which
+ *    require a separate call to a subfield initialisation function.
+ *
+ *    This method is provided for any aggregate type which is used as
+ *    an input parameter.
+ *
+ * void libxl_<type>_init_<subfield>(<type> *p, subfield):
+ *
+ *    Initialise those parts of "p" which are not initialised by the
+ *    main init function due to the unknown value of "subfield". Sets
+ *    p->subfield as well as initialising any fields to their default
+ *    values.
+ *
+ *    p->subfield must not have been previously initialised.
+ *
+ *    This method is provided for any aggregate type.
+ *
+ * void libxl_<type>_dispose(instance *p):
+ *
+ *    Frees any dynamically allocated memory used by the members of
+ *    "p" but not the storage used by "p" itself (this allows for the
+ *    allocation of arrays of types and for the composition of types).
+ */
 #ifndef LIBXL_H
 #define LIBXL_H
 
@@ -137,9 +181,6 @@
 
 #include <xentoollog.h>
 
-#include <xen/sched.h>
-#include <xen/sysctl.h>
-
 #include <libxl_uuid.h>
 #include <_libxl_list.h>
 
@@ -202,9 +243,34 @@
 struct libxl_event;
 typedef LIBXL_TAILQ_ENTRY(struct libxl_event) libxl_ev_link;
 
+/*
+ * A boolean variable with an explicit default state.
+ *
+ * Users should treat this struct as opaque and use the following
+ * defined macros and accessor functions.
+ *
+ * To allow users of the library to naively select all defaults this
+ * state is represented as 0. False is < 0 and True is > 0.
+ */
+typedef struct {
+    int val;
+} libxl_defbool;
+
+void libxl_defbool_set(libxl_defbool *db, bool b);
+/* Resets to default */
+void libxl_defbool_unset(libxl_defbool *db);
+/* Sets db only if it is currently == default */
+void libxl_defbool_setdefault(libxl_defbool *db, bool b);
+bool libxl_defbool_is_default(libxl_defbool db);
+/* db must not be == default */
+bool libxl_defbool_val(libxl_defbool db);
+
+const char *libxl_defbool_to_string(libxl_defbool b);
+
 typedef struct libxl__ctx libxl_ctx;
 
-#define LIBXL_TIMER_MODE_DEFAULT LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS
+#define LIBXL_TIMER_MODE_DEFAULT -1
+#define LIBXL_MEMKB_DEFAULT ~0ULL
 
 #include "_libxl_types.h"
 
@@ -315,10 +381,6 @@
 int libxl_ctx_postfork(libxl_ctx *ctx);
 
 /* domain related functions */
-int libxl_init_create_info(libxl_ctx *ctx, libxl_domain_create_info *c_info);
-int libxl_init_build_info(libxl_ctx *ctx,
-                          libxl_domain_build_info *b_info,
-                          libxl_domain_create_info *c_info);
 typedef int (*libxl_console_ready)(libxl_ctx *ctx, uint32_t domid, void *priv);
 int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid);
 int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid, int restore_fd);
@@ -390,11 +452,14 @@
  * guests using pygrub. */
 int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm);
 
+/* May be called with info_r == NULL to check for domain's existance */
 int libxl_domain_info(libxl_ctx*, libxl_dominfo *info_r,
                       uint32_t domid);
 libxl_dominfo * libxl_list_domain(libxl_ctx*, int *nb_domain);
+void libxl_dominfo_list_free(libxl_dominfo *list, int nr);
 libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx*, int *nb_pool);
 libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm);
+void libxl_vminfo_list_free(libxl_vminfo *list, int nr);
 
 /*
  * Devices
@@ -405,8 +470,9 @@
  * additional data type libxl_device_<TYPE>_getinfo which contains
  * further runtime information about the device.
  *
- * A common set of methods are available for each device type. These
- * are described below.
+ * In addition to the general methods available for libxl types (see
+ * "libxl types" above) a common set of methods are available for each
+ * device type. These are described below.
  *
  * Querying
  * --------
@@ -424,10 +490,6 @@
  * Creation / Control
  * ------------------
  *
- * libxl_device_<type>_init(ctx, device):
- *
- *    Initalises device to a default configuration.
- *
  * libxl_device_<type>_add(ctx, domid, device):
  *
  *   Adds the given device to the specified domain. This can be called
@@ -457,7 +519,6 @@
  */
 
 /* Disks */
-int libxl_device_disk_init(libxl_ctx *ctx, libxl_device_disk *disk);
 int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk);
 int libxl_device_disk_remove(libxl_ctx *ctx, uint32_t domid,
                              libxl_device_disk *disk,
@@ -483,7 +544,6 @@
 int libxl_device_disk_local_detach(libxl_ctx *ctx, libxl_device_disk *disk);
 
 /* Network Interfaces */
-int libxl_device_nic_init(libxl_ctx *ctx, libxl_device_nic *nic);
 int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic);
 int libxl_device_nic_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_nic *nic,
@@ -495,7 +555,6 @@
                               libxl_device_nic *nic, libxl_nicinfo *nicinfo);
 
 /* Keyboard */
-int libxl_device_vkb_init(libxl_ctx *ctx, libxl_device_vkb *vkb);
 int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
 int libxl_device_vkb_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_vkb *vkb,
@@ -503,7 +562,6 @@
 int libxl_device_vkb_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
 
 /* Framebuffer */
-int libxl_device_vfb_init(libxl_ctx *ctx, libxl_device_vfb *vfb);
 int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb);
 int libxl_device_vfb_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_vfb *vfb,
@@ -511,7 +569,6 @@
 int libxl_device_vfb_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb);
 
 /* PCI Passthrough */
-int libxl_device_pci_init(libxl_ctx *ctx, libxl_device_pci *pci);
 int libxl_device_pci_add(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
 int libxl_device_pci_remove(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
 int libxl_device_pci_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
@@ -584,7 +641,7 @@
                                unsigned int max_vcpus, libxl_cpumap *cpumap);
 int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_cpumap *cpumap);
 
-int libxl_get_sched_id(libxl_ctx *ctx);
+libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx);
 
 
 int libxl_sched_credit_domain_get(libxl_ctx *ctx, uint32_t domid,
@@ -627,7 +684,8 @@
 int libxl_tmem_freeable(libxl_ctx *ctx);
 
 int libxl_get_freecpus(libxl_ctx *ctx, libxl_cpumap *cpumap);
-int libxl_cpupool_create(libxl_ctx *ctx, const char *name, int schedid,
+int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
+                         libxl_scheduler sched,
                          libxl_cpumap cpumap, libxl_uuid *uuid,
                          uint32_t *poolid);
 int libxl_cpupool_destroy(libxl_ctx *ctx, uint32_t poolid);
@@ -638,12 +696,7 @@
 int libxl_cpupool_cpuremove_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus);
 int libxl_cpupool_movedomain(libxl_ctx *ctx, uint32_t poolid, uint32_t domid);
 
-static inline int libxl_domid_valid_guest(uint32_t domid)
-{
-    /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
-     * does not check whether the domain actually exists */
-    return domid > 0 && domid < DOMID_FIRST_RESERVED;
-}
+int libxl_domid_valid_guest(uint32_t domid);
 
 int libxl_flask_context_to_sid(libxl_ctx *ctx, char *buf, size_t len,
                                uint32_t *ssidref);
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_bootloader.c	Thu Mar 01 12:31:15 2012 +0000
@@ -346,9 +346,15 @@
 
     struct stat st_buf;
 
+    rc = libxl__domain_build_info_setdefault(gc, info);
+    if (rc) goto out;
+
     if (info->type != LIBXL_DOMAIN_TYPE_PV || !info->u.pv.bootloader)
         goto out;
 
+    rc = libxl__domain_build_info_setdefault(gc, info);
+    if (rc) goto out;
+
     rc = ERROR_INVAL;
     if (!disk)
         goto out;
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:31:15 2012 +0000
@@ -50,79 +50,141 @@
     libxl_domain_build_info_dispose(&d_config->b_info);
 }
 
-int libxl_init_create_info(libxl_ctx *ctx, libxl_domain_create_info *c_info)
+int libxl__domain_create_info_setdefault(libxl__gc *gc,
+                                         libxl_domain_create_info *c_info)
 {
-    memset(c_info, '\0', sizeof(*c_info));
-    c_info->xsdata = NULL;
-    c_info->platformdata = NULL;
-    c_info->hap = 1;
-    c_info->type = LIBXL_DOMAIN_TYPE_HVM;
-    c_info->oos = 1;
-    c_info->ssidref = 0;
-    c_info->poolid = 0;
+    if (!c_info->type)
+        return ERROR_INVAL;
+
+    if (c_info->type == LIBXL_DOMAIN_TYPE_HVM) {
+        libxl_defbool_setdefault(&c_info->hap, true);
+        libxl_defbool_setdefault(&c_info->oos, true);
+    }
+
     return 0;
 }
 
-int libxl_init_build_info(libxl_ctx *ctx,
-                          libxl_domain_build_info *b_info,
-                          libxl_domain_create_info *c_info)
+int libxl__domain_build_info_setdefault(libxl__gc *gc,
+                                        libxl_domain_build_info *b_info)
 {
-    memset(b_info, '\0', sizeof(*b_info));
-    b_info->max_vcpus = 1;
-    b_info->cur_vcpus = 1;
-    if (libxl_cpumap_alloc(ctx, &b_info->cpumap))
-        return ERROR_NOMEM;
-    libxl_cpumap_set_any(&b_info->cpumap);
-    b_info->max_memkb = 32 * 1024;
-    b_info->target_memkb = b_info->max_memkb;
-    b_info->disable_migrate = 0;
-    b_info->cpuid = NULL;
-    b_info->shadow_memkb = 0;
-    b_info->type = c_info->type;
+    if (!b_info->device_model_version)
+        b_info->device_model_version =
+            LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
 
-    b_info->device_model_version =
-        LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
-    b_info->device_model_stubdomain = false;
-    b_info->device_model = NULL;
+    if (!b_info->u.hvm.bios)
+        switch (b_info->device_model_version) {
+        case 1: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_ROMBIOS; break;
+        case 2: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_SEABIOS; break;
+        default:return ERROR_INVAL;
+    }
+
+    /* Enforce BIOS<->Device Model version relationship */
+    switch (b_info->device_model_version) {
+    case 1:
+        if (b_info->u.hvm.bios != LIBXL_BIOS_TYPE_ROMBIOS)
+            return ERROR_INVAL;
+        break;
+    case 2:
+        if (b_info->u.hvm.bios == LIBXL_BIOS_TYPE_ROMBIOS)
+            return ERROR_INVAL;
+        break;
+    default:abort();
+    }
+
+    libxl_defbool_setdefault(&b_info->device_model_stubdomain, false);
+
+    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM &&
+        b_info->device_model_version !=
+            LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL &&
+        libxl_defbool_val(b_info->device_model_stubdomain)) {
+        LIBXL__LOG(CTX, XTL_ERROR,
+            "device model stubdomains require \"qemu-xen-traditional\"");
+        return ERROR_INVAL;
+    }
+
+    if (!b_info->max_vcpus)
+        b_info->max_vcpus = 1;
+    if (!b_info->cur_vcpus)
+        b_info->cur_vcpus = 1;
+
+    if (!b_info->cpumap.size) {
+        if (libxl_cpumap_alloc(CTX, &b_info->cpumap))
+            return ERROR_NOMEM;
+        libxl_cpumap_set_any(&b_info->cpumap);
+    }
+
+    if (b_info->max_memkb == LIBXL_MEMKB_DEFAULT)
+        b_info->max_memkb = 32 * 1024;
+    if (b_info->target_memkb == LIBXL_MEMKB_DEFAULT)
+        b_info->target_memkb = b_info->max_memkb;
+
+    libxl_defbool_setdefault(&b_info->disable_migrate, false);
 
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
-        b_info->video_memkb = 8 * 1024;
-        b_info->u.hvm.firmware = NULL;
-        b_info->u.hvm.bios = 0;
-        b_info->u.hvm.pae = 1;
-        b_info->u.hvm.apic = 1;
-        b_info->u.hvm.acpi = 1;
-        b_info->u.hvm.acpi_s3 = 1;
-        b_info->u.hvm.acpi_s4 = 1;
-        b_info->u.hvm.nx = 1;
-        b_info->u.hvm.viridian = 0;
-        b_info->u.hvm.hpet = 1;
-        b_info->u.hvm.vpt_align = 1;
-        b_info->u.hvm.timer_mode = 1;
-        b_info->u.hvm.nested_hvm = 0;
-        b_info->u.hvm.no_incr_generationid = 0;
+        if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->shadow_memkb = 0;
+        if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->video_memkb = 8 * 1024;
+        if (b_info->u.hvm.timer_mode == LIBXL_TIMER_MODE_DEFAULT)
+            b_info->u.hvm.timer_mode =
+                LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS;
 
-        b_info->u.hvm.stdvga = 0;
-        b_info->u.hvm.vnc.enable = 1;
-        b_info->u.hvm.vnc.listen = strdup("127.0.0.1");
-        b_info->u.hvm.vnc.display = 0;
-        b_info->u.hvm.vnc.findunused = 1;
-        b_info->u.hvm.keymap = NULL;
-        b_info->u.hvm.sdl.enable = 0;
-        b_info->u.hvm.sdl.opengl = 0;
-        b_info->u.hvm.nographic = 0;
-        b_info->u.hvm.serial = NULL;
-        b_info->u.hvm.boot = strdup("cda");
-        b_info->u.hvm.usb = 0;
-        b_info->u.hvm.usbdevice = NULL;
-        b_info->u.hvm.xen_platform_pci = 1;
+        libxl_defbool_setdefault(&b_info->u.hvm.pae,                true);
+        libxl_defbool_setdefault(&b_info->u.hvm.apic,               true);
+        libxl_defbool_setdefault(&b_info->u.hvm.acpi,               true);
+        libxl_defbool_setdefault(&b_info->u.hvm.acpi_s3,            true);
+        libxl_defbool_setdefault(&b_info->u.hvm.acpi_s4,            true);
+        libxl_defbool_setdefault(&b_info->u.hvm.nx,                 true);
+        libxl_defbool_setdefault(&b_info->u.hvm.viridian,           false);
+        libxl_defbool_setdefault(&b_info->u.hvm.hpet,               true);
+        libxl_defbool_setdefault(&b_info->u.hvm.vpt_align,          true);
+        libxl_defbool_setdefault(&b_info->u.hvm.nested_hvm,         false);
+        libxl_defbool_setdefault(&b_info->u.hvm.incr_generationid,  false);
+        libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
+        libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
+
+        if (!b_info->u.hvm.boot) {
+            b_info->u.hvm.boot = strdup("cda");
+            if (!b_info->u.hvm.boot) return ERROR_NOMEM;
+        }
+
+        libxl_defbool_setdefault(&b_info->u.hvm.stdvga, false);
+        libxl_defbool_setdefault(&b_info->u.hvm.vnc.enable, true);
+        if (libxl_defbool_val(b_info->u.hvm.vnc.enable)) {
+            libxl_defbool_setdefault(&b_info->u.hvm.vnc.findunused, true);
+            if (!b_info->u.hvm.vnc.listen) {
+                b_info->u.hvm.vnc.listen = strdup("127.0.0.1");
+                if (!b_info->u.hvm.vnc.listen) return ERROR_NOMEM;
+            }
+        }
+
+        libxl_defbool_setdefault(&b_info->u.hvm.sdl.enable, false);
+        if (libxl_defbool_val(b_info->u.hvm.sdl.enable)) {
+            libxl_defbool_setdefault(&b_info->u.hvm.sdl.opengl, false);
+        }
+
+        libxl_defbool_setdefault(&b_info->u.hvm.spice.enable, false);
+        if (libxl_defbool_val(b_info->u.hvm.spice.enable)) {
+            libxl_defbool_setdefault(&b_info->u.hvm.spice.disable_ticketing,
+                                     false);
+            libxl_defbool_setdefault(&b_info->u.hvm.spice.agent_mouse, true);
+        }
+
+        libxl_defbool_setdefault(&b_info->u.hvm.nographic, false);
+
+        libxl_defbool_setdefault(&b_info->u.hvm.gfx_passthru, false);
+
         break;
     case LIBXL_DOMAIN_TYPE_PV:
-        b_info->u.pv.slack_memkb = 8 * 1024;
+        libxl_defbool_setdefault(&b_info->u.pv.e820_host, false);
+        if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->shadow_memkb = 0;
+        if (b_info->u.pv.slack_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->u.pv.slack_memkb = 0;
         break;
     default:
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+        LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
                    "invalid domain type %s in create info",
                    libxl_domain_type_to_string(b_info->type));
         return ERROR_INVAL;
@@ -130,17 +192,16 @@
     return 0;
 }
 
-static int init_console_info(libxl_device_console *console, int dev_num)
+static int init_console_info(libxl__device_console *console, int dev_num)
 {
-    memset(console, 0x00, sizeof(libxl_device_console));
+    memset(console, 0x00, sizeof(libxl__device_console));
     console->devid = dev_num;
-    console->consback = LIBXL_CONSOLE_BACKEND_XENCONSOLED;
+    console->consback = LIBXL__CONSOLE_BACKEND_XENCONSOLED;
     console->output = strdup("pty");
-    if ( NULL == console->output )
+    if (!console->output)
         return ERROR_NOMEM;
     return 0;
 }
-
 int libxl__domain_build(libxl__gc *gc,
                         libxl_domain_build_info *info,
                         uint32_t domid,
@@ -172,11 +233,11 @@
 
         localents = libxl__calloc(gc, 7, sizeof(char *));
         localents[0] = "platform/acpi";
-        localents[1] = (info->u.hvm.acpi) ? "1" : "0";
+        localents[1] = libxl_defbool_val(info->u.hvm.acpi) ? "1" : "0";
         localents[2] = "platform/acpi_s3";
-        localents[3] = (info->u.hvm.acpi_s3) ? "1" : "0";
+        localents[3] = libxl_defbool_val(info->u.hvm.acpi_s3) ? "1" : "0";
         localents[4] = "platform/acpi_s4";
-        localents[5] = (info->u.hvm.acpi_s4) ? "1" : "0";
+        localents[5] = libxl_defbool_val(info->u.hvm.acpi_s4) ? "1" : "0";
 
         break;
     case LIBXL_DOMAIN_TYPE_PV:
@@ -320,8 +381,8 @@
     flags = 0;
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
         flags |= XEN_DOMCTL_CDF_hvm_guest;
-        flags |= info->hap ? XEN_DOMCTL_CDF_hap : 0;
-        flags |= info->oos ? 0 : XEN_DOMCTL_CDF_oos_off;
+        flags |= libxl_defbool_val(info->hap) ? XEN_DOMCTL_CDF_hap : 0;
+        flags |= libxl_defbool_val(info->oos) ? 0 : XEN_DOMCTL_CDF_oos_off;
     }
     *domid = -1;
 
@@ -378,7 +439,6 @@
     xs_rm(ctx->xsh, t, dom_path);
     libxl__xs_mkdir(gc, t, dom_path, roperm, ARRAY_SIZE(roperm));
 
-
     xs_rm(ctx->xsh, t, vm_path);
     libxl__xs_mkdir(gc, t, vm_path, roperm, ARRAY_SIZE(roperm));
 
@@ -470,6 +530,12 @@
 
     domid = 0;
 
+    ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info);
+    if (ret) goto error_out;
+
+    ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info);
+    if (ret) goto error_out;
+
     ret = libxl__domain_make(gc, &d_config->c_info, &domid);
     if (ret) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot make domain: %d", ret);
@@ -482,9 +548,11 @@
             goto error_out;
     }
 
+    ret = libxl__domain_build_info_setdefault(gc, &d_config->b_info);
+    if (ret) goto error_out;
 
     for (i = 0; i < d_config->num_disks; i++) {
-        ret = libxl__device_disk_set_backend(gc, &d_config->disks[i]);
+        ret = libxl__device_disk_setdefault(gc, &d_config->disks[i]);
         if (ret) goto error_out;
     }
 
@@ -534,18 +602,16 @@
     switch (d_config->c_info.type) {
     case LIBXL_DOMAIN_TYPE_HVM:
     {
-        libxl_device_console console;
+        libxl__device_console console;
         libxl_device_vkb vkb;
 
         ret = init_console_info(&console, 0);
         if ( ret )
             goto error_out;
         libxl__device_console_add(gc, domid, &console, &state);
-        libxl_device_console_dispose(&console);
+        libxl__device_console_dispose(&console);
 
-        ret = libxl_device_vkb_init(ctx, &vkb);
-        if ( ret )
-            goto error_out;
+        libxl_device_vkb_init(&vkb);
         libxl_device_vkb_add(ctx, domid, &vkb);
         libxl_device_vkb_dispose(&vkb);
 
@@ -561,7 +627,7 @@
     case LIBXL_DOMAIN_TYPE_PV:
     {
         int need_qemu = 0;
-        libxl_device_console console;
+        libxl__device_console console;
 
         for (i = 0; i < d_config->num_vfbs; i++) {
             libxl_device_vfb_add(ctx, domid, &d_config->vfbs[i]);
@@ -577,10 +643,10 @@
                 d_config->num_disks, &d_config->disks[0]);
 
         if (need_qemu)
-             console.consback = LIBXL_CONSOLE_BACKEND_IOEMU;
+             console.consback = LIBXL__CONSOLE_BACKEND_IOEMU;
 
         libxl__device_console_add(gc, domid, &console, &state);
-        libxl_device_console_dispose(&console);
+        libxl__device_console_dispose(&console);
 
         if (need_qemu) {
             libxl__create_xenpv_qemu(gc, domid, d_config, &state, &dm_starting);
@@ -619,7 +685,7 @@
     }
 
     if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV &&
-        d_config->b_info.u.pv.e820_host) {
+        libxl_defbool_val(d_config->b_info.u.pv.e820_host)) {
         int rc;
         rc = libxl__e820_alloc(gc, domid, d_config);
         if (rc)
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:31:15 2012 +0000
@@ -39,7 +39,7 @@
     libxl_ctx *ctx = libxl__gc_owner(gc);
     const char *dm;
 
-    if (info->device_model_stubdomain)
+    if (libxl_defbool_val(info->device_model_stubdomain))
         return NULL;
 
     if (info->device_model) {
@@ -63,18 +63,6 @@
     return dm;
 }
 
-static const char *libxl__domain_bios(libxl__gc *gc,
-                                const libxl_domain_build_info *info)
-{
-    if (info->u.hvm.bios)
-       return libxl_bios_type_to_string(info->u.hvm.bios);
-    switch (info->device_model_version) {
-    case 1: return "rombios";
-    case 2: return "seabios";
-    default:return NULL;
-    }
-}
-
 const libxl_vnc_info *libxl__dm_vnc(const libxl_domain_config *guest_config)
 {
     const libxl_vnc_info *vnc = NULL;
@@ -83,7 +71,7 @@
     } else if (guest_config->num_vfbs > 0) {
         vnc = &guest_config->vfbs[0].vnc;
     }
-    return vnc && vnc->enable ? vnc : NULL;
+    return vnc && libxl_defbool_val(vnc->enable) ? vnc : NULL;
 }
 
 static const libxl_sdl_info *dm_sdl(const libxl_domain_config *guest_config)
@@ -94,7 +82,7 @@
     } else if (guest_config->num_vfbs > 0) {
         sdl = &guest_config->vfbs[0].sdl;
     }
-    return sdl && sdl->enable ? sdl : NULL;
+    return sdl && libxl_defbool_val(sdl->enable) ? sdl : NULL;
 }
 
 static const char *dm_keymap(const libxl_domain_config *guest_config)
@@ -156,13 +144,13 @@
         flexarray_append(dm_args, "-vnc");
         flexarray_append(dm_args, vncarg);
 
-        if (vnc->findunused) {
+        if (libxl_defbool_val(vnc->findunused)) {
             flexarray_append(dm_args, "-vncunused");
         }
     }
     if (sdl) {
         flexarray_append(dm_args, "-sdl");
-        if (!sdl->opengl) {
+        if (!libxl_defbool_val(sdl->opengl)) {
             flexarray_append(dm_args, "-disable-opengl");
         }
         /* XXX sdl->{display,xauthority} into $DISPLAY/$XAUTHORITY */
@@ -177,7 +165,7 @@
             flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, NULL);
         }
 
-        if (b_info->u.hvm.nographic && (!sdl && !vnc)) {
+        if (libxl_defbool_val(b_info->u.hvm.nographic) && (!sdl && !vnc)) {
             flexarray_append(dm_args, "-nographic");
         }
 
@@ -187,14 +175,14 @@
                                    libxl__sizekb_to_mb(b_info->video_memkb)),
                     NULL);
         }
-        if (b_info->u.hvm.stdvga) {
+        if (libxl_defbool_val(b_info->u.hvm.stdvga)) {
             flexarray_append(dm_args, "-std-vga");
         }
 
         if (b_info->u.hvm.boot) {
             flexarray_vappend(dm_args, "-boot", b_info->u.hvm.boot, NULL);
         }
-        if (b_info->u.hvm.usb || b_info->u.hvm.usbdevice) {
+        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
@@ -204,7 +192,7 @@
         if (b_info->u.hvm.soundhw) {
             flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
         }
-        if (b_info->u.hvm.acpi) {
+        if (libxl_defbool_val(b_info->u.hvm.acpi)) {
             flexarray_append(dm_args, "-acpi");
         }
         if (b_info->max_vcpus > 1) {
@@ -240,7 +228,7 @@
         if ( ioemu_vifs == 0 ) {
             flexarray_vappend(dm_args, "-net", "none", NULL);
         }
-        if (b_info->u.hvm.gfx_passthru) {
+        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
             flexarray_append(dm_args, "-gfx_passthru");
         }
     } else {
@@ -293,7 +281,7 @@
         return NULL;
     }
 
-    if (!spice->disable_ticketing) {
+    if (!libxl_defbool_val(spice->disable_ticketing)) {
         if (!spice->passwd) {
             LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
                        "spice ticketing is enabled but missing password");
@@ -309,12 +297,12 @@
                          spice->port, spice->tls_port);
     if (spice->host)
         opt = libxl__sprintf(gc, "%s,addr=%s", opt, spice->host);
-    if (spice->disable_ticketing)
+    if (libxl_defbool_val(spice->disable_ticketing))
         opt = libxl__sprintf(gc, "%s,disable-ticketing", opt);
     else
         opt = libxl__sprintf(gc, "%s,password=%s", opt, spice->passwd);
     opt = libxl__sprintf(gc, "%s,agent-mouse=%s", opt,
-                         spice->agent_mouse ? "on" : "off");
+                         libxl_defbool_val(spice->agent_mouse) ? "on" : "off");
     return opt;
 }
 
@@ -383,7 +371,7 @@
         if (vnc->passwd && vnc->passwd[0]) {
             vncarg = libxl__sprintf(gc, "%s,password", vncarg);
         }
-        if (vnc->findunused) {
+        if (libxl_defbool_val(vnc->findunused)) {
             /* This option asks to QEMU to try this number of port before to
              * give up.  So QEMU will try ports between $display and $display +
              * 99.  This option needs to be the last one of the vnc options. */
@@ -411,11 +399,11 @@
             flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, NULL);
         }
 
-        if (b_info->u.hvm.nographic && (!sdl && !vnc)) {
+        if (libxl_defbool_val(b_info->u.hvm.nographic) && (!sdl && !vnc)) {
             flexarray_append(dm_args, "-nographic");
         }
 
-        if (b_info->u.hvm.spice.enable) {
+        if (libxl_defbool_val(b_info->u.hvm.spice.enable)) {
             const libxl_spice_info *spice = &b_info->u.hvm.spice;
             char *spiceoptions = dm_spice_options(gc, spice);
             if (!spiceoptions)
@@ -425,7 +413,7 @@
             flexarray_append(dm_args, spiceoptions);
         }
 
-        if (b_info->u.hvm.stdvga) {
+        if (libxl_defbool_val(b_info->u.hvm.stdvga)) {
                 flexarray_vappend(dm_args, "-vga", "std", NULL);
         }
 
@@ -433,7 +421,7 @@
             flexarray_vappend(dm_args, "-boot",
                     libxl__sprintf(gc, "order=%s", b_info->u.hvm.boot), NULL);
         }
-        if (b_info->u.hvm.usb || b_info->u.hvm.usbdevice) {
+        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
@@ -443,7 +431,7 @@
         if (b_info->u.hvm.soundhw) {
             flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
         }
-        if (!b_info->u.hvm.acpi) {
+        if (!libxl_defbool_val(b_info->u.hvm.acpi)) {
             flexarray_append(dm_args, "-no-acpi");
         }
         if (b_info->max_vcpus > 1) {
@@ -485,7 +473,7 @@
             flexarray_append(dm_args, "-net");
             flexarray_append(dm_args, "none");
         }
-        if (b_info->u.hvm.gfx_passthru) {
+        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
             flexarray_append(dm_args, "-gfx_passthru");
         }
     } else {
@@ -616,8 +604,8 @@
     if (b_info->type != LIBXL_DOMAIN_TYPE_HVM)
         return ERROR_INVAL;
 
-    memset(vfb, 0x00, sizeof(libxl_device_vfb));
-    memset(vkb, 0x00, sizeof(libxl_device_vkb));
+    libxl_device_vfb_init(vfb);
+    libxl_device_vkb_init(vkb);
 
     vfb->backend_domid = 0;
     vfb->devid = 0;
@@ -688,7 +676,7 @@
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     int i, num_console = STUBDOM_SPECIAL_CONSOLES, ret;
-    libxl_device_console *console;
+    libxl__device_console *console;
     libxl_domain_config dm_config;
     libxl_device_vfb vfb;
     libxl_device_vkb vkb;
@@ -705,7 +693,7 @@
         goto out;
     }
 
-    memset(&dm_config.c_info, 0x00, sizeof(libxl_domain_create_info));
+    libxl_domain_create_info_init(&dm_config.c_info);
     dm_config.c_info.type = LIBXL_DOMAIN_TYPE_PV;
     dm_config.c_info.name = libxl__sprintf(gc, "%s-dm",
                                     libxl__domid_to_name(gc, guest_domid));
@@ -713,13 +701,13 @@
 
     libxl_uuid_generate(&dm_config.c_info.uuid);
 
-    memset(&dm_config.b_info, 0x00, sizeof(libxl_domain_build_info));
-    dm_config.b_info.type = dm_config.c_info.type;
+    libxl_domain_build_info_init(&dm_config.b_info);
+    libxl_domain_build_info_init_type(&dm_config.b_info, LIBXL_DOMAIN_TYPE_PV);
+
     dm_config.b_info.max_vcpus = 1;
     dm_config.b_info.max_memkb = 32 * 1024;
     dm_config.b_info.target_memkb = dm_config.b_info.max_memkb;
 
-    dm_config.b_info.type = LIBXL_DOMAIN_TYPE_PV;
     dm_config.b_info.u.pv.kernel.path = libxl__abs_path(gc, "ioemu-stubdom.gz",
                                               libxl_xenfirmwaredir_path());
     dm_config.b_info.u.pv.cmdline = libxl__sprintf(gc, " -d %d", guest_domid);
@@ -740,6 +728,11 @@
     dm_config.vifs = guest_config->vifs;
     dm_config.num_vifs = guest_config->num_vifs;
 
+    ret = libxl__domain_create_info_setdefault(gc, &dm_config.c_info);
+    if (ret) goto out;
+    ret = libxl__domain_build_info_setdefault(gc, &dm_config.b_info);
+    if (ret) goto out;
+
     libxl__vfb_and_vkb_from_hvm_guest_config(gc, guest_config, &vfb, &vkb);
     dm_config.vfbs = &vfb;
     dm_config.num_vfbs = 1;
@@ -816,7 +809,7 @@
     if (guest_config->b_info.u.hvm.serial)
         num_console++;
 
-    console = libxl__calloc(gc, num_console, sizeof(libxl_device_console));
+    console = libxl__calloc(gc, num_console, sizeof(libxl__device_console));
     if (!console) {
         ret = ERROR_NOMEM;
         goto out_free;
@@ -824,7 +817,7 @@
 
     for (i = 0; i < num_console; i++) {
         console[i].devid = i;
-        console[i].consback = LIBXL_CONSOLE_BACKEND_IOEMU;
+        console[i].consback = LIBXL__CONSOLE_BACKEND_IOEMU;
         /* STUBDOM_CONSOLE_LOGGING (console 0) is for minios logging
          * STUBDOM_CONSOLE_SAVE (console 1) is for writing the save file
          * STUBDOM_CONSOLE_RESTORE (console 2) is for reading the save file
@@ -907,7 +900,7 @@
     char **pass_stuff;
     const char *dm;
 
-    if (b_info->device_model_stubdomain) {
+    if (libxl_defbool_val(b_info->device_model_stubdomain)) {
         rc = libxl__create_stubdom(gc, domid, guest_config, state, starting_r);
         goto out;
     }
@@ -929,10 +922,13 @@
         goto out;
     }
 
-    path = xs_get_domain_path(ctx->xsh, domid);
-    libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/hvmloader/bios", path),
-                    "%s", libxl__domain_bios(gc, b_info));
-    free(path);
+    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
+        path = xs_get_domain_path(ctx->xsh, domid);
+        libxl__xs_write(gc, XBT_NULL,
+                        libxl__sprintf(gc, "%s/hvmloader/bios", path),
+                        "%s", libxl_bios_type_to_string(b_info->u.hvm.bios));
+        free(path);
+    }
 
     path = libxl__sprintf(gc, "/local/domain/0/device-model/%d", domid);
     xs_mkdir(ctx->xsh, XBT_NULL, path);
@@ -941,7 +937,7 @@
         b_info->device_model_version
         == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL)
         libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/disable_pf", path),
-                        "%d", !b_info->u.hvm.xen_platform_pci);
+                    "%d", !libxl_defbool_val(b_info->u.hvm.xen_platform_pci));
 
     libxl_create_logfile(ctx,
                          libxl__sprintf(gc, "qemu-dm-%s", c_info->name),
@@ -1088,7 +1084,7 @@
 }
 
 int libxl__need_xenpv_qemu(libxl__gc *gc,
-        int nr_consoles, libxl_device_console *consoles,
+        int nr_consoles, libxl__device_console *consoles,
         int nr_vfbs, libxl_device_vfb *vfbs,
         int nr_disks, libxl_device_disk *disks)
 {
@@ -1100,7 +1096,7 @@
     }
 
     for (i = 0; i < nr_consoles; i++) {
-        if (consoles[i].consback == LIBXL_CONSOLE_BACKEND_IOEMU) {
+        if (consoles[i].consback == LIBXL__CONSOLE_BACKEND_IOEMU) {
             ret = 1;
             goto out;
         }
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_dom.c	Thu Mar 01 12:31:15 2012 +0000
@@ -88,7 +88,7 @@
         abort();
     }
     xc_domain_set_tsc_info(ctx->xch, domid, tsc_mode, 0, 0, 0);
-    if ( info->disable_migrate )
+    if (libxl_defbool_val(info->disable_migrate))
         xc_domain_disable_migrate(ctx->xch, domid);
 
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
@@ -129,11 +129,12 @@
 
     ents = libxl__calloc(gc, 12 + (info->max_vcpus * 2) + 2, sizeof(char *));
     ents[0] = "memory/static-max";
-    ents[1] = libxl__sprintf(gc, "%d", info->max_memkb);
+    ents[1] = libxl__sprintf(gc, "%"PRId64, info->max_memkb);
     ents[2] = "memory/target";
-    ents[3] = libxl__sprintf(gc, "%d", info->target_memkb - info->video_memkb);
+    ents[3] = libxl__sprintf(gc, "%"PRId64,
+                             info->target_memkb - info->video_memkb);
     ents[4] = "memory/videoram";
-    ents[5] = libxl__sprintf(gc, "%d", info->video_memkb);
+    ents[5] = libxl__sprintf(gc, "%"PRId64, info->video_memkb);
     ents[6] = "domid";
     ents[7] = libxl__sprintf(gc, "%d", domid);
     ents[8] = "store/port";
@@ -291,7 +292,7 @@
         return -1;
 
     va_hvm = (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET);
-    va_hvm->apic_mode = info->u.hvm.apic;
+    va_hvm->apic_mode = libxl_defbool_val(info->u.hvm.apic);
     va_hvm->nr_vcpus = info->max_vcpus;
     memcpy(va_hvm->vcpu_online, &info->cur_vcpus, sizeof(info->cur_vcpus));
     for (i = 0, sum = 0; i < va_hvm->length; i++)
@@ -301,14 +302,19 @@
 
     xc_get_hvm_param(handle, domid, HVM_PARAM_STORE_PFN, store_mfn);
     xc_get_hvm_param(handle, domid, HVM_PARAM_CONSOLE_PFN, console_mfn);
-    xc_set_hvm_param(handle, domid, HVM_PARAM_PAE_ENABLED, info->u.hvm.pae);
+    xc_set_hvm_param(handle, domid, HVM_PARAM_PAE_ENABLED,
+                     libxl_defbool_val(info->u.hvm.pae));
 #if defined(__i386__) || defined(__x86_64__)
-    xc_set_hvm_param(handle, domid, HVM_PARAM_VIRIDIAN, info->u.hvm.viridian);
-    xc_set_hvm_param(handle, domid, HVM_PARAM_HPET_ENABLED, (unsigned long) info->u.hvm.hpet);
+    xc_set_hvm_param(handle, domid, HVM_PARAM_VIRIDIAN,
+                     libxl_defbool_val(info->u.hvm.viridian));
+    xc_set_hvm_param(handle, domid, HVM_PARAM_HPET_ENABLED,
+                     libxl_defbool_val(info->u.hvm.hpet));
 #endif
     xc_set_hvm_param(handle, domid, HVM_PARAM_TIMER_MODE, timer_mode(info));
-    xc_set_hvm_param(handle, domid, HVM_PARAM_VPT_ALIGN, (unsigned long) info->u.hvm.vpt_align);
-    xc_set_hvm_param(handle, domid, HVM_PARAM_NESTEDHVM, info->u.hvm.nested_hvm);
+    xc_set_hvm_param(handle, domid, HVM_PARAM_VPT_ALIGN,
+                     libxl_defbool_val(info->u.hvm.vpt_align));
+    xc_set_hvm_param(handle, domid, HVM_PARAM_NESTEDHVM,
+                     libxl_defbool_val(info->u.hvm.nested_hvm));
     xc_set_hvm_param(handle, domid, HVM_PARAM_STORE_EVTCHN, store_evtchn);
     xc_set_hvm_param(handle, domid, HVM_PARAM_CONSOLE_EVTCHN, console_evtchn);
 
@@ -399,8 +405,8 @@
     case LIBXL_DOMAIN_TYPE_HVM:
         hvm = 1;
         superpages = 1;
-        pae = info->u.hvm.pae;
-        no_incr_generationid = info->u.hvm.no_incr_generationid;
+        pae = libxl_defbool_val(info->u.hvm.pae);
+        no_incr_generationid = !libxl_defbool_val(info->u.hvm.incr_generationid);
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         hvm = 0;
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:31:15 2012 +0000
@@ -187,6 +187,16 @@
  * version of the _evdisable_FOO function; the internal one is
  * used during cleanup.
  */
+_hidden int libxl__domain_create_info_setdefault(libxl__gc *gc,
+                                        libxl_domain_create_info *c_info);
+_hidden int libxl__domain_build_info_setdefault(libxl__gc *gc,
+                                        libxl_domain_build_info *b_info);
+_hidden int libxl__device_disk_setdefault(libxl__gc *gc,
+                                          libxl_device_disk *disk);
+_hidden int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic);
+_hidden int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb);
+_hidden int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb);
+_hidden int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci);
 
 struct libxl__evgen_domain_death {
     uint32_t domid;
@@ -652,7 +662,7 @@
                                           int *pdisk, int *ppartition);
 
 _hidden int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
-                                      libxl_device_console *console,
+                                      libxl__device_console *console,
                                       libxl__domain_build_state *state);
 
 _hidden int libxl__device_generic_add(libxl__gc *gc, libxl__device *device,
@@ -665,6 +675,19 @@
 _hidden int libxl__devices_destroy(libxl__gc *gc, uint32_t domid);
 _hidden int libxl__wait_for_backend(libxl__gc *gc, char *be_path, char *state);
 
+/*
+ * For each aggregate type which can be used as an input we provide:
+ *
+ * int libxl__<type>_setdefault(gc, <type> *p):
+ *
+ *     Idempotently sets any members of "p" which is currently set to
+ *     a special value indicating that the defaults should be used
+ *     (per libxl_<type>_init) to a specific value.
+ *
+ *     All libxl API functions are expected to have arranged for this
+ *     to be called before using any values within these structures.
+ */
+
 /* Arranges that dev will be removed from its guest.  When
  * this is done, the ao will be completed.  An error
  * return from libxl__initiate_device_remove means that the ao
@@ -882,7 +905,7 @@
                               libxl__domain_build_state *state,
                               libxl__spawner_starting **starting_r);
 _hidden int libxl__need_xenpv_qemu(libxl__gc *gc,
-        int nr_consoles, libxl_device_console *consoles,
+        int nr_consoles, libxl__device_console *consoles,
         int nr_vfbs, libxl_device_vfb *vfbs,
         int nr_disks, libxl_device_disk *disks);
   /* Caller must either: pass starting_r==0, or on successful
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_json.c	Thu Mar 01 12:31:15 2012 +0000
@@ -85,6 +85,12 @@
 /*
  * YAJL generators for builtin libxl types.
  */
+yajl_gen_status libxl_defbool_gen_json(yajl_gen hand,
+                                       libxl_defbool *db)
+{
+    return libxl__yajl_gen_asciiz(hand, libxl_defbool_to_string(*db));
+}
+
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand,
                                     libxl_uuid *uuid)
 {
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_json.h
--- a/tools/libxl/libxl_json.h	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_json.h	Thu Mar 01 12:31:15 2012 +0000
@@ -22,6 +22,20 @@
 #  include <yajl/yajl_version.h>
 #endif
 
+yajl_gen_status libxl_defbool_gen_json(yajl_gen hand, libxl_defbool *p);
+yajl_gen_status libxl_domid_gen_json(yajl_gen hand, libxl_domid *p);
+yajl_gen_status libxl_uuid_gen_json(yajl_gen hand, libxl_uuid *p);
+yajl_gen_status libxl_mac_gen_json(yajl_gen hand, libxl_mac *p);
+yajl_gen_status libxl_cpumap_gen_json(yajl_gen hand, libxl_cpumap *p);
+yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
+                                                 libxl_cpuid_policy_list *p);
+yajl_gen_status libxl_string_list_gen_json(yajl_gen hand, libxl_string_list *p);
+yajl_gen_status libxl_key_value_list_gen_json(yajl_gen hand,
+                                              libxl_key_value_list *p);
+yajl_gen_status libxl_file_reference_gen_json(yajl_gen hand,
+                                              libxl_file_reference *p);
+yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand, libxl_hwcap *p);
+
 #include <_libxl_types_json.h>
 
 /* YAJL version check */
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_pci.c	Thu Mar 01 12:31:15 2012 +0000
@@ -765,6 +765,11 @@
     return -1;
 }
 
+int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci)
+{
+    return 0;
+}
+
 int libxl_device_pci_add(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev)
 {
     GC_INIT(ctx);
@@ -782,6 +787,9 @@
     int num_assigned, i, rc;
     int stubdomid = 0;
 
+    rc = libxl__device_pci_setdefault(gc, pcidev);
+    if (rc) goto out;
+
     rc = get_all_assigned_devices(gc, &assigned, &num_assigned);
     if ( rc ) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot determine if device is assigned, refusing to continue");
@@ -1365,7 +1373,7 @@
         return ERROR_INVAL;
 
     b_info = &d_config->b_info;
-    if (!b_info->u.pv.e820_host)
+    if (!libxl_defbool_val(b_info->u.pv.e820_host))
         return ERROR_INVAL;
 
     rc = xc_get_machine_memory_map(ctx->xch, map, E820MAX);
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:31:15 2012 +0000
@@ -5,6 +5,8 @@
 
 namespace("libxl_")
 
+libxl_defbool = Builtin("defbool", passby=PASS_BY_REFERENCE)
+
 libxl_domid = Builtin("domid", json_fn = "yajl_gen_integer", autogenerate_json = False)
 libxl_uuid = Builtin("uuid", passby=PASS_BY_REFERENCE)
 libxl_mac = Builtin("mac", passby=PASS_BY_REFERENCE)
@@ -18,6 +20,12 @@
 libxl_hwcap = Builtin("hwcap", passby=PASS_BY_REFERENCE)
 
 #
+# Specific integer types
+#
+
+MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
+
+#
 # Constants / Enumerations
 #
 
@@ -36,11 +44,6 @@
     (2, "PV"),
     ])
 
-libxl_console_backend = Enumeration("console_backend", [
-    (1, "XENCONSOLED"),
-    (2, "IOEMU"),
-    ])
-
 libxl_disk_format = Enumeration("disk_format", [
     (0, "UNKNOWN"),
     (1, "QCOW"),
@@ -97,7 +100,7 @@
     (1, "no_delay_for_missed_ticks"),
     (2, "no_missed_ticks_pending"),
     (3, "one_missed_tick_pending"),
-    ])
+    ], init_val = "LIBXL_TIMER_MODE_DEFAULT")
 
 libxl_bios_type = Enumeration("bios_type", [
     (1, "rombios"),
@@ -105,35 +108,52 @@
     (3, "ovmf"),
     ])
 
+# Consistent with values defined in domctl.h
+libxl_scheduler = Enumeration("scheduler", [
+    (4, "sedf"),
+    (5, "credit"),
+    (6, "credit2"),
+    (7, "arinc653"),
+    ])
+
+# Consistent with SHUTDOWN_* in sched.h
+libxl_shutdown_reason = Enumeration("shutdown_reason", [
+    (0, "poweroff"),
+    (1, "reboot"),
+    (2, "suspend"),
+    (3, "crash"),
+    (4, "watchdog"),
+    ])
+
 #
 # Complex libxl types
 #
 libxl_vnc_info = Struct("vnc_info", [
-    ("enable",        bool),
+    ("enable",        libxl_defbool),
     # "address:port" that should be listened on
     ("listen",        string),
     ("passwd",        string),
     ("display",       integer),
     # If set then try to find an unused port
-    ("findunused",    bool),
+    ("findunused",    libxl_defbool),
     ])
 
 libxl_spice_info = Struct("spice_info", [
-    ("enable",            bool),
+    ("enable",      libxl_defbool),
     # At least one of spice port or spicetls_post must be given
     ("port",        integer),
     ("tls_port",    integer),
     # Interface to bind to
     ("host",        string),
     # enable client connection with no password
-    ("disable_ticketing", bool),
+    ("disable_ticketing", libxl_defbool),
     ("passwd",      string),
-    ("agent_mouse", bool),
+    ("agent_mouse", libxl_defbool),
     ])
 
 libxl_sdl_info = Struct("sdl_info", [
-    ("enable",        bool),
-    ("opengl",        bool),
+    ("enable",        libxl_defbool),
+    ("opengl",        libxl_defbool),
     ("display",       string),
     ("xauthority",    string),
     ])
@@ -148,31 +168,31 @@
     ("shutdown",    bool),
     ("dying",       bool),
 
-    # Valid SHUTDOWN_* value from xen/sched.h iff (shutdown||dying).
+    # Valid iff (shutdown||dying).
     #
     # Otherwise set to a value guaranteed not to clash with any valid
-    # SHUTDOWN_* constant.
-    ("shutdown_reason", uint8),
-    ("current_memkb",   uint64),
-    ("shared_memkb", uint64),
-    ("max_memkb",   uint64),
+    # LIBXL_SHUTDOWN_REASON_* constant.
+    ("shutdown_reason", libxl_shutdown_reason),
+    ("current_memkb",   MemKB),
+    ("shared_memkb", MemKB),
+    ("max_memkb",   MemKB),
     ("cpu_time",    uint64),
     ("vcpu_max_id", uint32),
     ("vcpu_online", uint32),
     ("cpupool",     uint32),
-    ], dispose_fn=None)
+    ], dir=DIR_OUT)
 
 libxl_cpupoolinfo = Struct("cpupoolinfo", [
     ("poolid",      uint32),
-    ("sched_id",    uint32),
+    ("sched",       libxl_scheduler),
     ("n_dom",       uint32),
     ("cpumap",      libxl_cpumap)
-    ])
+    ], dir=DIR_OUT)
 
 libxl_vminfo = Struct("vminfo", [
     ("uuid", libxl_uuid),
     ("domid", libxl_domid),
-    ], dispose_fn=None)
+    ], dir=DIR_OUT)
 
 libxl_version_info = Struct("version_info", [
     ("xen_version_major", integer),
@@ -187,19 +207,21 @@
     ("virt_start",        uint64),
     ("pagesize",          integer),
     ("commandline",       string),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_domain_create_info = Struct("domain_create_info",[
     ("type",         libxl_domain_type),
-    ("hap",          bool),
-    ("oos",          bool),
+    ("hap",          libxl_defbool),
+    ("oos",          libxl_defbool),
     ("ssidref",      uint32),
     ("name",         string),
     ("uuid",         libxl_uuid),
     ("xsdata",       libxl_key_value_list),
     ("platformdata", libxl_key_value_list),
     ("poolid",       uint32),
-    ])
+    ], dir=DIR_IN)
+
+MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
 
 # Instances of libxl_file_reference contained in this struct which
 # have been mapped (with libxl_file_reference_map) will be unmapped
@@ -211,17 +233,16 @@
     ("cur_vcpus",       integer),
     ("cpumap",          libxl_cpumap),
     ("tsc_mode",        libxl_tsc_mode),
-    ("max_memkb",       uint32),
-    ("target_memkb",    uint32),
-    ("video_memkb",     uint32),
-    ("shadow_memkb",    uint32),
-    ("disable_migrate", bool),
+    ("max_memkb",       MemKB),
+    ("target_memkb",    MemKB),
+    ("video_memkb",     MemKB),
+    ("shadow_memkb",    MemKB),
+    ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
-    ("type",            libxl_domain_type),
     
     ("device_model_version", libxl_device_model_version),
-    ("device_model_stubdomain", bool),
-    # you set device_model you must set device_model_version too
+    ("device_model_stubdomain", libxl_defbool),
+    # if you set device_model you must set device_model_version too
     ("device_model",     string),
     ("device_model_ssidref", uint32),
 
@@ -233,53 +254,53 @@
     ("extra_hvm",        libxl_string_list),
 
     ("u", KeyedUnion(None, libxl_domain_type, "type",
-                [("hvm", Struct(None, [("firmware", string),
-                                       ("bios", libxl_bios_type),
-                                       ("pae", bool),
-                                       ("apic", bool),
-                                       ("acpi", bool),
-                                       ("acpi_s3", bool),
-                                       ("acpi_s4", bool),
-                                       ("nx", bool),
-                                       ("viridian", bool),
-                                       ("timeoffset", string),
-                                       ("hpet", bool),
-                                       ("vpt_align", bool),
-                                       ("timer_mode", libxl_timer_mode),
-                                       ("nested_hvm", bool),
-                                       ("no_incr_generationid", bool),
-                                       ("nographic",        bool),
-                                       ("stdvga",           bool),
+                [("hvm", Struct(None, [("firmware",         string),
+                                       ("bios",             libxl_bios_type),
+                                       ("pae",              libxl_defbool),
+                                       ("apic",             libxl_defbool),
+                                       ("acpi",             libxl_defbool),
+                                       ("acpi_s3",          libxl_defbool),
+                                       ("acpi_s4",          libxl_defbool),
+                                       ("nx",               libxl_defbool),
+                                       ("viridian",         libxl_defbool),
+                                       ("timeoffset",       string),
+                                       ("hpet",             libxl_defbool),
+                                       ("vpt_align",        libxl_defbool),
+                                       ("timer_mode",       libxl_timer_mode),
+                                       ("nested_hvm",       libxl_defbool),
+                                       ("incr_generationid",libxl_defbool),
+                                       ("nographic",        libxl_defbool),
+                                       ("stdvga",           libxl_defbool),
                                        ("vnc",              libxl_vnc_info),
                                        # keyboard layout, default is en-us keyboard
                                        ("keymap",           string),
                                        ("sdl",              libxl_sdl_info),
                                        ("spice",            libxl_spice_info),
                                        
-                                       ("gfx_passthru",     bool),
+                                       ("gfx_passthru",     libxl_defbool),
                                        
                                        ("serial",           string),
                                        ("boot",             string),
-                                       ("usb",              bool),
+                                       ("usb",              libxl_defbool),
                                        # usbdevice:
                                        # - "tablet" for absolute mouse,
                                        # - "mouse" for PS/2 protocol relative mouse
                                        ("usbdevice",        string),
                                        ("soundhw",          string),
-                                       ("xen_platform_pci", bool),
+                                       ("xen_platform_pci", libxl_defbool),
                                        ])),
                  ("pv", Struct(None, [("kernel", libxl_file_reference),
-                                      ("slack_memkb", uint32),
+                                      ("slack_memkb", MemKB),
                                       ("bootloader", string),
                                       ("bootloader_args", libxl_string_list),
                                       ("cmdline", string),
                                       ("ramdisk", libxl_file_reference),
                                       ("features", string, {'const': True}),
                                       # Use host's E820 for PCI passthrough.
-                                      ("e820_host", bool),
+                                      ("e820_host", libxl_defbool),
                                       ])),
-                 ])),
-    ],
+                 ], keyvar_init_val = "-1")),
+    ], dir=DIR_IN
 )
 
 libxl_device_vfb = Struct("device_vfb", [
@@ -296,13 +317,6 @@
     ("devid", integer),
     ])
 
-libxl_device_console = Struct("device_console", [
-    ("backend_domid", libxl_domid),
-    ("devid", integer),
-    ("consback", libxl_console_backend),
-    ("output", string),
-    ])
-
 libxl_device_disk = Struct("device_disk", [
     ("backend_domid", libxl_domid),
     ("pdev_path", string),
@@ -348,7 +362,7 @@
     ("state", integer),
     ("evtch", integer),
     ("rref", integer),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_nicinfo = Struct("nicinfo", [
     ("backend", string),
@@ -360,7 +374,7 @@
     ("evtch", integer),
     ("rref_tx", integer),
     ("rref_rx", integer),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_vcpuinfo = Struct("vcpuinfo", [
     ("vcpuid", uint32),
@@ -370,7 +384,7 @@
     ("running", bool),
     ("vcpu_time", uint64), # total vcpu time ran (ns)
     ("cpumap", libxl_cpumap), # current cpu's affinities
-    ])
+    ], dir=DIR_OUT)
 
 libxl_physinfo = Struct("physinfo", [
     ("threads_per_core", uint32),
@@ -388,23 +402,25 @@
 
     ("nr_nodes", uint32),
     ("hw_cap", libxl_hwcap),
-    ("phys_cap", uint32),
-    ], dispose_fn=None, dir=DIR_OUT)
+
+    ("cap_hvm", bool),
+    ("cap_hvm_directio", bool),
+    ], dir=DIR_OUT)
 
 libxl_cputopology = Struct("cputopology", [
     ("core", uint32),
     ("socket", uint32),
     ("node", uint32),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_sched_credit_domain = Struct("sched_credit_domain", [
     ("weight", integer),
     ("cap", integer),
-    ], dispose_fn=None)
+    ])
 
 libxl_sched_credit2_domain = Struct("sched_credit2_domain", [
     ("weight", integer),
-    ], dispose_fn=None)
+    ])
 
 libxl_sched_sedf_domain = Struct("sched_sedf_domain", [
     ("period", integer),
@@ -412,7 +428,7 @@
     ("latency", integer),
     ("extratime", integer),
     ("weight", integer),
-    ], dispose_fn=None)
+    ])
 
 libxl_event_type = Enumeration("event_type", [
     (1, "DOMAIN_SHUTDOWN"),
@@ -432,7 +448,6 @@
     ("domid",    libxl_domid),
     ("domuuid",  libxl_uuid),
     ("for_user", libxl_ev_user),
-    ("type",     libxl_event_type),
     ("u", KeyedUnion(None, libxl_event_type, "type",
           [("domain_shutdown", Struct(None, [
                                              ("shutdown_reason", uint8),
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_types_internal.idl
--- a/tools/libxl/libxl_types_internal.idl	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_types_internal.idl	Thu Mar 01 12:31:15 2012 +0000
@@ -1,5 +1,7 @@
 namespace("libxl__")
 
+libxl_domid = Builtin("domid", namespace="libxl_", json_fn = "yajl_gen_integer")
+
 libxl__qmp_message_type = Enumeration("qmp_message_type", [
     (1, "QMP"),
     (2, "return"),
@@ -17,3 +19,15 @@
     (6, "VKBD"),
     (7, "CONSOLE"),
     ])
+
+libxl__console_backend = Enumeration("console_backend", [
+    (1, "XENCONSOLED"),
+    (2, "IOEMU"),
+    ])
+
+libxl__device_console = Struct("device_console", [
+    ("backend_domid", libxl_domid),
+    ("devid", integer),
+    ("consback", libxl__console_backend),
+    ("output", string),
+    ])
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_utils.c	Thu Mar 01 12:31:15 2012 +0000
@@ -19,18 +19,6 @@
 
 #include "libxl_internal.h"
 
-struct schedid_name {
-    char *name;
-    int id;
-};
-
-static struct schedid_name schedid_name[] = {
-    { "credit", XEN_SCHEDULER_CREDIT },
-    { "sedf", XEN_SCHEDULER_SEDF },
-    { "credit2", XEN_SCHEDULER_CREDIT2 },
-    { NULL, -1 }
-};
-
 const char *libxl_basename(const char *name)
 {
     const char *filename;
@@ -151,28 +139,6 @@
     return ret;
 }
 
-int libxl_name_to_schedid(libxl_ctx *ctx, const char *name)
-{
-    int i;
-
-    for (i = 0; schedid_name[i].name != NULL; i++)
-        if (strcmp(name, schedid_name[i].name) == 0)
-            return schedid_name[i].id;
-
-    return ERROR_INVAL;
-}
-
-char *libxl_schedid_to_name(libxl_ctx *ctx, int schedid)
-{
-    int i;
-
-    for (i = 0; schedid_name[i].name != NULL; i++)
-        if (schedid_name[i].id == schedid)
-            return schedid_name[i].name;
-
-    return "unknown";
-}
-
 int libxl_get_stubdom_id(libxl_ctx *ctx, int guest_domid)
 {
     GC_INIT(ctx);
@@ -541,6 +507,29 @@
     free(list);
 }
 
+void libxl_dominfo_list_free(libxl_dominfo *list, int nr)
+{
+    int i;
+    for (i = 0; i < nr; i++)
+        libxl_dominfo_dispose(&list[i]);
+    free(list);
+}
+
+void libxl_vminfo_list_free(libxl_vminfo *list, int nr)
+{
+    int i;
+    for (i = 0; i < nr; i++)
+        libxl_vminfo_dispose(&list[i]);
+    free(list);
+}
+
+int libxl_domid_valid_guest(uint32_t domid)
+{
+    /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
+     * does not check whether the domain actually exists */
+    return domid > 0 && domid < DOMID_FIRST_RESERVED;
+}
+
 /*
  * Local variables:
  * mode: C
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_utils.h
--- a/tools/libxl/libxl_utils.h	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_utils.h	Thu Mar 01 12:31:15 2012 +0000
@@ -24,8 +24,6 @@
 char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid);
 int libxl_name_to_cpupoolid(libxl_ctx *ctx, const char *name, uint32_t *poolid);
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid);
-int libxl_name_to_schedid(libxl_ctx *ctx, const char *name);
-char *libxl_schedid_to_name(libxl_ctx *ctx, int schedid);
 int libxl_get_stubdom_id(libxl_ctx *ctx, int guest_domid);
 int libxl_is_stubdom(libxl_ctx *ctx, uint32_t domid, uint32_t *target_domid);
 int libxl_create_logfile(libxl_ctx *ctx, char *name, char **full_name);
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxlu_cfg.c
--- a/tools/libxl/libxlu_cfg.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxlu_cfg.c	Thu Mar 01 12:31:15 2012 +0000
@@ -237,6 +237,17 @@
     return 0;
 }
 
+int xlu_cfg_get_defbool(const XLU_Config *cfg, const char *n, libxl_defbool *b,
+                     int dont_warn)
+{
+    int ret;
+    long l;
+
+    ret = xlu_cfg_get_long(cfg, n, &l, dont_warn);
+    if (ret) return ret;
+    libxl_defbool_set(b, !!l);
+    return 0;
+}
 
 int xlu_cfg_get_list(const XLU_Config *cfg, const char *n,
                      XLU_ConfigList **list_r, int *entries_r, int dont_warn) {
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxlutil.h
--- a/tools/libxl/libxlutil.h	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxlutil.h	Thu Mar 01 12:31:15 2012 +0000
@@ -52,6 +52,8 @@
                            char **value_r, int dont_warn);
 int xlu_cfg_get_long(const XLU_Config*, const char *n, long *value_r,
                      int dont_warn);
+int xlu_cfg_get_defbool(const XLU_Config*, const char *n, libxl_defbool *b,
+                     int dont_warn);
 
 int xlu_cfg_get_list(const XLU_Config*, const char *n,
                      XLU_ConfigList **list_r /* may be 0 */,
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:31:15 2012 +0000
@@ -144,7 +144,6 @@
 static int domain_qualifier_to_domid(const char *p, uint32_t *domid_r,
                                      int *was_name_r)
 {
-    libxl_dominfo dominfo;
     int was_name, rc;
 
     was_name = qualifier_to_id(p, domid_r);
@@ -156,7 +155,7 @@
         if (rc)
             return rc;
     } else {
-        rc = libxl_domain_info(ctx, &dominfo, *domid_r);
+        rc = libxl_domain_info(ctx, NULL, *domid_r);
         /* error only if domain does not exist */
         if (rc == ERROR_INVAL)
             return rc;
@@ -383,7 +382,7 @@
 {
     int e;
 
-    libxl_device_disk_init(ctx, disk);
+    libxl_device_disk_init(disk);
 
     if (!*config) {
         *config = xlu_cfg_init(stderr, "command line");
@@ -536,8 +535,7 @@
         exit(1);
     }
 
-    if (libxl_init_create_info(ctx, c_info))
-        exit(1);
+    libxl_domain_create_info_init(c_info);
 
     if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
         e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
@@ -557,8 +555,7 @@
         !strncmp(buf, "hvm", strlen(buf)))
         c_info->type = LIBXL_DOMAIN_TYPE_HVM;
 
-    if (!xlu_cfg_get_long (config, "hap", &l, 0))
-        c_info->hap = l;
+    xlu_cfg_get_defbool(config, "hap", &c_info->hap, 0);
 
     if (xlu_cfg_replace_string (config, "name", &c_info->name, 0)) {
         fprintf(stderr, "Domain name must be specified.\n");
@@ -574,8 +571,7 @@
         libxl_uuid_generate(&c_info->uuid);
     }
 
-    if (!xlu_cfg_get_long(config, "oos", &l, 0))
-        c_info->oos = l;
+    xlu_cfg_get_defbool(config, "oos", &c_info->oos, 0);
 
     if (!xlu_cfg_get_string (config, "pool", &buf, 0)) {
         c_info->poolid = -1;
@@ -586,8 +582,8 @@
         exit(1);
     }
 
-    if (libxl_init_build_info(ctx, b_info, c_info))
-        exit(1);
+    libxl_domain_build_info_init(b_info);
+    libxl_domain_build_info_init_type(b_info, c_info->type);
 
     /* the following is the actual config parsing with overriding values in the structures */
     if (!xlu_cfg_get_long (config, "vcpus", &l, 0)) {
@@ -601,6 +597,11 @@
     if (!xlu_cfg_get_list (config, "cpus", &cpus, 0, 1)) {
         int i, n_cpus = 0;
 
+        if (libxl_cpumap_alloc(ctx, &b_info->cpumap)) {
+            fprintf(stderr, "Unable to allocate cpumap\n");
+            exit(1);
+        }
+
         libxl_cpumap_set_none(&b_info->cpumap);
         while ((buf = xlu_cfg_get_listitem(cpus, n_cpus)) != NULL) {
             i = atoi(buf);
@@ -615,6 +616,11 @@
     else if (!xlu_cfg_get_string (config, "cpus", &buf, 0)) {
         char *buf2 = strdup(buf);
 
+        if (libxl_cpumap_alloc(ctx, &b_info->cpumap)) {
+            fprintf(stderr, "Unable to allocate cpumap\n");
+            exit(1);
+        }
+
         libxl_cpumap_set_none(&b_info->cpumap);
         if (vcpupin_parse(buf2, &b_info->cpumap))
             exit(1);
@@ -666,8 +672,7 @@
         : libxl_get_required_shadow_memory(b_info->max_memkb,
                                            b_info->max_vcpus);
 
-    if (!xlu_cfg_get_long (config, "nomigrate", &l, 0))
-        b_info->disable_migrate = l;
+    xlu_cfg_get_defbool(config, "nomigrate", &b_info->disable_migrate, 0);
 
     if (!xlu_cfg_get_long(config, "tsc_mode", &l, 1)) {
         const char *s = libxl_tsc_mode_to_string(l);
@@ -695,7 +700,7 @@
     if (!xlu_cfg_get_long (config, "videoram", &l, 0))
         b_info->video_memkb = l * 1024;
 
-    switch(c_info->type) {
+    switch(b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         if (!xlu_cfg_get_string (config, "kernel", &buf, 0))
             fprintf(stderr, "WARNING: ignoring \"kernel\" directive for HVM guest. "
@@ -709,24 +714,16 @@
                     buf);
                 exit (1);
         }
-        if (!xlu_cfg_get_long (config, "pae", &l, 0))
-            b_info->u.hvm.pae = l;
-        if (!xlu_cfg_get_long (config, "apic", &l, 0))
-            b_info->u.hvm.apic = l;
-        if (!xlu_cfg_get_long (config, "acpi", &l, 0))
-            b_info->u.hvm.acpi = l;
-        if (!xlu_cfg_get_long (config, "acpi_s3", &l, 0))
-            b_info->u.hvm.acpi_s3 = l;
-        if (!xlu_cfg_get_long (config, "acpi_s4", &l, 0))
-            b_info->u.hvm.acpi_s4 = l;
-        if (!xlu_cfg_get_long (config, "nx", &l, 0))
-            b_info->u.hvm.nx = l;
-        if (!xlu_cfg_get_long (config, "viridian", &l, 0))
-            b_info->u.hvm.viridian = l;
-        if (!xlu_cfg_get_long (config, "hpet", &l, 0))
-            b_info->u.hvm.hpet = l;
-        if (!xlu_cfg_get_long (config, "vpt_align", &l, 0))
-            b_info->u.hvm.vpt_align = l;
+
+        xlu_cfg_get_defbool(config, "pae", &b_info->u.hvm.pae, 0);
+        xlu_cfg_get_defbool(config, "apic", &b_info->u.hvm.apic, 0);
+        xlu_cfg_get_defbool(config, "acpi", &b_info->u.hvm.acpi, 0);
+        xlu_cfg_get_defbool(config, "acpi_s3", &b_info->u.hvm.acpi_s3, 0);
+        xlu_cfg_get_defbool(config, "acpi_s4", &b_info->u.hvm.acpi_s4, 0);
+        xlu_cfg_get_defbool(config, "nx", &b_info->u.hvm.nx, 0);
+        xlu_cfg_get_defbool(config, "viridian", &b_info->u.hvm.viridian, 0);
+        xlu_cfg_get_defbool(config, "hpet", &b_info->u.hvm.hpet, 0);
+        xlu_cfg_get_defbool(config, "vpt_align", &b_info->u.hvm.vpt_align, 0);
 
         if (!xlu_cfg_get_long(config, "timer_mode", &l, 1)) {
             const char *s = libxl_timer_mode_to_string(l);
@@ -751,8 +748,7 @@
             }
         }
 
-        if (!xlu_cfg_get_long (config, "nestedhvm", &l, 0))
-            b_info->u.hvm.nested_hvm = l;
+        xlu_cfg_get_defbool(config, "nestedhvm", &b_info->u.hvm.nested_hvm, 0);
         break;
     case LIBXL_DOMAIN_TYPE_PV:
     {
@@ -837,7 +833,7 @@
 
             d_config->vifs = (libxl_device_nic *) realloc(d_config->vifs, sizeof (libxl_device_nic) * (d_config->num_vifs+1));
             nic = d_config->vifs + d_config->num_vifs;
-            CHK_ERRNO( libxl_device_nic_init(ctx, nic) );
+            libxl_device_nic_init(nic);
             nic->devid = d_config->num_vifs;
 
             if (default_vifscript) {
@@ -933,12 +929,12 @@
 
             d_config->vfbs = (libxl_device_vfb *) realloc(d_config->vfbs, sizeof(libxl_device_vfb) * (d_config->num_vfbs + 1));
             vfb = d_config->vfbs + d_config->num_vfbs;
-            libxl_device_vfb_init(ctx, vfb);
+            libxl_device_vfb_init(vfb);
             vfb->devid = d_config->num_vfbs;
 
             d_config->vkbs = (libxl_device_vkb *) realloc(d_config->vkbs, sizeof(libxl_device_vkb) * (d_config->num_vkbs + 1));
             vkb = d_config->vkbs + d_config->num_vkbs;
-            libxl_device_vkb_init(ctx, vkb);
+            libxl_device_vkb_init(vkb);
             vkb->devid = d_config->num_vkbs;
 
             p = strtok(buf2, ",");
@@ -951,7 +947,7 @@
                     break;
                 *p2 = '\0';
                 if (!strcmp(p, "vnc")) {
-                    vfb->vnc.enable = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->vnc.enable, atoi(p2 + 1));
                 } else if (!strcmp(p, "vnclisten")) {
                     free(vfb->vnc.listen);
                     vfb->vnc.listen = strdup(p2 + 1);
@@ -961,14 +957,14 @@
                 } else if (!strcmp(p, "vncdisplay")) {
                     vfb->vnc.display = atoi(p2 + 1);
                 } else if (!strcmp(p, "vncunused")) {
-                    vfb->vnc.findunused = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->vnc.findunused, atoi(p2 + 1));
                 } else if (!strcmp(p, "keymap")) {
                     free(vfb->keymap);
                     vfb->keymap = strdup(p2 + 1);
                 } else if (!strcmp(p, "sdl")) {
-                    vfb->sdl.enable = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->sdl.enable, atoi(p2 + 1));
                 } else if (!strcmp(p, "opengl")) {
-                    vfb->sdl.opengl = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->sdl.opengl, atoi(p2 + 1));
                 } else if (!strcmp(p, "display")) {
                     free(vfb->sdl.display);
                     vfb->sdl.display = strdup(p2 + 1);
@@ -992,19 +988,10 @@
 
     /* To be reworked (automatically enabled) once the auto ballooning
      * after guest starts is done (with PCI devices passed in). */
-    if (!xlu_cfg_get_long (config, "e820_host", &l, 0)) {
-        switch (c_info->type) {
-        case LIBXL_DOMAIN_TYPE_HVM:
-            fprintf(stderr, "Can't do e820_host in HVM mode!");
-            break;
-        case LIBXL_DOMAIN_TYPE_PV:
-            if (l)
-                b_info->u.pv.e820_host = true;
-            break;
-        default:
-            abort();
-        }
-    }
+    if (c_info->type == LIBXL_DOMAIN_TYPE_PV) {
+        xlu_cfg_get_defbool(config, "e820_host", &b_info->u.pv.e820_host, 0);
+    }
+
     if (!xlu_cfg_get_list (config, "pci", &pcis, 0, 0)) {
         int i;
         d_config->num_pcidevs = 0;
@@ -1014,7 +1001,7 @@
 
             d_config->pcidevs = (libxl_device_pci *) realloc(d_config->pcidevs, sizeof (libxl_device_pci) * (d_config->num_pcidevs + 1));
             pcidev = d_config->pcidevs + d_config->num_pcidevs;
-            memset(pcidev, 0x00, sizeof(libxl_device_pci));
+            libxl_device_pci_init(pcidev);
 
             pcidev->msitranslate = pci_msitranslate;
             pcidev->power_mgmt = pci_power_mgmt;
@@ -1022,7 +1009,7 @@
                 d_config->num_pcidevs++;
         }
         if (d_config->num_pcidevs && c_info->type == LIBXL_DOMAIN_TYPE_PV)
-            b_info->u.pv.e820_host = true;
+            libxl_defbool_set(&b_info->u.pv.e820_host, true);
     }
 
     switch (xlu_cfg_get_list(config, "cpuid", &cpuids, 0, 1)) {
@@ -1139,8 +1126,8 @@
         }
     } else if (b_info->device_model)
         fprintf(stderr, "WARNING: device model override given without specific DM version\n");
-    if (!xlu_cfg_get_long (config, "device_model_stubdomain_override", &l, 0))
-        b_info->device_model_stubdomain = l;
+    xlu_cfg_get_defbool (config, "device_model_stubdomain_override",
+                         &b_info->device_model_stubdomain, 0);
 
     if (!xlu_cfg_get_string (config, "device_model_stubdomain_seclabel",
                              &buf, 0)) {
@@ -1177,49 +1164,43 @@
 #undef parse_extra_args
 
     if (c_info->type == LIBXL_DOMAIN_TYPE_HVM) {
-        if (!xlu_cfg_get_long (config, "stdvga", &l, 0))
-            b_info->u.hvm.stdvga = l;
-        if (!xlu_cfg_get_long (config, "vnc", &l, 0))
-            b_info->u.hvm.vnc.enable = l;
-        xlu_cfg_replace_string (config, "vnclisten", &b_info->u.hvm.vnc.listen, 0);
-        xlu_cfg_replace_string (config, "vncpasswd", &b_info->u.hvm.vnc.passwd, 0);
+        xlu_cfg_get_defbool(config, "stdvga", &b_info->u.hvm.stdvga, 0);
+        xlu_cfg_get_defbool(config, "vnc", &b_info->u.hvm.vnc.enable, 0);
+        xlu_cfg_replace_string (config, "vnclisten",
+                                &b_info->u.hvm.vnc.listen, 0);
+        xlu_cfg_replace_string (config, "vncpasswd",
+                                &b_info->u.hvm.vnc.passwd, 0);
         if (!xlu_cfg_get_long (config, "vncdisplay", &l, 0))
             b_info->u.hvm.vnc.display = l;
-        if (!xlu_cfg_get_long (config, "vncunused", &l, 0))
-            b_info->u.hvm.vnc.findunused = l;
+        xlu_cfg_get_defbool(config, "vncunused",
+                            &b_info->u.hvm.vnc.findunused, 0);
         xlu_cfg_replace_string (config, "keymap", &b_info->u.hvm.keymap, 0);
-        if (!xlu_cfg_get_long (config, "sdl", &l, 0))
-            b_info->u.hvm.sdl.enable = l;
-        if (!xlu_cfg_get_long (config, "opengl", &l, 0))
-            b_info->u.hvm.sdl.opengl = l;
-        if (!xlu_cfg_get_long (config, "spice", &l, 0))
-            b_info->u.hvm.spice.enable = l;
+        xlu_cfg_get_defbool(config, "sdl", &b_info->u.hvm.sdl.enable, 0);
+        xlu_cfg_get_defbool(config, "opengl", &b_info->u.hvm.sdl.opengl, 0);
+        xlu_cfg_get_defbool (config, "spice", &b_info->u.hvm.spice.enable, 0);
         if (!xlu_cfg_get_long (config, "spiceport", &l, 0))
             b_info->u.hvm.spice.port = l;
         if (!xlu_cfg_get_long (config, "spicetls_port", &l, 0))
             b_info->u.hvm.spice.tls_port = l;
         xlu_cfg_replace_string (config, "spicehost",
                                 &b_info->u.hvm.spice.host, 0);
-        if (!xlu_cfg_get_long (config, "spicedisable_ticketing", &l, 0))
-            b_info->u.hvm.spice.disable_ticketing = l;
+        xlu_cfg_get_defbool(config, "spicedisable_ticketing",
+                            &b_info->u.hvm.spice.disable_ticketing, 0);
         xlu_cfg_replace_string (config, "spicepasswd",
                                 &b_info->u.hvm.spice.passwd, 0);
-        if (!xlu_cfg_get_long (config, "spiceagent_mouse", &l, 0))
-            b_info->u.hvm.spice.agent_mouse = l;
-        else
-            b_info->u.hvm.spice.agent_mouse = 1;
-        if (!xlu_cfg_get_long (config, "nographic", &l, 0))
-            b_info->u.hvm.nographic = l;
-        if (!xlu_cfg_get_long (config, "gfx_passthru", &l, 0))
-            b_info->u.hvm.gfx_passthru = l;
+        xlu_cfg_get_defbool(config, "spiceagent_mouse",
+                            &b_info->u.hvm.spice.agent_mouse, 0);
+        xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
+        xlu_cfg_get_defbool(config, "gfx_passthru", 
+                            &b_info->u.hvm.gfx_passthru, 0);
         xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
         xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
-        if (!xlu_cfg_get_long (config, "usb", &l, 0))
-            b_info->u.hvm.usb = l;
-        xlu_cfg_replace_string (config, "usbdevice", &b_info->u.hvm.usbdevice, 0);
+        xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
+        xlu_cfg_replace_string (config, "usbdevice",
+                                &b_info->u.hvm.usbdevice, 0);
         xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
-        if (!xlu_cfg_get_long (config, "xen_platform_pci", &l, 0))
-            b_info->u.hvm.xen_platform_pci = l;
+        xlu_cfg_get_defbool(config, "xen_platform_pci",
+                            &b_info->u.hvm.xen_platform_pci, 0);
     }
 
     xlu_cfg_destroy(config);
@@ -1235,19 +1216,19 @@
     libxl_action_on_shutdown action;
 
     switch (event->u.domain_shutdown.shutdown_reason) {
-    case SHUTDOWN_poweroff:
+    case LIBXL_SHUTDOWN_REASON_POWEROFF:
         action = d_config->on_poweroff;
         break;
-    case SHUTDOWN_reboot:
+    case LIBXL_SHUTDOWN_REASON_REBOOT:
         action = d_config->on_reboot;
         break;
-    case SHUTDOWN_suspend:
+    case LIBXL_SHUTDOWN_REASON_SUSPEND:
         LOG("Domain has suspended.");
         return 0;
-    case SHUTDOWN_crash:
+    case LIBXL_SHUTDOWN_REASON_CRASH:
         action = d_config->on_crash;
         break;
-    case SHUTDOWN_watchdog:
+    case LIBXL_SHUTDOWN_REASON_WATCHDOG:
         action = d_config->on_watchdog;
         break;
     default:
@@ -1371,7 +1352,7 @@
     const char *restore_file;
     int migrate_fd; /* -1 means none */
     char **migration_domname_r; /* from malloc */
-    int no_incr_generationid;
+    int incr_generationid;
 };
 
 static int freemem(libxl_domain_build_info *b_info)
@@ -1622,8 +1603,8 @@
     }
 
     if (d_config.c_info.type == LIBXL_DOMAIN_TYPE_HVM)
-        d_config.b_info.u.hvm.no_incr_generationid =
-            dom_info->no_incr_generationid;
+        libxl_defbool_set(&d_config.b_info.u.hvm.incr_generationid,
+                          dom_info->incr_generationid);
 
     if (debug || dom_info->dryrun)
         printf_info(default_output_format, -1, &d_config);
@@ -2505,7 +2486,7 @@
             info[i].domid, domname);
         free(domname);
     }
-    free(info);
+    libxl_vminfo_list_free(info, nb_vm);
 }
 
 static void save_domain_core_begin(const char *domain_spec,
@@ -2898,7 +2879,7 @@
     dom_info.restore_file = "incoming migration stream";
     dom_info.migrate_fd = 0; /* stdin */
     dom_info.migration_domname_r = &migration_domname;
-    dom_info.no_incr_generationid = 1;
+    dom_info.incr_generationid = 0;
 
     rc = create_domain(&dom_info);
     if (rc < 0) {
@@ -3023,6 +3004,7 @@
     dom_info.restore_file = checkpoint_file;
     dom_info.migrate_fd = -1;
     dom_info.console_autoconnect = console_autoconnect;
+    dom_info.incr_generationid = 1;
 
     rc = create_domain(&dom_info);
     if (rc < 0)
@@ -3302,7 +3284,10 @@
     else
         list_domains(verbose, context, info, nb_domain);
 
-    free(info_free);
+    if (info_free)
+        libxl_dominfo_list_free(info, nb_domain);
+    else
+        libxl_dominfo_dispose(info);
 
     return 0;
 }
@@ -3405,6 +3390,7 @@
     dom_info.extra_config = extra_config;
     dom_info.migrate_fd = -1;
     dom_info.console_autoconnect = console_autoconnect;
+    dom_info.incr_generationid = 0;
 
     rc = create_domain(&dom_info);
     if (rc < 0)
@@ -3565,8 +3551,7 @@
         for (i = 0; i<nb_domain; i++)
             print_domain_vcpuinfo(dominfo[i].domid, physinfo.nr_cpus);
 
-        free(dominfo);
-
+        libxl_dominfo_list_free(dominfo, nb_domain);
     } else {
         for (; argc > 0; ++argv, --argc) {
             if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
@@ -3578,7 +3563,7 @@
         }
     }
   vcpulist_out:
-    ;
+    libxl_physinfo_dispose(&physinfo);
 }
 
 int main_vcpulist(int argc, char **argv)
@@ -3693,15 +3678,15 @@
 static void output_xeninfo(void)
 {
     const libxl_version_info *info;
-    int sched_id;
+    libxl_scheduler sched;
 
     if (!(info = libxl_get_version_info(ctx))) {
         fprintf(stderr, "libxl_get_version_info failed.\n");
         return;
     }
 
-    if ((sched_id = libxl_get_sched_id(ctx)) < 0) {
-        fprintf(stderr, "get_sched_id sysctl failed.\n");
+    if ((sched = libxl_get_scheduler(ctx)) < 0) {
+        fprintf(stderr, "get_scheduler sysctl failed.\n");
         return;
     }
 
@@ -3709,7 +3694,7 @@
     printf("xen_minor              : %d\n", info->xen_version_minor);
     printf("xen_extra              : %s\n", info->xen_version_extra);
     printf("xen_caps               : %s\n", info->capabilities);
-    printf("xen_scheduler          : %s\n", libxl_schedid_to_name(ctx, sched_id));
+    printf("xen_scheduler          : %s\n", libxl_scheduler_to_string(sched));
     printf("xen_pagesize           : %u\n", info->pagesize);
     printf("platform_params        : virt_start=0x%"PRIx64"\n", info->virt_start);
     printf("xen_changeset          : %s\n", info->changeset);
@@ -3757,9 +3742,9 @@
     for (i = 0; i < 8; i++)
         printf("%08x%c", info.hw_cap[i], i < 7 ? ':' : '\n');
     printf("virt_caps              :");
-    if (info.phys_cap & XEN_SYSCTL_PHYSCAP_hvm)
+    if (info.cap_hvm)
         printf(" hvm");
-    if (info.phys_cap & XEN_SYSCTL_PHYSCAP_hvm_directio)
+    if (info.cap_hvm_directio)
         printf(" hvm_directio");
     printf("\n");
     vinfo = libxl_get_version_info(ctx);
@@ -3778,6 +3763,7 @@
         free(cpumap.map);
     }
 
+    libxl_physinfo_dispose(&info);
     return;
 }
 
@@ -3912,7 +3898,9 @@
     sharing(info, nb_domain);
 
     if (info_free)
-        free(info_free);
+        libxl_dominfo_list_free(info_free, nb_domain);
+    else
+        libxl_dominfo_dispose(info);
 
     return 0;
 }
@@ -3934,6 +3922,7 @@
 {
     int rc;
 
+    
     rc = libxl_sched_credit_domain_set(ctx, domid, scinfo);
     if (rc)
         fprintf(stderr, "libxl_sched_credit_domain_set failed.\n");
@@ -3962,6 +3951,7 @@
         scinfo.weight,
         scinfo.cap);
     free(domname);
+    libxl_sched_credit_domain_dispose(&scinfo);
     return 0;
 }
 
@@ -4009,6 +3999,7 @@
         domid,
         scinfo.weight);
     free(domname);
+    libxl_sched_credit2_domain_dispose(&scinfo);
     return 0;
 }
 
@@ -4032,7 +4023,6 @@
     rc = libxl_sched_sedf_domain_set(ctx, domid, scinfo);
     if (rc)
         fprintf(stderr, "libxl_sched_sedf_domain_set failed.\n");
-
     return rc;
 }
 
@@ -4061,11 +4051,12 @@
         scinfo.extratime,
         scinfo.weight);
     free(domname);
+    libxl_sched_sedf_domain_dispose(&scinfo);
     return 0;
 }
 
 static int sched_domain_output(
-    uint32_t sched, int (*output)(int), const char *cpupool)
+    libxl_scheduler sched, int (*output)(int), const char *cpupool)
 {
     libxl_dominfo *info;
     libxl_cpupoolinfo *poolinfo = NULL;
@@ -4094,7 +4085,7 @@
     }
 
     for (p = 0; !rc && (p < n_pools); p++) {
-        if ((poolinfo[p].sched_id != sched) ||
+        if ((poolinfo[p].sched != sched) ||
             (cpupool && (poolid != poolinfo[p].poolid)))
             continue;
 
@@ -4175,7 +4166,7 @@
     }
 
     if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(XEN_SCHEDULER_CREDIT,
+        return -sched_domain_output(LIBXL_SCHEDULER_CREDIT,
                                     sched_credit_domain_output, cpupool);
     } else {
         find_domain(dom);
@@ -4193,6 +4184,7 @@
             if (opt_c)
                 scinfo.cap = cap;
             rc = sched_credit_domain_set(domid, &scinfo);
+            libxl_sched_credit_domain_dispose(&scinfo);
             if (rc)
                 return -rc;
         }
@@ -4251,7 +4243,7 @@
     }
 
     if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(XEN_SCHEDULER_CREDIT2,
+        return -sched_domain_output(LIBXL_SCHEDULER_CREDIT2,
                                     sched_credit2_domain_output, cpupool);
     } else {
         find_domain(dom);
@@ -4267,6 +4259,7 @@
             if (opt_w)
                 scinfo.weight = weight;
             rc = sched_credit2_domain_set(domid, &scinfo);
+            libxl_sched_credit2_domain_dispose(&scinfo);
             if (rc)
                 return -rc;
         }
@@ -4353,7 +4346,7 @@
     }
 
     if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(XEN_SCHEDULER_SEDF,
+        return -sched_domain_output(LIBXL_SCHEDULER_SEDF,
                                     sched_sedf_domain_output, cpupool);
     } else {
         find_domain(dom);
@@ -4385,6 +4378,7 @@
                 scinfo.slice = 0;
             }
             rc = sched_sedf_domain_set(domid, &scinfo);
+            libxl_sched_sedf_domain_dispose(&scinfo);
             if (rc)
                 return -rc;
         }
@@ -4602,7 +4596,7 @@
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
         return 1;
     }
-    libxl_device_nic_init(ctx, &nic);
+    libxl_device_nic_init(&nic);
     for (argv += optind+1, argc -= optind+1; argc > 0; ++argv, --argc) {
         if (MATCH_OPTION("type", *argv, oparg)) {
             if (!strcmp("vif", oparg)) {
@@ -4968,6 +4962,7 @@
         info = libxl_list_vm(ctx, &nb_vm);
         for (i = 0; i < nb_vm; i++)
             print_domU_uptime(info[i].domid, short_mode, now);
+        libxl_vminfo_list_free(info, nb_vm);
     } else {
         for (i = 0; i < nb_doms; i++) {
             if (doms[i] == 0)
@@ -5292,9 +5287,8 @@
     XLU_Config *config;
     const char *buf;
     const char *name;
-    const char *sched;
     uint32_t poolid;
-    int schedid = -1;
+    libxl_scheduler sched = 0;
     XLU_ConfigList *cpus;
     XLU_ConfigList *nodes;
     int n_cpus, n_nodes, i, n;
@@ -5389,17 +5383,16 @@
     }
 
     if (!xlu_cfg_get_string (config, "sched", &buf, 0)) {
-        if ((schedid = libxl_name_to_schedid(ctx, buf)) < 0) {
+        if ((libxl_scheduler_from_string(buf, &sched)) < 0) {
             fprintf(stderr, "Unknown scheduler\n");
             return -ERROR_FAIL;
         }
     } else {
-        if ((schedid = libxl_get_sched_id(ctx)) < 0) {
-            fprintf(stderr, "get_sched_id sysctl failed.\n");
+        if ((sched = libxl_get_scheduler(ctx)) < 0) {
+            fprintf(stderr, "get_scheduler sysctl failed.\n");
             return -ERROR_FAIL;
         }
     }
-    sched = libxl_schedid_to_name(ctx, schedid);
 
     if (libxl_get_freecpus(ctx, &freemap)) {
         fprintf(stderr, "libxl_get_freecpus failed\n");
@@ -5467,14 +5460,14 @@
 
     printf("Using config file \"%s\"\n", filename);
     printf("cpupool name:   %s\n", name);
-    printf("scheduler:      %s\n", sched);
+    printf("scheduler:      %s\n", libxl_scheduler_to_string(sched));
     printf("number of cpus: %d\n", n_cpus);
 
     if (dryrun_only)
         return 0;
 
     poolid = 0;
-    if (libxl_cpupool_create(ctx, name, schedid, cpumap, &uuid, &poolid)) {
+    if (libxl_cpupool_create(ctx, name, sched, cpumap, &uuid, &poolid)) {
         fprintf(stderr, "error on creating cpupool\n");
         return -ERROR_FAIL;
     }
@@ -5559,7 +5552,7 @@
                     }
                 if (!opt_cpus) {
                     printf("%3d %9s       y       %4d", n,
-                           libxl_schedid_to_name(ctx, poolinfo[p].sched_id),
+                           libxl_scheduler_to_string(poolinfo[p].sched),
                            poolinfo[p].n_dom);
                 }
                 printf("\n");
@@ -5744,7 +5737,7 @@
     int c;
     int n;
     uint32_t poolid;
-    int schedid;
+    libxl_scheduler sched;
     int n_pools;
     int node;
     int n_cpus;
@@ -5765,7 +5758,7 @@
         return -ERROR_NOMEM;
     }
     poolid = poolinfo[0].poolid;
-    schedid = poolinfo[0].sched_id;
+    sched = poolinfo[0].sched;
     for (p = 0; p < n_pools; p++) {
         libxl_cpupoolinfo_dispose(poolinfo + p);
     }
@@ -5845,7 +5838,7 @@
         snprintf(name, 15, "Pool-node%d", node);
         libxl_uuid_generate(&uuid);
         poolid = 0;
-        ret = -libxl_cpupool_create(ctx, name, schedid, cpumap, &uuid, &poolid);
+        ret = -libxl_cpupool_create(ctx, name, sched, cpumap, &uuid, &poolid);
         if (ret) {
             fprintf(stderr, "error on creating cpupool\n");
             goto out;
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/xl_sxp.c	Thu Mar 01 12:31:15 2012 +0000
@@ -21,6 +21,7 @@
 #include "libxl_osdeps.h"
 
 #include <stdlib.h>
+#include <inttypes.h>
 
 #include "libxl.h"
 #include "libxl_utils.h"
@@ -40,8 +41,8 @@
     printf("(domain\n\t(domid %d)\n", domid);
     printf("\t(create_info)\n");
     printf("\t(hvm %d)\n", c_info->type == LIBXL_DOMAIN_TYPE_HVM);
-    printf("\t(hap %d)\n", c_info->hap);
-    printf("\t(oos %d)\n", c_info->oos);
+    printf("\t(hap %s)\n", libxl_defbool_to_string(c_info->hap));
+    printf("\t(oos %s)\n", libxl_defbool_to_string(c_info->oos));
     printf("\t(ssidref %d)\n", c_info->ssidref);
     printf("\t(name %s)\n", c_info->name);
 
@@ -68,9 +69,10 @@
     printf("\t(build_info)\n");
     printf("\t(max_vcpus %d)\n", b_info->max_vcpus);
     printf("\t(tsc_mode %s)\n", libxl_tsc_mode_to_string(b_info->tsc_mode));
-    printf("\t(max_memkb %d)\n", b_info->max_memkb);
-    printf("\t(target_memkb %d)\n", b_info->target_memkb);
-    printf("\t(nomigrate %d)\n", b_info->disable_migrate);
+    printf("\t(max_memkb %"PRId64")\n", b_info->max_memkb);
+    printf("\t(target_memkb %"PRId64")\n", b_info->target_memkb);
+    printf("\t(nomigrate %s)\n",
+           libxl_defbool_to_string(b_info->disable_migrate));
 
     if (c_info->type == LIBXL_DOMAIN_TYPE_PV && b_info->u.pv.bootloader) {
         int i;
@@ -88,43 +90,57 @@
     case LIBXL_DOMAIN_TYPE_HVM:
         printf("\t\t(hvm\n");
         printf("\t\t\t(firmware %s)\n", b_info->u.hvm.firmware);
-        printf("\t\t\t(video_memkb %d)\n", b_info->video_memkb);
-        printf("\t\t\t(shadow_memkb %d)\n", b_info->shadow_memkb);
-        printf("\t\t\t(pae %d)\n", b_info->u.hvm.pae);
-        printf("\t\t\t(apic %d)\n", b_info->u.hvm.apic);
-        printf("\t\t\t(acpi %d)\n", b_info->u.hvm.acpi);
-        printf("\t\t\t(nx %d)\n", b_info->u.hvm.nx);
-        printf("\t\t\t(viridian %d)\n", b_info->u.hvm.viridian);
-        printf("\t\t\t(hpet %d)\n", b_info->u.hvm.hpet);
-        printf("\t\t\t(vpt_align %d)\n", b_info->u.hvm.vpt_align);
+        printf("\t\t\t(video_memkb %"PRId64")\n", b_info->video_memkb);
+        printf("\t\t\t(shadow_memkb %"PRId64")\n", b_info->shadow_memkb);
+        printf("\t\t\t(pae %s)\n", libxl_defbool_to_string(b_info->u.hvm.pae));
+        printf("\t\t\t(apic %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.apic));
+        printf("\t\t\t(acpi %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.acpi));
+        printf("\t\t\t(nx %s)\n", libxl_defbool_to_string(b_info->u.hvm.nx));
+        printf("\t\t\t(viridian %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.viridian));
+        printf("\t\t\t(hpet %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.hpet));
+        printf("\t\t\t(vpt_align %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.vpt_align));
         printf("\t\t\t(timer_mode %s)\n",
                libxl_timer_mode_to_string(b_info->u.hvm.timer_mode));
-        printf("\t\t\t(nestedhvm %d)\n", b_info->u.hvm.nested_hvm);
-        printf("\t\t\t(no_incr_generationid %d)\n",
-                    b_info->u.hvm.no_incr_generationid);
-
-        printf("\t\t\t(stdvga %d)\n", b_info->u.hvm.stdvga);
-        printf("\t\t\t(vnc %d)\n", b_info->u.hvm.vnc.enable);
+        printf("\t\t\t(nestedhvm %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.nested_hvm));
+        printf("\t\t\t(no_incr_generationid %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.incr_generationid));
+        printf("\t\t\t(stdvga %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.stdvga));
+        printf("\t\t\t(vnc %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.vnc.enable));
         printf("\t\t\t(vnclisten %s)\n", b_info->u.hvm.vnc.listen);
         printf("\t\t\t(vncdisplay %d)\n", b_info->u.hvm.vnc.display);
-        printf("\t\t\t(vncunused %d)\n", b_info->u.hvm.vnc.findunused);
+        printf("\t\t\t(vncunused %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.vnc.findunused));
         printf("\t\t\t(keymap %s)\n", b_info->u.hvm.keymap);
-        printf("\t\t\t(sdl %d)\n", b_info->u.hvm.sdl.enable);
-        printf("\t\t\t(opengl %d)\n", b_info->u.hvm.sdl.opengl);
-        printf("\t\t\t(nographic %d)\n", b_info->u.hvm.nographic);
-        printf("\t\t\t(spice %d)\n", b_info->u.hvm.spice.enable);
+        printf("\t\t\t(sdl %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.sdl.enable));
+        printf("\t\t\t(opengl %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.sdl.opengl));
+        printf("\t\t\t(nographic %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.nographic));
+        printf("\t\t\t(spice %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.spice.enable));
         printf("\t\t\t(spiceport %d)\n", b_info->u.hvm.spice.port);
         printf("\t\t\t(spicetls_port %d)\n", b_info->u.hvm.spice.tls_port);
         printf("\t\t\t(spicehost %s)\n", b_info->u.hvm.spice.host);
-        printf("\t\t\t(spicedisable_ticketing %d)\n",
-                    b_info->u.hvm.spice.disable_ticketing);
-        printf("\t\t\t(spiceagent_mouse %d)\n", b_info->u.hvm.spice.agent_mouse);
+        printf("\t\t\t(spicedisable_ticketing %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.spice.disable_ticketing));
+        printf("\t\t\t(spiceagent_mouse %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.spice.agent_mouse));
 
         printf("\t\t\t(device_model %s)\n", b_info->device_model ? : "default");
-        printf("\t\t\t(gfx_passthru %d)\n", b_info->u.hvm.gfx_passthru);
+        printf("\t\t\t(gfx_passthru %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.gfx_passthru));
         printf("\t\t\t(serial %s)\n", b_info->u.hvm.serial);
         printf("\t\t\t(boot %s)\n", b_info->u.hvm.boot);
-        printf("\t\t\t(usb %d)\n", b_info->u.hvm.usb);
+        printf("\t\t\t(usb %s)\n", libxl_defbool_to_string(b_info->u.hvm.usb));
         printf("\t\t\t(usbdevice %s)\n", b_info->u.hvm.usbdevice);
         printf("\t\t)\n");
         break;
@@ -133,7 +149,8 @@
         printf("\t\t\t(kernel %s)\n", b_info->u.pv.kernel.path);
         printf("\t\t\t(cmdline %s)\n", b_info->u.pv.cmdline);
         printf("\t\t\t(ramdisk %s)\n", b_info->u.pv.ramdisk.path);
-        printf("\t\t\t(e820_host %d)\n", b_info->u.pv.e820_host);
+        printf("\t\t\t(e820_host %s)\n",
+               libxl_defbool_to_string(b_info->u.pv.e820_host));
         printf("\t\t)\n");
         break;
     default:
@@ -195,13 +212,17 @@
         printf("\t\t\t(backend_domid %d)\n", d_config->vfbs[i].backend_domid);
         printf("\t\t\t(frontend_domid %d)\n", domid);
         printf("\t\t\t(devid %d)\n", d_config->vfbs[i].devid);
-        printf("\t\t\t(vnc %d)\n", d_config->vfbs[i].vnc.enable);
+        printf("\t\t\t(vnc %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].vnc.enable));
         printf("\t\t\t(vnclisten %s)\n", d_config->vfbs[i].vnc.listen);
         printf("\t\t\t(vncdisplay %d)\n", d_config->vfbs[i].vnc.display);
-        printf("\t\t\t(vncunused %d)\n", d_config->vfbs[i].vnc.findunused);
+        printf("\t\t\t(vncunused %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].vnc.findunused));
         printf("\t\t\t(keymap %s)\n", d_config->vfbs[i].keymap);
-        printf("\t\t\t(sdl %d)\n", d_config->vfbs[i].sdl.enable);
-        printf("\t\t\t(opengl %d)\n", d_config->vfbs[i].sdl.opengl);
+        printf("\t\t\t(sdl %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].sdl.enable));
+        printf("\t\t\t(opengl %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].sdl.opengl));
         printf("\t\t\t(display %s)\n", d_config->vfbs[i].sdl.display);
         printf("\t\t\t(xauthority %s)\n", d_config->vfbs[i].sdl.xauthority);
         printf("\t\t)\n");
diff -r d7fe4cd831a0 -r d64aa013a82e tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Thu Mar 01 12:31:15 2012 +0000
@@ -10,6 +10,7 @@
     "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_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),
     "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",    "Val_mac(&%(c)s)"),
diff -r d7fe4cd831a0 -r d64aa013a82e tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Thu Mar 01 12:31:15 2012 +0000
@@ -195,6 +195,33 @@
 	CAMLreturn(0);
 }
 
+static value Val_defbool(libxl_defbool c_val)
+{
+	CAMLparam0();
+	CAMLlocal1(v);
+
+	if (libxl_defbool_is_default(c_val))
+		v = Val_none;
+	else {
+		bool b = libxl_defbool_val(c_val);
+		v = Val_some(b ? Val_bool(true) : Val_bool(false));
+	}
+	CAMLreturn(v);
+}
+
+static libxl_defbool Defbool_val(value v)
+{
+	CAMLparam1(v);
+	libxl_defbool db;
+	if (v == Val_none)
+		libxl_defbool_unset(&db);
+	else {
+		bool b = Bool_val(Some_val(v));
+		libxl_defbool_set(&db, b);
+	}
+	return db;
+}
+
 static value Val_hwcap(libxl_hwcap *c_val)
 {
 	CAMLparam0();
diff -r d7fe4cd831a0 -r d64aa013a82e tools/python/genwrap.py
--- a/tools/python/genwrap.py	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/python/genwrap.py	Thu Mar 01 12:31:15 2012 +0000
@@ -4,11 +4,13 @@
 
 import idl
 
-(TYPE_BOOL, TYPE_INT, TYPE_UINT, TYPE_STRING, TYPE_AGGREGATE) = range(5)
+(TYPE_DEFBOOL, TYPE_BOOL, TYPE_INT, TYPE_UINT, TYPE_STRING, TYPE_AGGREGATE) = range(6)
 
 def py_type(ty):
     if ty == idl.bool:
         return TYPE_BOOL
+    if ty.typename == "libxl_defbool":
+        return TYPE_DEFBOOL
     if isinstance(ty, idl.Enumeration):
         return TYPE_UINT
     if isinstance(ty, idl.Number):
@@ -44,6 +46,8 @@
         for f in ty.fields:
             if py_type(f.type) is not None:
                 continue
+            if py_type(f.type) == TYPE_DEFBOOL:
+                continue
             if ty.marshal_out():
                 l.append('_hidden PyObject *attrib__%s_get(%s *%s);'%(\
                     fsanitize(f.type.typename), f.type.typename, f.name))
@@ -62,6 +66,8 @@
         l.append('    ret = (self->obj.%s) ? Py_True : Py_False;'%f.name)
         l.append('    Py_INCREF(ret);')
         l.append('    return ret;')
+    elif t == TYPE_DEFBOOL:
+        l.append('    return genwrap__defbool_get(&self->obj.%s);'%f.name)
     elif t == TYPE_INT:
         l.append('    return genwrap__ll_get(self->obj.%s);'%f.name)
     elif t == TYPE_UINT:
@@ -85,6 +91,8 @@
     if t == TYPE_BOOL:
         l.append('    self->obj.%s = (NULL == v || Py_None == v || Py_False == v) ? 0 : 1;'%f.name)
         l.append('    return 0;')
+    elif t == TYPE_DEFBOOL:
+        l.append('    return genwrap__defbool_set(v, &self->obj.%s);'%f.name)
     elif t == TYPE_UINT or t == TYPE_INT:
         l.append('    %slong long tmp;'%(t == TYPE_UINT and 'unsigned ' or ''))
         l.append('    int ret;')
@@ -275,6 +283,8 @@
 _hidden int genwrap__ull_set(PyObject *v, unsigned long long *val, unsigned long long mask);
 _hidden PyObject *genwrap__ll_get(long long val);
 _hidden int genwrap__ll_set(PyObject *v, long long *val, long long mask);
+_hidden PyObject *genwrap__defbool_get(libxl_defbool *db);
+_hidden int genwrap__defbool_set(PyObject *v, libxl_defbool *db);
 
 """ % " ".join(sys.argv))
     for ty in [ty for ty in types if isinstance(ty, idl.Aggregate)]:
diff -r d7fe4cd831a0 -r d64aa013a82e tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/python/xen/lowlevel/xl/xl.c	Thu Mar 01 12:31:15 2012 +0000
@@ -156,6 +156,21 @@
     return 0;
 }
 
+PyObject *genwrap__defbool_get(libxl_defbool *db)
+{
+    PyObject *ret;
+    ret = libxl_defbool_val(*db) ? Py_True : Py_False;
+    Py_INCREF(ret);
+    return ret;
+}
+
+int genwrap__defbool_set(PyObject *v, libxl_defbool *db)
+{
+    bool val = !(NULL == v || Py_None == v || Py_False == v);
+    libxl_defbool_set(db, val);
+    return 0;
+}
+
 static int fixed_bytearray_set(PyObject *v, uint8_t *ptr, size_t len)
 {
     char *tmp;
@@ -762,11 +777,11 @@
     Py_INCREF(xl_error_obj);
     PyModule_AddObject(m, "Error", xl_error_obj);
 
-    _INT_CONST(m, SHUTDOWN_poweroff);
-    _INT_CONST(m, SHUTDOWN_reboot);
-    _INT_CONST(m, SHUTDOWN_suspend);
-    _INT_CONST(m, SHUTDOWN_crash);
-    _INT_CONST(m, SHUTDOWN_watchdog);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_POWEROFF);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_REBOOT);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_SUSPEND);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_CRASH);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_WATCHDOG);
 
     genwrap__init(m);
 }

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:34 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:34 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf0-0000fX-MC; Sat, 03 Mar 2012 04:33:34 +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 1S3gey-0000B5-MV
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:33 +0000
Received: from [85.158.143.99:30747] by server-1.bemta-4.messagelabs.com id
	65/D9-20925-C1F915F4; Sat, 03 Mar 2012 04:33:32 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1330749205!17391925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=1.1 required=7.0 tests=BODY_RANDOM_LONG,DIET_1
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2877 invoked from network); 3 Mar 2012 04:33:26 -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;
	3 Mar 2012 04:33: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 1S3ger-0004h5-B3
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3geq-0003X9-S2
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:25 +0000
Message-Id: <E1S3geq-0003X9-S2@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Merge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330605075 0
# Node ID d64aa013a82e591f628abd7a2cac7cc82da41a4f
# Parent  d7fe4cd831a0d8d7b3cd71ca302ca0280e3a5096
# Parent  17bfd4d2ffce56b65e7849a5779471ef4f5e4aea
Merge
---


diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/gentest.py
--- a/tools/libxl/gentest.py	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/gentest.py	Thu Mar 01 12:31:15 2012 +0000
@@ -1,5 +1,6 @@
 #!/usr/bin/python
 
+import os
 import sys
 import re
 import random
@@ -30,7 +31,7 @@
     elif isinstance(ty, idl.KeyedUnion):
         if parent is None:
             raise Exception("KeyedUnion type must have a parent")
-        s += "switch (%s) {\n" % (parent + ty.keyvar_name)
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
@@ -54,6 +55,8 @@
               ty.pass_arg(v, parent is None))
     elif ty.typename in ["bool"]:
         s += "%s = rand() %% 2;\n" % v
+    elif ty.typename in ["libxl_defbool"]:
+        s += "libxl_defbool_set(%s, !!rand() %% 1);\n" % v
     elif ty.typename in ["char *"]:
         s += "%s = rand_str();\n" % v
     elif ty.private:
@@ -72,7 +75,7 @@
         print >>sys.stderr, "Usage: gentest.py <idl> <implementation>"
         sys.exit(1)
 
-    random.seed()
+    random.seed(os.getenv('LIBXL_TESTIDL_SEED'))
 
     (builtins,types) = idl.parse(sys.argv[1])
 
@@ -196,6 +199,7 @@
 }
 """)
     for ty in builtins + types:
+        if isinstance(ty, idl.Number): continue
         if ty.typename not in handcoded:
             f.write("static void %s_rand_init(%s);\n" % \
                     (ty.typename,
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/gentypes.py
--- a/tools/libxl/gentypes.py	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/gentypes.py	Thu Mar 01 12:31:15 2012 +0000
@@ -32,6 +32,9 @@
             s += "} %s" % ty.typename
 
     elif isinstance(ty, idl.Aggregate):
+        if isinstance(ty, idl.KeyedUnion):
+            s += libxl_C_instance_of(ty.keyvar.type, ty.keyvar.name) + ";\n"
+            
         if ty.typename is None:
             s += "%s {\n" % ty.kind
         else:
@@ -56,7 +59,7 @@
     if isinstance(ty, idl.KeyedUnion):
         if parent is None:
             raise Exception("KeyedUnion type must have a parent")
-        s += "switch (%s) {\n" % (parent + ty.keyvar_name)
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
@@ -75,6 +78,88 @@
         s = indent + s
     return s.replace("\n", "\n%s" % indent).rstrip(indent)
 
+def libxl_init_members(ty, nesting = 0):
+    """Returns a list of members of ty which require a separate init"""
+
+    if isinstance(ty, idl.Aggregate):
+        return [f for f in ty.fields if not f.const and isinstance(f.type,idl.KeyedUnion)]
+    else:
+        return []
+    
+def _libxl_C_type_init(ty, v, indent = "    ", parent = None, subinit=False):
+    s = ""
+    if isinstance(ty, idl.KeyedUnion):
+        if parent is None:
+            raise Exception("KeyedUnion type must have a parent")
+        if subinit:
+            s += "switch (%s) {\n" % (parent + ty.keyvar.name)
+            for f in ty.fields:
+                (nparent,fexpr) = ty.member(v, f, parent is None)
+                s += "case %s:\n" % f.enumname
+                s += _libxl_C_type_init(f.type, fexpr, "    ", nparent)
+                s += "    break;\n"
+            s += "}\n"
+        else:
+            if ty.keyvar.init_val:
+                s += "%s = %s;\n" % (parent + ty.keyvar.name, ty.keyvar.init_val)
+            elif ty.keyvar.type.init_val:
+                s += "%s = %s;\n" % (parent + ty.keyvar.name, ty.keyvar.type.init_val)
+    elif isinstance(ty, idl.Struct) and (parent is None or ty.init_fn is None):
+        for f in [f for f in ty.fields if not f.const]:
+            (nparent,fexpr) = ty.member(v, f, parent is None)
+            if f.init_val is not None:
+                s += "%s = %s;\n" % (fexpr, f.init_val)
+            else:
+                s += _libxl_C_type_init(f.type, fexpr, "", nparent)
+    else:
+        if ty.init_val is not None:
+            s += "%s = %s;\n" % (ty.pass_arg(v, parent is None), ty.init_val)
+        elif ty.init_fn is not None:
+            s += "%s(%s);\n" % (ty.init_fn, ty.pass_arg(v, parent is None))
+
+    if s != "":
+        s = indent + s
+    return s.replace("\n", "\n%s" % indent).rstrip(indent)
+
+def libxl_C_type_init(ty):
+    s = ""
+    s += "void %s(%s)\n" % (ty.init_fn, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE))
+    s += "{\n"
+    s += "    memset(p, '\\0', sizeof(*p));\n"
+    s += _libxl_C_type_init(ty, "p")
+    s += "}\n"
+    s += "\n"
+    return s
+
+def libxl_C_type_member_init(ty, field):
+    if not isinstance(field.type, idl.KeyedUnion):
+        raise Exception("Only KeyedUnion is supported for member init")
+
+    ku = field.type
+    
+    s = ""
+    s += "void %s(%s, %s)\n" % (ty.init_fn + "_" + ku.keyvar.name,
+                                ty.make_arg("p", passby=idl.PASS_BY_REFERENCE),
+                                ku.keyvar.type.make_arg(ku.keyvar.name))
+    s += "{\n"
+    
+    if ku.keyvar.init_val:
+        init_val = ku.keyvar.init_val
+    elif ku.keyvar.type.init_val:
+        init_val = ku.keyvar.type.init_val
+    else:
+        init_val = None
+        
+    if init_val is not None:
+        (nparent,fexpr) = ty.member(ty.pass_arg("p"), ku.keyvar, isref=True)
+        s += "    assert(%s == %s);\n" % (fexpr, init_val)
+        s += "    %s = %s;\n" % (fexpr, ku.keyvar.name)
+    (nparent,fexpr) = ty.member(ty.pass_arg("p"), field, isref=True)
+    s += _libxl_C_type_init(ku, fexpr, parent=nparent, subinit=True)
+    s += "}\n"
+    s += "\n"
+    return s
+
 def libxl_C_type_gen_json(ty, v, indent = "    ", parent = None):
     s = ""
     if parent is None:
@@ -86,7 +171,7 @@
     elif isinstance(ty, idl.KeyedUnion):
         if parent is None:
             raise Exception("KeyedUnion type must have a parent")
-        s += "switch (%s) {\n" % (parent + ty.keyvar_name)
+        s += "switch (%s) {\n" % (parent + ty.keyvar.name)
         for f in ty.fields:
             (nparent,fexpr) = ty.member(v, f, parent is None)
             s += "case %s:\n" % f.enumname
@@ -196,6 +281,15 @@
         f.write(libxl_C_type_define(ty) + ";\n")
         if ty.dispose_fn is not None:
             f.write("void %s(%s);\n" % (ty.dispose_fn, ty.make_arg("p")))
+        if ty.init_fn is not None:
+            f.write("void %s(%s);\n" % (ty.init_fn, ty.make_arg("p")))
+            for field in libxl_init_members(ty):
+                if not isinstance(field.type, idl.KeyedUnion):
+                    raise Exception("Only KeyedUnion is supported for member init")
+                ku = field.type
+                f.write("void %s(%s, %s);\n" % (ty.init_fn + "_" + ku.keyvar.name,
+                                               ty.make_arg("p"),
+                                               ku.keyvar.type.make_arg(ku.keyvar.name)))
         if ty.json_fn is not None:
             f.write("char *%s_to_json(libxl_ctx *ctx, %s);\n" % (ty.typename, ty.make_arg("p")))
         if isinstance(ty, idl.Enumeration):
@@ -224,7 +318,7 @@
 
 """ % (header_json_define, header_json_define, " ".join(sys.argv)))
 
-    for ty in [ty for ty in types+builtins if ty.json_fn is not None]:
+    for ty in [ty for ty in types if ty.json_fn is not None]:
         f.write("yajl_gen_status %s_gen_json(yajl_gen hand, %s);\n" % (ty.typename, ty.make_arg("p", passby=idl.PASS_BY_REFERENCE)))
 
     f.write("\n")
@@ -261,6 +355,11 @@
         f.write("    memset(p, LIBXL_DTOR_POISON, sizeof(*p));\n")
         f.write("}\n")
         f.write("\n")
+        
+    for ty in [t for t in types if t.init_fn is not None and t.autogenerate_init_fn]:
+        f.write(libxl_C_type_init(ty))
+        for field in libxl_init_members(ty):
+            f.write(libxl_C_type_member_init(ty, field))
 
     for ty in [t for t in types if isinstance(t,idl.Enumeration)]:
         f.write("const char *%s_to_string(%s e)\n" % (ty.typename, ty.typename))
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/idl.py
--- a/tools/libxl/idl.py	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/idl.py	Thu Mar 01 12:31:15 2012 +0000
@@ -51,6 +51,10 @@
 
         self.autogenerate_dispose_fn = kwargs.setdefault('autogenerate_dispose_fn', True)
 
+        self.init_fn = kwargs.setdefault('init_fn', None)
+        self.init_val = kwargs.setdefault('init_val', None)
+        self.autogenerate_init_fn = kwargs.setdefault('autogenerate_init_fn', False)
+
         if self.typename is not None and not self.private:
             self.json_fn = kwargs.setdefault('json_fn', self.typename + "_gen_json")
         else:
@@ -144,12 +148,20 @@
         self.name = name
         self.const = kwargs.setdefault('const', False)
         self.enumname = kwargs.setdefault('enumname', None)
+        self.init_val = kwargs.setdefault('init_val', None)
 
 class Aggregate(Type):
     """A type containing a collection of other types"""
     def __init__(self, kind, typename, fields, **kwargs):
         Type.__init__(self, typename, **kwargs)
 
+        if self.typename is not None:
+            self.init_fn = kwargs.setdefault('init_fn', self.typename + "_init")
+        else:
+            self.init_fn = kwargs.setdefault('init_fn', None)
+
+        self.autogenerate_init_fn = kwargs.setdefault('autogenerate_init_fn', True)
+
         self.kind = kind
 
         self.fields = []
@@ -206,8 +218,9 @@
         if not isinstance(keyvar_type, Enumeration):
             raise ValueError
 
-        self.keyvar_name = keyvar_name
-        self.keyvar_type = keyvar_type
+        kv_kwargs = dict([(x.lstrip('keyvar_'),y) for (x,y) in kwargs.items() if x.startswith('keyvar_')])
+        
+        self.keyvar = Field(keyvar_type, keyvar_name, **kv_kwargs)
 
         for f in fields:
             # (name, enum, type)
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/idl.txt
--- a/tools/libxl/idl.txt	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/idl.txt	Thu Mar 01 12:31:15 2012 +0000
@@ -44,6 +44,22 @@
  Indicates if the above named Type.dispose_fn should be
  autogenerated.
 
+Type.init_val: (default: None)
+
+ C expression for the value to initialise instances of this type to.
+
+ If present takes precendence over init_fn (see below).
+
+Type.init_fn: (default: typename + "_init" if dir in [IN, BOTH] and
+                        type != None)
+
+ The name of the C function which will initialist Type.
+
+Type.autogenerate_init_fn: (default: True if dir in [IN, BOTH])
+
+ Indicates if the above named Type.init_fn should be
+ autogenerated.
+
 Type.json_fn: (default: typename + "_gen_json" or None if type == None)
 
  The name of the C function which will generate a YAJL data structure
@@ -105,10 +121,13 @@
 
  Each field has the following properties:
 
-  Field.type    The type of the member (a idl.Type).
-  Field.name    The name of the member (can be None for anonymous
-                fields).
-  Field.const   Boolean, true if the member is const.
+  Field.type     The type of the member (a idl.Type).
+  Field.name     The name of the member (can be None for anonymous
+                 fields).
+  Field.const    Boolean, true if the member is const.
+  Field.init_val The initialisation value for this field. Takes
+                 precendence over both Field.type.init_val and
+                 Field.type.init_fn.
 
 idl.Struct
 
@@ -128,10 +147,9 @@
  where the currently valid member of the union can be determined based
  upon another member in the containing type.
 
- The KeyedUnion.keyvar_name must contain the name of the member of the
+ The KeyedUnion.keyvar contains an idl.type the member of the
  containing type which determines the valid member of the union. The
- member referenced by KeyedUnion.keyvar_name has type
- KeyedUnion.keyvar_type which must be an instance of the Enumeration type.
+ must be an instance of the Enumeration type.
 
 Standard Types
 --------------
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 12:31:15 2012 +0000
@@ -184,6 +184,47 @@
     free(kvl);
 }
 
+#define LIBXL__DEFBOOL_DEFAULT (0)
+#define LIBXL__DEFBOOL_FALSE (-1)
+#define LIBXL__DEFBOOL_TRUE (1)
+
+void libxl_defbool_set(libxl_defbool *db, bool b)
+{
+    db->val = b ? LIBXL__DEFBOOL_TRUE : LIBXL__DEFBOOL_FALSE;
+}
+
+void libxl_defbool_unset(libxl_defbool *db)
+{
+    db->val = LIBXL__DEFBOOL_DEFAULT;
+}
+
+bool libxl_defbool_is_default(libxl_defbool db)
+{
+    return !db.val;
+}
+
+void libxl_defbool_setdefault(libxl_defbool *db, bool b)
+{
+    if (libxl_defbool_is_default(*db))
+        libxl_defbool_set(db, b);
+}
+
+bool libxl_defbool_val(libxl_defbool db)
+{
+    assert(!libxl_defbool_is_default(db));
+    return db.val > 0;
+}
+
+const char *libxl_defbool_to_string(libxl_defbool b)
+{
+    if (b.val < 0)
+        return "False";
+    else if (b.val > 0)
+        return "True";
+    else
+        return "<default>";
+}
+
 /******************************************************************************/
 
 
@@ -442,6 +483,7 @@
     ret = xc_domain_getinfolist(ctx->xch, 0, 1024, info);
     if (ret<0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "geting domain info list");
+        free(ptr);
         return NULL;
     }
 
@@ -464,7 +506,8 @@
     }
     if (ret==0 || xcinfo.domain != domid) return ERROR_INVAL;
 
-    xcinfo2xlinfo(&xcinfo, info_r);
+    if (info_r)
+        xcinfo2xlinfo(&xcinfo, info_r);
     return 0;
 }
 
@@ -491,7 +534,7 @@
         }
         ptr = tmp;
         ptr[i].poolid = info->cpupool_id;
-        ptr[i].sched_id = info->sched_id;
+        ptr[i].sched = info->sched_id;
         ptr[i].n_dom = info->n_dom;
         if (libxl_cpumap_alloc(ctx, &ptr[i].cpumap)) {
             xc_cpupool_infofree(ctx->xch, info);
@@ -986,13 +1029,12 @@
 int libxl_domain_destroy(libxl_ctx *ctx, uint32_t domid)
 {
     GC_INIT(ctx);
-    libxl_dominfo dominfo;
     char *dom_path;
     char *vm_path;
     char *pid;
     int rc, dm_present;
 
-    rc = libxl_domain_info(ctx, &dominfo, domid);
+    rc = libxl_domain_info(ctx, NULL, domid);
     switch(rc) {
     case 0:
         break;
@@ -1185,10 +1227,14 @@
 
 /******************************************************************************/
 
-int libxl_device_disk_init(libxl_ctx *ctx, libxl_device_disk *disk)
+int libxl__device_disk_setdefault(libxl__gc *gc, libxl_device_disk *disk)
 {
-    memset(disk, 0x00, sizeof(libxl_device_disk));
-    return 0;
+    int rc;
+
+    rc = libxl__device_disk_set_backend(gc, disk);
+    if (rc) return rc;
+
+    return rc;
 }
 
 static int libxl__device_from_disk(libxl__gc *gc, uint32_t domid,
@@ -1240,10 +1286,7 @@
     libxl__device device;
     int major, minor, rc;
 
-    rc = libxl__device_disk_set_backend(gc, disk);
-    if (rc) goto out;
-
-    rc = libxl__device_disk_set_backend(gc, disk);
+    rc = libxl__device_disk_setdefault(gc, disk);
     if (rc) goto out;
 
     front = flexarray_make(16, 1);
@@ -1395,7 +1438,7 @@
     unsigned int len;
     char *tmp;
 
-    libxl_device_disk_init(ctx, disk);
+    libxl_device_disk_init(disk);
 
     tmp = xs_read(ctx->xsh, XBT_NULL,
                   libxl__sprintf(gc, "%s/params", be_path), &len);
@@ -1439,7 +1482,7 @@
     char *dompath, *path;
     int rc = ERROR_FAIL;
 
-    libxl_device_disk_init(ctx, disk);
+    libxl_device_disk_init(disk);
 
     dompath = libxl__xs_get_dompath(gc, domid);
     if (!dompath) {
@@ -1603,7 +1646,7 @@
     char *ret = NULL;
     int rc;
 
-    rc = libxl__device_disk_set_backend(gc, disk);
+    rc = libxl__device_disk_setdefault(gc, disk);
     if (rc) goto out;
 
     switch (disk->backend) {
@@ -1670,32 +1713,39 @@
 }
 
 /******************************************************************************/
-int libxl_device_nic_init(libxl_ctx *ctx, libxl_device_nic *nic)
+
+int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic)
 {
-    const uint8_t *r;
-    libxl_uuid uuid;
-
-    libxl_uuid_generate(&uuid);
-    r = libxl_uuid_bytearray(&uuid);
-    memset(nic, '\0', sizeof(*nic));
-
-    nic->backend_domid = 0;
-    nic->devid = -1;
-    nic->mtu = 1492;
-    nic->model = strdup("rtl8139");
-    nic->mac[0] = 0x00;
-    nic->mac[1] = 0x16;
-    nic->mac[2] = 0x3e;
-    nic->mac[3] = r[0] & 0x7f;
-    nic->mac[4] = r[1];
-    nic->mac[5] = r[2];
-    nic->ifname = NULL;
-    nic->bridge = strdup("xenbr0");
-    nic->ip = NULL;
-    if ( asprintf(&nic->script, "%s/vif-bridge",
-               libxl_xen_script_dir_path()) < 0 )
+    if (!nic->mtu)
+        nic->mtu = 1492;
+    if (!nic->model) {
+        nic->model = strdup("rtl8139");
+        if (!nic->model) return ERROR_NOMEM;
+    }
+    if (!nic->mac[0] && !nic->mac[1] && !nic->mac[2] &&
+        !nic->mac[3] && !nic->mac[4] && !nic->mac[5]) {
+        const uint8_t *r;
+        libxl_uuid uuid;
+
+        libxl_uuid_generate(&uuid);
+        r = libxl_uuid_bytearray(&uuid);
+
+        nic->mac[0] = 0x00;
+        nic->mac[1] = 0x16;
+        nic->mac[2] = 0x3e;
+        nic->mac[3] = r[0] & 0x7f;
+        nic->mac[4] = r[1];
+        nic->mac[5] = r[2];
+    }
+    if (!nic->bridge) {
+        nic->bridge = strdup("xenbr0");
+        if (!nic->bridge) return ERROR_NOMEM;
+    }
+    if ( !nic->script && asprintf(&nic->script, "%s/vif-bridge",
+                                  libxl_xen_script_dir_path()) < 0 )
         return ERROR_FAIL;
-    nic->nictype = LIBXL_NIC_TYPE_IOEMU;
+    if (!nic->nictype)
+        nic->nictype = LIBXL_NIC_TYPE_IOEMU;
     return 0;
 }
 
@@ -1722,6 +1772,9 @@
     char *dompath, **l;
     unsigned int nb, rc;
 
+    rc = libxl__device_nic_setdefault(gc, nic);
+    if (rc) goto out;
+
     front = flexarray_make(16, 1);
     if (!front) {
         rc = ERROR_NOMEM;
@@ -2002,7 +2055,7 @@
 
 /******************************************************************************/
 int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
-                              libxl_device_console *console,
+                              libxl__device_console *console,
                               libxl__domain_build_state *state)
 {
     flexarray_t *front;
@@ -2049,7 +2102,7 @@
     flexarray_append(front, "limit");
     flexarray_append(front, libxl__sprintf(gc, "%d", LIBXL_XENCONSOLE_LIMIT));
     flexarray_append(front, "type");
-    if (console->consback == LIBXL_CONSOLE_BACKEND_XENCONSOLED)
+    if (console->consback == LIBXL__CONSOLE_BACKEND_XENCONSOLED)
         flexarray_append(front, "xenconsoled");
     else
         flexarray_append(front, "ioemu");
@@ -2080,9 +2133,9 @@
 }
 
 /******************************************************************************/
-int libxl_device_vkb_init(libxl_ctx *ctx, libxl_device_vkb *vkb)
+
+int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb)
 {
-    memset(vkb, 0x00, sizeof(libxl_device_vkb));
     return 0;
 }
 
@@ -2108,6 +2161,9 @@
     libxl__device device;
     int rc;
 
+    rc = libxl__device_vkb_setdefault(gc, vkb);
+    if (rc) goto out;
+
     front = flexarray_make(16, 1);
     if (!front) {
         rc = ERROR_NOMEM;
@@ -2185,19 +2241,24 @@
 }
 
 /******************************************************************************/
-int libxl_device_vfb_init(libxl_ctx *ctx, libxl_device_vfb *vfb)
+
+int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb)
 {
-    memset(vfb, 0x00, sizeof(libxl_device_vfb));
-    vfb->vnc.enable = 1;
-    vfb->vnc.passwd = NULL;
-    vfb->vnc.listen = strdup("127.0.0.1");
-    vfb->vnc.display = 0;
-    vfb->vnc.findunused = 1;
-    vfb->keymap = NULL;
-    vfb->sdl.enable = 0;
-    vfb->sdl.opengl = 0;
-    vfb->sdl.display = NULL;
-    vfb->sdl.xauthority = NULL;
+    libxl_defbool_setdefault(&vfb->vnc.enable, true);
+    if (libxl_defbool_val(vfb->vnc.enable)) {
+        if (!vfb->vnc.listen) {
+            vfb->vnc.listen = strdup("127.0.0.1");
+            if (!vfb->vnc.listen) return ERROR_NOMEM;
+        }
+
+        libxl_defbool_setdefault(&vfb->vnc.findunused, true);
+    }
+
+    libxl_defbool_setdefault(&vfb->sdl.enable, false);
+    if (libxl_defbool_val(vfb->sdl.enable)) {
+        libxl_defbool_setdefault(&vfb->sdl.opengl, false);
+    }
+
     return 0;
 }
 
@@ -2222,6 +2283,9 @@
     libxl__device device;
     int rc;
 
+    rc = libxl__device_vfb_setdefault(gc, vfb);
+    if (rc) goto out;
+
     front = flexarray_make(16, 1);
     if (!front) {
         rc = ERROR_NOMEM;
@@ -2241,17 +2305,17 @@
     flexarray_append_pair(back, "state", libxl__sprintf(gc, "%d", 1));
     flexarray_append_pair(back, "domain", libxl__domid_to_name(gc, domid));
     flexarray_append_pair(back, "vnc",
-                          libxl__sprintf(gc, "%d", vfb->vnc.enable));
+                          libxl_defbool_val(vfb->vnc.enable) ? "1" : "0");
     flexarray_append_pair(back, "vnclisten", vfb->vnc.listen);
     flexarray_append_pair(back, "vncpasswd", vfb->vnc.passwd);
     flexarray_append_pair(back, "vncdisplay",
                           libxl__sprintf(gc, "%d", vfb->vnc.display));
     flexarray_append_pair(back, "vncunused",
-                          libxl__sprintf(gc, "%d", vfb->vnc.findunused));
+                          libxl_defbool_val(vfb->vnc.findunused) ? "1" : "0");
     flexarray_append_pair(back, "sdl",
-                          libxl__sprintf(gc, "%d", vfb->sdl.enable));
+                          libxl_defbool_val(vfb->sdl.enable) ? "1" : "0");
     flexarray_append_pair(back, "opengl",
-                          libxl__sprintf(gc, "%d", vfb->sdl.opengl));
+                          libxl_defbool_val(vfb->sdl.opengl) ? "1" : "0");
     if (vfb->sdl.xauthority) {
         flexarray_append_pair(back, "xauthority", vfb->sdl.xauthority);
     }
@@ -2624,18 +2688,23 @@
                              uint32_t *need_memkb)
 {
     GC_INIT(ctx);
-    int rc = ERROR_INVAL;
+    int rc;
+
+    rc = libxl__domain_build_info_setdefault(gc, b_info);
+    if (rc) goto out;
+
     *need_memkb = b_info->target_memkb;
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         *need_memkb += b_info->shadow_memkb + LIBXL_HVM_EXTRA_MEMORY;
-        if (b_info->device_model_stubdomain)
+        if (libxl_defbool_val(b_info->device_model_stubdomain))
             *need_memkb += 32 * 1024;
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         *need_memkb += b_info->shadow_memkb + LIBXL_PV_EXTRA_MEMORY;
         break;
     default:
+        rc = ERROR_INVAL;
         goto out;
     }
     if (*need_memkb % (2 * 1024))
@@ -2750,7 +2819,10 @@
     physinfo->sharing_used_frames = xc_sharing_used_frames(ctx->xch);
     physinfo->nr_nodes = xcphysinfo.nr_nodes;
     memcpy(physinfo->hw_cap,xcphysinfo.hw_cap, sizeof(physinfo->hw_cap));
-    physinfo->phys_cap = xcphysinfo.capabilities;
+
+    physinfo->cap_hvm = !!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_hvm);
+    physinfo->cap_hvm_directio =
+        !!(xcphysinfo.capabilities & XEN_SYSCTL_PHYSCAP_hvm_directio);
 
     return 0;
 }
@@ -2961,14 +3033,11 @@
     return rc;
 }
 
-/*
- * returns one of the XEN_SCHEDULER_* constants from public/domctl.h
- */
-int libxl_get_sched_id(libxl_ctx *ctx)
+libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx)
 {
-    int sched, ret;
-
-    if ((ret = xc_sched_id(ctx->xch, &sched)) != 0) {
+    libxl_scheduler sched, ret;
+
+    if ((ret = xc_sched_id(ctx->xch, (int *)&sched)) != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain info list");
         return ERROR_FAIL;
     }
@@ -2981,6 +3050,8 @@
     struct xen_domctl_sched_credit sdom;
     int rc;
 
+    libxl_sched_credit_domain_init(scinfo);
+
     rc = xc_sched_credit_domain_get(ctx->xch, domid, &sdom);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting domain sched credit");
@@ -3040,6 +3111,8 @@
     struct xen_domctl_sched_credit2 sdom;
     int rc;
 
+    libxl_sched_credit2_domain_init(scinfo);
+
     rc = xc_sched_credit2_domain_get(ctx->xch, domid, &sdom);
     if (rc != 0) {
         LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR,
@@ -3097,6 +3170,8 @@
     uint16_t weight;
     int rc;
 
+    libxl_sched_sedf_domain_init(scinfo);
+
     rc = xc_sedf_domain_get(ctx->xch, domid, &period, &slice, &latency,
                             &extratime, &weight);
     if (rc != 0) {
@@ -3443,7 +3518,8 @@
     return 0;
 }
 
-int libxl_cpupool_create(libxl_ctx *ctx, const char *name, int schedid,
+int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
+                         libxl_scheduler sched,
                          libxl_cpumap cpumap, libxl_uuid *uuid,
                          uint32_t *poolid)
 {
@@ -3459,7 +3535,7 @@
         return ERROR_NOMEM;
     }
 
-    rc = xc_cpupool_create(ctx->xch, poolid, schedid);
+    rc = xc_cpupool_create(ctx->xch, poolid, sched);
     if (rc) {
         LIBXL__LOG_ERRNOVAL(ctx, LIBXL__LOG_ERROR, rc,
            "Could not create cpupool");
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 12:31:15 2012 +0000
@@ -124,6 +124,50 @@
  * Therefore public functions which initialize a libxl__gc MUST call
  * libxl__free_all() before returning.
  */
+/*
+ * libxl types
+ *
+ * Most libxl types are defined by the libxl IDL (see
+ * libxl_types.idl). The library provides a common set of methods for
+ * initialising and freeing these types.
+ *
+ * void libxl_<type>_init(<type> *p):
+ *
+ *    Initialises the members of "p" to all defaults. These may either
+ *    be special value which indicates to the library that it should
+ *    select an appropriate default when using this field or actual
+ *    default values.
+ *
+ *    Some fields within a data type (e.g. unions) cannot be sensibly
+ *    initialised without further information. In these cases a
+ *    separate subfield initialisation function is provided (see
+ *    below).
+ *
+ *    An instance which has been initialised using this method can
+ *    always be safely passed to the dispose function (see
+ *    below). This is true even if the data type contains fields which
+ *    require a separate call to a subfield initialisation function.
+ *
+ *    This method is provided for any aggregate type which is used as
+ *    an input parameter.
+ *
+ * void libxl_<type>_init_<subfield>(<type> *p, subfield):
+ *
+ *    Initialise those parts of "p" which are not initialised by the
+ *    main init function due to the unknown value of "subfield". Sets
+ *    p->subfield as well as initialising any fields to their default
+ *    values.
+ *
+ *    p->subfield must not have been previously initialised.
+ *
+ *    This method is provided for any aggregate type.
+ *
+ * void libxl_<type>_dispose(instance *p):
+ *
+ *    Frees any dynamically allocated memory used by the members of
+ *    "p" but not the storage used by "p" itself (this allows for the
+ *    allocation of arrays of types and for the composition of types).
+ */
 #ifndef LIBXL_H
 #define LIBXL_H
 
@@ -137,9 +181,6 @@
 
 #include <xentoollog.h>
 
-#include <xen/sched.h>
-#include <xen/sysctl.h>
-
 #include <libxl_uuid.h>
 #include <_libxl_list.h>
 
@@ -202,9 +243,34 @@
 struct libxl_event;
 typedef LIBXL_TAILQ_ENTRY(struct libxl_event) libxl_ev_link;
 
+/*
+ * A boolean variable with an explicit default state.
+ *
+ * Users should treat this struct as opaque and use the following
+ * defined macros and accessor functions.
+ *
+ * To allow users of the library to naively select all defaults this
+ * state is represented as 0. False is < 0 and True is > 0.
+ */
+typedef struct {
+    int val;
+} libxl_defbool;
+
+void libxl_defbool_set(libxl_defbool *db, bool b);
+/* Resets to default */
+void libxl_defbool_unset(libxl_defbool *db);
+/* Sets db only if it is currently == default */
+void libxl_defbool_setdefault(libxl_defbool *db, bool b);
+bool libxl_defbool_is_default(libxl_defbool db);
+/* db must not be == default */
+bool libxl_defbool_val(libxl_defbool db);
+
+const char *libxl_defbool_to_string(libxl_defbool b);
+
 typedef struct libxl__ctx libxl_ctx;
 
-#define LIBXL_TIMER_MODE_DEFAULT LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS
+#define LIBXL_TIMER_MODE_DEFAULT -1
+#define LIBXL_MEMKB_DEFAULT ~0ULL
 
 #include "_libxl_types.h"
 
@@ -315,10 +381,6 @@
 int libxl_ctx_postfork(libxl_ctx *ctx);
 
 /* domain related functions */
-int libxl_init_create_info(libxl_ctx *ctx, libxl_domain_create_info *c_info);
-int libxl_init_build_info(libxl_ctx *ctx,
-                          libxl_domain_build_info *b_info,
-                          libxl_domain_create_info *c_info);
 typedef int (*libxl_console_ready)(libxl_ctx *ctx, uint32_t domid, void *priv);
 int libxl_domain_create_new(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid);
 int libxl_domain_create_restore(libxl_ctx *ctx, libxl_domain_config *d_config, libxl_console_ready cb, void *priv, uint32_t *domid, int restore_fd);
@@ -390,11 +452,14 @@
  * guests using pygrub. */
 int libxl_primary_console_exec(libxl_ctx *ctx, uint32_t domid_vm);
 
+/* May be called with info_r == NULL to check for domain's existance */
 int libxl_domain_info(libxl_ctx*, libxl_dominfo *info_r,
                       uint32_t domid);
 libxl_dominfo * libxl_list_domain(libxl_ctx*, int *nb_domain);
+void libxl_dominfo_list_free(libxl_dominfo *list, int nr);
 libxl_cpupoolinfo * libxl_list_cpupool(libxl_ctx*, int *nb_pool);
 libxl_vminfo * libxl_list_vm(libxl_ctx *ctx, int *nb_vm);
+void libxl_vminfo_list_free(libxl_vminfo *list, int nr);
 
 /*
  * Devices
@@ -405,8 +470,9 @@
  * additional data type libxl_device_<TYPE>_getinfo which contains
  * further runtime information about the device.
  *
- * A common set of methods are available for each device type. These
- * are described below.
+ * In addition to the general methods available for libxl types (see
+ * "libxl types" above) a common set of methods are available for each
+ * device type. These are described below.
  *
  * Querying
  * --------
@@ -424,10 +490,6 @@
  * Creation / Control
  * ------------------
  *
- * libxl_device_<type>_init(ctx, device):
- *
- *    Initalises device to a default configuration.
- *
  * libxl_device_<type>_add(ctx, domid, device):
  *
  *   Adds the given device to the specified domain. This can be called
@@ -457,7 +519,6 @@
  */
 
 /* Disks */
-int libxl_device_disk_init(libxl_ctx *ctx, libxl_device_disk *disk);
 int libxl_device_disk_add(libxl_ctx *ctx, uint32_t domid, libxl_device_disk *disk);
 int libxl_device_disk_remove(libxl_ctx *ctx, uint32_t domid,
                              libxl_device_disk *disk,
@@ -483,7 +544,6 @@
 int libxl_device_disk_local_detach(libxl_ctx *ctx, libxl_device_disk *disk);
 
 /* Network Interfaces */
-int libxl_device_nic_init(libxl_ctx *ctx, libxl_device_nic *nic);
 int libxl_device_nic_add(libxl_ctx *ctx, uint32_t domid, libxl_device_nic *nic);
 int libxl_device_nic_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_nic *nic,
@@ -495,7 +555,6 @@
                               libxl_device_nic *nic, libxl_nicinfo *nicinfo);
 
 /* Keyboard */
-int libxl_device_vkb_init(libxl_ctx *ctx, libxl_device_vkb *vkb);
 int libxl_device_vkb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
 int libxl_device_vkb_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_vkb *vkb,
@@ -503,7 +562,6 @@
 int libxl_device_vkb_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_vkb *vkb);
 
 /* Framebuffer */
-int libxl_device_vfb_init(libxl_ctx *ctx, libxl_device_vfb *vfb);
 int libxl_device_vfb_add(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb);
 int libxl_device_vfb_remove(libxl_ctx *ctx, uint32_t domid,
                             libxl_device_vfb *vfb,
@@ -511,7 +569,6 @@
 int libxl_device_vfb_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_vfb *vfb);
 
 /* PCI Passthrough */
-int libxl_device_pci_init(libxl_ctx *ctx, libxl_device_pci *pci);
 int libxl_device_pci_add(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
 int libxl_device_pci_remove(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
 int libxl_device_pci_destroy(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev);
@@ -584,7 +641,7 @@
                                unsigned int max_vcpus, libxl_cpumap *cpumap);
 int libxl_set_vcpuonline(libxl_ctx *ctx, uint32_t domid, libxl_cpumap *cpumap);
 
-int libxl_get_sched_id(libxl_ctx *ctx);
+libxl_scheduler libxl_get_scheduler(libxl_ctx *ctx);
 
 
 int libxl_sched_credit_domain_get(libxl_ctx *ctx, uint32_t domid,
@@ -627,7 +684,8 @@
 int libxl_tmem_freeable(libxl_ctx *ctx);
 
 int libxl_get_freecpus(libxl_ctx *ctx, libxl_cpumap *cpumap);
-int libxl_cpupool_create(libxl_ctx *ctx, const char *name, int schedid,
+int libxl_cpupool_create(libxl_ctx *ctx, const char *name,
+                         libxl_scheduler sched,
                          libxl_cpumap cpumap, libxl_uuid *uuid,
                          uint32_t *poolid);
 int libxl_cpupool_destroy(libxl_ctx *ctx, uint32_t poolid);
@@ -638,12 +696,7 @@
 int libxl_cpupool_cpuremove_node(libxl_ctx *ctx, uint32_t poolid, int node, int *cpus);
 int libxl_cpupool_movedomain(libxl_ctx *ctx, uint32_t poolid, uint32_t domid);
 
-static inline int libxl_domid_valid_guest(uint32_t domid)
-{
-    /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
-     * does not check whether the domain actually exists */
-    return domid > 0 && domid < DOMID_FIRST_RESERVED;
-}
+int libxl_domid_valid_guest(uint32_t domid);
 
 int libxl_flask_context_to_sid(libxl_ctx *ctx, char *buf, size_t len,
                                uint32_t *ssidref);
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_bootloader.c
--- a/tools/libxl/libxl_bootloader.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_bootloader.c	Thu Mar 01 12:31:15 2012 +0000
@@ -346,9 +346,15 @@
 
     struct stat st_buf;
 
+    rc = libxl__domain_build_info_setdefault(gc, info);
+    if (rc) goto out;
+
     if (info->type != LIBXL_DOMAIN_TYPE_PV || !info->u.pv.bootloader)
         goto out;
 
+    rc = libxl__domain_build_info_setdefault(gc, info);
+    if (rc) goto out;
+
     rc = ERROR_INVAL;
     if (!disk)
         goto out;
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_create.c	Thu Mar 01 12:31:15 2012 +0000
@@ -50,79 +50,141 @@
     libxl_domain_build_info_dispose(&d_config->b_info);
 }
 
-int libxl_init_create_info(libxl_ctx *ctx, libxl_domain_create_info *c_info)
+int libxl__domain_create_info_setdefault(libxl__gc *gc,
+                                         libxl_domain_create_info *c_info)
 {
-    memset(c_info, '\0', sizeof(*c_info));
-    c_info->xsdata = NULL;
-    c_info->platformdata = NULL;
-    c_info->hap = 1;
-    c_info->type = LIBXL_DOMAIN_TYPE_HVM;
-    c_info->oos = 1;
-    c_info->ssidref = 0;
-    c_info->poolid = 0;
+    if (!c_info->type)
+        return ERROR_INVAL;
+
+    if (c_info->type == LIBXL_DOMAIN_TYPE_HVM) {
+        libxl_defbool_setdefault(&c_info->hap, true);
+        libxl_defbool_setdefault(&c_info->oos, true);
+    }
+
     return 0;
 }
 
-int libxl_init_build_info(libxl_ctx *ctx,
-                          libxl_domain_build_info *b_info,
-                          libxl_domain_create_info *c_info)
+int libxl__domain_build_info_setdefault(libxl__gc *gc,
+                                        libxl_domain_build_info *b_info)
 {
-    memset(b_info, '\0', sizeof(*b_info));
-    b_info->max_vcpus = 1;
-    b_info->cur_vcpus = 1;
-    if (libxl_cpumap_alloc(ctx, &b_info->cpumap))
-        return ERROR_NOMEM;
-    libxl_cpumap_set_any(&b_info->cpumap);
-    b_info->max_memkb = 32 * 1024;
-    b_info->target_memkb = b_info->max_memkb;
-    b_info->disable_migrate = 0;
-    b_info->cpuid = NULL;
-    b_info->shadow_memkb = 0;
-    b_info->type = c_info->type;
+    if (!b_info->device_model_version)
+        b_info->device_model_version =
+            LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
 
-    b_info->device_model_version =
-        LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
-    b_info->device_model_stubdomain = false;
-    b_info->device_model = NULL;
+    if (!b_info->u.hvm.bios)
+        switch (b_info->device_model_version) {
+        case 1: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_ROMBIOS; break;
+        case 2: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_SEABIOS; break;
+        default:return ERROR_INVAL;
+    }
+
+    /* Enforce BIOS<->Device Model version relationship */
+    switch (b_info->device_model_version) {
+    case 1:
+        if (b_info->u.hvm.bios != LIBXL_BIOS_TYPE_ROMBIOS)
+            return ERROR_INVAL;
+        break;
+    case 2:
+        if (b_info->u.hvm.bios == LIBXL_BIOS_TYPE_ROMBIOS)
+            return ERROR_INVAL;
+        break;
+    default:abort();
+    }
+
+    libxl_defbool_setdefault(&b_info->device_model_stubdomain, false);
+
+    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM &&
+        b_info->device_model_version !=
+            LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL &&
+        libxl_defbool_val(b_info->device_model_stubdomain)) {
+        LIBXL__LOG(CTX, XTL_ERROR,
+            "device model stubdomains require \"qemu-xen-traditional\"");
+        return ERROR_INVAL;
+    }
+
+    if (!b_info->max_vcpus)
+        b_info->max_vcpus = 1;
+    if (!b_info->cur_vcpus)
+        b_info->cur_vcpus = 1;
+
+    if (!b_info->cpumap.size) {
+        if (libxl_cpumap_alloc(CTX, &b_info->cpumap))
+            return ERROR_NOMEM;
+        libxl_cpumap_set_any(&b_info->cpumap);
+    }
+
+    if (b_info->max_memkb == LIBXL_MEMKB_DEFAULT)
+        b_info->max_memkb = 32 * 1024;
+    if (b_info->target_memkb == LIBXL_MEMKB_DEFAULT)
+        b_info->target_memkb = b_info->max_memkb;
+
+    libxl_defbool_setdefault(&b_info->disable_migrate, false);
 
     switch (b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
-        b_info->video_memkb = 8 * 1024;
-        b_info->u.hvm.firmware = NULL;
-        b_info->u.hvm.bios = 0;
-        b_info->u.hvm.pae = 1;
-        b_info->u.hvm.apic = 1;
-        b_info->u.hvm.acpi = 1;
-        b_info->u.hvm.acpi_s3 = 1;
-        b_info->u.hvm.acpi_s4 = 1;
-        b_info->u.hvm.nx = 1;
-        b_info->u.hvm.viridian = 0;
-        b_info->u.hvm.hpet = 1;
-        b_info->u.hvm.vpt_align = 1;
-        b_info->u.hvm.timer_mode = 1;
-        b_info->u.hvm.nested_hvm = 0;
-        b_info->u.hvm.no_incr_generationid = 0;
+        if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->shadow_memkb = 0;
+        if (b_info->video_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->video_memkb = 8 * 1024;
+        if (b_info->u.hvm.timer_mode == LIBXL_TIMER_MODE_DEFAULT)
+            b_info->u.hvm.timer_mode =
+                LIBXL_TIMER_MODE_NO_DELAY_FOR_MISSED_TICKS;
 
-        b_info->u.hvm.stdvga = 0;
-        b_info->u.hvm.vnc.enable = 1;
-        b_info->u.hvm.vnc.listen = strdup("127.0.0.1");
-        b_info->u.hvm.vnc.display = 0;
-        b_info->u.hvm.vnc.findunused = 1;
-        b_info->u.hvm.keymap = NULL;
-        b_info->u.hvm.sdl.enable = 0;
-        b_info->u.hvm.sdl.opengl = 0;
-        b_info->u.hvm.nographic = 0;
-        b_info->u.hvm.serial = NULL;
-        b_info->u.hvm.boot = strdup("cda");
-        b_info->u.hvm.usb = 0;
-        b_info->u.hvm.usbdevice = NULL;
-        b_info->u.hvm.xen_platform_pci = 1;
+        libxl_defbool_setdefault(&b_info->u.hvm.pae,                true);
+        libxl_defbool_setdefault(&b_info->u.hvm.apic,               true);
+        libxl_defbool_setdefault(&b_info->u.hvm.acpi,               true);
+        libxl_defbool_setdefault(&b_info->u.hvm.acpi_s3,            true);
+        libxl_defbool_setdefault(&b_info->u.hvm.acpi_s4,            true);
+        libxl_defbool_setdefault(&b_info->u.hvm.nx,                 true);
+        libxl_defbool_setdefault(&b_info->u.hvm.viridian,           false);
+        libxl_defbool_setdefault(&b_info->u.hvm.hpet,               true);
+        libxl_defbool_setdefault(&b_info->u.hvm.vpt_align,          true);
+        libxl_defbool_setdefault(&b_info->u.hvm.nested_hvm,         false);
+        libxl_defbool_setdefault(&b_info->u.hvm.incr_generationid,  false);
+        libxl_defbool_setdefault(&b_info->u.hvm.usb,                false);
+        libxl_defbool_setdefault(&b_info->u.hvm.xen_platform_pci,   true);
+
+        if (!b_info->u.hvm.boot) {
+            b_info->u.hvm.boot = strdup("cda");
+            if (!b_info->u.hvm.boot) return ERROR_NOMEM;
+        }
+
+        libxl_defbool_setdefault(&b_info->u.hvm.stdvga, false);
+        libxl_defbool_setdefault(&b_info->u.hvm.vnc.enable, true);
+        if (libxl_defbool_val(b_info->u.hvm.vnc.enable)) {
+            libxl_defbool_setdefault(&b_info->u.hvm.vnc.findunused, true);
+            if (!b_info->u.hvm.vnc.listen) {
+                b_info->u.hvm.vnc.listen = strdup("127.0.0.1");
+                if (!b_info->u.hvm.vnc.listen) return ERROR_NOMEM;
+            }
+        }
+
+        libxl_defbool_setdefault(&b_info->u.hvm.sdl.enable, false);
+        if (libxl_defbool_val(b_info->u.hvm.sdl.enable)) {
+            libxl_defbool_setdefault(&b_info->u.hvm.sdl.opengl, false);
+        }
+
+        libxl_defbool_setdefault(&b_info->u.hvm.spice.enable, false);
+        if (libxl_defbool_val(b_info->u.hvm.spice.enable)) {
+            libxl_defbool_setdefault(&b_info->u.hvm.spice.disable_ticketing,
+                                     false);
+            libxl_defbool_setdefault(&b_info->u.hvm.spice.agent_mouse, true);
+        }
+
+        libxl_defbool_setdefault(&b_info->u.hvm.nographic, false);
+
+        libxl_defbool_setdefault(&b_info->u.hvm.gfx_passthru, false);
+
         break;
     case LIBXL_DOMAIN_TYPE_PV:
-        b_info->u.pv.slack_memkb = 8 * 1024;
+        libxl_defbool_setdefault(&b_info->u.pv.e820_host, false);
+        if (b_info->shadow_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->shadow_memkb = 0;
+        if (b_info->u.pv.slack_memkb == LIBXL_MEMKB_DEFAULT)
+            b_info->u.pv.slack_memkb = 0;
         break;
     default:
-        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+        LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
                    "invalid domain type %s in create info",
                    libxl_domain_type_to_string(b_info->type));
         return ERROR_INVAL;
@@ -130,17 +192,16 @@
     return 0;
 }
 
-static int init_console_info(libxl_device_console *console, int dev_num)
+static int init_console_info(libxl__device_console *console, int dev_num)
 {
-    memset(console, 0x00, sizeof(libxl_device_console));
+    memset(console, 0x00, sizeof(libxl__device_console));
     console->devid = dev_num;
-    console->consback = LIBXL_CONSOLE_BACKEND_XENCONSOLED;
+    console->consback = LIBXL__CONSOLE_BACKEND_XENCONSOLED;
     console->output = strdup("pty");
-    if ( NULL == console->output )
+    if (!console->output)
         return ERROR_NOMEM;
     return 0;
 }
-
 int libxl__domain_build(libxl__gc *gc,
                         libxl_domain_build_info *info,
                         uint32_t domid,
@@ -172,11 +233,11 @@
 
         localents = libxl__calloc(gc, 7, sizeof(char *));
         localents[0] = "platform/acpi";
-        localents[1] = (info->u.hvm.acpi) ? "1" : "0";
+        localents[1] = libxl_defbool_val(info->u.hvm.acpi) ? "1" : "0";
         localents[2] = "platform/acpi_s3";
-        localents[3] = (info->u.hvm.acpi_s3) ? "1" : "0";
+        localents[3] = libxl_defbool_val(info->u.hvm.acpi_s3) ? "1" : "0";
         localents[4] = "platform/acpi_s4";
-        localents[5] = (info->u.hvm.acpi_s4) ? "1" : "0";
+        localents[5] = libxl_defbool_val(info->u.hvm.acpi_s4) ? "1" : "0";
 
         break;
     case LIBXL_DOMAIN_TYPE_PV:
@@ -320,8 +381,8 @@
     flags = 0;
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
         flags |= XEN_DOMCTL_CDF_hvm_guest;
-        flags |= info->hap ? XEN_DOMCTL_CDF_hap : 0;
-        flags |= info->oos ? 0 : XEN_DOMCTL_CDF_oos_off;
+        flags |= libxl_defbool_val(info->hap) ? XEN_DOMCTL_CDF_hap : 0;
+        flags |= libxl_defbool_val(info->oos) ? 0 : XEN_DOMCTL_CDF_oos_off;
     }
     *domid = -1;
 
@@ -378,7 +439,6 @@
     xs_rm(ctx->xsh, t, dom_path);
     libxl__xs_mkdir(gc, t, dom_path, roperm, ARRAY_SIZE(roperm));
 
-
     xs_rm(ctx->xsh, t, vm_path);
     libxl__xs_mkdir(gc, t, vm_path, roperm, ARRAY_SIZE(roperm));
 
@@ -470,6 +530,12 @@
 
     domid = 0;
 
+    ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info);
+    if (ret) goto error_out;
+
+    ret = libxl__domain_create_info_setdefault(gc, &d_config->c_info);
+    if (ret) goto error_out;
+
     ret = libxl__domain_make(gc, &d_config->c_info, &domid);
     if (ret) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot make domain: %d", ret);
@@ -482,9 +548,11 @@
             goto error_out;
     }
 
+    ret = libxl__domain_build_info_setdefault(gc, &d_config->b_info);
+    if (ret) goto error_out;
 
     for (i = 0; i < d_config->num_disks; i++) {
-        ret = libxl__device_disk_set_backend(gc, &d_config->disks[i]);
+        ret = libxl__device_disk_setdefault(gc, &d_config->disks[i]);
         if (ret) goto error_out;
     }
 
@@ -534,18 +602,16 @@
     switch (d_config->c_info.type) {
     case LIBXL_DOMAIN_TYPE_HVM:
     {
-        libxl_device_console console;
+        libxl__device_console console;
         libxl_device_vkb vkb;
 
         ret = init_console_info(&console, 0);
         if ( ret )
             goto error_out;
         libxl__device_console_add(gc, domid, &console, &state);
-        libxl_device_console_dispose(&console);
+        libxl__device_console_dispose(&console);
 
-        ret = libxl_device_vkb_init(ctx, &vkb);
-        if ( ret )
-            goto error_out;
+        libxl_device_vkb_init(&vkb);
         libxl_device_vkb_add(ctx, domid, &vkb);
         libxl_device_vkb_dispose(&vkb);
 
@@ -561,7 +627,7 @@
     case LIBXL_DOMAIN_TYPE_PV:
     {
         int need_qemu = 0;
-        libxl_device_console console;
+        libxl__device_console console;
 
         for (i = 0; i < d_config->num_vfbs; i++) {
             libxl_device_vfb_add(ctx, domid, &d_config->vfbs[i]);
@@ -577,10 +643,10 @@
                 d_config->num_disks, &d_config->disks[0]);
 
         if (need_qemu)
-             console.consback = LIBXL_CONSOLE_BACKEND_IOEMU;
+             console.consback = LIBXL__CONSOLE_BACKEND_IOEMU;
 
         libxl__device_console_add(gc, domid, &console, &state);
-        libxl_device_console_dispose(&console);
+        libxl__device_console_dispose(&console);
 
         if (need_qemu) {
             libxl__create_xenpv_qemu(gc, domid, d_config, &state, &dm_starting);
@@ -619,7 +685,7 @@
     }
 
     if (d_config->c_info.type == LIBXL_DOMAIN_TYPE_PV &&
-        d_config->b_info.u.pv.e820_host) {
+        libxl_defbool_val(d_config->b_info.u.pv.e820_host)) {
         int rc;
         rc = libxl__e820_alloc(gc, domid, d_config);
         if (rc)
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_dm.c
--- a/tools/libxl/libxl_dm.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_dm.c	Thu Mar 01 12:31:15 2012 +0000
@@ -39,7 +39,7 @@
     libxl_ctx *ctx = libxl__gc_owner(gc);
     const char *dm;
 
-    if (info->device_model_stubdomain)
+    if (libxl_defbool_val(info->device_model_stubdomain))
         return NULL;
 
     if (info->device_model) {
@@ -63,18 +63,6 @@
     return dm;
 }
 
-static const char *libxl__domain_bios(libxl__gc *gc,
-                                const libxl_domain_build_info *info)
-{
-    if (info->u.hvm.bios)
-       return libxl_bios_type_to_string(info->u.hvm.bios);
-    switch (info->device_model_version) {
-    case 1: return "rombios";
-    case 2: return "seabios";
-    default:return NULL;
-    }
-}
-
 const libxl_vnc_info *libxl__dm_vnc(const libxl_domain_config *guest_config)
 {
     const libxl_vnc_info *vnc = NULL;
@@ -83,7 +71,7 @@
     } else if (guest_config->num_vfbs > 0) {
         vnc = &guest_config->vfbs[0].vnc;
     }
-    return vnc && vnc->enable ? vnc : NULL;
+    return vnc && libxl_defbool_val(vnc->enable) ? vnc : NULL;
 }
 
 static const libxl_sdl_info *dm_sdl(const libxl_domain_config *guest_config)
@@ -94,7 +82,7 @@
     } else if (guest_config->num_vfbs > 0) {
         sdl = &guest_config->vfbs[0].sdl;
     }
-    return sdl && sdl->enable ? sdl : NULL;
+    return sdl && libxl_defbool_val(sdl->enable) ? sdl : NULL;
 }
 
 static const char *dm_keymap(const libxl_domain_config *guest_config)
@@ -156,13 +144,13 @@
         flexarray_append(dm_args, "-vnc");
         flexarray_append(dm_args, vncarg);
 
-        if (vnc->findunused) {
+        if (libxl_defbool_val(vnc->findunused)) {
             flexarray_append(dm_args, "-vncunused");
         }
     }
     if (sdl) {
         flexarray_append(dm_args, "-sdl");
-        if (!sdl->opengl) {
+        if (!libxl_defbool_val(sdl->opengl)) {
             flexarray_append(dm_args, "-disable-opengl");
         }
         /* XXX sdl->{display,xauthority} into $DISPLAY/$XAUTHORITY */
@@ -177,7 +165,7 @@
             flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, NULL);
         }
 
-        if (b_info->u.hvm.nographic && (!sdl && !vnc)) {
+        if (libxl_defbool_val(b_info->u.hvm.nographic) && (!sdl && !vnc)) {
             flexarray_append(dm_args, "-nographic");
         }
 
@@ -187,14 +175,14 @@
                                    libxl__sizekb_to_mb(b_info->video_memkb)),
                     NULL);
         }
-        if (b_info->u.hvm.stdvga) {
+        if (libxl_defbool_val(b_info->u.hvm.stdvga)) {
             flexarray_append(dm_args, "-std-vga");
         }
 
         if (b_info->u.hvm.boot) {
             flexarray_vappend(dm_args, "-boot", b_info->u.hvm.boot, NULL);
         }
-        if (b_info->u.hvm.usb || b_info->u.hvm.usbdevice) {
+        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
@@ -204,7 +192,7 @@
         if (b_info->u.hvm.soundhw) {
             flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
         }
-        if (b_info->u.hvm.acpi) {
+        if (libxl_defbool_val(b_info->u.hvm.acpi)) {
             flexarray_append(dm_args, "-acpi");
         }
         if (b_info->max_vcpus > 1) {
@@ -240,7 +228,7 @@
         if ( ioemu_vifs == 0 ) {
             flexarray_vappend(dm_args, "-net", "none", NULL);
         }
-        if (b_info->u.hvm.gfx_passthru) {
+        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
             flexarray_append(dm_args, "-gfx_passthru");
         }
     } else {
@@ -293,7 +281,7 @@
         return NULL;
     }
 
-    if (!spice->disable_ticketing) {
+    if (!libxl_defbool_val(spice->disable_ticketing)) {
         if (!spice->passwd) {
             LIBXL__LOG(CTX, LIBXL__LOG_ERROR,
                        "spice ticketing is enabled but missing password");
@@ -309,12 +297,12 @@
                          spice->port, spice->tls_port);
     if (spice->host)
         opt = libxl__sprintf(gc, "%s,addr=%s", opt, spice->host);
-    if (spice->disable_ticketing)
+    if (libxl_defbool_val(spice->disable_ticketing))
         opt = libxl__sprintf(gc, "%s,disable-ticketing", opt);
     else
         opt = libxl__sprintf(gc, "%s,password=%s", opt, spice->passwd);
     opt = libxl__sprintf(gc, "%s,agent-mouse=%s", opt,
-                         spice->agent_mouse ? "on" : "off");
+                         libxl_defbool_val(spice->agent_mouse) ? "on" : "off");
     return opt;
 }
 
@@ -383,7 +371,7 @@
         if (vnc->passwd && vnc->passwd[0]) {
             vncarg = libxl__sprintf(gc, "%s,password", vncarg);
         }
-        if (vnc->findunused) {
+        if (libxl_defbool_val(vnc->findunused)) {
             /* This option asks to QEMU to try this number of port before to
              * give up.  So QEMU will try ports between $display and $display +
              * 99.  This option needs to be the last one of the vnc options. */
@@ -411,11 +399,11 @@
             flexarray_vappend(dm_args, "-serial", b_info->u.hvm.serial, NULL);
         }
 
-        if (b_info->u.hvm.nographic && (!sdl && !vnc)) {
+        if (libxl_defbool_val(b_info->u.hvm.nographic) && (!sdl && !vnc)) {
             flexarray_append(dm_args, "-nographic");
         }
 
-        if (b_info->u.hvm.spice.enable) {
+        if (libxl_defbool_val(b_info->u.hvm.spice.enable)) {
             const libxl_spice_info *spice = &b_info->u.hvm.spice;
             char *spiceoptions = dm_spice_options(gc, spice);
             if (!spiceoptions)
@@ -425,7 +413,7 @@
             flexarray_append(dm_args, spiceoptions);
         }
 
-        if (b_info->u.hvm.stdvga) {
+        if (libxl_defbool_val(b_info->u.hvm.stdvga)) {
                 flexarray_vappend(dm_args, "-vga", "std", NULL);
         }
 
@@ -433,7 +421,7 @@
             flexarray_vappend(dm_args, "-boot",
                     libxl__sprintf(gc, "order=%s", b_info->u.hvm.boot), NULL);
         }
-        if (b_info->u.hvm.usb || b_info->u.hvm.usbdevice) {
+        if (libxl_defbool_val(b_info->u.hvm.usb) || b_info->u.hvm.usbdevice) {
             flexarray_append(dm_args, "-usb");
             if (b_info->u.hvm.usbdevice) {
                 flexarray_vappend(dm_args,
@@ -443,7 +431,7 @@
         if (b_info->u.hvm.soundhw) {
             flexarray_vappend(dm_args, "-soundhw", b_info->u.hvm.soundhw, NULL);
         }
-        if (!b_info->u.hvm.acpi) {
+        if (!libxl_defbool_val(b_info->u.hvm.acpi)) {
             flexarray_append(dm_args, "-no-acpi");
         }
         if (b_info->max_vcpus > 1) {
@@ -485,7 +473,7 @@
             flexarray_append(dm_args, "-net");
             flexarray_append(dm_args, "none");
         }
-        if (b_info->u.hvm.gfx_passthru) {
+        if (libxl_defbool_val(b_info->u.hvm.gfx_passthru)) {
             flexarray_append(dm_args, "-gfx_passthru");
         }
     } else {
@@ -616,8 +604,8 @@
     if (b_info->type != LIBXL_DOMAIN_TYPE_HVM)
         return ERROR_INVAL;
 
-    memset(vfb, 0x00, sizeof(libxl_device_vfb));
-    memset(vkb, 0x00, sizeof(libxl_device_vkb));
+    libxl_device_vfb_init(vfb);
+    libxl_device_vkb_init(vkb);
 
     vfb->backend_domid = 0;
     vfb->devid = 0;
@@ -688,7 +676,7 @@
 {
     libxl_ctx *ctx = libxl__gc_owner(gc);
     int i, num_console = STUBDOM_SPECIAL_CONSOLES, ret;
-    libxl_device_console *console;
+    libxl__device_console *console;
     libxl_domain_config dm_config;
     libxl_device_vfb vfb;
     libxl_device_vkb vkb;
@@ -705,7 +693,7 @@
         goto out;
     }
 
-    memset(&dm_config.c_info, 0x00, sizeof(libxl_domain_create_info));
+    libxl_domain_create_info_init(&dm_config.c_info);
     dm_config.c_info.type = LIBXL_DOMAIN_TYPE_PV;
     dm_config.c_info.name = libxl__sprintf(gc, "%s-dm",
                                     libxl__domid_to_name(gc, guest_domid));
@@ -713,13 +701,13 @@
 
     libxl_uuid_generate(&dm_config.c_info.uuid);
 
-    memset(&dm_config.b_info, 0x00, sizeof(libxl_domain_build_info));
-    dm_config.b_info.type = dm_config.c_info.type;
+    libxl_domain_build_info_init(&dm_config.b_info);
+    libxl_domain_build_info_init_type(&dm_config.b_info, LIBXL_DOMAIN_TYPE_PV);
+
     dm_config.b_info.max_vcpus = 1;
     dm_config.b_info.max_memkb = 32 * 1024;
     dm_config.b_info.target_memkb = dm_config.b_info.max_memkb;
 
-    dm_config.b_info.type = LIBXL_DOMAIN_TYPE_PV;
     dm_config.b_info.u.pv.kernel.path = libxl__abs_path(gc, "ioemu-stubdom.gz",
                                               libxl_xenfirmwaredir_path());
     dm_config.b_info.u.pv.cmdline = libxl__sprintf(gc, " -d %d", guest_domid);
@@ -740,6 +728,11 @@
     dm_config.vifs = guest_config->vifs;
     dm_config.num_vifs = guest_config->num_vifs;
 
+    ret = libxl__domain_create_info_setdefault(gc, &dm_config.c_info);
+    if (ret) goto out;
+    ret = libxl__domain_build_info_setdefault(gc, &dm_config.b_info);
+    if (ret) goto out;
+
     libxl__vfb_and_vkb_from_hvm_guest_config(gc, guest_config, &vfb, &vkb);
     dm_config.vfbs = &vfb;
     dm_config.num_vfbs = 1;
@@ -816,7 +809,7 @@
     if (guest_config->b_info.u.hvm.serial)
         num_console++;
 
-    console = libxl__calloc(gc, num_console, sizeof(libxl_device_console));
+    console = libxl__calloc(gc, num_console, sizeof(libxl__device_console));
     if (!console) {
         ret = ERROR_NOMEM;
         goto out_free;
@@ -824,7 +817,7 @@
 
     for (i = 0; i < num_console; i++) {
         console[i].devid = i;
-        console[i].consback = LIBXL_CONSOLE_BACKEND_IOEMU;
+        console[i].consback = LIBXL__CONSOLE_BACKEND_IOEMU;
         /* STUBDOM_CONSOLE_LOGGING (console 0) is for minios logging
          * STUBDOM_CONSOLE_SAVE (console 1) is for writing the save file
          * STUBDOM_CONSOLE_RESTORE (console 2) is for reading the save file
@@ -907,7 +900,7 @@
     char **pass_stuff;
     const char *dm;
 
-    if (b_info->device_model_stubdomain) {
+    if (libxl_defbool_val(b_info->device_model_stubdomain)) {
         rc = libxl__create_stubdom(gc, domid, guest_config, state, starting_r);
         goto out;
     }
@@ -929,10 +922,13 @@
         goto out;
     }
 
-    path = xs_get_domain_path(ctx->xsh, domid);
-    libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/hvmloader/bios", path),
-                    "%s", libxl__domain_bios(gc, b_info));
-    free(path);
+    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
+        path = xs_get_domain_path(ctx->xsh, domid);
+        libxl__xs_write(gc, XBT_NULL,
+                        libxl__sprintf(gc, "%s/hvmloader/bios", path),
+                        "%s", libxl_bios_type_to_string(b_info->u.hvm.bios));
+        free(path);
+    }
 
     path = libxl__sprintf(gc, "/local/domain/0/device-model/%d", domid);
     xs_mkdir(ctx->xsh, XBT_NULL, path);
@@ -941,7 +937,7 @@
         b_info->device_model_version
         == LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL)
         libxl__xs_write(gc, XBT_NULL, libxl__sprintf(gc, "%s/disable_pf", path),
-                        "%d", !b_info->u.hvm.xen_platform_pci);
+                    "%d", !libxl_defbool_val(b_info->u.hvm.xen_platform_pci));
 
     libxl_create_logfile(ctx,
                          libxl__sprintf(gc, "qemu-dm-%s", c_info->name),
@@ -1088,7 +1084,7 @@
 }
 
 int libxl__need_xenpv_qemu(libxl__gc *gc,
-        int nr_consoles, libxl_device_console *consoles,
+        int nr_consoles, libxl__device_console *consoles,
         int nr_vfbs, libxl_device_vfb *vfbs,
         int nr_disks, libxl_device_disk *disks)
 {
@@ -1100,7 +1096,7 @@
     }
 
     for (i = 0; i < nr_consoles; i++) {
-        if (consoles[i].consback == LIBXL_CONSOLE_BACKEND_IOEMU) {
+        if (consoles[i].consback == LIBXL__CONSOLE_BACKEND_IOEMU) {
             ret = 1;
             goto out;
         }
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_dom.c
--- a/tools/libxl/libxl_dom.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_dom.c	Thu Mar 01 12:31:15 2012 +0000
@@ -88,7 +88,7 @@
         abort();
     }
     xc_domain_set_tsc_info(ctx->xch, domid, tsc_mode, 0, 0, 0);
-    if ( info->disable_migrate )
+    if (libxl_defbool_val(info->disable_migrate))
         xc_domain_disable_migrate(ctx->xch, domid);
 
     if (info->type == LIBXL_DOMAIN_TYPE_HVM) {
@@ -129,11 +129,12 @@
 
     ents = libxl__calloc(gc, 12 + (info->max_vcpus * 2) + 2, sizeof(char *));
     ents[0] = "memory/static-max";
-    ents[1] = libxl__sprintf(gc, "%d", info->max_memkb);
+    ents[1] = libxl__sprintf(gc, "%"PRId64, info->max_memkb);
     ents[2] = "memory/target";
-    ents[3] = libxl__sprintf(gc, "%d", info->target_memkb - info->video_memkb);
+    ents[3] = libxl__sprintf(gc, "%"PRId64,
+                             info->target_memkb - info->video_memkb);
     ents[4] = "memory/videoram";
-    ents[5] = libxl__sprintf(gc, "%d", info->video_memkb);
+    ents[5] = libxl__sprintf(gc, "%"PRId64, info->video_memkb);
     ents[6] = "domid";
     ents[7] = libxl__sprintf(gc, "%d", domid);
     ents[8] = "store/port";
@@ -291,7 +292,7 @@
         return -1;
 
     va_hvm = (struct hvm_info_table *)(va_map + HVM_INFO_OFFSET);
-    va_hvm->apic_mode = info->u.hvm.apic;
+    va_hvm->apic_mode = libxl_defbool_val(info->u.hvm.apic);
     va_hvm->nr_vcpus = info->max_vcpus;
     memcpy(va_hvm->vcpu_online, &info->cur_vcpus, sizeof(info->cur_vcpus));
     for (i = 0, sum = 0; i < va_hvm->length; i++)
@@ -301,14 +302,19 @@
 
     xc_get_hvm_param(handle, domid, HVM_PARAM_STORE_PFN, store_mfn);
     xc_get_hvm_param(handle, domid, HVM_PARAM_CONSOLE_PFN, console_mfn);
-    xc_set_hvm_param(handle, domid, HVM_PARAM_PAE_ENABLED, info->u.hvm.pae);
+    xc_set_hvm_param(handle, domid, HVM_PARAM_PAE_ENABLED,
+                     libxl_defbool_val(info->u.hvm.pae));
 #if defined(__i386__) || defined(__x86_64__)
-    xc_set_hvm_param(handle, domid, HVM_PARAM_VIRIDIAN, info->u.hvm.viridian);
-    xc_set_hvm_param(handle, domid, HVM_PARAM_HPET_ENABLED, (unsigned long) info->u.hvm.hpet);
+    xc_set_hvm_param(handle, domid, HVM_PARAM_VIRIDIAN,
+                     libxl_defbool_val(info->u.hvm.viridian));
+    xc_set_hvm_param(handle, domid, HVM_PARAM_HPET_ENABLED,
+                     libxl_defbool_val(info->u.hvm.hpet));
 #endif
     xc_set_hvm_param(handle, domid, HVM_PARAM_TIMER_MODE, timer_mode(info));
-    xc_set_hvm_param(handle, domid, HVM_PARAM_VPT_ALIGN, (unsigned long) info->u.hvm.vpt_align);
-    xc_set_hvm_param(handle, domid, HVM_PARAM_NESTEDHVM, info->u.hvm.nested_hvm);
+    xc_set_hvm_param(handle, domid, HVM_PARAM_VPT_ALIGN,
+                     libxl_defbool_val(info->u.hvm.vpt_align));
+    xc_set_hvm_param(handle, domid, HVM_PARAM_NESTEDHVM,
+                     libxl_defbool_val(info->u.hvm.nested_hvm));
     xc_set_hvm_param(handle, domid, HVM_PARAM_STORE_EVTCHN, store_evtchn);
     xc_set_hvm_param(handle, domid, HVM_PARAM_CONSOLE_EVTCHN, console_evtchn);
 
@@ -399,8 +405,8 @@
     case LIBXL_DOMAIN_TYPE_HVM:
         hvm = 1;
         superpages = 1;
-        pae = info->u.hvm.pae;
-        no_incr_generationid = info->u.hvm.no_incr_generationid;
+        pae = libxl_defbool_val(info->u.hvm.pae);
+        no_incr_generationid = !libxl_defbool_val(info->u.hvm.incr_generationid);
         break;
     case LIBXL_DOMAIN_TYPE_PV:
         hvm = 0;
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_internal.h
--- a/tools/libxl/libxl_internal.h	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_internal.h	Thu Mar 01 12:31:15 2012 +0000
@@ -187,6 +187,16 @@
  * version of the _evdisable_FOO function; the internal one is
  * used during cleanup.
  */
+_hidden int libxl__domain_create_info_setdefault(libxl__gc *gc,
+                                        libxl_domain_create_info *c_info);
+_hidden int libxl__domain_build_info_setdefault(libxl__gc *gc,
+                                        libxl_domain_build_info *b_info);
+_hidden int libxl__device_disk_setdefault(libxl__gc *gc,
+                                          libxl_device_disk *disk);
+_hidden int libxl__device_nic_setdefault(libxl__gc *gc, libxl_device_nic *nic);
+_hidden int libxl__device_vfb_setdefault(libxl__gc *gc, libxl_device_vfb *vfb);
+_hidden int libxl__device_vkb_setdefault(libxl__gc *gc, libxl_device_vkb *vkb);
+_hidden int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci);
 
 struct libxl__evgen_domain_death {
     uint32_t domid;
@@ -652,7 +662,7 @@
                                           int *pdisk, int *ppartition);
 
 _hidden int libxl__device_console_add(libxl__gc *gc, uint32_t domid,
-                                      libxl_device_console *console,
+                                      libxl__device_console *console,
                                       libxl__domain_build_state *state);
 
 _hidden int libxl__device_generic_add(libxl__gc *gc, libxl__device *device,
@@ -665,6 +675,19 @@
 _hidden int libxl__devices_destroy(libxl__gc *gc, uint32_t domid);
 _hidden int libxl__wait_for_backend(libxl__gc *gc, char *be_path, char *state);
 
+/*
+ * For each aggregate type which can be used as an input we provide:
+ *
+ * int libxl__<type>_setdefault(gc, <type> *p):
+ *
+ *     Idempotently sets any members of "p" which is currently set to
+ *     a special value indicating that the defaults should be used
+ *     (per libxl_<type>_init) to a specific value.
+ *
+ *     All libxl API functions are expected to have arranged for this
+ *     to be called before using any values within these structures.
+ */
+
 /* Arranges that dev will be removed from its guest.  When
  * this is done, the ao will be completed.  An error
  * return from libxl__initiate_device_remove means that the ao
@@ -882,7 +905,7 @@
                               libxl__domain_build_state *state,
                               libxl__spawner_starting **starting_r);
 _hidden int libxl__need_xenpv_qemu(libxl__gc *gc,
-        int nr_consoles, libxl_device_console *consoles,
+        int nr_consoles, libxl__device_console *consoles,
         int nr_vfbs, libxl_device_vfb *vfbs,
         int nr_disks, libxl_device_disk *disks);
   /* Caller must either: pass starting_r==0, or on successful
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_json.c
--- a/tools/libxl/libxl_json.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_json.c	Thu Mar 01 12:31:15 2012 +0000
@@ -85,6 +85,12 @@
 /*
  * YAJL generators for builtin libxl types.
  */
+yajl_gen_status libxl_defbool_gen_json(yajl_gen hand,
+                                       libxl_defbool *db)
+{
+    return libxl__yajl_gen_asciiz(hand, libxl_defbool_to_string(*db));
+}
+
 yajl_gen_status libxl_uuid_gen_json(yajl_gen hand,
                                     libxl_uuid *uuid)
 {
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_json.h
--- a/tools/libxl/libxl_json.h	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_json.h	Thu Mar 01 12:31:15 2012 +0000
@@ -22,6 +22,20 @@
 #  include <yajl/yajl_version.h>
 #endif
 
+yajl_gen_status libxl_defbool_gen_json(yajl_gen hand, libxl_defbool *p);
+yajl_gen_status libxl_domid_gen_json(yajl_gen hand, libxl_domid *p);
+yajl_gen_status libxl_uuid_gen_json(yajl_gen hand, libxl_uuid *p);
+yajl_gen_status libxl_mac_gen_json(yajl_gen hand, libxl_mac *p);
+yajl_gen_status libxl_cpumap_gen_json(yajl_gen hand, libxl_cpumap *p);
+yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
+                                                 libxl_cpuid_policy_list *p);
+yajl_gen_status libxl_string_list_gen_json(yajl_gen hand, libxl_string_list *p);
+yajl_gen_status libxl_key_value_list_gen_json(yajl_gen hand,
+                                              libxl_key_value_list *p);
+yajl_gen_status libxl_file_reference_gen_json(yajl_gen hand,
+                                              libxl_file_reference *p);
+yajl_gen_status libxl_hwcap_gen_json(yajl_gen hand, libxl_hwcap *p);
+
 #include <_libxl_types_json.h>
 
 /* YAJL version check */
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_pci.c
--- a/tools/libxl/libxl_pci.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_pci.c	Thu Mar 01 12:31:15 2012 +0000
@@ -765,6 +765,11 @@
     return -1;
 }
 
+int libxl__device_pci_setdefault(libxl__gc *gc, libxl_device_pci *pci)
+{
+    return 0;
+}
+
 int libxl_device_pci_add(libxl_ctx *ctx, uint32_t domid, libxl_device_pci *pcidev)
 {
     GC_INIT(ctx);
@@ -782,6 +787,9 @@
     int num_assigned, i, rc;
     int stubdomid = 0;
 
+    rc = libxl__device_pci_setdefault(gc, pcidev);
+    if (rc) goto out;
+
     rc = get_all_assigned_devices(gc, &assigned, &num_assigned);
     if ( rc ) {
         LIBXL__LOG(ctx, LIBXL__LOG_ERROR, "cannot determine if device is assigned, refusing to continue");
@@ -1365,7 +1373,7 @@
         return ERROR_INVAL;
 
     b_info = &d_config->b_info;
-    if (!b_info->u.pv.e820_host)
+    if (!libxl_defbool_val(b_info->u.pv.e820_host))
         return ERROR_INVAL;
 
     rc = xc_get_machine_memory_map(ctx->xch, map, E820MAX);
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 12:31:15 2012 +0000
@@ -5,6 +5,8 @@
 
 namespace("libxl_")
 
+libxl_defbool = Builtin("defbool", passby=PASS_BY_REFERENCE)
+
 libxl_domid = Builtin("domid", json_fn = "yajl_gen_integer", autogenerate_json = False)
 libxl_uuid = Builtin("uuid", passby=PASS_BY_REFERENCE)
 libxl_mac = Builtin("mac", passby=PASS_BY_REFERENCE)
@@ -18,6 +20,12 @@
 libxl_hwcap = Builtin("hwcap", passby=PASS_BY_REFERENCE)
 
 #
+# Specific integer types
+#
+
+MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
+
+#
 # Constants / Enumerations
 #
 
@@ -36,11 +44,6 @@
     (2, "PV"),
     ])
 
-libxl_console_backend = Enumeration("console_backend", [
-    (1, "XENCONSOLED"),
-    (2, "IOEMU"),
-    ])
-
 libxl_disk_format = Enumeration("disk_format", [
     (0, "UNKNOWN"),
     (1, "QCOW"),
@@ -97,7 +100,7 @@
     (1, "no_delay_for_missed_ticks"),
     (2, "no_missed_ticks_pending"),
     (3, "one_missed_tick_pending"),
-    ])
+    ], init_val = "LIBXL_TIMER_MODE_DEFAULT")
 
 libxl_bios_type = Enumeration("bios_type", [
     (1, "rombios"),
@@ -105,35 +108,52 @@
     (3, "ovmf"),
     ])
 
+# Consistent with values defined in domctl.h
+libxl_scheduler = Enumeration("scheduler", [
+    (4, "sedf"),
+    (5, "credit"),
+    (6, "credit2"),
+    (7, "arinc653"),
+    ])
+
+# Consistent with SHUTDOWN_* in sched.h
+libxl_shutdown_reason = Enumeration("shutdown_reason", [
+    (0, "poweroff"),
+    (1, "reboot"),
+    (2, "suspend"),
+    (3, "crash"),
+    (4, "watchdog"),
+    ])
+
 #
 # Complex libxl types
 #
 libxl_vnc_info = Struct("vnc_info", [
-    ("enable",        bool),
+    ("enable",        libxl_defbool),
     # "address:port" that should be listened on
     ("listen",        string),
     ("passwd",        string),
     ("display",       integer),
     # If set then try to find an unused port
-    ("findunused",    bool),
+    ("findunused",    libxl_defbool),
     ])
 
 libxl_spice_info = Struct("spice_info", [
-    ("enable",            bool),
+    ("enable",      libxl_defbool),
     # At least one of spice port or spicetls_post must be given
     ("port",        integer),
     ("tls_port",    integer),
     # Interface to bind to
     ("host",        string),
     # enable client connection with no password
-    ("disable_ticketing", bool),
+    ("disable_ticketing", libxl_defbool),
     ("passwd",      string),
-    ("agent_mouse", bool),
+    ("agent_mouse", libxl_defbool),
     ])
 
 libxl_sdl_info = Struct("sdl_info", [
-    ("enable",        bool),
-    ("opengl",        bool),
+    ("enable",        libxl_defbool),
+    ("opengl",        libxl_defbool),
     ("display",       string),
     ("xauthority",    string),
     ])
@@ -148,31 +168,31 @@
     ("shutdown",    bool),
     ("dying",       bool),
 
-    # Valid SHUTDOWN_* value from xen/sched.h iff (shutdown||dying).
+    # Valid iff (shutdown||dying).
     #
     # Otherwise set to a value guaranteed not to clash with any valid
-    # SHUTDOWN_* constant.
-    ("shutdown_reason", uint8),
-    ("current_memkb",   uint64),
-    ("shared_memkb", uint64),
-    ("max_memkb",   uint64),
+    # LIBXL_SHUTDOWN_REASON_* constant.
+    ("shutdown_reason", libxl_shutdown_reason),
+    ("current_memkb",   MemKB),
+    ("shared_memkb", MemKB),
+    ("max_memkb",   MemKB),
     ("cpu_time",    uint64),
     ("vcpu_max_id", uint32),
     ("vcpu_online", uint32),
     ("cpupool",     uint32),
-    ], dispose_fn=None)
+    ], dir=DIR_OUT)
 
 libxl_cpupoolinfo = Struct("cpupoolinfo", [
     ("poolid",      uint32),
-    ("sched_id",    uint32),
+    ("sched",       libxl_scheduler),
     ("n_dom",       uint32),
     ("cpumap",      libxl_cpumap)
-    ])
+    ], dir=DIR_OUT)
 
 libxl_vminfo = Struct("vminfo", [
     ("uuid", libxl_uuid),
     ("domid", libxl_domid),
-    ], dispose_fn=None)
+    ], dir=DIR_OUT)
 
 libxl_version_info = Struct("version_info", [
     ("xen_version_major", integer),
@@ -187,19 +207,21 @@
     ("virt_start",        uint64),
     ("pagesize",          integer),
     ("commandline",       string),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_domain_create_info = Struct("domain_create_info",[
     ("type",         libxl_domain_type),
-    ("hap",          bool),
-    ("oos",          bool),
+    ("hap",          libxl_defbool),
+    ("oos",          libxl_defbool),
     ("ssidref",      uint32),
     ("name",         string),
     ("uuid",         libxl_uuid),
     ("xsdata",       libxl_key_value_list),
     ("platformdata", libxl_key_value_list),
     ("poolid",       uint32),
-    ])
+    ], dir=DIR_IN)
+
+MemKB = UInt(64, init_val = "LIBXL_MEMKB_DEFAULT")
 
 # Instances of libxl_file_reference contained in this struct which
 # have been mapped (with libxl_file_reference_map) will be unmapped
@@ -211,17 +233,16 @@
     ("cur_vcpus",       integer),
     ("cpumap",          libxl_cpumap),
     ("tsc_mode",        libxl_tsc_mode),
-    ("max_memkb",       uint32),
-    ("target_memkb",    uint32),
-    ("video_memkb",     uint32),
-    ("shadow_memkb",    uint32),
-    ("disable_migrate", bool),
+    ("max_memkb",       MemKB),
+    ("target_memkb",    MemKB),
+    ("video_memkb",     MemKB),
+    ("shadow_memkb",    MemKB),
+    ("disable_migrate", libxl_defbool),
     ("cpuid",           libxl_cpuid_policy_list),
-    ("type",            libxl_domain_type),
     
     ("device_model_version", libxl_device_model_version),
-    ("device_model_stubdomain", bool),
-    # you set device_model you must set device_model_version too
+    ("device_model_stubdomain", libxl_defbool),
+    # if you set device_model you must set device_model_version too
     ("device_model",     string),
     ("device_model_ssidref", uint32),
 
@@ -233,53 +254,53 @@
     ("extra_hvm",        libxl_string_list),
 
     ("u", KeyedUnion(None, libxl_domain_type, "type",
-                [("hvm", Struct(None, [("firmware", string),
-                                       ("bios", libxl_bios_type),
-                                       ("pae", bool),
-                                       ("apic", bool),
-                                       ("acpi", bool),
-                                       ("acpi_s3", bool),
-                                       ("acpi_s4", bool),
-                                       ("nx", bool),
-                                       ("viridian", bool),
-                                       ("timeoffset", string),
-                                       ("hpet", bool),
-                                       ("vpt_align", bool),
-                                       ("timer_mode", libxl_timer_mode),
-                                       ("nested_hvm", bool),
-                                       ("no_incr_generationid", bool),
-                                       ("nographic",        bool),
-                                       ("stdvga",           bool),
+                [("hvm", Struct(None, [("firmware",         string),
+                                       ("bios",             libxl_bios_type),
+                                       ("pae",              libxl_defbool),
+                                       ("apic",             libxl_defbool),
+                                       ("acpi",             libxl_defbool),
+                                       ("acpi_s3",          libxl_defbool),
+                                       ("acpi_s4",          libxl_defbool),
+                                       ("nx",               libxl_defbool),
+                                       ("viridian",         libxl_defbool),
+                                       ("timeoffset",       string),
+                                       ("hpet",             libxl_defbool),
+                                       ("vpt_align",        libxl_defbool),
+                                       ("timer_mode",       libxl_timer_mode),
+                                       ("nested_hvm",       libxl_defbool),
+                                       ("incr_generationid",libxl_defbool),
+                                       ("nographic",        libxl_defbool),
+                                       ("stdvga",           libxl_defbool),
                                        ("vnc",              libxl_vnc_info),
                                        # keyboard layout, default is en-us keyboard
                                        ("keymap",           string),
                                        ("sdl",              libxl_sdl_info),
                                        ("spice",            libxl_spice_info),
                                        
-                                       ("gfx_passthru",     bool),
+                                       ("gfx_passthru",     libxl_defbool),
                                        
                                        ("serial",           string),
                                        ("boot",             string),
-                                       ("usb",              bool),
+                                       ("usb",              libxl_defbool),
                                        # usbdevice:
                                        # - "tablet" for absolute mouse,
                                        # - "mouse" for PS/2 protocol relative mouse
                                        ("usbdevice",        string),
                                        ("soundhw",          string),
-                                       ("xen_platform_pci", bool),
+                                       ("xen_platform_pci", libxl_defbool),
                                        ])),
                  ("pv", Struct(None, [("kernel", libxl_file_reference),
-                                      ("slack_memkb", uint32),
+                                      ("slack_memkb", MemKB),
                                       ("bootloader", string),
                                       ("bootloader_args", libxl_string_list),
                                       ("cmdline", string),
                                       ("ramdisk", libxl_file_reference),
                                       ("features", string, {'const': True}),
                                       # Use host's E820 for PCI passthrough.
-                                      ("e820_host", bool),
+                                      ("e820_host", libxl_defbool),
                                       ])),
-                 ])),
-    ],
+                 ], keyvar_init_val = "-1")),
+    ], dir=DIR_IN
 )
 
 libxl_device_vfb = Struct("device_vfb", [
@@ -296,13 +317,6 @@
     ("devid", integer),
     ])
 
-libxl_device_console = Struct("device_console", [
-    ("backend_domid", libxl_domid),
-    ("devid", integer),
-    ("consback", libxl_console_backend),
-    ("output", string),
-    ])
-
 libxl_device_disk = Struct("device_disk", [
     ("backend_domid", libxl_domid),
     ("pdev_path", string),
@@ -348,7 +362,7 @@
     ("state", integer),
     ("evtch", integer),
     ("rref", integer),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_nicinfo = Struct("nicinfo", [
     ("backend", string),
@@ -360,7 +374,7 @@
     ("evtch", integer),
     ("rref_tx", integer),
     ("rref_rx", integer),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_vcpuinfo = Struct("vcpuinfo", [
     ("vcpuid", uint32),
@@ -370,7 +384,7 @@
     ("running", bool),
     ("vcpu_time", uint64), # total vcpu time ran (ns)
     ("cpumap", libxl_cpumap), # current cpu's affinities
-    ])
+    ], dir=DIR_OUT)
 
 libxl_physinfo = Struct("physinfo", [
     ("threads_per_core", uint32),
@@ -388,23 +402,25 @@
 
     ("nr_nodes", uint32),
     ("hw_cap", libxl_hwcap),
-    ("phys_cap", uint32),
-    ], dispose_fn=None, dir=DIR_OUT)
+
+    ("cap_hvm", bool),
+    ("cap_hvm_directio", bool),
+    ], dir=DIR_OUT)
 
 libxl_cputopology = Struct("cputopology", [
     ("core", uint32),
     ("socket", uint32),
     ("node", uint32),
-    ])
+    ], dir=DIR_OUT)
 
 libxl_sched_credit_domain = Struct("sched_credit_domain", [
     ("weight", integer),
     ("cap", integer),
-    ], dispose_fn=None)
+    ])
 
 libxl_sched_credit2_domain = Struct("sched_credit2_domain", [
     ("weight", integer),
-    ], dispose_fn=None)
+    ])
 
 libxl_sched_sedf_domain = Struct("sched_sedf_domain", [
     ("period", integer),
@@ -412,7 +428,7 @@
     ("latency", integer),
     ("extratime", integer),
     ("weight", integer),
-    ], dispose_fn=None)
+    ])
 
 libxl_event_type = Enumeration("event_type", [
     (1, "DOMAIN_SHUTDOWN"),
@@ -432,7 +448,6 @@
     ("domid",    libxl_domid),
     ("domuuid",  libxl_uuid),
     ("for_user", libxl_ev_user),
-    ("type",     libxl_event_type),
     ("u", KeyedUnion(None, libxl_event_type, "type",
           [("domain_shutdown", Struct(None, [
                                              ("shutdown_reason", uint8),
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_types_internal.idl
--- a/tools/libxl/libxl_types_internal.idl	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_types_internal.idl	Thu Mar 01 12:31:15 2012 +0000
@@ -1,5 +1,7 @@
 namespace("libxl__")
 
+libxl_domid = Builtin("domid", namespace="libxl_", json_fn = "yajl_gen_integer")
+
 libxl__qmp_message_type = Enumeration("qmp_message_type", [
     (1, "QMP"),
     (2, "return"),
@@ -17,3 +19,15 @@
     (6, "VKBD"),
     (7, "CONSOLE"),
     ])
+
+libxl__console_backend = Enumeration("console_backend", [
+    (1, "XENCONSOLED"),
+    (2, "IOEMU"),
+    ])
+
+libxl__device_console = Struct("device_console", [
+    ("backend_domid", libxl_domid),
+    ("devid", integer),
+    ("consback", libxl__console_backend),
+    ("output", string),
+    ])
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_utils.c
--- a/tools/libxl/libxl_utils.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_utils.c	Thu Mar 01 12:31:15 2012 +0000
@@ -19,18 +19,6 @@
 
 #include "libxl_internal.h"
 
-struct schedid_name {
-    char *name;
-    int id;
-};
-
-static struct schedid_name schedid_name[] = {
-    { "credit", XEN_SCHEDULER_CREDIT },
-    { "sedf", XEN_SCHEDULER_SEDF },
-    { "credit2", XEN_SCHEDULER_CREDIT2 },
-    { NULL, -1 }
-};
-
 const char *libxl_basename(const char *name)
 {
     const char *filename;
@@ -151,28 +139,6 @@
     return ret;
 }
 
-int libxl_name_to_schedid(libxl_ctx *ctx, const char *name)
-{
-    int i;
-
-    for (i = 0; schedid_name[i].name != NULL; i++)
-        if (strcmp(name, schedid_name[i].name) == 0)
-            return schedid_name[i].id;
-
-    return ERROR_INVAL;
-}
-
-char *libxl_schedid_to_name(libxl_ctx *ctx, int schedid)
-{
-    int i;
-
-    for (i = 0; schedid_name[i].name != NULL; i++)
-        if (schedid_name[i].id == schedid)
-            return schedid_name[i].name;
-
-    return "unknown";
-}
-
 int libxl_get_stubdom_id(libxl_ctx *ctx, int guest_domid)
 {
     GC_INIT(ctx);
@@ -541,6 +507,29 @@
     free(list);
 }
 
+void libxl_dominfo_list_free(libxl_dominfo *list, int nr)
+{
+    int i;
+    for (i = 0; i < nr; i++)
+        libxl_dominfo_dispose(&list[i]);
+    free(list);
+}
+
+void libxl_vminfo_list_free(libxl_vminfo *list, int nr)
+{
+    int i;
+    for (i = 0; i < nr; i++)
+        libxl_vminfo_dispose(&list[i]);
+    free(list);
+}
+
+int libxl_domid_valid_guest(uint32_t domid)
+{
+    /* returns 1 if the value _could_ be a valid guest domid, 0 otherwise
+     * does not check whether the domain actually exists */
+    return domid > 0 && domid < DOMID_FIRST_RESERVED;
+}
+
 /*
  * Local variables:
  * mode: C
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxl_utils.h
--- a/tools/libxl/libxl_utils.h	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxl_utils.h	Thu Mar 01 12:31:15 2012 +0000
@@ -24,8 +24,6 @@
 char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid);
 int libxl_name_to_cpupoolid(libxl_ctx *ctx, const char *name, uint32_t *poolid);
 char *libxl_cpupoolid_to_name(libxl_ctx *ctx, uint32_t poolid);
-int libxl_name_to_schedid(libxl_ctx *ctx, const char *name);
-char *libxl_schedid_to_name(libxl_ctx *ctx, int schedid);
 int libxl_get_stubdom_id(libxl_ctx *ctx, int guest_domid);
 int libxl_is_stubdom(libxl_ctx *ctx, uint32_t domid, uint32_t *target_domid);
 int libxl_create_logfile(libxl_ctx *ctx, char *name, char **full_name);
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxlu_cfg.c
--- a/tools/libxl/libxlu_cfg.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxlu_cfg.c	Thu Mar 01 12:31:15 2012 +0000
@@ -237,6 +237,17 @@
     return 0;
 }
 
+int xlu_cfg_get_defbool(const XLU_Config *cfg, const char *n, libxl_defbool *b,
+                     int dont_warn)
+{
+    int ret;
+    long l;
+
+    ret = xlu_cfg_get_long(cfg, n, &l, dont_warn);
+    if (ret) return ret;
+    libxl_defbool_set(b, !!l);
+    return 0;
+}
 
 int xlu_cfg_get_list(const XLU_Config *cfg, const char *n,
                      XLU_ConfigList **list_r, int *entries_r, int dont_warn) {
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/libxlutil.h
--- a/tools/libxl/libxlutil.h	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/libxlutil.h	Thu Mar 01 12:31:15 2012 +0000
@@ -52,6 +52,8 @@
                            char **value_r, int dont_warn);
 int xlu_cfg_get_long(const XLU_Config*, const char *n, long *value_r,
                      int dont_warn);
+int xlu_cfg_get_defbool(const XLU_Config*, const char *n, libxl_defbool *b,
+                     int dont_warn);
 
 int xlu_cfg_get_list(const XLU_Config*, const char *n,
                      XLU_ConfigList **list_r /* may be 0 */,
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Thu Mar 01 12:31:15 2012 +0000
@@ -144,7 +144,6 @@
 static int domain_qualifier_to_domid(const char *p, uint32_t *domid_r,
                                      int *was_name_r)
 {
-    libxl_dominfo dominfo;
     int was_name, rc;
 
     was_name = qualifier_to_id(p, domid_r);
@@ -156,7 +155,7 @@
         if (rc)
             return rc;
     } else {
-        rc = libxl_domain_info(ctx, &dominfo, *domid_r);
+        rc = libxl_domain_info(ctx, NULL, *domid_r);
         /* error only if domain does not exist */
         if (rc == ERROR_INVAL)
             return rc;
@@ -383,7 +382,7 @@
 {
     int e;
 
-    libxl_device_disk_init(ctx, disk);
+    libxl_device_disk_init(disk);
 
     if (!*config) {
         *config = xlu_cfg_init(stderr, "command line");
@@ -536,8 +535,7 @@
         exit(1);
     }
 
-    if (libxl_init_create_info(ctx, c_info))
-        exit(1);
+    libxl_domain_create_info_init(c_info);
 
     if (!xlu_cfg_get_string (config, "seclabel", &buf, 0)) {
         e = libxl_flask_context_to_sid(ctx, (char *)buf, strlen(buf),
@@ -557,8 +555,7 @@
         !strncmp(buf, "hvm", strlen(buf)))
         c_info->type = LIBXL_DOMAIN_TYPE_HVM;
 
-    if (!xlu_cfg_get_long (config, "hap", &l, 0))
-        c_info->hap = l;
+    xlu_cfg_get_defbool(config, "hap", &c_info->hap, 0);
 
     if (xlu_cfg_replace_string (config, "name", &c_info->name, 0)) {
         fprintf(stderr, "Domain name must be specified.\n");
@@ -574,8 +571,7 @@
         libxl_uuid_generate(&c_info->uuid);
     }
 
-    if (!xlu_cfg_get_long(config, "oos", &l, 0))
-        c_info->oos = l;
+    xlu_cfg_get_defbool(config, "oos", &c_info->oos, 0);
 
     if (!xlu_cfg_get_string (config, "pool", &buf, 0)) {
         c_info->poolid = -1;
@@ -586,8 +582,8 @@
         exit(1);
     }
 
-    if (libxl_init_build_info(ctx, b_info, c_info))
-        exit(1);
+    libxl_domain_build_info_init(b_info);
+    libxl_domain_build_info_init_type(b_info, c_info->type);
 
     /* the following is the actual config parsing with overriding values in the structures */
     if (!xlu_cfg_get_long (config, "vcpus", &l, 0)) {
@@ -601,6 +597,11 @@
     if (!xlu_cfg_get_list (config, "cpus", &cpus, 0, 1)) {
         int i, n_cpus = 0;
 
+        if (libxl_cpumap_alloc(ctx, &b_info->cpumap)) {
+            fprintf(stderr, "Unable to allocate cpumap\n");
+            exit(1);
+        }
+
         libxl_cpumap_set_none(&b_info->cpumap);
         while ((buf = xlu_cfg_get_listitem(cpus, n_cpus)) != NULL) {
             i = atoi(buf);
@@ -615,6 +616,11 @@
     else if (!xlu_cfg_get_string (config, "cpus", &buf, 0)) {
         char *buf2 = strdup(buf);
 
+        if (libxl_cpumap_alloc(ctx, &b_info->cpumap)) {
+            fprintf(stderr, "Unable to allocate cpumap\n");
+            exit(1);
+        }
+
         libxl_cpumap_set_none(&b_info->cpumap);
         if (vcpupin_parse(buf2, &b_info->cpumap))
             exit(1);
@@ -666,8 +672,7 @@
         : libxl_get_required_shadow_memory(b_info->max_memkb,
                                            b_info->max_vcpus);
 
-    if (!xlu_cfg_get_long (config, "nomigrate", &l, 0))
-        b_info->disable_migrate = l;
+    xlu_cfg_get_defbool(config, "nomigrate", &b_info->disable_migrate, 0);
 
     if (!xlu_cfg_get_long(config, "tsc_mode", &l, 1)) {
         const char *s = libxl_tsc_mode_to_string(l);
@@ -695,7 +700,7 @@
     if (!xlu_cfg_get_long (config, "videoram", &l, 0))
         b_info->video_memkb = l * 1024;
 
-    switch(c_info->type) {
+    switch(b_info->type) {
     case LIBXL_DOMAIN_TYPE_HVM:
         if (!xlu_cfg_get_string (config, "kernel", &buf, 0))
             fprintf(stderr, "WARNING: ignoring \"kernel\" directive for HVM guest. "
@@ -709,24 +714,16 @@
                     buf);
                 exit (1);
         }
-        if (!xlu_cfg_get_long (config, "pae", &l, 0))
-            b_info->u.hvm.pae = l;
-        if (!xlu_cfg_get_long (config, "apic", &l, 0))
-            b_info->u.hvm.apic = l;
-        if (!xlu_cfg_get_long (config, "acpi", &l, 0))
-            b_info->u.hvm.acpi = l;
-        if (!xlu_cfg_get_long (config, "acpi_s3", &l, 0))
-            b_info->u.hvm.acpi_s3 = l;
-        if (!xlu_cfg_get_long (config, "acpi_s4", &l, 0))
-            b_info->u.hvm.acpi_s4 = l;
-        if (!xlu_cfg_get_long (config, "nx", &l, 0))
-            b_info->u.hvm.nx = l;
-        if (!xlu_cfg_get_long (config, "viridian", &l, 0))
-            b_info->u.hvm.viridian = l;
-        if (!xlu_cfg_get_long (config, "hpet", &l, 0))
-            b_info->u.hvm.hpet = l;
-        if (!xlu_cfg_get_long (config, "vpt_align", &l, 0))
-            b_info->u.hvm.vpt_align = l;
+
+        xlu_cfg_get_defbool(config, "pae", &b_info->u.hvm.pae, 0);
+        xlu_cfg_get_defbool(config, "apic", &b_info->u.hvm.apic, 0);
+        xlu_cfg_get_defbool(config, "acpi", &b_info->u.hvm.acpi, 0);
+        xlu_cfg_get_defbool(config, "acpi_s3", &b_info->u.hvm.acpi_s3, 0);
+        xlu_cfg_get_defbool(config, "acpi_s4", &b_info->u.hvm.acpi_s4, 0);
+        xlu_cfg_get_defbool(config, "nx", &b_info->u.hvm.nx, 0);
+        xlu_cfg_get_defbool(config, "viridian", &b_info->u.hvm.viridian, 0);
+        xlu_cfg_get_defbool(config, "hpet", &b_info->u.hvm.hpet, 0);
+        xlu_cfg_get_defbool(config, "vpt_align", &b_info->u.hvm.vpt_align, 0);
 
         if (!xlu_cfg_get_long(config, "timer_mode", &l, 1)) {
             const char *s = libxl_timer_mode_to_string(l);
@@ -751,8 +748,7 @@
             }
         }
 
-        if (!xlu_cfg_get_long (config, "nestedhvm", &l, 0))
-            b_info->u.hvm.nested_hvm = l;
+        xlu_cfg_get_defbool(config, "nestedhvm", &b_info->u.hvm.nested_hvm, 0);
         break;
     case LIBXL_DOMAIN_TYPE_PV:
     {
@@ -837,7 +833,7 @@
 
             d_config->vifs = (libxl_device_nic *) realloc(d_config->vifs, sizeof (libxl_device_nic) * (d_config->num_vifs+1));
             nic = d_config->vifs + d_config->num_vifs;
-            CHK_ERRNO( libxl_device_nic_init(ctx, nic) );
+            libxl_device_nic_init(nic);
             nic->devid = d_config->num_vifs;
 
             if (default_vifscript) {
@@ -933,12 +929,12 @@
 
             d_config->vfbs = (libxl_device_vfb *) realloc(d_config->vfbs, sizeof(libxl_device_vfb) * (d_config->num_vfbs + 1));
             vfb = d_config->vfbs + d_config->num_vfbs;
-            libxl_device_vfb_init(ctx, vfb);
+            libxl_device_vfb_init(vfb);
             vfb->devid = d_config->num_vfbs;
 
             d_config->vkbs = (libxl_device_vkb *) realloc(d_config->vkbs, sizeof(libxl_device_vkb) * (d_config->num_vkbs + 1));
             vkb = d_config->vkbs + d_config->num_vkbs;
-            libxl_device_vkb_init(ctx, vkb);
+            libxl_device_vkb_init(vkb);
             vkb->devid = d_config->num_vkbs;
 
             p = strtok(buf2, ",");
@@ -951,7 +947,7 @@
                     break;
                 *p2 = '\0';
                 if (!strcmp(p, "vnc")) {
-                    vfb->vnc.enable = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->vnc.enable, atoi(p2 + 1));
                 } else if (!strcmp(p, "vnclisten")) {
                     free(vfb->vnc.listen);
                     vfb->vnc.listen = strdup(p2 + 1);
@@ -961,14 +957,14 @@
                 } else if (!strcmp(p, "vncdisplay")) {
                     vfb->vnc.display = atoi(p2 + 1);
                 } else if (!strcmp(p, "vncunused")) {
-                    vfb->vnc.findunused = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->vnc.findunused, atoi(p2 + 1));
                 } else if (!strcmp(p, "keymap")) {
                     free(vfb->keymap);
                     vfb->keymap = strdup(p2 + 1);
                 } else if (!strcmp(p, "sdl")) {
-                    vfb->sdl.enable = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->sdl.enable, atoi(p2 + 1));
                 } else if (!strcmp(p, "opengl")) {
-                    vfb->sdl.opengl = atoi(p2 + 1);
+                    libxl_defbool_set(&vfb->sdl.opengl, atoi(p2 + 1));
                 } else if (!strcmp(p, "display")) {
                     free(vfb->sdl.display);
                     vfb->sdl.display = strdup(p2 + 1);
@@ -992,19 +988,10 @@
 
     /* To be reworked (automatically enabled) once the auto ballooning
      * after guest starts is done (with PCI devices passed in). */
-    if (!xlu_cfg_get_long (config, "e820_host", &l, 0)) {
-        switch (c_info->type) {
-        case LIBXL_DOMAIN_TYPE_HVM:
-            fprintf(stderr, "Can't do e820_host in HVM mode!");
-            break;
-        case LIBXL_DOMAIN_TYPE_PV:
-            if (l)
-                b_info->u.pv.e820_host = true;
-            break;
-        default:
-            abort();
-        }
-    }
+    if (c_info->type == LIBXL_DOMAIN_TYPE_PV) {
+        xlu_cfg_get_defbool(config, "e820_host", &b_info->u.pv.e820_host, 0);
+    }
+
     if (!xlu_cfg_get_list (config, "pci", &pcis, 0, 0)) {
         int i;
         d_config->num_pcidevs = 0;
@@ -1014,7 +1001,7 @@
 
             d_config->pcidevs = (libxl_device_pci *) realloc(d_config->pcidevs, sizeof (libxl_device_pci) * (d_config->num_pcidevs + 1));
             pcidev = d_config->pcidevs + d_config->num_pcidevs;
-            memset(pcidev, 0x00, sizeof(libxl_device_pci));
+            libxl_device_pci_init(pcidev);
 
             pcidev->msitranslate = pci_msitranslate;
             pcidev->power_mgmt = pci_power_mgmt;
@@ -1022,7 +1009,7 @@
                 d_config->num_pcidevs++;
         }
         if (d_config->num_pcidevs && c_info->type == LIBXL_DOMAIN_TYPE_PV)
-            b_info->u.pv.e820_host = true;
+            libxl_defbool_set(&b_info->u.pv.e820_host, true);
     }
 
     switch (xlu_cfg_get_list(config, "cpuid", &cpuids, 0, 1)) {
@@ -1139,8 +1126,8 @@
         }
     } else if (b_info->device_model)
         fprintf(stderr, "WARNING: device model override given without specific DM version\n");
-    if (!xlu_cfg_get_long (config, "device_model_stubdomain_override", &l, 0))
-        b_info->device_model_stubdomain = l;
+    xlu_cfg_get_defbool (config, "device_model_stubdomain_override",
+                         &b_info->device_model_stubdomain, 0);
 
     if (!xlu_cfg_get_string (config, "device_model_stubdomain_seclabel",
                              &buf, 0)) {
@@ -1177,49 +1164,43 @@
 #undef parse_extra_args
 
     if (c_info->type == LIBXL_DOMAIN_TYPE_HVM) {
-        if (!xlu_cfg_get_long (config, "stdvga", &l, 0))
-            b_info->u.hvm.stdvga = l;
-        if (!xlu_cfg_get_long (config, "vnc", &l, 0))
-            b_info->u.hvm.vnc.enable = l;
-        xlu_cfg_replace_string (config, "vnclisten", &b_info->u.hvm.vnc.listen, 0);
-        xlu_cfg_replace_string (config, "vncpasswd", &b_info->u.hvm.vnc.passwd, 0);
+        xlu_cfg_get_defbool(config, "stdvga", &b_info->u.hvm.stdvga, 0);
+        xlu_cfg_get_defbool(config, "vnc", &b_info->u.hvm.vnc.enable, 0);
+        xlu_cfg_replace_string (config, "vnclisten",
+                                &b_info->u.hvm.vnc.listen, 0);
+        xlu_cfg_replace_string (config, "vncpasswd",
+                                &b_info->u.hvm.vnc.passwd, 0);
         if (!xlu_cfg_get_long (config, "vncdisplay", &l, 0))
             b_info->u.hvm.vnc.display = l;
-        if (!xlu_cfg_get_long (config, "vncunused", &l, 0))
-            b_info->u.hvm.vnc.findunused = l;
+        xlu_cfg_get_defbool(config, "vncunused",
+                            &b_info->u.hvm.vnc.findunused, 0);
         xlu_cfg_replace_string (config, "keymap", &b_info->u.hvm.keymap, 0);
-        if (!xlu_cfg_get_long (config, "sdl", &l, 0))
-            b_info->u.hvm.sdl.enable = l;
-        if (!xlu_cfg_get_long (config, "opengl", &l, 0))
-            b_info->u.hvm.sdl.opengl = l;
-        if (!xlu_cfg_get_long (config, "spice", &l, 0))
-            b_info->u.hvm.spice.enable = l;
+        xlu_cfg_get_defbool(config, "sdl", &b_info->u.hvm.sdl.enable, 0);
+        xlu_cfg_get_defbool(config, "opengl", &b_info->u.hvm.sdl.opengl, 0);
+        xlu_cfg_get_defbool (config, "spice", &b_info->u.hvm.spice.enable, 0);
         if (!xlu_cfg_get_long (config, "spiceport", &l, 0))
             b_info->u.hvm.spice.port = l;
         if (!xlu_cfg_get_long (config, "spicetls_port", &l, 0))
             b_info->u.hvm.spice.tls_port = l;
         xlu_cfg_replace_string (config, "spicehost",
                                 &b_info->u.hvm.spice.host, 0);
-        if (!xlu_cfg_get_long (config, "spicedisable_ticketing", &l, 0))
-            b_info->u.hvm.spice.disable_ticketing = l;
+        xlu_cfg_get_defbool(config, "spicedisable_ticketing",
+                            &b_info->u.hvm.spice.disable_ticketing, 0);
         xlu_cfg_replace_string (config, "spicepasswd",
                                 &b_info->u.hvm.spice.passwd, 0);
-        if (!xlu_cfg_get_long (config, "spiceagent_mouse", &l, 0))
-            b_info->u.hvm.spice.agent_mouse = l;
-        else
-            b_info->u.hvm.spice.agent_mouse = 1;
-        if (!xlu_cfg_get_long (config, "nographic", &l, 0))
-            b_info->u.hvm.nographic = l;
-        if (!xlu_cfg_get_long (config, "gfx_passthru", &l, 0))
-            b_info->u.hvm.gfx_passthru = l;
+        xlu_cfg_get_defbool(config, "spiceagent_mouse",
+                            &b_info->u.hvm.spice.agent_mouse, 0);
+        xlu_cfg_get_defbool(config, "nographic", &b_info->u.hvm.nographic, 0);
+        xlu_cfg_get_defbool(config, "gfx_passthru", 
+                            &b_info->u.hvm.gfx_passthru, 0);
         xlu_cfg_replace_string (config, "serial", &b_info->u.hvm.serial, 0);
         xlu_cfg_replace_string (config, "boot", &b_info->u.hvm.boot, 0);
-        if (!xlu_cfg_get_long (config, "usb", &l, 0))
-            b_info->u.hvm.usb = l;
-        xlu_cfg_replace_string (config, "usbdevice", &b_info->u.hvm.usbdevice, 0);
+        xlu_cfg_get_defbool(config, "usb", &b_info->u.hvm.usb, 0);
+        xlu_cfg_replace_string (config, "usbdevice",
+                                &b_info->u.hvm.usbdevice, 0);
         xlu_cfg_replace_string (config, "soundhw", &b_info->u.hvm.soundhw, 0);
-        if (!xlu_cfg_get_long (config, "xen_platform_pci", &l, 0))
-            b_info->u.hvm.xen_platform_pci = l;
+        xlu_cfg_get_defbool(config, "xen_platform_pci",
+                            &b_info->u.hvm.xen_platform_pci, 0);
     }
 
     xlu_cfg_destroy(config);
@@ -1235,19 +1216,19 @@
     libxl_action_on_shutdown action;
 
     switch (event->u.domain_shutdown.shutdown_reason) {
-    case SHUTDOWN_poweroff:
+    case LIBXL_SHUTDOWN_REASON_POWEROFF:
         action = d_config->on_poweroff;
         break;
-    case SHUTDOWN_reboot:
+    case LIBXL_SHUTDOWN_REASON_REBOOT:
         action = d_config->on_reboot;
         break;
-    case SHUTDOWN_suspend:
+    case LIBXL_SHUTDOWN_REASON_SUSPEND:
         LOG("Domain has suspended.");
         return 0;
-    case SHUTDOWN_crash:
+    case LIBXL_SHUTDOWN_REASON_CRASH:
         action = d_config->on_crash;
         break;
-    case SHUTDOWN_watchdog:
+    case LIBXL_SHUTDOWN_REASON_WATCHDOG:
         action = d_config->on_watchdog;
         break;
     default:
@@ -1371,7 +1352,7 @@
     const char *restore_file;
     int migrate_fd; /* -1 means none */
     char **migration_domname_r; /* from malloc */
-    int no_incr_generationid;
+    int incr_generationid;
 };
 
 static int freemem(libxl_domain_build_info *b_info)
@@ -1622,8 +1603,8 @@
     }
 
     if (d_config.c_info.type == LIBXL_DOMAIN_TYPE_HVM)
-        d_config.b_info.u.hvm.no_incr_generationid =
-            dom_info->no_incr_generationid;
+        libxl_defbool_set(&d_config.b_info.u.hvm.incr_generationid,
+                          dom_info->incr_generationid);
 
     if (debug || dom_info->dryrun)
         printf_info(default_output_format, -1, &d_config);
@@ -2505,7 +2486,7 @@
             info[i].domid, domname);
         free(domname);
     }
-    free(info);
+    libxl_vminfo_list_free(info, nb_vm);
 }
 
 static void save_domain_core_begin(const char *domain_spec,
@@ -2898,7 +2879,7 @@
     dom_info.restore_file = "incoming migration stream";
     dom_info.migrate_fd = 0; /* stdin */
     dom_info.migration_domname_r = &migration_domname;
-    dom_info.no_incr_generationid = 1;
+    dom_info.incr_generationid = 0;
 
     rc = create_domain(&dom_info);
     if (rc < 0) {
@@ -3023,6 +3004,7 @@
     dom_info.restore_file = checkpoint_file;
     dom_info.migrate_fd = -1;
     dom_info.console_autoconnect = console_autoconnect;
+    dom_info.incr_generationid = 1;
 
     rc = create_domain(&dom_info);
     if (rc < 0)
@@ -3302,7 +3284,10 @@
     else
         list_domains(verbose, context, info, nb_domain);
 
-    free(info_free);
+    if (info_free)
+        libxl_dominfo_list_free(info, nb_domain);
+    else
+        libxl_dominfo_dispose(info);
 
     return 0;
 }
@@ -3405,6 +3390,7 @@
     dom_info.extra_config = extra_config;
     dom_info.migrate_fd = -1;
     dom_info.console_autoconnect = console_autoconnect;
+    dom_info.incr_generationid = 0;
 
     rc = create_domain(&dom_info);
     if (rc < 0)
@@ -3565,8 +3551,7 @@
         for (i = 0; i<nb_domain; i++)
             print_domain_vcpuinfo(dominfo[i].domid, physinfo.nr_cpus);
 
-        free(dominfo);
-
+        libxl_dominfo_list_free(dominfo, nb_domain);
     } else {
         for (; argc > 0; ++argv, --argc) {
             if (domain_qualifier_to_domid(*argv, &domid, 0) < 0) {
@@ -3578,7 +3563,7 @@
         }
     }
   vcpulist_out:
-    ;
+    libxl_physinfo_dispose(&physinfo);
 }
 
 int main_vcpulist(int argc, char **argv)
@@ -3693,15 +3678,15 @@
 static void output_xeninfo(void)
 {
     const libxl_version_info *info;
-    int sched_id;
+    libxl_scheduler sched;
 
     if (!(info = libxl_get_version_info(ctx))) {
         fprintf(stderr, "libxl_get_version_info failed.\n");
         return;
     }
 
-    if ((sched_id = libxl_get_sched_id(ctx)) < 0) {
-        fprintf(stderr, "get_sched_id sysctl failed.\n");
+    if ((sched = libxl_get_scheduler(ctx)) < 0) {
+        fprintf(stderr, "get_scheduler sysctl failed.\n");
         return;
     }
 
@@ -3709,7 +3694,7 @@
     printf("xen_minor              : %d\n", info->xen_version_minor);
     printf("xen_extra              : %s\n", info->xen_version_extra);
     printf("xen_caps               : %s\n", info->capabilities);
-    printf("xen_scheduler          : %s\n", libxl_schedid_to_name(ctx, sched_id));
+    printf("xen_scheduler          : %s\n", libxl_scheduler_to_string(sched));
     printf("xen_pagesize           : %u\n", info->pagesize);
     printf("platform_params        : virt_start=0x%"PRIx64"\n", info->virt_start);
     printf("xen_changeset          : %s\n", info->changeset);
@@ -3757,9 +3742,9 @@
     for (i = 0; i < 8; i++)
         printf("%08x%c", info.hw_cap[i], i < 7 ? ':' : '\n');
     printf("virt_caps              :");
-    if (info.phys_cap & XEN_SYSCTL_PHYSCAP_hvm)
+    if (info.cap_hvm)
         printf(" hvm");
-    if (info.phys_cap & XEN_SYSCTL_PHYSCAP_hvm_directio)
+    if (info.cap_hvm_directio)
         printf(" hvm_directio");
     printf("\n");
     vinfo = libxl_get_version_info(ctx);
@@ -3778,6 +3763,7 @@
         free(cpumap.map);
     }
 
+    libxl_physinfo_dispose(&info);
     return;
 }
 
@@ -3912,7 +3898,9 @@
     sharing(info, nb_domain);
 
     if (info_free)
-        free(info_free);
+        libxl_dominfo_list_free(info_free, nb_domain);
+    else
+        libxl_dominfo_dispose(info);
 
     return 0;
 }
@@ -3934,6 +3922,7 @@
 {
     int rc;
 
+    
     rc = libxl_sched_credit_domain_set(ctx, domid, scinfo);
     if (rc)
         fprintf(stderr, "libxl_sched_credit_domain_set failed.\n");
@@ -3962,6 +3951,7 @@
         scinfo.weight,
         scinfo.cap);
     free(domname);
+    libxl_sched_credit_domain_dispose(&scinfo);
     return 0;
 }
 
@@ -4009,6 +3999,7 @@
         domid,
         scinfo.weight);
     free(domname);
+    libxl_sched_credit2_domain_dispose(&scinfo);
     return 0;
 }
 
@@ -4032,7 +4023,6 @@
     rc = libxl_sched_sedf_domain_set(ctx, domid, scinfo);
     if (rc)
         fprintf(stderr, "libxl_sched_sedf_domain_set failed.\n");
-
     return rc;
 }
 
@@ -4061,11 +4051,12 @@
         scinfo.extratime,
         scinfo.weight);
     free(domname);
+    libxl_sched_sedf_domain_dispose(&scinfo);
     return 0;
 }
 
 static int sched_domain_output(
-    uint32_t sched, int (*output)(int), const char *cpupool)
+    libxl_scheduler sched, int (*output)(int), const char *cpupool)
 {
     libxl_dominfo *info;
     libxl_cpupoolinfo *poolinfo = NULL;
@@ -4094,7 +4085,7 @@
     }
 
     for (p = 0; !rc && (p < n_pools); p++) {
-        if ((poolinfo[p].sched_id != sched) ||
+        if ((poolinfo[p].sched != sched) ||
             (cpupool && (poolid != poolinfo[p].poolid)))
             continue;
 
@@ -4175,7 +4166,7 @@
     }
 
     if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(XEN_SCHEDULER_CREDIT,
+        return -sched_domain_output(LIBXL_SCHEDULER_CREDIT,
                                     sched_credit_domain_output, cpupool);
     } else {
         find_domain(dom);
@@ -4193,6 +4184,7 @@
             if (opt_c)
                 scinfo.cap = cap;
             rc = sched_credit_domain_set(domid, &scinfo);
+            libxl_sched_credit_domain_dispose(&scinfo);
             if (rc)
                 return -rc;
         }
@@ -4251,7 +4243,7 @@
     }
 
     if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(XEN_SCHEDULER_CREDIT2,
+        return -sched_domain_output(LIBXL_SCHEDULER_CREDIT2,
                                     sched_credit2_domain_output, cpupool);
     } else {
         find_domain(dom);
@@ -4267,6 +4259,7 @@
             if (opt_w)
                 scinfo.weight = weight;
             rc = sched_credit2_domain_set(domid, &scinfo);
+            libxl_sched_credit2_domain_dispose(&scinfo);
             if (rc)
                 return -rc;
         }
@@ -4353,7 +4346,7 @@
     }
 
     if (!dom) { /* list all domain's credit scheduler info */
-        return -sched_domain_output(XEN_SCHEDULER_SEDF,
+        return -sched_domain_output(LIBXL_SCHEDULER_SEDF,
                                     sched_sedf_domain_output, cpupool);
     } else {
         find_domain(dom);
@@ -4385,6 +4378,7 @@
                 scinfo.slice = 0;
             }
             rc = sched_sedf_domain_set(domid, &scinfo);
+            libxl_sched_sedf_domain_dispose(&scinfo);
             if (rc)
                 return -rc;
         }
@@ -4602,7 +4596,7 @@
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
         return 1;
     }
-    libxl_device_nic_init(ctx, &nic);
+    libxl_device_nic_init(&nic);
     for (argv += optind+1, argc -= optind+1; argc > 0; ++argv, --argc) {
         if (MATCH_OPTION("type", *argv, oparg)) {
             if (!strcmp("vif", oparg)) {
@@ -4968,6 +4962,7 @@
         info = libxl_list_vm(ctx, &nb_vm);
         for (i = 0; i < nb_vm; i++)
             print_domU_uptime(info[i].domid, short_mode, now);
+        libxl_vminfo_list_free(info, nb_vm);
     } else {
         for (i = 0; i < nb_doms; i++) {
             if (doms[i] == 0)
@@ -5292,9 +5287,8 @@
     XLU_Config *config;
     const char *buf;
     const char *name;
-    const char *sched;
     uint32_t poolid;
-    int schedid = -1;
+    libxl_scheduler sched = 0;
     XLU_ConfigList *cpus;
     XLU_ConfigList *nodes;
     int n_cpus, n_nodes, i, n;
@@ -5389,17 +5383,16 @@
     }
 
     if (!xlu_cfg_get_string (config, "sched", &buf, 0)) {
-        if ((schedid = libxl_name_to_schedid(ctx, buf)) < 0) {
+        if ((libxl_scheduler_from_string(buf, &sched)) < 0) {
             fprintf(stderr, "Unknown scheduler\n");
             return -ERROR_FAIL;
         }
     } else {
-        if ((schedid = libxl_get_sched_id(ctx)) < 0) {
-            fprintf(stderr, "get_sched_id sysctl failed.\n");
+        if ((sched = libxl_get_scheduler(ctx)) < 0) {
+            fprintf(stderr, "get_scheduler sysctl failed.\n");
             return -ERROR_FAIL;
         }
     }
-    sched = libxl_schedid_to_name(ctx, schedid);
 
     if (libxl_get_freecpus(ctx, &freemap)) {
         fprintf(stderr, "libxl_get_freecpus failed\n");
@@ -5467,14 +5460,14 @@
 
     printf("Using config file \"%s\"\n", filename);
     printf("cpupool name:   %s\n", name);
-    printf("scheduler:      %s\n", sched);
+    printf("scheduler:      %s\n", libxl_scheduler_to_string(sched));
     printf("number of cpus: %d\n", n_cpus);
 
     if (dryrun_only)
         return 0;
 
     poolid = 0;
-    if (libxl_cpupool_create(ctx, name, schedid, cpumap, &uuid, &poolid)) {
+    if (libxl_cpupool_create(ctx, name, sched, cpumap, &uuid, &poolid)) {
         fprintf(stderr, "error on creating cpupool\n");
         return -ERROR_FAIL;
     }
@@ -5559,7 +5552,7 @@
                     }
                 if (!opt_cpus) {
                     printf("%3d %9s       y       %4d", n,
-                           libxl_schedid_to_name(ctx, poolinfo[p].sched_id),
+                           libxl_scheduler_to_string(poolinfo[p].sched),
                            poolinfo[p].n_dom);
                 }
                 printf("\n");
@@ -5744,7 +5737,7 @@
     int c;
     int n;
     uint32_t poolid;
-    int schedid;
+    libxl_scheduler sched;
     int n_pools;
     int node;
     int n_cpus;
@@ -5765,7 +5758,7 @@
         return -ERROR_NOMEM;
     }
     poolid = poolinfo[0].poolid;
-    schedid = poolinfo[0].sched_id;
+    sched = poolinfo[0].sched;
     for (p = 0; p < n_pools; p++) {
         libxl_cpupoolinfo_dispose(poolinfo + p);
     }
@@ -5845,7 +5838,7 @@
         snprintf(name, 15, "Pool-node%d", node);
         libxl_uuid_generate(&uuid);
         poolid = 0;
-        ret = -libxl_cpupool_create(ctx, name, schedid, cpumap, &uuid, &poolid);
+        ret = -libxl_cpupool_create(ctx, name, sched, cpumap, &uuid, &poolid);
         if (ret) {
             fprintf(stderr, "error on creating cpupool\n");
             goto out;
diff -r d7fe4cd831a0 -r d64aa013a82e tools/libxl/xl_sxp.c
--- a/tools/libxl/xl_sxp.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/libxl/xl_sxp.c	Thu Mar 01 12:31:15 2012 +0000
@@ -21,6 +21,7 @@
 #include "libxl_osdeps.h"
 
 #include <stdlib.h>
+#include <inttypes.h>
 
 #include "libxl.h"
 #include "libxl_utils.h"
@@ -40,8 +41,8 @@
     printf("(domain\n\t(domid %d)\n", domid);
     printf("\t(create_info)\n");
     printf("\t(hvm %d)\n", c_info->type == LIBXL_DOMAIN_TYPE_HVM);
-    printf("\t(hap %d)\n", c_info->hap);
-    printf("\t(oos %d)\n", c_info->oos);
+    printf("\t(hap %s)\n", libxl_defbool_to_string(c_info->hap));
+    printf("\t(oos %s)\n", libxl_defbool_to_string(c_info->oos));
     printf("\t(ssidref %d)\n", c_info->ssidref);
     printf("\t(name %s)\n", c_info->name);
 
@@ -68,9 +69,10 @@
     printf("\t(build_info)\n");
     printf("\t(max_vcpus %d)\n", b_info->max_vcpus);
     printf("\t(tsc_mode %s)\n", libxl_tsc_mode_to_string(b_info->tsc_mode));
-    printf("\t(max_memkb %d)\n", b_info->max_memkb);
-    printf("\t(target_memkb %d)\n", b_info->target_memkb);
-    printf("\t(nomigrate %d)\n", b_info->disable_migrate);
+    printf("\t(max_memkb %"PRId64")\n", b_info->max_memkb);
+    printf("\t(target_memkb %"PRId64")\n", b_info->target_memkb);
+    printf("\t(nomigrate %s)\n",
+           libxl_defbool_to_string(b_info->disable_migrate));
 
     if (c_info->type == LIBXL_DOMAIN_TYPE_PV && b_info->u.pv.bootloader) {
         int i;
@@ -88,43 +90,57 @@
     case LIBXL_DOMAIN_TYPE_HVM:
         printf("\t\t(hvm\n");
         printf("\t\t\t(firmware %s)\n", b_info->u.hvm.firmware);
-        printf("\t\t\t(video_memkb %d)\n", b_info->video_memkb);
-        printf("\t\t\t(shadow_memkb %d)\n", b_info->shadow_memkb);
-        printf("\t\t\t(pae %d)\n", b_info->u.hvm.pae);
-        printf("\t\t\t(apic %d)\n", b_info->u.hvm.apic);
-        printf("\t\t\t(acpi %d)\n", b_info->u.hvm.acpi);
-        printf("\t\t\t(nx %d)\n", b_info->u.hvm.nx);
-        printf("\t\t\t(viridian %d)\n", b_info->u.hvm.viridian);
-        printf("\t\t\t(hpet %d)\n", b_info->u.hvm.hpet);
-        printf("\t\t\t(vpt_align %d)\n", b_info->u.hvm.vpt_align);
+        printf("\t\t\t(video_memkb %"PRId64")\n", b_info->video_memkb);
+        printf("\t\t\t(shadow_memkb %"PRId64")\n", b_info->shadow_memkb);
+        printf("\t\t\t(pae %s)\n", libxl_defbool_to_string(b_info->u.hvm.pae));
+        printf("\t\t\t(apic %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.apic));
+        printf("\t\t\t(acpi %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.acpi));
+        printf("\t\t\t(nx %s)\n", libxl_defbool_to_string(b_info->u.hvm.nx));
+        printf("\t\t\t(viridian %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.viridian));
+        printf("\t\t\t(hpet %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.hpet));
+        printf("\t\t\t(vpt_align %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.vpt_align));
         printf("\t\t\t(timer_mode %s)\n",
                libxl_timer_mode_to_string(b_info->u.hvm.timer_mode));
-        printf("\t\t\t(nestedhvm %d)\n", b_info->u.hvm.nested_hvm);
-        printf("\t\t\t(no_incr_generationid %d)\n",
-                    b_info->u.hvm.no_incr_generationid);
-
-        printf("\t\t\t(stdvga %d)\n", b_info->u.hvm.stdvga);
-        printf("\t\t\t(vnc %d)\n", b_info->u.hvm.vnc.enable);
+        printf("\t\t\t(nestedhvm %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.nested_hvm));
+        printf("\t\t\t(no_incr_generationid %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.incr_generationid));
+        printf("\t\t\t(stdvga %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.stdvga));
+        printf("\t\t\t(vnc %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.vnc.enable));
         printf("\t\t\t(vnclisten %s)\n", b_info->u.hvm.vnc.listen);
         printf("\t\t\t(vncdisplay %d)\n", b_info->u.hvm.vnc.display);
-        printf("\t\t\t(vncunused %d)\n", b_info->u.hvm.vnc.findunused);
+        printf("\t\t\t(vncunused %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.vnc.findunused));
         printf("\t\t\t(keymap %s)\n", b_info->u.hvm.keymap);
-        printf("\t\t\t(sdl %d)\n", b_info->u.hvm.sdl.enable);
-        printf("\t\t\t(opengl %d)\n", b_info->u.hvm.sdl.opengl);
-        printf("\t\t\t(nographic %d)\n", b_info->u.hvm.nographic);
-        printf("\t\t\t(spice %d)\n", b_info->u.hvm.spice.enable);
+        printf("\t\t\t(sdl %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.sdl.enable));
+        printf("\t\t\t(opengl %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.sdl.opengl));
+        printf("\t\t\t(nographic %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.nographic));
+        printf("\t\t\t(spice %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.spice.enable));
         printf("\t\t\t(spiceport %d)\n", b_info->u.hvm.spice.port);
         printf("\t\t\t(spicetls_port %d)\n", b_info->u.hvm.spice.tls_port);
         printf("\t\t\t(spicehost %s)\n", b_info->u.hvm.spice.host);
-        printf("\t\t\t(spicedisable_ticketing %d)\n",
-                    b_info->u.hvm.spice.disable_ticketing);
-        printf("\t\t\t(spiceagent_mouse %d)\n", b_info->u.hvm.spice.agent_mouse);
+        printf("\t\t\t(spicedisable_ticketing %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.spice.disable_ticketing));
+        printf("\t\t\t(spiceagent_mouse %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.spice.agent_mouse));
 
         printf("\t\t\t(device_model %s)\n", b_info->device_model ? : "default");
-        printf("\t\t\t(gfx_passthru %d)\n", b_info->u.hvm.gfx_passthru);
+        printf("\t\t\t(gfx_passthru %s)\n",
+               libxl_defbool_to_string(b_info->u.hvm.gfx_passthru));
         printf("\t\t\t(serial %s)\n", b_info->u.hvm.serial);
         printf("\t\t\t(boot %s)\n", b_info->u.hvm.boot);
-        printf("\t\t\t(usb %d)\n", b_info->u.hvm.usb);
+        printf("\t\t\t(usb %s)\n", libxl_defbool_to_string(b_info->u.hvm.usb));
         printf("\t\t\t(usbdevice %s)\n", b_info->u.hvm.usbdevice);
         printf("\t\t)\n");
         break;
@@ -133,7 +149,8 @@
         printf("\t\t\t(kernel %s)\n", b_info->u.pv.kernel.path);
         printf("\t\t\t(cmdline %s)\n", b_info->u.pv.cmdline);
         printf("\t\t\t(ramdisk %s)\n", b_info->u.pv.ramdisk.path);
-        printf("\t\t\t(e820_host %d)\n", b_info->u.pv.e820_host);
+        printf("\t\t\t(e820_host %s)\n",
+               libxl_defbool_to_string(b_info->u.pv.e820_host));
         printf("\t\t)\n");
         break;
     default:
@@ -195,13 +212,17 @@
         printf("\t\t\t(backend_domid %d)\n", d_config->vfbs[i].backend_domid);
         printf("\t\t\t(frontend_domid %d)\n", domid);
         printf("\t\t\t(devid %d)\n", d_config->vfbs[i].devid);
-        printf("\t\t\t(vnc %d)\n", d_config->vfbs[i].vnc.enable);
+        printf("\t\t\t(vnc %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].vnc.enable));
         printf("\t\t\t(vnclisten %s)\n", d_config->vfbs[i].vnc.listen);
         printf("\t\t\t(vncdisplay %d)\n", d_config->vfbs[i].vnc.display);
-        printf("\t\t\t(vncunused %d)\n", d_config->vfbs[i].vnc.findunused);
+        printf("\t\t\t(vncunused %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].vnc.findunused));
         printf("\t\t\t(keymap %s)\n", d_config->vfbs[i].keymap);
-        printf("\t\t\t(sdl %d)\n", d_config->vfbs[i].sdl.enable);
-        printf("\t\t\t(opengl %d)\n", d_config->vfbs[i].sdl.opengl);
+        printf("\t\t\t(sdl %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].sdl.enable));
+        printf("\t\t\t(opengl %s)\n",
+               libxl_defbool_to_string(d_config->vfbs[i].sdl.opengl));
         printf("\t\t\t(display %s)\n", d_config->vfbs[i].sdl.display);
         printf("\t\t\t(xauthority %s)\n", d_config->vfbs[i].sdl.xauthority);
         printf("\t\t)\n");
diff -r d7fe4cd831a0 -r d64aa013a82e tools/ocaml/libs/xl/genwrap.py
--- a/tools/ocaml/libs/xl/genwrap.py	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/ocaml/libs/xl/genwrap.py	Thu Mar 01 12:31:15 2012 +0000
@@ -10,6 +10,7 @@
     "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_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),
     "libxl_mac":            ("int array",              "Mac_val(gc, lg, &%(c)s, %(o)s)",    "Val_mac(&%(c)s)"),
diff -r d7fe4cd831a0 -r d64aa013a82e tools/ocaml/libs/xl/xenlight_stubs.c
--- a/tools/ocaml/libs/xl/xenlight_stubs.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/ocaml/libs/xl/xenlight_stubs.c	Thu Mar 01 12:31:15 2012 +0000
@@ -195,6 +195,33 @@
 	CAMLreturn(0);
 }
 
+static value Val_defbool(libxl_defbool c_val)
+{
+	CAMLparam0();
+	CAMLlocal1(v);
+
+	if (libxl_defbool_is_default(c_val))
+		v = Val_none;
+	else {
+		bool b = libxl_defbool_val(c_val);
+		v = Val_some(b ? Val_bool(true) : Val_bool(false));
+	}
+	CAMLreturn(v);
+}
+
+static libxl_defbool Defbool_val(value v)
+{
+	CAMLparam1(v);
+	libxl_defbool db;
+	if (v == Val_none)
+		libxl_defbool_unset(&db);
+	else {
+		bool b = Bool_val(Some_val(v));
+		libxl_defbool_set(&db, b);
+	}
+	return db;
+}
+
 static value Val_hwcap(libxl_hwcap *c_val)
 {
 	CAMLparam0();
diff -r d7fe4cd831a0 -r d64aa013a82e tools/python/genwrap.py
--- a/tools/python/genwrap.py	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/python/genwrap.py	Thu Mar 01 12:31:15 2012 +0000
@@ -4,11 +4,13 @@
 
 import idl
 
-(TYPE_BOOL, TYPE_INT, TYPE_UINT, TYPE_STRING, TYPE_AGGREGATE) = range(5)
+(TYPE_DEFBOOL, TYPE_BOOL, TYPE_INT, TYPE_UINT, TYPE_STRING, TYPE_AGGREGATE) = range(6)
 
 def py_type(ty):
     if ty == idl.bool:
         return TYPE_BOOL
+    if ty.typename == "libxl_defbool":
+        return TYPE_DEFBOOL
     if isinstance(ty, idl.Enumeration):
         return TYPE_UINT
     if isinstance(ty, idl.Number):
@@ -44,6 +46,8 @@
         for f in ty.fields:
             if py_type(f.type) is not None:
                 continue
+            if py_type(f.type) == TYPE_DEFBOOL:
+                continue
             if ty.marshal_out():
                 l.append('_hidden PyObject *attrib__%s_get(%s *%s);'%(\
                     fsanitize(f.type.typename), f.type.typename, f.name))
@@ -62,6 +66,8 @@
         l.append('    ret = (self->obj.%s) ? Py_True : Py_False;'%f.name)
         l.append('    Py_INCREF(ret);')
         l.append('    return ret;')
+    elif t == TYPE_DEFBOOL:
+        l.append('    return genwrap__defbool_get(&self->obj.%s);'%f.name)
     elif t == TYPE_INT:
         l.append('    return genwrap__ll_get(self->obj.%s);'%f.name)
     elif t == TYPE_UINT:
@@ -85,6 +91,8 @@
     if t == TYPE_BOOL:
         l.append('    self->obj.%s = (NULL == v || Py_None == v || Py_False == v) ? 0 : 1;'%f.name)
         l.append('    return 0;')
+    elif t == TYPE_DEFBOOL:
+        l.append('    return genwrap__defbool_set(v, &self->obj.%s);'%f.name)
     elif t == TYPE_UINT or t == TYPE_INT:
         l.append('    %slong long tmp;'%(t == TYPE_UINT and 'unsigned ' or ''))
         l.append('    int ret;')
@@ -275,6 +283,8 @@
 _hidden int genwrap__ull_set(PyObject *v, unsigned long long *val, unsigned long long mask);
 _hidden PyObject *genwrap__ll_get(long long val);
 _hidden int genwrap__ll_set(PyObject *v, long long *val, long long mask);
+_hidden PyObject *genwrap__defbool_get(libxl_defbool *db);
+_hidden int genwrap__defbool_set(PyObject *v, libxl_defbool *db);
 
 """ % " ".join(sys.argv))
     for ty in [ty for ty in types if isinstance(ty, idl.Aggregate)]:
diff -r d7fe4cd831a0 -r d64aa013a82e tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c	Wed Feb 29 17:01:41 2012 +0000
+++ b/tools/python/xen/lowlevel/xl/xl.c	Thu Mar 01 12:31:15 2012 +0000
@@ -156,6 +156,21 @@
     return 0;
 }
 
+PyObject *genwrap__defbool_get(libxl_defbool *db)
+{
+    PyObject *ret;
+    ret = libxl_defbool_val(*db) ? Py_True : Py_False;
+    Py_INCREF(ret);
+    return ret;
+}
+
+int genwrap__defbool_set(PyObject *v, libxl_defbool *db)
+{
+    bool val = !(NULL == v || Py_None == v || Py_False == v);
+    libxl_defbool_set(db, val);
+    return 0;
+}
+
 static int fixed_bytearray_set(PyObject *v, uint8_t *ptr, size_t len)
 {
     char *tmp;
@@ -762,11 +777,11 @@
     Py_INCREF(xl_error_obj);
     PyModule_AddObject(m, "Error", xl_error_obj);
 
-    _INT_CONST(m, SHUTDOWN_poweroff);
-    _INT_CONST(m, SHUTDOWN_reboot);
-    _INT_CONST(m, SHUTDOWN_suspend);
-    _INT_CONST(m, SHUTDOWN_crash);
-    _INT_CONST(m, SHUTDOWN_watchdog);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_POWEROFF);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_REBOOT);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_SUSPEND);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_CRASH);
+    _INT_CONST_LIBXL(m, SHUTDOWN_REASON_WATCHDOG);
 
     genwrap__init(m);
 }

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:35 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf0-0000fi-Pc; Sat, 03 Mar 2012 04:33:34 +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 1S3gez-0000RW-IL
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:33 +0000
Received: from [85.158.139.83:62113] by server-9.bemta-5.messagelabs.com id
	C4/AF-09826-D1F915F4; Sat, 03 Mar 2012 04:33:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1330749209!17661782!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20995 invoked from network); 3 Mar 2012 04:33:30 -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;
	3 Mar 2012 04:33:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gev-0004i2-6J
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gev-0003ar-4k
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:29 +0000
Message-Id: <E1S3gev-0003ar-4k@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: autoconf: remove ip 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1330618769 0
# Node ID ed898c1d80881e9e3fb07ad7d9b30b70ac407543
# Parent  2a9dd3b751d2f21f5ca6f9376121584d4b31165b
build: autoconf: remove ip check

ip is a run-time dependency, and it is not needed to build Xen tools.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 2a9dd3b751d2 -r ed898c1d8088 tools/configure
--- a/tools/configure	Thu Mar 01 16:03:21 2012 +0000
+++ b/tools/configure	Thu Mar 01 16:19:29 2012 +0000
@@ -637,7 +637,6 @@
 CURL
 FLEX
 BISON
-IP
 PERL
 PYTHON
 APPEND_LIB
@@ -737,7 +736,6 @@
 APPEND_LIB
 PYTHON
 PERL
-IP
 BISON
 FLEX
 CURL
@@ -1391,7 +1389,6 @@
   APPEND_LIB  List of library folders to append to LDFLAGS (without -L)
   PYTHON      Path to the Python parser
   PERL        Path to Perl parser
-  IP          Path to ip tool
   BISON       Path to Bison parser generator
   FLEX        Path to Flex lexical analyser generator
   CURL        Path to curl-config tool
@@ -4134,7 +4131,6 @@
 
 
 
-
 # Checks for programs.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
@@ -4925,51 +4921,6 @@
 then
     as_fn_error $? "Unable to find perl, please install perl" "$LINENO" 5
 fi
-# Extract the first word of "ip", so it can be a program name with args.
-set dummy ip; 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_IP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $IP in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_IP="$IP" # 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_IP="$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_IP" && ac_cv_path_IP="no"
-  ;;
-esac
-fi
-IP=$ac_cv_path_IP
-if test -n "$IP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IP" >&5
-$as_echo "$IP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x"${IP}" == x"no"
-then
-    as_fn_error $? "Unable to find ip, please install ip" "$LINENO" 5
-fi
 if test "x$xapi" = "xy"; then :
 
     # Extract the first word of "curl-config", so it can be a program name with args.
diff -r 2a9dd3b751d2 -r ed898c1d8088 tools/configure.ac
--- a/tools/configure.ac	Thu Mar 01 16:03:21 2012 +0000
+++ b/tools/configure.ac	Thu Mar 01 16:19:29 2012 +0000
@@ -60,7 +60,6 @@
 
 AC_ARG_VAR([PYTHON], [Path to the Python parser])
 AC_ARG_VAR([PERL], [Path to Perl parser])
-AC_ARG_VAR([IP], [Path to ip tool])
 AC_ARG_VAR([BISON], [Path to Bison parser generator])
 AC_ARG_VAR([FLEX], [Path to Flex lexical analyser generator])
 AC_ARG_VAR([CURL], [Path to curl-config tool])
@@ -75,7 +74,6 @@
 AC_PROG_MAKE_SET
 AC_PROG_INSTALL
 AX_PATH_PROG_OR_FAIL([PERL], [perl])
-AX_PATH_PROG_OR_FAIL([IP], [ip])
 AS_IF([test "x$xapi" = "xy"], [
     AX_PATH_PROG_OR_FAIL([CURL], [curl-config])
     AX_PATH_PROG_OR_FAIL([XML], [xml2-config])

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:35 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf0-0000fi-Pc; Sat, 03 Mar 2012 04:33:34 +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 1S3gez-0000RW-IL
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:33 +0000
Received: from [85.158.139.83:62113] by server-9.bemta-5.messagelabs.com id
	C4/AF-09826-D1F915F4; Sat, 03 Mar 2012 04:33:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1330749209!17661782!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20995 invoked from network); 3 Mar 2012 04:33:30 -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;
	3 Mar 2012 04:33:30 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gev-0004i2-6J
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:29 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gev-0003ar-4k
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:29 +0000
Message-Id: <E1S3gev-0003ar-4k@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:28 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: autoconf: remove ip 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1330618769 0
# Node ID ed898c1d80881e9e3fb07ad7d9b30b70ac407543
# Parent  2a9dd3b751d2f21f5ca6f9376121584d4b31165b
build: autoconf: remove ip check

ip is a run-time dependency, and it is not needed to build Xen tools.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 2a9dd3b751d2 -r ed898c1d8088 tools/configure
--- a/tools/configure	Thu Mar 01 16:03:21 2012 +0000
+++ b/tools/configure	Thu Mar 01 16:19:29 2012 +0000
@@ -637,7 +637,6 @@
 CURL
 FLEX
 BISON
-IP
 PERL
 PYTHON
 APPEND_LIB
@@ -737,7 +736,6 @@
 APPEND_LIB
 PYTHON
 PERL
-IP
 BISON
 FLEX
 CURL
@@ -1391,7 +1389,6 @@
   APPEND_LIB  List of library folders to append to LDFLAGS (without -L)
   PYTHON      Path to the Python parser
   PERL        Path to Perl parser
-  IP          Path to ip tool
   BISON       Path to Bison parser generator
   FLEX        Path to Flex lexical analyser generator
   CURL        Path to curl-config tool
@@ -4134,7 +4131,6 @@
 
 
 
-
 # Checks for programs.
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
 $as_echo_n "checking for a sed that does not truncate output... " >&6; }
@@ -4925,51 +4921,6 @@
 then
     as_fn_error $? "Unable to find perl, please install perl" "$LINENO" 5
 fi
-# Extract the first word of "ip", so it can be a program name with args.
-set dummy ip; 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_IP+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  case $IP in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_IP="$IP" # 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_IP="$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_IP" && ac_cv_path_IP="no"
-  ;;
-esac
-fi
-IP=$ac_cv_path_IP
-if test -n "$IP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IP" >&5
-$as_echo "$IP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-if test x"${IP}" == x"no"
-then
-    as_fn_error $? "Unable to find ip, please install ip" "$LINENO" 5
-fi
 if test "x$xapi" = "xy"; then :
 
     # Extract the first word of "curl-config", so it can be a program name with args.
diff -r 2a9dd3b751d2 -r ed898c1d8088 tools/configure.ac
--- a/tools/configure.ac	Thu Mar 01 16:03:21 2012 +0000
+++ b/tools/configure.ac	Thu Mar 01 16:19:29 2012 +0000
@@ -60,7 +60,6 @@
 
 AC_ARG_VAR([PYTHON], [Path to the Python parser])
 AC_ARG_VAR([PERL], [Path to Perl parser])
-AC_ARG_VAR([IP], [Path to ip tool])
 AC_ARG_VAR([BISON], [Path to Bison parser generator])
 AC_ARG_VAR([FLEX], [Path to Flex lexical analyser generator])
 AC_ARG_VAR([CURL], [Path to curl-config tool])
@@ -75,7 +74,6 @@
 AC_PROG_MAKE_SET
 AC_PROG_INSTALL
 AX_PATH_PROG_OR_FAIL([PERL], [perl])
-AX_PATH_PROG_OR_FAIL([IP], [ip])
 AS_IF([test "x$xapi" = "xy"], [
     AX_PATH_PROG_OR_FAIL([CURL], [curl-config])
     AX_PATH_PROG_OR_FAIL([XML], [xml2-config])

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:35 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf0-0000g5-TA; Sat, 03 Mar 2012 04:33:34 +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 1S3gez-0000cg-RJ
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:34 +0000
Received: from [85.158.139.83:62146] by server-3.bemta-5.messagelabs.com id
	62/12-25237-D1F915F4; Sat, 03 Mar 2012 04:33:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1330749211!17673496!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12880 invoked from network); 3 Mar 2012 04:33:32 -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;
	3 Mar 2012 04:33:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gew-0004iK-PE
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gew-0003cK-Ny
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:30 +0000
Message-Id: <E1S3gew-0003cK-Ny@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Introduce a new lock for
	event and ppr logging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330619754 0
# Node ID ce5ef8a192c1050d85580305921d2e5caf220461
# Parent  2fbac9359e3b4fb61436e6e6653ec266b4f82ba9
amd iommu: Introduce a new lock for event and ppr logging

iommu->lock is used with irq disabled, so it cannot be used to protect
ppr log.  Otherwise, after c/s 24770, get_gfn will trigger a BUG() if
called by parse_ppr_log_entry(). This patch adds an additional lock to
protect ppr and event pointers in iommu_read_log().

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


diff -r 2fbac9359e3b -r ce5ef8a192c1 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Mar 01 16:31:52 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Mar 01 16:35:54 2012 +0000
@@ -367,6 +367,8 @@
     u32 tail, head, *entry, tail_offest, head_offset;
 
     BUG_ON(!iommu || ((log != &iommu->event_log) && (log != &iommu->ppr_log)));
+    
+    spin_lock(&log->lock);
 
     /* make sure there's an entry in the log */
     tail_offest = ( log == &iommu->event_log ) ?
@@ -396,6 +398,8 @@
         writel(head, iommu->mmio_base + head_offset);
     }
 
+    spin_unlock(&log->lock);
+   
     return 0;
 }
 
@@ -618,11 +622,11 @@
     u32 entry;
     unsigned long flags;
 
-    spin_lock_irqsave(&iommu->lock, flags);
-
     iommu_read_log(iommu, &iommu->event_log,
                    sizeof(event_entry_t), parse_event_log_entry);
 
+    spin_lock_irqsave(&iommu->lock, flags);
+    
     /*check event overflow */
     entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
 
@@ -651,14 +655,10 @@
     bus = PCI_BUS(device_id);
     devfn = PCI_DEVFN2(device_id);
 
-    local_irq_enable();
-
     spin_lock(&pcidevs_lock);
     pdev = pci_get_pdev(iommu->seg, bus, devfn);
     spin_unlock(&pcidevs_lock);
 
-    local_irq_disable();
-
     if ( pdev == NULL )
         return;
 
@@ -672,10 +672,10 @@
     u32 entry;
     unsigned long flags;
 
-    spin_lock_irqsave(&iommu->lock, flags);
-
     iommu_read_log(iommu, &iommu->ppr_log,
                    sizeof(ppr_entry_t), parse_ppr_log_entry);
+    
+    spin_lock_irqsave(&iommu->lock, flags);
 
     /*check event overflow */
     entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
@@ -852,6 +852,8 @@
     ring_buf->head = 0;
     ring_buf->tail = 0;
 
+    spin_lock_init(&ring_buf->lock);
+    
     ring_buf->alloc_size = PAGE_SIZE << get_order_from_bytes(entries *
                                                              entry_size);
     ring_buf->entries = ring_buf->alloc_size / entry_size;
diff -r 2fbac9359e3b -r ce5ef8a192c1 xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Thu Mar 01 16:31:52 2012 +0000
+++ b/xen/include/asm-x86/amd-iommu.h	Thu Mar 01 16:35:54 2012 +0000
@@ -65,6 +65,7 @@
     unsigned long alloc_size;
     uint32_t tail;
     uint32_t head;
+    spinlock_t lock;    /* protect buffer pointers */
 };
 
 typedef struct iommu_cap {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:35 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf0-0000g5-TA; Sat, 03 Mar 2012 04:33:34 +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 1S3gez-0000cg-RJ
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:34 +0000
Received: from [85.158.139.83:62146] by server-3.bemta-5.messagelabs.com id
	62/12-25237-D1F915F4; Sat, 03 Mar 2012 04:33:33 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1330749211!17673496!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12880 invoked from network); 3 Mar 2012 04:33:32 -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;
	3 Mar 2012 04:33:32 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gew-0004iK-PE
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:30 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gew-0003cK-Ny
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:30 +0000
Message-Id: <E1S3gew-0003cK-Ny@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] amd iommu: Introduce a new lock for
	event and ppr logging
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330619754 0
# Node ID ce5ef8a192c1050d85580305921d2e5caf220461
# Parent  2fbac9359e3b4fb61436e6e6653ec266b4f82ba9
amd iommu: Introduce a new lock for event and ppr logging

iommu->lock is used with irq disabled, so it cannot be used to protect
ppr log.  Otherwise, after c/s 24770, get_gfn will trigger a BUG() if
called by parse_ppr_log_entry(). This patch adds an additional lock to
protect ppr and event pointers in iommu_read_log().

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


diff -r 2fbac9359e3b -r ce5ef8a192c1 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Mar 01 16:31:52 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Mar 01 16:35:54 2012 +0000
@@ -367,6 +367,8 @@
     u32 tail, head, *entry, tail_offest, head_offset;
 
     BUG_ON(!iommu || ((log != &iommu->event_log) && (log != &iommu->ppr_log)));
+    
+    spin_lock(&log->lock);
 
     /* make sure there's an entry in the log */
     tail_offest = ( log == &iommu->event_log ) ?
@@ -396,6 +398,8 @@
         writel(head, iommu->mmio_base + head_offset);
     }
 
+    spin_unlock(&log->lock);
+   
     return 0;
 }
 
@@ -618,11 +622,11 @@
     u32 entry;
     unsigned long flags;
 
-    spin_lock_irqsave(&iommu->lock, flags);
-
     iommu_read_log(iommu, &iommu->event_log,
                    sizeof(event_entry_t), parse_event_log_entry);
 
+    spin_lock_irqsave(&iommu->lock, flags);
+    
     /*check event overflow */
     entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
 
@@ -651,14 +655,10 @@
     bus = PCI_BUS(device_id);
     devfn = PCI_DEVFN2(device_id);
 
-    local_irq_enable();
-
     spin_lock(&pcidevs_lock);
     pdev = pci_get_pdev(iommu->seg, bus, devfn);
     spin_unlock(&pcidevs_lock);
 
-    local_irq_disable();
-
     if ( pdev == NULL )
         return;
 
@@ -672,10 +672,10 @@
     u32 entry;
     unsigned long flags;
 
-    spin_lock_irqsave(&iommu->lock, flags);
-
     iommu_read_log(iommu, &iommu->ppr_log,
                    sizeof(ppr_entry_t), parse_ppr_log_entry);
+    
+    spin_lock_irqsave(&iommu->lock, flags);
 
     /*check event overflow */
     entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
@@ -852,6 +852,8 @@
     ring_buf->head = 0;
     ring_buf->tail = 0;
 
+    spin_lock_init(&ring_buf->lock);
+    
     ring_buf->alloc_size = PAGE_SIZE << get_order_from_bytes(entries *
                                                              entry_size);
     ring_buf->entries = ring_buf->alloc_size / entry_size;
diff -r 2fbac9359e3b -r ce5ef8a192c1 xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Thu Mar 01 16:31:52 2012 +0000
+++ b/xen/include/asm-x86/amd-iommu.h	Thu Mar 01 16:35:54 2012 +0000
@@ -65,6 +65,7 @@
     unsigned long alloc_size;
     uint32_t tail;
     uint32_t head;
+    spinlock_t lock;    /* protect buffer pointers */
 };
 
 typedef struct iommu_cap {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf4-0000oD-Ld; Sat, 03 Mar 2012 04:33:38 +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 1S3gf1-0000hS-Qw
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:36 +0000
Received: from [85.158.139.83:62178] by server-5.bemta-5.messagelabs.com id
	11/89-13566-E1F915F4; Sat, 03 Mar 2012 04:33:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1330749213!16808806!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12568 invoked from network); 3 Mar 2012 04:33:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gez-0004ij-0O
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gey-0003eK-S9
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:32 +0000
Message-Id: <E1S3gey-0003eK-S9@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:32 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] lowmemd: Fix build when xs.h has not
	been previously installed.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330620226 0
# Node ID 3ea51ace058283c2db577d85d05fd680e321f84d
# Parent  2cd89be4791ba420f63e00369e9defa4974b41ca
lowmemd: Fix build when xs.h has not been previously installed.

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


diff -r 2cd89be4791b -r 3ea51ace0582 tools/misc/Makefile
--- a/tools/misc/Makefile	Thu Mar 01 16:41:39 2012 +0000
+++ b/tools/misc/Makefile	Thu Mar 01 16:43:46 2012 +0000
@@ -5,6 +5,7 @@
 
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_xeninclude)
+CFLAGS += $(CFLAGS_libxenstore)
 
 HDRS     = $(wildcard *.h)
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:38 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:38 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf4-0000oD-Ld; Sat, 03 Mar 2012 04:33:38 +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 1S3gf1-0000hS-Qw
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:36 +0000
Received: from [85.158.139.83:62178] by server-5.bemta-5.messagelabs.com id
	11/89-13566-E1F915F4; Sat, 03 Mar 2012 04:33:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1330749213!16808806!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12568 invoked from network); 3 Mar 2012 04:33:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gez-0004ij-0O
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gey-0003eK-S9
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:32 +0000
Message-Id: <E1S3gey-0003eK-S9@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:32 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] lowmemd: Fix build when xs.h has not
	been previously installed.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330620226 0
# Node ID 3ea51ace058283c2db577d85d05fd680e321f84d
# Parent  2cd89be4791ba420f63e00369e9defa4974b41ca
lowmemd: Fix build when xs.h has not been previously installed.

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


diff -r 2cd89be4791b -r 3ea51ace0582 tools/misc/Makefile
--- a/tools/misc/Makefile	Thu Mar 01 16:41:39 2012 +0000
+++ b/tools/misc/Makefile	Thu Mar 01 16:43:46 2012 +0000
@@ -5,6 +5,7 @@
 
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_xeninclude)
+CFLAGS += $(CFLAGS_libxenstore)
 
 HDRS     = $(wildcard *.h)
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf4-0000oL-O5; Sat, 03 Mar 2012 04:33:38 +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 1S3gf1-0000gD-Dz
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:35 +0000
Received: from [85.158.139.83:19153] by server-7.bemta-5.messagelabs.com id
	C0/9A-16195-E1F915F4; Sat, 03 Mar 2012 04:33:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1330749212!17661787!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21031 invoked from network); 3 Mar 2012 04:33:33 -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;
	3 Mar 2012 04:33:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gex-0004iT-AI
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gex-0003co-8k
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:31 +0000
Message-Id: <E1S3gex-0003co-8k@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Grant table: fix a bug when grant
	copying a previous grant mapped 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Liu <wei.liu2@citrix.com>
# Date 1330619838 0
# Node ID 9ef985f5e6a57d2e78d27c5f0f64e6a049d8d1ff
# Parent  ce5ef8a192c1050d85580305921d2e5caf220461
Grant table: fix a bug when grant copying a previous grant mapped page.

In grant table version 2, when we create a non-transitive mapping from
DomU to Dom0, we need to set active entry's trans_domain and
trans_ref.  Otherwise when we grant copy from this previous mapped
ref, preemption count will get messed up.

See changeset 22994:299ed79acecf for more information.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r ce5ef8a192c1 -r 9ef985f5e6a5 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Mar 01 16:35:54 2012 +0000
+++ b/xen/common/grant_table.c	Thu Mar 01 16:37:18 2012 +0000
@@ -585,6 +585,8 @@
             act->start = 0;
             act->length = PAGE_SIZE;
             act->is_sub_page = 0;
+            act->trans_domain = rd;
+            act->trans_gref = op->ref;
         }
     }
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf4-0000oL-O5; Sat, 03 Mar 2012 04:33:38 +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 1S3gf1-0000gD-Dz
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:35 +0000
Received: from [85.158.139.83:19153] by server-7.bemta-5.messagelabs.com id
	C0/9A-16195-E1F915F4; Sat, 03 Mar 2012 04:33:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1330749212!17661787!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21031 invoked from network); 3 Mar 2012 04:33:33 -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;
	3 Mar 2012 04:33:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gex-0004iT-AI
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gex-0003co-8k
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:31 +0000
Message-Id: <E1S3gex-0003co-8k@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:30 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Grant table: fix a bug when grant
	copying a previous grant mapped 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Liu <wei.liu2@citrix.com>
# Date 1330619838 0
# Node ID 9ef985f5e6a57d2e78d27c5f0f64e6a049d8d1ff
# Parent  ce5ef8a192c1050d85580305921d2e5caf220461
Grant table: fix a bug when grant copying a previous grant mapped page.

In grant table version 2, when we create a non-transitive mapping from
DomU to Dom0, we need to set active entry's trans_domain and
trans_ref.  Otherwise when we grant copy from this previous mapped
ref, preemption count will get messed up.

See changeset 22994:299ed79acecf for more information.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r ce5ef8a192c1 -r 9ef985f5e6a5 xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Mar 01 16:35:54 2012 +0000
+++ b/xen/common/grant_table.c	Thu Mar 01 16:37:18 2012 +0000
@@ -585,6 +585,8 @@
             act->start = 0;
             act->length = PAGE_SIZE;
             act->is_sub_page = 0;
+            act->trans_domain = rd;
+            act->trans_gref = op->ref;
         }
     }
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf4-0000nw-Io; Sat, 03 Mar 2012 04:33:38 +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 1S3gf1-0000ET-AW
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:35 +0000
Received: from [85.158.143.99:30792] by server-2.bemta-4.messagelabs.com id
	9F/9D-17550-E1F915F4; Sat, 03 Mar 2012 04:33:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1330749212!17391933!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2980 invoked from network); 3 Mar 2012 04:33:33 -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;
	3 Mar 2012 04:33:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gey-0004id-CQ
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gey-0003dm-Am
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:32 +0000
Message-Id: <E1S3gey-0003dm-Am@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Lowmemd: Simple demo code to show
	use of VIRQ_ENOMEM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330620099 0
# Node ID 2cd89be4791ba420f63e00369e9defa4974b41ca
# Parent  8c6f3b307c7b61bb300daa1214e199011e170572
Lowmemd: Simple demo code to show use of VIRQ_ENOMEM

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 8c6f3b307c7b -r 2cd89be4791b .hgignore
--- a/.hgignore	Thu Mar 01 16:40:45 2012 +0000
+++ b/.hgignore	Thu Mar 01 16:41:39 2012 +0000
@@ -202,6 +202,7 @@
 ^tools/misc/xenperf$
 ^tools/misc/xenpm$
 ^tools/misc/xen-hvmctx$
+^tools/misc/xen-lowmemd$
 ^tools/misc/gtraceview$
 ^tools/misc/gtracestat$
 ^tools/misc/xenlockprof$
diff -r 8c6f3b307c7b -r 2cd89be4791b tools/misc/Makefile
--- a/tools/misc/Makefile	Thu Mar 01 16:40:45 2012 +0000
+++ b/tools/misc/Makefile	Thu Mar 01 16:41:39 2012 +0000
@@ -9,7 +9,7 @@
 HDRS     = $(wildcard *.h)
 
 TARGETS-y := xenperf xenpm xen-tmem-list-parse gtraceview gtracestat xenlockprof xenwatchdogd
-TARGETS-$(CONFIG_X86) += xen-detect xen-hvmctx xen-hvmcrash
+TARGETS-$(CONFIG_X86) += xen-detect xen-hvmctx xen-hvmcrash xen-lowmemd
 TARGETS-$(CONFIG_MIGRATE) += xen-hptool
 TARGETS := $(TARGETS-y)
 
@@ -21,7 +21,7 @@
 INSTALL_BIN-$(CONFIG_X86) += xen-detect
 INSTALL_BIN := $(INSTALL_BIN-y)
 
-INSTALL_SBIN-y := xm xen-bugtool xen-python-path xend xenperf xsview xenpm xen-tmem-list-parse gtraceview gtracestat xenlockprof xenwatchdogd xen-ringwatch
+INSTALL_SBIN-y := xm xen-bugtool xen-python-path xend xenperf xsview xenpm xen-tmem-list-parse gtraceview gtracestat xenlockprof xenwatchdogd xen-ringwatch xen-lowmemd
 INSTALL_SBIN-$(CONFIG_X86) += xen-hvmctx xen-hvmcrash
 INSTALL_SBIN-$(CONFIG_MIGRATE) += xen-hptool
 INSTALL_SBIN := $(INSTALL_SBIN-y)
@@ -70,6 +70,9 @@
 xenwatchdogd: xenwatchdogd.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
+xen-lowmemd: xen-lowmemd.o
+	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(APPEND_LDFLAGS)
+
 gtraceview: gtraceview.o
 	$(CC) $(LDFLAGS) -o $@ $< $(CURSES_LIBS) $(APPEND_LDFLAGS)
 
diff -r 8c6f3b307c7b -r 2cd89be4791b tools/misc/xen-lowmemd.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/misc/xen-lowmemd.c	Thu Mar 01 16:41:39 2012 +0000
@@ -0,0 +1,148 @@
+/*
+ * xen-lowmemd: demo VIRQ_ENOMEM
+ * Andres Lagar-Cavilla (GridCentric Inc.)
+ */
+
+#include <stdio.h>
+#include <xenctrl.h>
+#include <xs.h>
+#include <stdlib.h>
+#include <string.h>
+
+static evtchn_port_t virq_port      = -1;
+static xc_evtchn *xce_handle        = NULL;
+static xc_interface *xch            = NULL;
+static struct xs_handle *xs_handle  = NULL;
+
+void cleanup(void)
+{
+    if (virq_port > -1)
+        xc_evtchn_unbind(xce_handle, virq_port);
+    if (xce_handle)
+        xc_evtchn_close(xce_handle);
+    if (xch)
+        xc_interface_close(xch);
+    if (xs_handle)
+        xs_daemon_close(xs_handle);
+}
+
+/* Never shrink dom0 below 1 GiB */
+#define DOM0_FLOOR  (1 << 30)
+#define DOM0_FLOOR_PG   ((DOM0_FLOOR) >> 12)
+
+/* Act if free memory is less than 92 MiB */
+#define THRESHOLD   (92 << 20)
+#define THRESHOLD_PG    ((THRESHOLD) >> 12)
+
+#define BUFSZ 512
+void handle_low_mem(void)
+{
+    xc_dominfo_t  dom0_info;
+    xc_physinfo_t info;
+    unsigned long long free_pages, dom0_pages, diff, dom0_target;
+    char data[BUFSZ], error[BUFSZ];
+
+    if (xc_physinfo(xch, &info) < 0)
+    {
+        perror("Getting physinfo failed");
+        return;
+    }
+
+    free_pages = (unsigned long long) info.free_pages;
+    printf("Available free pages: 0x%llx:%llux\n",
+            free_pages, free_pages);
+
+    /* Don't do anything if we have more than the threshold free */
+    if ( free_pages >= THRESHOLD_PG )
+        return;
+    diff = THRESHOLD_PG - free_pages; 
+
+    if (xc_domain_getinfo(xch, 0, 1, &dom0_info) < 1)
+    {
+        perror("Failed to get dom0 info");
+        return;
+    }
+
+    dom0_pages = (unsigned long long) dom0_info.nr_pages;
+    printf("Dom0 pages: 0x%llx:%llu\n", dom0_pages, dom0_pages);
+    dom0_target = dom0_pages - diff;
+    if (dom0_target <= DOM0_FLOOR_PG)
+        return;
+
+    printf("Shooting for dom0 target 0x%llx:%llu\n", 
+            dom0_target, dom0_target);
+
+    snprintf(data, BUFSZ, "%llu", dom0_target);
+    if (!xs_write(xs_handle, XBT_NULL, 
+            "/local/domain/0/memory/target", data, strlen(data)))
+    {
+        snprintf(error, BUFSZ,"Failed to write target %s to xenstore", data);
+        perror(error);
+    }
+}
+
+int main(int argc, char *argv[])
+{
+    int rc;
+
+    atexit(cleanup);
+
+	xch = xc_interface_open(NULL, NULL, 0);
+	if (xch == NULL)
+    {
+        perror("Failed to open xc interface");
+        return 1;
+    }
+
+	xce_handle = xc_evtchn_open(NULL, 0);
+	if (xce_handle == NULL)
+    {
+        perror("Failed to open evtchn device");
+        return 2;
+    }
+
+    xs_handle = xs_daemon_open();
+    if (xs_handle == NULL)
+    {
+        perror("Failed to open xenstore connection");
+        return 3;
+    }
+
+	if ((rc = xc_evtchn_bind_virq(xce_handle, VIRQ_ENOMEM)) == -1)
+    {
+        perror("Failed to bind to domain exception virq port");
+        return 4;
+    }
+
+    virq_port = rc;
+    
+    while(1)
+    {
+        evtchn_port_t port;
+
+        if ((port = xc_evtchn_pending(xce_handle)) == -1)
+        {
+            perror("Failed to listen for pending event channel");
+            return 5;
+        }
+
+        if (port != virq_port)
+        {
+            char data[BUFSZ];
+            snprintf(data, BUFSZ, "Wrong port, got %d expected %d", port, virq_port);
+            perror(data);
+            return 6;
+        }
+
+        if (xc_evtchn_unmask(xce_handle, port) == -1)
+        {
+            perror("Failed to unmask port");
+            return 7;
+        }
+
+        printf("Got a virq kick, time to get work\n");
+        handle_low_mem();
+    }
+
+    return 0;
+}

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf3-0000ly-FQ; Sat, 03 Mar 2012 04:33:37 +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 1S3gf0-0000ET-NL
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:35 +0000
Received: from [85.158.143.35:63009] by server-2.bemta-4.messagelabs.com id
	EE/9D-17550-E1F915F4; Sat, 03 Mar 2012 04:33:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1330749212!9240396!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10743 invoked from network); 3 Mar 2012 04:33:33 -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;
	3 Mar 2012 04:33:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gex-0004iY-RE
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gex-0003dJ-Pj
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:31 +0000
Message-Id: <E1S3gex-0003dJ-Pj@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Global virq for low memory situations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330620045 0
# Node ID 8c6f3b307c7b61bb300daa1214e199011e170572
# Parent  9ef985f5e6a57d2e78d27c5f0f64e6a049d8d1ff
Global virq for low memory situations

When a low memory threshold on the Xen heap is reached, we fire a
global dom0 virq. If someone's listening, they can free up some more
memory.

The low threshold is configurable via the command line token
'low_mem_virq_limit", and defaults to 64MiB. If the user specifies
zero via the command line, the virq is disabled.

We define a new virq VIRQ_ENOMEM. Potential listeners include
squeezed, xenballoond, or anything else that can be fired through
xencommons.

We error-check the low mem virq against initial available heap (after
dom0 allocation), to avoid firing immediately.

Virq issuing is controlled by a hysteresis algorithm: when memory dips
below a threshold, the virq is issued and the next virq will fire when
memory shrinks another order of magnitude. The virq will not fire
again in the current "band" until memory grows over the next higher
order of magnitude.

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


diff -r 9ef985f5e6a5 -r 8c6f3b307c7b xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Thu Mar 01 16:37:18 2012 +0000
+++ b/xen/common/page_alloc.c	Thu Mar 01 16:40:45 2012 +0000
@@ -35,6 +35,7 @@
 #include <xen/perfc.h>
 #include <xen/numa.h>
 #include <xen/nodemask.h>
+#include <xen/event.h>
 #include <xen/tmem.h>
 #include <xen/tmem_xen.h>
 #include <public/sysctl.h>
@@ -300,6 +301,107 @@
     return needed;
 }
 
+/* Default to 64 MiB */
+#define DEFAULT_LOW_MEM_VIRQ    (((paddr_t) 64)   << 20)
+#define MAX_LOW_MEM_VIRQ        (((paddr_t) 1024) << 20)
+
+static paddr_t __read_mostly opt_low_mem_virq = ((paddr_t) -1);
+size_param("low_mem_virq_limit", opt_low_mem_virq);
+
+/* Thresholds to control hysteresis. In pages */
+/* When memory grows above this threshold, reset hysteresis.
+ * -1 initially to not reset until at least one virq issued. */
+static unsigned long low_mem_virq_high      = -1UL;
+/* Threshold at which we issue virq */
+static unsigned long low_mem_virq_th        = 0;
+/* Original threshold after all checks completed */
+static unsigned long low_mem_virq_orig      = 0;
+/* Order for current threshold */
+static unsigned int  low_mem_virq_th_order  = 0;
+
+/* Perform bootstrapping checks and set bounds */
+static void __init setup_low_mem_virq(void)
+{
+    unsigned int order;
+    paddr_t threshold;
+    bool_t halve;
+
+    /* If the user specifies zero, then he/she doesn't want this virq
+     * to ever trigger. */
+    if ( opt_low_mem_virq == 0 )
+    {
+        low_mem_virq_th = -1UL;
+        return;
+    }
+
+    /* If the user did not specify a knob, remember that */
+    halve = (opt_low_mem_virq == ((paddr_t) -1));
+    threshold = halve ? DEFAULT_LOW_MEM_VIRQ : opt_low_mem_virq;
+
+    /* Dom0 has already been allocated by now. So check we won't be
+     * complaining immediately with whatever's left of the heap. */
+    threshold = min(threshold,
+                    ((paddr_t) total_avail_pages) << PAGE_SHIFT);
+
+    /* Then, cap to some predefined maximum */
+    threshold = min(threshold, MAX_LOW_MEM_VIRQ);
+
+    /* If the user specified no knob, and we are at the current available
+     * level, halve the threshold. */
+    if ( halve &&
+         (threshold == (((paddr_t) total_avail_pages) << PAGE_SHIFT)) )
+        threshold >>= 1;
+
+    /* Zero? Have to fire immediately */
+    threshold = max(threshold, (paddr_t) PAGE_SIZE);
+
+    /* Threshold bytes -> pages */
+    low_mem_virq_th = threshold >> PAGE_SHIFT;
+
+    /* Next, round the threshold down to the next order */
+    order = get_order_from_pages(low_mem_virq_th);
+    if ( (1UL << order) > low_mem_virq_th )
+        order--;
+
+    /* Set bounds, ready to go */
+    low_mem_virq_th = low_mem_virq_orig = 1UL << order;
+    low_mem_virq_th_order = order;
+
+    printk("Initial low memory virq threshold set at 0x%lx pages.\n",
+            low_mem_virq_th);
+}
+
+static void check_low_mem_virq(void)
+{
+    if ( unlikely(total_avail_pages <= low_mem_virq_th) )
+    {
+        send_global_virq(VIRQ_ENOMEM);
+
+        /* Update thresholds. Next warning will be when we drop below
+         * next order. However, we wait until we grow beyond one
+         * order above us to complain again at the current order */
+        low_mem_virq_high   = 1UL << (low_mem_virq_th_order + 1);
+        if ( low_mem_virq_th_order > 0 )
+            low_mem_virq_th_order--;
+        low_mem_virq_th     = 1UL << low_mem_virq_th_order;
+        return;
+    }
+
+    if ( unlikely(total_avail_pages >= low_mem_virq_high) )
+    {
+        /* Reset hysteresis. Bring threshold up one order.
+         * If we are back where originally set, set high
+         * threshold to -1 to avoid further growth of
+         * virq threshold. */
+        low_mem_virq_th_order++;
+        low_mem_virq_th = 1UL << low_mem_virq_th_order;
+        if ( low_mem_virq_th == low_mem_virq_orig )
+            low_mem_virq_high = -1UL;
+        else
+            low_mem_virq_high = 1UL << (low_mem_virq_th_order + 2);
+    }
+}
+
 /* Allocate 2^@order contiguous pages. */
 static struct page_info *alloc_heap_pages(
     unsigned int zone_lo, unsigned int zone_hi,
@@ -420,6 +522,8 @@
     total_avail_pages -= request;
     ASSERT(total_avail_pages >= 0);
 
+    check_low_mem_virq();
+
     if ( d != NULL )
         d->last_alloc_node = node;
 
@@ -1022,6 +1126,10 @@
     }
 
     printk("done.\n");
+
+    /* Now that the heap is initialized, run checks and set bounds
+     * for the low mem virq algorithm. */
+    setup_low_mem_virq();
 }
 
 
diff -r 9ef985f5e6a5 -r 8c6f3b307c7b xen/include/public/xen.h
--- a/xen/include/public/xen.h	Thu Mar 01 16:37:18 2012 +0000
+++ b/xen/include/public/xen.h	Thu Mar 01 16:40:45 2012 +0000
@@ -158,6 +158,7 @@
 #define VIRQ_PCPU_STATE 9  /* G. (DOM0) PCPU state changed                   */
 #define VIRQ_MEM_EVENT  10 /* G. (DOM0) A memory event has occured           */
 #define VIRQ_XC_RESERVED 11 /* G. Reserved for XenClient                     */
+#define VIRQ_ENOMEM     12 /* G. (DOM0) Low on heap memory       */
 
 /* Architecture-specific VIRQ definitions. */
 #define VIRQ_ARCH_0    16

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf4-0000nw-Io; Sat, 03 Mar 2012 04:33:38 +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 1S3gf1-0000ET-AW
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:35 +0000
Received: from [85.158.143.99:30792] by server-2.bemta-4.messagelabs.com id
	9F/9D-17550-E1F915F4; Sat, 03 Mar 2012 04:33:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1330749212!17391933!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2980 invoked from network); 3 Mar 2012 04:33:33 -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;
	3 Mar 2012 04:33:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gey-0004id-CQ
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:32 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gey-0003dm-Am
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:32 +0000
Message-Id: <E1S3gey-0003dm-Am@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Lowmemd: Simple demo code to show
	use of VIRQ_ENOMEM
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330620099 0
# Node ID 2cd89be4791ba420f63e00369e9defa4974b41ca
# Parent  8c6f3b307c7b61bb300daa1214e199011e170572
Lowmemd: Simple demo code to show use of VIRQ_ENOMEM

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 8c6f3b307c7b -r 2cd89be4791b .hgignore
--- a/.hgignore	Thu Mar 01 16:40:45 2012 +0000
+++ b/.hgignore	Thu Mar 01 16:41:39 2012 +0000
@@ -202,6 +202,7 @@
 ^tools/misc/xenperf$
 ^tools/misc/xenpm$
 ^tools/misc/xen-hvmctx$
+^tools/misc/xen-lowmemd$
 ^tools/misc/gtraceview$
 ^tools/misc/gtracestat$
 ^tools/misc/xenlockprof$
diff -r 8c6f3b307c7b -r 2cd89be4791b tools/misc/Makefile
--- a/tools/misc/Makefile	Thu Mar 01 16:40:45 2012 +0000
+++ b/tools/misc/Makefile	Thu Mar 01 16:41:39 2012 +0000
@@ -9,7 +9,7 @@
 HDRS     = $(wildcard *.h)
 
 TARGETS-y := xenperf xenpm xen-tmem-list-parse gtraceview gtracestat xenlockprof xenwatchdogd
-TARGETS-$(CONFIG_X86) += xen-detect xen-hvmctx xen-hvmcrash
+TARGETS-$(CONFIG_X86) += xen-detect xen-hvmctx xen-hvmcrash xen-lowmemd
 TARGETS-$(CONFIG_MIGRATE) += xen-hptool
 TARGETS := $(TARGETS-y)
 
@@ -21,7 +21,7 @@
 INSTALL_BIN-$(CONFIG_X86) += xen-detect
 INSTALL_BIN := $(INSTALL_BIN-y)
 
-INSTALL_SBIN-y := xm xen-bugtool xen-python-path xend xenperf xsview xenpm xen-tmem-list-parse gtraceview gtracestat xenlockprof xenwatchdogd xen-ringwatch
+INSTALL_SBIN-y := xm xen-bugtool xen-python-path xend xenperf xsview xenpm xen-tmem-list-parse gtraceview gtracestat xenlockprof xenwatchdogd xen-ringwatch xen-lowmemd
 INSTALL_SBIN-$(CONFIG_X86) += xen-hvmctx xen-hvmcrash
 INSTALL_SBIN-$(CONFIG_MIGRATE) += xen-hptool
 INSTALL_SBIN := $(INSTALL_SBIN-y)
@@ -70,6 +70,9 @@
 xenwatchdogd: xenwatchdogd.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
+xen-lowmemd: xen-lowmemd.o
+	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(APPEND_LDFLAGS)
+
 gtraceview: gtraceview.o
 	$(CC) $(LDFLAGS) -o $@ $< $(CURSES_LIBS) $(APPEND_LDFLAGS)
 
diff -r 8c6f3b307c7b -r 2cd89be4791b tools/misc/xen-lowmemd.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/misc/xen-lowmemd.c	Thu Mar 01 16:41:39 2012 +0000
@@ -0,0 +1,148 @@
+/*
+ * xen-lowmemd: demo VIRQ_ENOMEM
+ * Andres Lagar-Cavilla (GridCentric Inc.)
+ */
+
+#include <stdio.h>
+#include <xenctrl.h>
+#include <xs.h>
+#include <stdlib.h>
+#include <string.h>
+
+static evtchn_port_t virq_port      = -1;
+static xc_evtchn *xce_handle        = NULL;
+static xc_interface *xch            = NULL;
+static struct xs_handle *xs_handle  = NULL;
+
+void cleanup(void)
+{
+    if (virq_port > -1)
+        xc_evtchn_unbind(xce_handle, virq_port);
+    if (xce_handle)
+        xc_evtchn_close(xce_handle);
+    if (xch)
+        xc_interface_close(xch);
+    if (xs_handle)
+        xs_daemon_close(xs_handle);
+}
+
+/* Never shrink dom0 below 1 GiB */
+#define DOM0_FLOOR  (1 << 30)
+#define DOM0_FLOOR_PG   ((DOM0_FLOOR) >> 12)
+
+/* Act if free memory is less than 92 MiB */
+#define THRESHOLD   (92 << 20)
+#define THRESHOLD_PG    ((THRESHOLD) >> 12)
+
+#define BUFSZ 512
+void handle_low_mem(void)
+{
+    xc_dominfo_t  dom0_info;
+    xc_physinfo_t info;
+    unsigned long long free_pages, dom0_pages, diff, dom0_target;
+    char data[BUFSZ], error[BUFSZ];
+
+    if (xc_physinfo(xch, &info) < 0)
+    {
+        perror("Getting physinfo failed");
+        return;
+    }
+
+    free_pages = (unsigned long long) info.free_pages;
+    printf("Available free pages: 0x%llx:%llux\n",
+            free_pages, free_pages);
+
+    /* Don't do anything if we have more than the threshold free */
+    if ( free_pages >= THRESHOLD_PG )
+        return;
+    diff = THRESHOLD_PG - free_pages; 
+
+    if (xc_domain_getinfo(xch, 0, 1, &dom0_info) < 1)
+    {
+        perror("Failed to get dom0 info");
+        return;
+    }
+
+    dom0_pages = (unsigned long long) dom0_info.nr_pages;
+    printf("Dom0 pages: 0x%llx:%llu\n", dom0_pages, dom0_pages);
+    dom0_target = dom0_pages - diff;
+    if (dom0_target <= DOM0_FLOOR_PG)
+        return;
+
+    printf("Shooting for dom0 target 0x%llx:%llu\n", 
+            dom0_target, dom0_target);
+
+    snprintf(data, BUFSZ, "%llu", dom0_target);
+    if (!xs_write(xs_handle, XBT_NULL, 
+            "/local/domain/0/memory/target", data, strlen(data)))
+    {
+        snprintf(error, BUFSZ,"Failed to write target %s to xenstore", data);
+        perror(error);
+    }
+}
+
+int main(int argc, char *argv[])
+{
+    int rc;
+
+    atexit(cleanup);
+
+	xch = xc_interface_open(NULL, NULL, 0);
+	if (xch == NULL)
+    {
+        perror("Failed to open xc interface");
+        return 1;
+    }
+
+	xce_handle = xc_evtchn_open(NULL, 0);
+	if (xce_handle == NULL)
+    {
+        perror("Failed to open evtchn device");
+        return 2;
+    }
+
+    xs_handle = xs_daemon_open();
+    if (xs_handle == NULL)
+    {
+        perror("Failed to open xenstore connection");
+        return 3;
+    }
+
+	if ((rc = xc_evtchn_bind_virq(xce_handle, VIRQ_ENOMEM)) == -1)
+    {
+        perror("Failed to bind to domain exception virq port");
+        return 4;
+    }
+
+    virq_port = rc;
+    
+    while(1)
+    {
+        evtchn_port_t port;
+
+        if ((port = xc_evtchn_pending(xce_handle)) == -1)
+        {
+            perror("Failed to listen for pending event channel");
+            return 5;
+        }
+
+        if (port != virq_port)
+        {
+            char data[BUFSZ];
+            snprintf(data, BUFSZ, "Wrong port, got %d expected %d", port, virq_port);
+            perror(data);
+            return 6;
+        }
+
+        if (xc_evtchn_unmask(xce_handle, port) == -1)
+        {
+            perror("Failed to unmask port");
+            return 7;
+        }
+
+        printf("Got a virq kick, time to get work\n");
+        handle_low_mem();
+    }
+
+    return 0;
+}

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:39 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf3-0000ly-FQ; Sat, 03 Mar 2012 04:33:37 +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 1S3gf0-0000ET-NL
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:35 +0000
Received: from [85.158.143.35:63009] by server-2.bemta-4.messagelabs.com id
	EE/9D-17550-E1F915F4; Sat, 03 Mar 2012 04:33:34 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1330749212!9240396!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10743 invoked from network); 3 Mar 2012 04:33:33 -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;
	3 Mar 2012 04:33:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gex-0004iY-RE
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:31 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gex-0003dJ-Pj
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:31 +0000
Message-Id: <E1S3gex-0003dJ-Pj@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:31 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Global virq for low memory situations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330620045 0
# Node ID 8c6f3b307c7b61bb300daa1214e199011e170572
# Parent  9ef985f5e6a57d2e78d27c5f0f64e6a049d8d1ff
Global virq for low memory situations

When a low memory threshold on the Xen heap is reached, we fire a
global dom0 virq. If someone's listening, they can free up some more
memory.

The low threshold is configurable via the command line token
'low_mem_virq_limit", and defaults to 64MiB. If the user specifies
zero via the command line, the virq is disabled.

We define a new virq VIRQ_ENOMEM. Potential listeners include
squeezed, xenballoond, or anything else that can be fired through
xencommons.

We error-check the low mem virq against initial available heap (after
dom0 allocation), to avoid firing immediately.

Virq issuing is controlled by a hysteresis algorithm: when memory dips
below a threshold, the virq is issued and the next virq will fire when
memory shrinks another order of magnitude. The virq will not fire
again in the current "band" until memory grows over the next higher
order of magnitude.

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


diff -r 9ef985f5e6a5 -r 8c6f3b307c7b xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Thu Mar 01 16:37:18 2012 +0000
+++ b/xen/common/page_alloc.c	Thu Mar 01 16:40:45 2012 +0000
@@ -35,6 +35,7 @@
 #include <xen/perfc.h>
 #include <xen/numa.h>
 #include <xen/nodemask.h>
+#include <xen/event.h>
 #include <xen/tmem.h>
 #include <xen/tmem_xen.h>
 #include <public/sysctl.h>
@@ -300,6 +301,107 @@
     return needed;
 }
 
+/* Default to 64 MiB */
+#define DEFAULT_LOW_MEM_VIRQ    (((paddr_t) 64)   << 20)
+#define MAX_LOW_MEM_VIRQ        (((paddr_t) 1024) << 20)
+
+static paddr_t __read_mostly opt_low_mem_virq = ((paddr_t) -1);
+size_param("low_mem_virq_limit", opt_low_mem_virq);
+
+/* Thresholds to control hysteresis. In pages */
+/* When memory grows above this threshold, reset hysteresis.
+ * -1 initially to not reset until at least one virq issued. */
+static unsigned long low_mem_virq_high      = -1UL;
+/* Threshold at which we issue virq */
+static unsigned long low_mem_virq_th        = 0;
+/* Original threshold after all checks completed */
+static unsigned long low_mem_virq_orig      = 0;
+/* Order for current threshold */
+static unsigned int  low_mem_virq_th_order  = 0;
+
+/* Perform bootstrapping checks and set bounds */
+static void __init setup_low_mem_virq(void)
+{
+    unsigned int order;
+    paddr_t threshold;
+    bool_t halve;
+
+    /* If the user specifies zero, then he/she doesn't want this virq
+     * to ever trigger. */
+    if ( opt_low_mem_virq == 0 )
+    {
+        low_mem_virq_th = -1UL;
+        return;
+    }
+
+    /* If the user did not specify a knob, remember that */
+    halve = (opt_low_mem_virq == ((paddr_t) -1));
+    threshold = halve ? DEFAULT_LOW_MEM_VIRQ : opt_low_mem_virq;
+
+    /* Dom0 has already been allocated by now. So check we won't be
+     * complaining immediately with whatever's left of the heap. */
+    threshold = min(threshold,
+                    ((paddr_t) total_avail_pages) << PAGE_SHIFT);
+
+    /* Then, cap to some predefined maximum */
+    threshold = min(threshold, MAX_LOW_MEM_VIRQ);
+
+    /* If the user specified no knob, and we are at the current available
+     * level, halve the threshold. */
+    if ( halve &&
+         (threshold == (((paddr_t) total_avail_pages) << PAGE_SHIFT)) )
+        threshold >>= 1;
+
+    /* Zero? Have to fire immediately */
+    threshold = max(threshold, (paddr_t) PAGE_SIZE);
+
+    /* Threshold bytes -> pages */
+    low_mem_virq_th = threshold >> PAGE_SHIFT;
+
+    /* Next, round the threshold down to the next order */
+    order = get_order_from_pages(low_mem_virq_th);
+    if ( (1UL << order) > low_mem_virq_th )
+        order--;
+
+    /* Set bounds, ready to go */
+    low_mem_virq_th = low_mem_virq_orig = 1UL << order;
+    low_mem_virq_th_order = order;
+
+    printk("Initial low memory virq threshold set at 0x%lx pages.\n",
+            low_mem_virq_th);
+}
+
+static void check_low_mem_virq(void)
+{
+    if ( unlikely(total_avail_pages <= low_mem_virq_th) )
+    {
+        send_global_virq(VIRQ_ENOMEM);
+
+        /* Update thresholds. Next warning will be when we drop below
+         * next order. However, we wait until we grow beyond one
+         * order above us to complain again at the current order */
+        low_mem_virq_high   = 1UL << (low_mem_virq_th_order + 1);
+        if ( low_mem_virq_th_order > 0 )
+            low_mem_virq_th_order--;
+        low_mem_virq_th     = 1UL << low_mem_virq_th_order;
+        return;
+    }
+
+    if ( unlikely(total_avail_pages >= low_mem_virq_high) )
+    {
+        /* Reset hysteresis. Bring threshold up one order.
+         * If we are back where originally set, set high
+         * threshold to -1 to avoid further growth of
+         * virq threshold. */
+        low_mem_virq_th_order++;
+        low_mem_virq_th = 1UL << low_mem_virq_th_order;
+        if ( low_mem_virq_th == low_mem_virq_orig )
+            low_mem_virq_high = -1UL;
+        else
+            low_mem_virq_high = 1UL << (low_mem_virq_th_order + 2);
+    }
+}
+
 /* Allocate 2^@order contiguous pages. */
 static struct page_info *alloc_heap_pages(
     unsigned int zone_lo, unsigned int zone_hi,
@@ -420,6 +522,8 @@
     total_avail_pages -= request;
     ASSERT(total_avail_pages >= 0);
 
+    check_low_mem_virq();
+
     if ( d != NULL )
         d->last_alloc_node = node;
 
@@ -1022,6 +1126,10 @@
     }
 
     printk("done.\n");
+
+    /* Now that the heap is initialized, run checks and set bounds
+     * for the low mem virq algorithm. */
+    setup_low_mem_virq();
 }
 
 
diff -r 9ef985f5e6a5 -r 8c6f3b307c7b xen/include/public/xen.h
--- a/xen/include/public/xen.h	Thu Mar 01 16:37:18 2012 +0000
+++ b/xen/include/public/xen.h	Thu Mar 01 16:40:45 2012 +0000
@@ -158,6 +158,7 @@
 #define VIRQ_PCPU_STATE 9  /* G. (DOM0) PCPU state changed                   */
 #define VIRQ_MEM_EVENT  10 /* G. (DOM0) A memory event has occured           */
 #define VIRQ_XC_RESERVED 11 /* G. Reserved for XenClient                     */
+#define VIRQ_ENOMEM     12 /* G. (DOM0) Low on heap memory       */
 
 /* Architecture-specific VIRQ definitions. */
 #define VIRQ_ARCH_0    16

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf5-0000rT-Tj; Sat, 03 Mar 2012 04:33:39 +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 1S3gf4-0000mg-7v
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:38 +0000
Received: from [85.158.139.83:19210] by server-10.bemta-5.messagelabs.com id
	A1/5D-08260-12F915F4; Sat, 03 Mar 2012 04:33:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1330749215!6394629!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21497 invoked from network); 3 Mar 2012 04:33:36 -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;
	3 Mar 2012 04:33:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf1-0004j9-6a
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf1-0003gM-52
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:35 +0000
Message-Id: <E1S3gf1-0003gM-52@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:34 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: xen-headers: Annotate typedefs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330620699 0
# Node ID bad55a5879d5f5bfb8507f8d9080d5e984f935a3
# Parent  08392a9cde1e858644ecce6a4ee0dea0dd4a5968
docs: xen-headers: Annotate typedefs

Parse (some) typedef statements.  (Make type names links to the
underlying struct if there is one, rather than to just the typedef.)

Also, exclude the new arch-arm headers.

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


diff -r 08392a9cde1e -r bad55a5879d5 docs/Makefile
--- a/docs/Makefile	Thu Mar 01 16:48:36 2012 +0000
+++ b/docs/Makefile	Thu Mar 01 16:51:39 2012 +0000
@@ -120,7 +120,7 @@
 	@$(INSTALL_DIR) $(@D)
 	./xen-headers -O $(@D) \
 		-T 'arch-x86_64 - Xen public headers' \
-		-X arch-ia64 -X arch-x86_32 -X xen-x86_32 \
+		-X arch-ia64 -X arch-x86_32 -X xen-x86_32 -X arch-arm \
 		../xen include/public include/xen/errno.h
 
 -include html/hypercall/.deps
diff -r 08392a9cde1e -r bad55a5879d5 docs/xen-headers
--- a/docs/xen-headers	Thu Mar 01 16:48:36 2012 +0000
+++ b/docs/xen-headers	Thu Mar 01 16:51:39 2012 +0000
@@ -120,11 +120,12 @@
     return "<a $hparams>$ytext</a>";
 }
 
-sub defn ($$$;$) {
-    my ($text,$type,$name,$hparams) = @_;
+sub defn ($$$;$$) {
+    my ($text,$type,$name,$hparams,$deref) = @_;
     $hparams='' if !defined $hparams;
-    debug(2,"DEFN $. $type $name $hparams");
+    debug(2,"DEFN $. $type $name $hparams |$text|");
     $sdef{$type}{$name}{DefLocs}{"$leaf:$."} = $leaf_opath;
+    $sdef{$type}{$name}{Derefs}{"$leaf:$."} = $deref;
     my $xrefs = $sdef{$type}{$name}{Xrefs};
     push @pending_xrefs, values %$xrefs if $xrefs;
     $hparams .= " name=\"${type}_$name\"" if $sdef{$type}{$name}{Used};
@@ -140,7 +141,7 @@
 	} elsif (s/^(struct|union|enum)\s+(\w+)\b//) {
 	    $no .= ahref($&, (ucfirst $1), $2);
 	} elsif (s/^\w+\b//) {
-	    $no .= ahref($&, 'Func', $&);
+	    $no .= ahref($&, [qw(Func Typedef)], $&);
 	} else {
 	    die "$_ ?";
 	}
@@ -148,18 +149,42 @@
     return $no;
 }
 
+sub sdefval ($$$) {
+    my ($type,$name,$hkey) = @_;
+    $sdef{$type}{$name}{Used} = 1;
+    my $sdef = $sdef{$type}{$name};
+    my $hash = $sdef->{$hkey};
+    if ((scalar keys %$hash) > 1 && !$sdef->{MultiWarned}{$hkey}) {
+        warning("multiple definitions of $type $name: $_")
+            foreach keys %$hash;
+        $sdef->{MultiWarned}{$hkey}=1;
+    }
+    my ($val) = values %$hash;
+    return $val;
+}
+
 sub refhref ($$) {
-    my ($type,$name) = @_;
-    $sdef{$type}{$name}{Used} = 1;
-    my $locs = $sdef{$type}{$name}{DefLocs};
-    return '' unless $locs;
-    if ((scalar keys %$locs) != 1 && !$sdef{$type}{$name}{MultiWarned}) {
-	warning("multiple definitions of $type $name: $_")
-	    foreach keys %$locs;
-	$sdef{$type}{$name}{MultiWarned}=1;
+    my ($types,$name) = @_;
+    foreach my $type (ref($types) ? @$types : ($types)) {
+        my ($ttype,$tname) = ($type,$name);
+        my $loc = sdefval($ttype,$tname,'DefLocs');
+        for (;;) {
+            my $deref = sdefval($ttype,$tname,'Derefs');
+            last unless $deref;
+            my ($type2,$name2,$loc2);
+            my @deref = @$deref;
+            while (@deref) {
+                ($type2,$name2,@deref) = @deref;
+                $loc2 = sdefval($type2,$name2,'DefLocs');
+                last if defined $loc2;
+            }
+            last unless defined $loc2;
+            ($loc,$ttype,$tname) = ($loc2,$type2,$name2);
+        }
+        next unless defined $loc;
+        return "href=\"$loc#${ttype}_$tname\"";
     }
-    my ($loc) = values %$locs;
-    return "href=\"$loc#${type}_$name\"";
+    return '';
 }
 
 sub ahref ($$$) {
@@ -259,6 +284,14 @@
 		    in_enum($1,(ucfirst $2),$3);
 	        }
 	    }
+	} elsif (s/^(typedef \s+ )((struct|union|enum) \  (\w+))
+                      (\s+) (\w+)(\;)$
+                  / norm($1).norm($2).$5.
+                    defn($6,'Typedef',$6,undef,[(ucfirst $3),$4]).
+                    $7 /xe) {
+        } elsif (s/^(typedef \s+) (\w+) (\s+) (\w+) (\;)$
+                  / $1.norm($2).$3.
+                    defn($4,'Typedef',$4,undef,['Typedef',$2]). $5 /xe) {
 	} elsif (s/^( \s* \#define \s+ ) (\w+) ( \s+\S )
                   / $1.defmacro($2).norm($3) /xe) {
 	} elsif (s/( \`incontents \s+ (\d+) \s+ (\w+) \s+ )(\S .* \S)
@@ -315,6 +348,7 @@
     $forkind->('Func','Functions','','()');
     $forkind->('Struct','Structs','struct ','');
     $forkind->('Enum','Enums and sets of #defines','','');
+    $forkind->('Typedef','Typedefs','typedef ','');
     $forkind->('EnumVal','Enum values and individual #defines','','');
     $o .= "</ul>\n<h2>Files</h2><ul>\n";
     foreach my $of (sort { $a->[0] cmp $b->[0] } @outfiles) {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf5-0000rT-Tj; Sat, 03 Mar 2012 04:33:39 +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 1S3gf4-0000mg-7v
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:38 +0000
Received: from [85.158.139.83:19210] by server-10.bemta-5.messagelabs.com id
	A1/5D-08260-12F915F4; Sat, 03 Mar 2012 04:33:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1330749215!6394629!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21497 invoked from network); 3 Mar 2012 04:33:36 -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;
	3 Mar 2012 04:33:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf1-0004j9-6a
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf1-0003gM-52
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:35 +0000
Message-Id: <E1S3gf1-0003gM-52@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:34 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: xen-headers: Annotate typedefs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330620699 0
# Node ID bad55a5879d5f5bfb8507f8d9080d5e984f935a3
# Parent  08392a9cde1e858644ecce6a4ee0dea0dd4a5968
docs: xen-headers: Annotate typedefs

Parse (some) typedef statements.  (Make type names links to the
underlying struct if there is one, rather than to just the typedef.)

Also, exclude the new arch-arm headers.

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


diff -r 08392a9cde1e -r bad55a5879d5 docs/Makefile
--- a/docs/Makefile	Thu Mar 01 16:48:36 2012 +0000
+++ b/docs/Makefile	Thu Mar 01 16:51:39 2012 +0000
@@ -120,7 +120,7 @@
 	@$(INSTALL_DIR) $(@D)
 	./xen-headers -O $(@D) \
 		-T 'arch-x86_64 - Xen public headers' \
-		-X arch-ia64 -X arch-x86_32 -X xen-x86_32 \
+		-X arch-ia64 -X arch-x86_32 -X xen-x86_32 -X arch-arm \
 		../xen include/public include/xen/errno.h
 
 -include html/hypercall/.deps
diff -r 08392a9cde1e -r bad55a5879d5 docs/xen-headers
--- a/docs/xen-headers	Thu Mar 01 16:48:36 2012 +0000
+++ b/docs/xen-headers	Thu Mar 01 16:51:39 2012 +0000
@@ -120,11 +120,12 @@
     return "<a $hparams>$ytext</a>";
 }
 
-sub defn ($$$;$) {
-    my ($text,$type,$name,$hparams) = @_;
+sub defn ($$$;$$) {
+    my ($text,$type,$name,$hparams,$deref) = @_;
     $hparams='' if !defined $hparams;
-    debug(2,"DEFN $. $type $name $hparams");
+    debug(2,"DEFN $. $type $name $hparams |$text|");
     $sdef{$type}{$name}{DefLocs}{"$leaf:$."} = $leaf_opath;
+    $sdef{$type}{$name}{Derefs}{"$leaf:$."} = $deref;
     my $xrefs = $sdef{$type}{$name}{Xrefs};
     push @pending_xrefs, values %$xrefs if $xrefs;
     $hparams .= " name=\"${type}_$name\"" if $sdef{$type}{$name}{Used};
@@ -140,7 +141,7 @@
 	} elsif (s/^(struct|union|enum)\s+(\w+)\b//) {
 	    $no .= ahref($&, (ucfirst $1), $2);
 	} elsif (s/^\w+\b//) {
-	    $no .= ahref($&, 'Func', $&);
+	    $no .= ahref($&, [qw(Func Typedef)], $&);
 	} else {
 	    die "$_ ?";
 	}
@@ -148,18 +149,42 @@
     return $no;
 }
 
+sub sdefval ($$$) {
+    my ($type,$name,$hkey) = @_;
+    $sdef{$type}{$name}{Used} = 1;
+    my $sdef = $sdef{$type}{$name};
+    my $hash = $sdef->{$hkey};
+    if ((scalar keys %$hash) > 1 && !$sdef->{MultiWarned}{$hkey}) {
+        warning("multiple definitions of $type $name: $_")
+            foreach keys %$hash;
+        $sdef->{MultiWarned}{$hkey}=1;
+    }
+    my ($val) = values %$hash;
+    return $val;
+}
+
 sub refhref ($$) {
-    my ($type,$name) = @_;
-    $sdef{$type}{$name}{Used} = 1;
-    my $locs = $sdef{$type}{$name}{DefLocs};
-    return '' unless $locs;
-    if ((scalar keys %$locs) != 1 && !$sdef{$type}{$name}{MultiWarned}) {
-	warning("multiple definitions of $type $name: $_")
-	    foreach keys %$locs;
-	$sdef{$type}{$name}{MultiWarned}=1;
+    my ($types,$name) = @_;
+    foreach my $type (ref($types) ? @$types : ($types)) {
+        my ($ttype,$tname) = ($type,$name);
+        my $loc = sdefval($ttype,$tname,'DefLocs');
+        for (;;) {
+            my $deref = sdefval($ttype,$tname,'Derefs');
+            last unless $deref;
+            my ($type2,$name2,$loc2);
+            my @deref = @$deref;
+            while (@deref) {
+                ($type2,$name2,@deref) = @deref;
+                $loc2 = sdefval($type2,$name2,'DefLocs');
+                last if defined $loc2;
+            }
+            last unless defined $loc2;
+            ($loc,$ttype,$tname) = ($loc2,$type2,$name2);
+        }
+        next unless defined $loc;
+        return "href=\"$loc#${ttype}_$tname\"";
     }
-    my ($loc) = values %$locs;
-    return "href=\"$loc#${type}_$name\"";
+    return '';
 }
 
 sub ahref ($$$) {
@@ -259,6 +284,14 @@
 		    in_enum($1,(ucfirst $2),$3);
 	        }
 	    }
+	} elsif (s/^(typedef \s+ )((struct|union|enum) \  (\w+))
+                      (\s+) (\w+)(\;)$
+                  / norm($1).norm($2).$5.
+                    defn($6,'Typedef',$6,undef,[(ucfirst $3),$4]).
+                    $7 /xe) {
+        } elsif (s/^(typedef \s+) (\w+) (\s+) (\w+) (\;)$
+                  / $1.norm($2).$3.
+                    defn($4,'Typedef',$4,undef,['Typedef',$2]). $5 /xe) {
 	} elsif (s/^( \s* \#define \s+ ) (\w+) ( \s+\S )
                   / $1.defmacro($2).norm($3) /xe) {
 	} elsif (s/( \`incontents \s+ (\d+) \s+ (\w+) \s+ )(\S .* \S)
@@ -315,6 +348,7 @@
     $forkind->('Func','Functions','','()');
     $forkind->('Struct','Structs','struct ','');
     $forkind->('Enum','Enums and sets of #defines','','');
+    $forkind->('Typedef','Typedefs','typedef ','');
     $forkind->('EnumVal','Enum values and individual #defines','','');
     $o .= "</ul>\n<h2>Files</h2><ul>\n";
     foreach my $of (sort { $a->[0] cmp $b->[0] } @outfiles) {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf6-0000rg-0U; Sat, 03 Mar 2012 04:33:40 +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 1S3gf4-0000RW-3M
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:38 +0000
Received: from [85.158.139.83:19213] by server-9.bemta-5.messagelabs.com id
	AD/AF-09826-12F915F4; Sat, 03 Mar 2012 04:33:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1330749215!17625947!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12651 invoked from network); 3 Mar 2012 04:33:36 -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;
	3 Mar 2012 04:33:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf0-0004j4-Lt
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf0-0003fs-KN
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:34 +0000
Message-Id: <E1S3gf0-0003fs-KN@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:34 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Merge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330620516 0
# Node ID 08392a9cde1e858644ecce6a4ee0dea0dd4a5968
# Parent  01d95561350bd249fa0fe67741b3eacea66ee153
# Parent  3ea51ace058283c2db577d85d05fd680e321f84d
Merge
---


diff -r 01d95561350b -r 08392a9cde1e .hgignore
--- a/.hgignore	Thu Mar 01 16:41:56 2012 +0000
+++ b/.hgignore	Thu Mar 01 16:48:36 2012 +0000
@@ -202,6 +202,7 @@
 ^tools/misc/xenperf$
 ^tools/misc/xenpm$
 ^tools/misc/xen-hvmctx$
+^tools/misc/xen-lowmemd$
 ^tools/misc/gtraceview$
 ^tools/misc/gtracestat$
 ^tools/misc/xenlockprof$
diff -r 01d95561350b -r 08392a9cde1e tools/libxc/xc_cpufeature.h
--- a/tools/libxc/xc_cpufeature.h	Thu Mar 01 16:41:56 2012 +0000
+++ b/tools/libxc/xc_cpufeature.h	Thu Mar 01 16:48:36 2012 +0000
@@ -129,10 +129,12 @@
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx) */
 #define X86_FEATURE_FSGSBASE     0 /* {RD,WR}{FS,GS}BASE instructions */
 #define X86_FEATURE_BMI1         3 /* 1st group bit manipulation extensions */
+#define X86_FEATURE_HLE          4 /* Hardware Lock Elision */
 #define X86_FEATURE_AVX2         5 /* AVX2 instructions */
 #define X86_FEATURE_SMEP         7 /* Supervisor Mode Execution Protection */
 #define X86_FEATURE_BMI2         8 /* 2nd group bit manipulation extensions */
 #define X86_FEATURE_ERMS         9 /* Enhanced REP MOVSB/STOSB */
 #define X86_FEATURE_INVPCID     10 /* Invalidate Process Context ID */
+#define X86_FEATURE_RTM         11 /* Restricted Transactional Memory */
 
 #endif /* __LIBXC_CPUFEATURE_H */
diff -r 01d95561350b -r 08392a9cde1e tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c	Thu Mar 01 16:41:56 2012 +0000
+++ b/tools/libxc/xc_cpuid_x86.c	Thu Mar 01 16:48:36 2012 +0000
@@ -363,11 +363,13 @@
     case 0x00000007: /* Intel-defined CPU features */
         if ( input[1] == 0 ) {
             regs[1] &= (bitmaskof(X86_FEATURE_BMI1) |
+                        bitmaskof(X86_FEATURE_HLE)  |
                         bitmaskof(X86_FEATURE_AVX2) |
                         bitmaskof(X86_FEATURE_SMEP) |
                         bitmaskof(X86_FEATURE_BMI2) |
                         bitmaskof(X86_FEATURE_ERMS) |
                         bitmaskof(X86_FEATURE_INVPCID) |
+                        bitmaskof(X86_FEATURE_RTM)  |
                         bitmaskof(X86_FEATURE_FSGSBASE));
         } else
             regs[1] = 0;
@@ -496,9 +498,11 @@
     case 0x00000007:
         if ( input[1] == 0 )
             regs[1] &= (bitmaskof(X86_FEATURE_BMI1) |
+                        bitmaskof(X86_FEATURE_HLE)  |
                         bitmaskof(X86_FEATURE_AVX2) |
                         bitmaskof(X86_FEATURE_BMI2) |
                         bitmaskof(X86_FEATURE_ERMS) |
+                        bitmaskof(X86_FEATURE_RTM)  |
                         bitmaskof(X86_FEATURE_FSGSBASE));
         else
             regs[1] = 0;
diff -r 01d95561350b -r 08392a9cde1e tools/misc/Makefile
--- a/tools/misc/Makefile	Thu Mar 01 16:41:56 2012 +0000
+++ b/tools/misc/Makefile	Thu Mar 01 16:48:36 2012 +0000
@@ -5,11 +5,12 @@
 
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_xeninclude)
+CFLAGS += $(CFLAGS_libxenstore)
 
 HDRS     = $(wildcard *.h)
 
 TARGETS-y := xenperf xenpm xen-tmem-list-parse gtraceview gtracestat xenlockprof xenwatchdogd
-TARGETS-$(CONFIG_X86) += xen-detect xen-hvmctx xen-hvmcrash
+TARGETS-$(CONFIG_X86) += xen-detect xen-hvmctx xen-hvmcrash xen-lowmemd
 TARGETS-$(CONFIG_MIGRATE) += xen-hptool
 TARGETS := $(TARGETS-y)
 
@@ -21,7 +22,7 @@
 INSTALL_BIN-$(CONFIG_X86) += xen-detect
 INSTALL_BIN := $(INSTALL_BIN-y)
 
-INSTALL_SBIN-y := xm xen-bugtool xen-python-path xend xenperf xsview xenpm xen-tmem-list-parse gtraceview gtracestat xenlockprof xenwatchdogd xen-ringwatch
+INSTALL_SBIN-y := xm xen-bugtool xen-python-path xend xenperf xsview xenpm xen-tmem-list-parse gtraceview gtracestat xenlockprof xenwatchdogd xen-ringwatch xen-lowmemd
 INSTALL_SBIN-$(CONFIG_X86) += xen-hvmctx xen-hvmcrash
 INSTALL_SBIN-$(CONFIG_MIGRATE) += xen-hptool
 INSTALL_SBIN := $(INSTALL_SBIN-y)
@@ -70,6 +71,9 @@
 xenwatchdogd: xenwatchdogd.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
+xen-lowmemd: xen-lowmemd.o
+	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(APPEND_LDFLAGS)
+
 gtraceview: gtraceview.o
 	$(CC) $(LDFLAGS) -o $@ $< $(CURSES_LIBS) $(APPEND_LDFLAGS)
 
diff -r 01d95561350b -r 08392a9cde1e tools/misc/xen-lowmemd.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/misc/xen-lowmemd.c	Thu Mar 01 16:48:36 2012 +0000
@@ -0,0 +1,148 @@
+/*
+ * xen-lowmemd: demo VIRQ_ENOMEM
+ * Andres Lagar-Cavilla (GridCentric Inc.)
+ */
+
+#include <stdio.h>
+#include <xenctrl.h>
+#include <xs.h>
+#include <stdlib.h>
+#include <string.h>
+
+static evtchn_port_t virq_port      = -1;
+static xc_evtchn *xce_handle        = NULL;
+static xc_interface *xch            = NULL;
+static struct xs_handle *xs_handle  = NULL;
+
+void cleanup(void)
+{
+    if (virq_port > -1)
+        xc_evtchn_unbind(xce_handle, virq_port);
+    if (xce_handle)
+        xc_evtchn_close(xce_handle);
+    if (xch)
+        xc_interface_close(xch);
+    if (xs_handle)
+        xs_daemon_close(xs_handle);
+}
+
+/* Never shrink dom0 below 1 GiB */
+#define DOM0_FLOOR  (1 << 30)
+#define DOM0_FLOOR_PG   ((DOM0_FLOOR) >> 12)
+
+/* Act if free memory is less than 92 MiB */
+#define THRESHOLD   (92 << 20)
+#define THRESHOLD_PG    ((THRESHOLD) >> 12)
+
+#define BUFSZ 512
+void handle_low_mem(void)
+{
+    xc_dominfo_t  dom0_info;
+    xc_physinfo_t info;
+    unsigned long long free_pages, dom0_pages, diff, dom0_target;
+    char data[BUFSZ], error[BUFSZ];
+
+    if (xc_physinfo(xch, &info) < 0)
+    {
+        perror("Getting physinfo failed");
+        return;
+    }
+
+    free_pages = (unsigned long long) info.free_pages;
+    printf("Available free pages: 0x%llx:%llux\n",
+            free_pages, free_pages);
+
+    /* Don't do anything if we have more than the threshold free */
+    if ( free_pages >= THRESHOLD_PG )
+        return;
+    diff = THRESHOLD_PG - free_pages; 
+
+    if (xc_domain_getinfo(xch, 0, 1, &dom0_info) < 1)
+    {
+        perror("Failed to get dom0 info");
+        return;
+    }
+
+    dom0_pages = (unsigned long long) dom0_info.nr_pages;
+    printf("Dom0 pages: 0x%llx:%llu\n", dom0_pages, dom0_pages);
+    dom0_target = dom0_pages - diff;
+    if (dom0_target <= DOM0_FLOOR_PG)
+        return;
+
+    printf("Shooting for dom0 target 0x%llx:%llu\n", 
+            dom0_target, dom0_target);
+
+    snprintf(data, BUFSZ, "%llu", dom0_target);
+    if (!xs_write(xs_handle, XBT_NULL, 
+            "/local/domain/0/memory/target", data, strlen(data)))
+    {
+        snprintf(error, BUFSZ,"Failed to write target %s to xenstore", data);
+        perror(error);
+    }
+}
+
+int main(int argc, char *argv[])
+{
+    int rc;
+
+    atexit(cleanup);
+
+	xch = xc_interface_open(NULL, NULL, 0);
+	if (xch == NULL)
+    {
+        perror("Failed to open xc interface");
+        return 1;
+    }
+
+	xce_handle = xc_evtchn_open(NULL, 0);
+	if (xce_handle == NULL)
+    {
+        perror("Failed to open evtchn device");
+        return 2;
+    }
+
+    xs_handle = xs_daemon_open();
+    if (xs_handle == NULL)
+    {
+        perror("Failed to open xenstore connection");
+        return 3;
+    }
+
+	if ((rc = xc_evtchn_bind_virq(xce_handle, VIRQ_ENOMEM)) == -1)
+    {
+        perror("Failed to bind to domain exception virq port");
+        return 4;
+    }
+
+    virq_port = rc;
+    
+    while(1)
+    {
+        evtchn_port_t port;
+
+        if ((port = xc_evtchn_pending(xce_handle)) == -1)
+        {
+            perror("Failed to listen for pending event channel");
+            return 5;
+        }
+
+        if (port != virq_port)
+        {
+            char data[BUFSZ];
+            snprintf(data, BUFSZ, "Wrong port, got %d expected %d", port, virq_port);
+            perror(data);
+            return 6;
+        }
+
+        if (xc_evtchn_unmask(xce_handle, port) == -1)
+        {
+            perror("Failed to unmask port");
+            return 7;
+        }
+
+        printf("Got a virq kick, time to get work\n");
+        handle_low_mem();
+    }
+
+    return 0;
+}
diff -r 01d95561350b -r 08392a9cde1e xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Thu Mar 01 16:41:56 2012 +0000
+++ b/xen/arch/x86/hvm/rtc.c	Thu Mar 01 16:48:36 2012 +0000
@@ -33,6 +33,8 @@
 #define vrtc_domain(x) (container_of((x), struct domain, \
                                      arch.hvm_domain.pl_time.vrtc))
 #define vrtc_vcpu(x)   (pt_global_vcpu_target(vrtc_domain(x)))
+#define epoch_year     1900
+#define get_year(x)    (x + epoch_year)
 
 static void rtc_periodic_cb(struct vcpu *v, void *opaque)
 {
@@ -165,7 +167,7 @@
       
     ASSERT(spin_is_locked(&s->lock));
 
-    before = mktime(tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
+    before = mktime(get_year(tm->tm_year), tm->tm_mon + 1, tm->tm_mday,
 		    tm->tm_hour, tm->tm_min, tm->tm_sec);
     
     tm->tm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
@@ -179,7 +181,7 @@
     tm->tm_mon = from_bcd(s, s->hw.cmos_data[RTC_MONTH]) - 1;
     tm->tm_year = from_bcd(s, s->hw.cmos_data[RTC_YEAR]) + 100;
 
-    after = mktime(tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
+    after = mktime(get_year(tm->tm_year), tm->tm_mon + 1, tm->tm_mday,
                    tm->tm_hour, tm->tm_min, tm->tm_sec);
 
     /* We use the guest's setting of the RTC to define the local-time 
@@ -257,7 +259,7 @@
                 if ( (unsigned)tm->tm_wday >= 7 )
                     tm->tm_wday = 0;
                 days_in_month = get_days_in_month(tm->tm_mon, 
-                                                  tm->tm_year + 1900);
+                                                  get_year(tm->tm_year));
                 tm->tm_mday++;
                 if ( tm->tm_mday < 1 )
                 {
diff -r 01d95561350b -r 08392a9cde1e xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Mar 01 16:41:56 2012 +0000
+++ b/xen/common/grant_table.c	Thu Mar 01 16:48:36 2012 +0000
@@ -585,6 +585,8 @@
             act->start = 0;
             act->length = PAGE_SIZE;
             act->is_sub_page = 0;
+            act->trans_domain = rd;
+            act->trans_gref = op->ref;
         }
     }
 
diff -r 01d95561350b -r 08392a9cde1e xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Thu Mar 01 16:41:56 2012 +0000
+++ b/xen/common/page_alloc.c	Thu Mar 01 16:48:36 2012 +0000
@@ -35,6 +35,7 @@
 #include <xen/perfc.h>
 #include <xen/numa.h>
 #include <xen/nodemask.h>
+#include <xen/event.h>
 #include <xen/tmem.h>
 #include <xen/tmem_xen.h>
 #include <public/sysctl.h>
@@ -300,6 +301,107 @@
     return needed;
 }
 
+/* Default to 64 MiB */
+#define DEFAULT_LOW_MEM_VIRQ    (((paddr_t) 64)   << 20)
+#define MAX_LOW_MEM_VIRQ        (((paddr_t) 1024) << 20)
+
+static paddr_t __read_mostly opt_low_mem_virq = ((paddr_t) -1);
+size_param("low_mem_virq_limit", opt_low_mem_virq);
+
+/* Thresholds to control hysteresis. In pages */
+/* When memory grows above this threshold, reset hysteresis.
+ * -1 initially to not reset until at least one virq issued. */
+static unsigned long low_mem_virq_high      = -1UL;
+/* Threshold at which we issue virq */
+static unsigned long low_mem_virq_th        = 0;
+/* Original threshold after all checks completed */
+static unsigned long low_mem_virq_orig      = 0;
+/* Order for current threshold */
+static unsigned int  low_mem_virq_th_order  = 0;
+
+/* Perform bootstrapping checks and set bounds */
+static void __init setup_low_mem_virq(void)
+{
+    unsigned int order;
+    paddr_t threshold;
+    bool_t halve;
+
+    /* If the user specifies zero, then he/she doesn't want this virq
+     * to ever trigger. */
+    if ( opt_low_mem_virq == 0 )
+    {
+        low_mem_virq_th = -1UL;
+        return;
+    }
+
+    /* If the user did not specify a knob, remember that */
+    halve = (opt_low_mem_virq == ((paddr_t) -1));
+    threshold = halve ? DEFAULT_LOW_MEM_VIRQ : opt_low_mem_virq;
+
+    /* Dom0 has already been allocated by now. So check we won't be
+     * complaining immediately with whatever's left of the heap. */
+    threshold = min(threshold,
+                    ((paddr_t) total_avail_pages) << PAGE_SHIFT);
+
+    /* Then, cap to some predefined maximum */
+    threshold = min(threshold, MAX_LOW_MEM_VIRQ);
+
+    /* If the user specified no knob, and we are at the current available
+     * level, halve the threshold. */
+    if ( halve &&
+         (threshold == (((paddr_t) total_avail_pages) << PAGE_SHIFT)) )
+        threshold >>= 1;
+
+    /* Zero? Have to fire immediately */
+    threshold = max(threshold, (paddr_t) PAGE_SIZE);
+
+    /* Threshold bytes -> pages */
+    low_mem_virq_th = threshold >> PAGE_SHIFT;
+
+    /* Next, round the threshold down to the next order */
+    order = get_order_from_pages(low_mem_virq_th);
+    if ( (1UL << order) > low_mem_virq_th )
+        order--;
+
+    /* Set bounds, ready to go */
+    low_mem_virq_th = low_mem_virq_orig = 1UL << order;
+    low_mem_virq_th_order = order;
+
+    printk("Initial low memory virq threshold set at 0x%lx pages.\n",
+            low_mem_virq_th);
+}
+
+static void check_low_mem_virq(void)
+{
+    if ( unlikely(total_avail_pages <= low_mem_virq_th) )
+    {
+        send_global_virq(VIRQ_ENOMEM);
+
+        /* Update thresholds. Next warning will be when we drop below
+         * next order. However, we wait until we grow beyond one
+         * order above us to complain again at the current order */
+        low_mem_virq_high   = 1UL << (low_mem_virq_th_order + 1);
+        if ( low_mem_virq_th_order > 0 )
+            low_mem_virq_th_order--;
+        low_mem_virq_th     = 1UL << low_mem_virq_th_order;
+        return;
+    }
+
+    if ( unlikely(total_avail_pages >= low_mem_virq_high) )
+    {
+        /* Reset hysteresis. Bring threshold up one order.
+         * If we are back where originally set, set high
+         * threshold to -1 to avoid further growth of
+         * virq threshold. */
+        low_mem_virq_th_order++;
+        low_mem_virq_th = 1UL << low_mem_virq_th_order;
+        if ( low_mem_virq_th == low_mem_virq_orig )
+            low_mem_virq_high = -1UL;
+        else
+            low_mem_virq_high = 1UL << (low_mem_virq_th_order + 2);
+    }
+}
+
 /* Allocate 2^@order contiguous pages. */
 static struct page_info *alloc_heap_pages(
     unsigned int zone_lo, unsigned int zone_hi,
@@ -420,6 +522,8 @@
     total_avail_pages -= request;
     ASSERT(total_avail_pages >= 0);
 
+    check_low_mem_virq();
+
     if ( d != NULL )
         d->last_alloc_node = node;
 
@@ -1022,6 +1126,10 @@
     }
 
     printk("done.\n");
+
+    /* Now that the heap is initialized, run checks and set bounds
+     * for the low mem virq algorithm. */
+    setup_low_mem_virq();
 }
 
 
diff -r 01d95561350b -r 08392a9cde1e xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Mar 01 16:41:56 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Mar 01 16:48:36 2012 +0000
@@ -367,6 +367,8 @@
     u32 tail, head, *entry, tail_offest, head_offset;
 
     BUG_ON(!iommu || ((log != &iommu->event_log) && (log != &iommu->ppr_log)));
+    
+    spin_lock(&log->lock);
 
     /* make sure there's an entry in the log */
     tail_offest = ( log == &iommu->event_log ) ?
@@ -396,6 +398,8 @@
         writel(head, iommu->mmio_base + head_offset);
     }
 
+    spin_unlock(&log->lock);
+   
     return 0;
 }
 
@@ -618,11 +622,11 @@
     u32 entry;
     unsigned long flags;
 
-    spin_lock_irqsave(&iommu->lock, flags);
-
     iommu_read_log(iommu, &iommu->event_log,
                    sizeof(event_entry_t), parse_event_log_entry);
 
+    spin_lock_irqsave(&iommu->lock, flags);
+    
     /*check event overflow */
     entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
 
@@ -651,14 +655,10 @@
     bus = PCI_BUS(device_id);
     devfn = PCI_DEVFN2(device_id);
 
-    local_irq_enable();
-
     spin_lock(&pcidevs_lock);
     pdev = pci_get_pdev(iommu->seg, bus, devfn);
     spin_unlock(&pcidevs_lock);
 
-    local_irq_disable();
-
     if ( pdev == NULL )
         return;
 
@@ -672,10 +672,10 @@
     u32 entry;
     unsigned long flags;
 
-    spin_lock_irqsave(&iommu->lock, flags);
-
     iommu_read_log(iommu, &iommu->ppr_log,
                    sizeof(ppr_entry_t), parse_ppr_log_entry);
+    
+    spin_lock_irqsave(&iommu->lock, flags);
 
     /*check event overflow */
     entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
@@ -852,6 +852,8 @@
     ring_buf->head = 0;
     ring_buf->tail = 0;
 
+    spin_lock_init(&ring_buf->lock);
+    
     ring_buf->alloc_size = PAGE_SIZE << get_order_from_bytes(entries *
                                                              entry_size);
     ring_buf->entries = ring_buf->alloc_size / entry_size;
diff -r 01d95561350b -r 08392a9cde1e xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Thu Mar 01 16:41:56 2012 +0000
+++ b/xen/include/asm-x86/amd-iommu.h	Thu Mar 01 16:48:36 2012 +0000
@@ -65,6 +65,7 @@
     unsigned long alloc_size;
     uint32_t tail;
     uint32_t head;
+    spinlock_t lock;    /* protect buffer pointers */
 };
 
 typedef struct iommu_cap {
diff -r 01d95561350b -r 08392a9cde1e xen/include/public/xen.h
--- a/xen/include/public/xen.h	Thu Mar 01 16:41:56 2012 +0000
+++ b/xen/include/public/xen.h	Thu Mar 01 16:48:36 2012 +0000
@@ -158,6 +158,7 @@
 #define VIRQ_PCPU_STATE 9  /* G. (DOM0) PCPU state changed                   */
 #define VIRQ_MEM_EVENT  10 /* G. (DOM0) A memory event has occured           */
 #define VIRQ_XC_RESERVED 11 /* G. Reserved for XenClient                     */
+#define VIRQ_ENOMEM     12 /* G. (DOM0) Low on heap memory       */
 
 /* Architecture-specific VIRQ definitions. */
 #define VIRQ_ARCH_0    16

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:40 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:40 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf6-0000rg-0U; Sat, 03 Mar 2012 04:33:40 +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 1S3gf4-0000RW-3M
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:38 +0000
Received: from [85.158.139.83:19213] by server-9.bemta-5.messagelabs.com id
	AD/AF-09826-12F915F4; Sat, 03 Mar 2012 04:33:37 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1330749215!17625947!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12651 invoked from network); 3 Mar 2012 04:33:36 -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;
	3 Mar 2012 04:33:36 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf0-0004j4-Lt
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf0-0003fs-KN
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:34 +0000
Message-Id: <E1S3gf0-0003fs-KN@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:34 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Merge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330620516 0
# Node ID 08392a9cde1e858644ecce6a4ee0dea0dd4a5968
# Parent  01d95561350bd249fa0fe67741b3eacea66ee153
# Parent  3ea51ace058283c2db577d85d05fd680e321f84d
Merge
---


diff -r 01d95561350b -r 08392a9cde1e .hgignore
--- a/.hgignore	Thu Mar 01 16:41:56 2012 +0000
+++ b/.hgignore	Thu Mar 01 16:48:36 2012 +0000
@@ -202,6 +202,7 @@
 ^tools/misc/xenperf$
 ^tools/misc/xenpm$
 ^tools/misc/xen-hvmctx$
+^tools/misc/xen-lowmemd$
 ^tools/misc/gtraceview$
 ^tools/misc/gtracestat$
 ^tools/misc/xenlockprof$
diff -r 01d95561350b -r 08392a9cde1e tools/libxc/xc_cpufeature.h
--- a/tools/libxc/xc_cpufeature.h	Thu Mar 01 16:41:56 2012 +0000
+++ b/tools/libxc/xc_cpufeature.h	Thu Mar 01 16:48:36 2012 +0000
@@ -129,10 +129,12 @@
 /* Intel-defined CPU features, CPUID level 0x00000007:0 (ebx) */
 #define X86_FEATURE_FSGSBASE     0 /* {RD,WR}{FS,GS}BASE instructions */
 #define X86_FEATURE_BMI1         3 /* 1st group bit manipulation extensions */
+#define X86_FEATURE_HLE          4 /* Hardware Lock Elision */
 #define X86_FEATURE_AVX2         5 /* AVX2 instructions */
 #define X86_FEATURE_SMEP         7 /* Supervisor Mode Execution Protection */
 #define X86_FEATURE_BMI2         8 /* 2nd group bit manipulation extensions */
 #define X86_FEATURE_ERMS         9 /* Enhanced REP MOVSB/STOSB */
 #define X86_FEATURE_INVPCID     10 /* Invalidate Process Context ID */
+#define X86_FEATURE_RTM         11 /* Restricted Transactional Memory */
 
 #endif /* __LIBXC_CPUFEATURE_H */
diff -r 01d95561350b -r 08392a9cde1e tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c	Thu Mar 01 16:41:56 2012 +0000
+++ b/tools/libxc/xc_cpuid_x86.c	Thu Mar 01 16:48:36 2012 +0000
@@ -363,11 +363,13 @@
     case 0x00000007: /* Intel-defined CPU features */
         if ( input[1] == 0 ) {
             regs[1] &= (bitmaskof(X86_FEATURE_BMI1) |
+                        bitmaskof(X86_FEATURE_HLE)  |
                         bitmaskof(X86_FEATURE_AVX2) |
                         bitmaskof(X86_FEATURE_SMEP) |
                         bitmaskof(X86_FEATURE_BMI2) |
                         bitmaskof(X86_FEATURE_ERMS) |
                         bitmaskof(X86_FEATURE_INVPCID) |
+                        bitmaskof(X86_FEATURE_RTM)  |
                         bitmaskof(X86_FEATURE_FSGSBASE));
         } else
             regs[1] = 0;
@@ -496,9 +498,11 @@
     case 0x00000007:
         if ( input[1] == 0 )
             regs[1] &= (bitmaskof(X86_FEATURE_BMI1) |
+                        bitmaskof(X86_FEATURE_HLE)  |
                         bitmaskof(X86_FEATURE_AVX2) |
                         bitmaskof(X86_FEATURE_BMI2) |
                         bitmaskof(X86_FEATURE_ERMS) |
+                        bitmaskof(X86_FEATURE_RTM)  |
                         bitmaskof(X86_FEATURE_FSGSBASE));
         else
             regs[1] = 0;
diff -r 01d95561350b -r 08392a9cde1e tools/misc/Makefile
--- a/tools/misc/Makefile	Thu Mar 01 16:41:56 2012 +0000
+++ b/tools/misc/Makefile	Thu Mar 01 16:48:36 2012 +0000
@@ -5,11 +5,12 @@
 
 CFLAGS += $(CFLAGS_libxenctrl)
 CFLAGS += $(CFLAGS_xeninclude)
+CFLAGS += $(CFLAGS_libxenstore)
 
 HDRS     = $(wildcard *.h)
 
 TARGETS-y := xenperf xenpm xen-tmem-list-parse gtraceview gtracestat xenlockprof xenwatchdogd
-TARGETS-$(CONFIG_X86) += xen-detect xen-hvmctx xen-hvmcrash
+TARGETS-$(CONFIG_X86) += xen-detect xen-hvmctx xen-hvmcrash xen-lowmemd
 TARGETS-$(CONFIG_MIGRATE) += xen-hptool
 TARGETS := $(TARGETS-y)
 
@@ -21,7 +22,7 @@
 INSTALL_BIN-$(CONFIG_X86) += xen-detect
 INSTALL_BIN := $(INSTALL_BIN-y)
 
-INSTALL_SBIN-y := xm xen-bugtool xen-python-path xend xenperf xsview xenpm xen-tmem-list-parse gtraceview gtracestat xenlockprof xenwatchdogd xen-ringwatch
+INSTALL_SBIN-y := xm xen-bugtool xen-python-path xend xenperf xsview xenpm xen-tmem-list-parse gtraceview gtracestat xenlockprof xenwatchdogd xen-ringwatch xen-lowmemd
 INSTALL_SBIN-$(CONFIG_X86) += xen-hvmctx xen-hvmcrash
 INSTALL_SBIN-$(CONFIG_MIGRATE) += xen-hptool
 INSTALL_SBIN := $(INSTALL_SBIN-y)
@@ -70,6 +71,9 @@
 xenwatchdogd: xenwatchdogd.o
 	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS)
 
+xen-lowmemd: xen-lowmemd.o
+	$(CC) $(LDFLAGS) -o $@ $< $(LDLIBS_libxenctrl) $(LDLIBS_libxenstore) $(APPEND_LDFLAGS)
+
 gtraceview: gtraceview.o
 	$(CC) $(LDFLAGS) -o $@ $< $(CURSES_LIBS) $(APPEND_LDFLAGS)
 
diff -r 01d95561350b -r 08392a9cde1e tools/misc/xen-lowmemd.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/misc/xen-lowmemd.c	Thu Mar 01 16:48:36 2012 +0000
@@ -0,0 +1,148 @@
+/*
+ * xen-lowmemd: demo VIRQ_ENOMEM
+ * Andres Lagar-Cavilla (GridCentric Inc.)
+ */
+
+#include <stdio.h>
+#include <xenctrl.h>
+#include <xs.h>
+#include <stdlib.h>
+#include <string.h>
+
+static evtchn_port_t virq_port      = -1;
+static xc_evtchn *xce_handle        = NULL;
+static xc_interface *xch            = NULL;
+static struct xs_handle *xs_handle  = NULL;
+
+void cleanup(void)
+{
+    if (virq_port > -1)
+        xc_evtchn_unbind(xce_handle, virq_port);
+    if (xce_handle)
+        xc_evtchn_close(xce_handle);
+    if (xch)
+        xc_interface_close(xch);
+    if (xs_handle)
+        xs_daemon_close(xs_handle);
+}
+
+/* Never shrink dom0 below 1 GiB */
+#define DOM0_FLOOR  (1 << 30)
+#define DOM0_FLOOR_PG   ((DOM0_FLOOR) >> 12)
+
+/* Act if free memory is less than 92 MiB */
+#define THRESHOLD   (92 << 20)
+#define THRESHOLD_PG    ((THRESHOLD) >> 12)
+
+#define BUFSZ 512
+void handle_low_mem(void)
+{
+    xc_dominfo_t  dom0_info;
+    xc_physinfo_t info;
+    unsigned long long free_pages, dom0_pages, diff, dom0_target;
+    char data[BUFSZ], error[BUFSZ];
+
+    if (xc_physinfo(xch, &info) < 0)
+    {
+        perror("Getting physinfo failed");
+        return;
+    }
+
+    free_pages = (unsigned long long) info.free_pages;
+    printf("Available free pages: 0x%llx:%llux\n",
+            free_pages, free_pages);
+
+    /* Don't do anything if we have more than the threshold free */
+    if ( free_pages >= THRESHOLD_PG )
+        return;
+    diff = THRESHOLD_PG - free_pages; 
+
+    if (xc_domain_getinfo(xch, 0, 1, &dom0_info) < 1)
+    {
+        perror("Failed to get dom0 info");
+        return;
+    }
+
+    dom0_pages = (unsigned long long) dom0_info.nr_pages;
+    printf("Dom0 pages: 0x%llx:%llu\n", dom0_pages, dom0_pages);
+    dom0_target = dom0_pages - diff;
+    if (dom0_target <= DOM0_FLOOR_PG)
+        return;
+
+    printf("Shooting for dom0 target 0x%llx:%llu\n", 
+            dom0_target, dom0_target);
+
+    snprintf(data, BUFSZ, "%llu", dom0_target);
+    if (!xs_write(xs_handle, XBT_NULL, 
+            "/local/domain/0/memory/target", data, strlen(data)))
+    {
+        snprintf(error, BUFSZ,"Failed to write target %s to xenstore", data);
+        perror(error);
+    }
+}
+
+int main(int argc, char *argv[])
+{
+    int rc;
+
+    atexit(cleanup);
+
+	xch = xc_interface_open(NULL, NULL, 0);
+	if (xch == NULL)
+    {
+        perror("Failed to open xc interface");
+        return 1;
+    }
+
+	xce_handle = xc_evtchn_open(NULL, 0);
+	if (xce_handle == NULL)
+    {
+        perror("Failed to open evtchn device");
+        return 2;
+    }
+
+    xs_handle = xs_daemon_open();
+    if (xs_handle == NULL)
+    {
+        perror("Failed to open xenstore connection");
+        return 3;
+    }
+
+	if ((rc = xc_evtchn_bind_virq(xce_handle, VIRQ_ENOMEM)) == -1)
+    {
+        perror("Failed to bind to domain exception virq port");
+        return 4;
+    }
+
+    virq_port = rc;
+    
+    while(1)
+    {
+        evtchn_port_t port;
+
+        if ((port = xc_evtchn_pending(xce_handle)) == -1)
+        {
+            perror("Failed to listen for pending event channel");
+            return 5;
+        }
+
+        if (port != virq_port)
+        {
+            char data[BUFSZ];
+            snprintf(data, BUFSZ, "Wrong port, got %d expected %d", port, virq_port);
+            perror(data);
+            return 6;
+        }
+
+        if (xc_evtchn_unmask(xce_handle, port) == -1)
+        {
+            perror("Failed to unmask port");
+            return 7;
+        }
+
+        printf("Got a virq kick, time to get work\n");
+        handle_low_mem();
+    }
+
+    return 0;
+}
diff -r 01d95561350b -r 08392a9cde1e xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Thu Mar 01 16:41:56 2012 +0000
+++ b/xen/arch/x86/hvm/rtc.c	Thu Mar 01 16:48:36 2012 +0000
@@ -33,6 +33,8 @@
 #define vrtc_domain(x) (container_of((x), struct domain, \
                                      arch.hvm_domain.pl_time.vrtc))
 #define vrtc_vcpu(x)   (pt_global_vcpu_target(vrtc_domain(x)))
+#define epoch_year     1900
+#define get_year(x)    (x + epoch_year)
 
 static void rtc_periodic_cb(struct vcpu *v, void *opaque)
 {
@@ -165,7 +167,7 @@
       
     ASSERT(spin_is_locked(&s->lock));
 
-    before = mktime(tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
+    before = mktime(get_year(tm->tm_year), tm->tm_mon + 1, tm->tm_mday,
 		    tm->tm_hour, tm->tm_min, tm->tm_sec);
     
     tm->tm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
@@ -179,7 +181,7 @@
     tm->tm_mon = from_bcd(s, s->hw.cmos_data[RTC_MONTH]) - 1;
     tm->tm_year = from_bcd(s, s->hw.cmos_data[RTC_YEAR]) + 100;
 
-    after = mktime(tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
+    after = mktime(get_year(tm->tm_year), tm->tm_mon + 1, tm->tm_mday,
                    tm->tm_hour, tm->tm_min, tm->tm_sec);
 
     /* We use the guest's setting of the RTC to define the local-time 
@@ -257,7 +259,7 @@
                 if ( (unsigned)tm->tm_wday >= 7 )
                     tm->tm_wday = 0;
                 days_in_month = get_days_in_month(tm->tm_mon, 
-                                                  tm->tm_year + 1900);
+                                                  get_year(tm->tm_year));
                 tm->tm_mday++;
                 if ( tm->tm_mday < 1 )
                 {
diff -r 01d95561350b -r 08392a9cde1e xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Mar 01 16:41:56 2012 +0000
+++ b/xen/common/grant_table.c	Thu Mar 01 16:48:36 2012 +0000
@@ -585,6 +585,8 @@
             act->start = 0;
             act->length = PAGE_SIZE;
             act->is_sub_page = 0;
+            act->trans_domain = rd;
+            act->trans_gref = op->ref;
         }
     }
 
diff -r 01d95561350b -r 08392a9cde1e xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Thu Mar 01 16:41:56 2012 +0000
+++ b/xen/common/page_alloc.c	Thu Mar 01 16:48:36 2012 +0000
@@ -35,6 +35,7 @@
 #include <xen/perfc.h>
 #include <xen/numa.h>
 #include <xen/nodemask.h>
+#include <xen/event.h>
 #include <xen/tmem.h>
 #include <xen/tmem_xen.h>
 #include <public/sysctl.h>
@@ -300,6 +301,107 @@
     return needed;
 }
 
+/* Default to 64 MiB */
+#define DEFAULT_LOW_MEM_VIRQ    (((paddr_t) 64)   << 20)
+#define MAX_LOW_MEM_VIRQ        (((paddr_t) 1024) << 20)
+
+static paddr_t __read_mostly opt_low_mem_virq = ((paddr_t) -1);
+size_param("low_mem_virq_limit", opt_low_mem_virq);
+
+/* Thresholds to control hysteresis. In pages */
+/* When memory grows above this threshold, reset hysteresis.
+ * -1 initially to not reset until at least one virq issued. */
+static unsigned long low_mem_virq_high      = -1UL;
+/* Threshold at which we issue virq */
+static unsigned long low_mem_virq_th        = 0;
+/* Original threshold after all checks completed */
+static unsigned long low_mem_virq_orig      = 0;
+/* Order for current threshold */
+static unsigned int  low_mem_virq_th_order  = 0;
+
+/* Perform bootstrapping checks and set bounds */
+static void __init setup_low_mem_virq(void)
+{
+    unsigned int order;
+    paddr_t threshold;
+    bool_t halve;
+
+    /* If the user specifies zero, then he/she doesn't want this virq
+     * to ever trigger. */
+    if ( opt_low_mem_virq == 0 )
+    {
+        low_mem_virq_th = -1UL;
+        return;
+    }
+
+    /* If the user did not specify a knob, remember that */
+    halve = (opt_low_mem_virq == ((paddr_t) -1));
+    threshold = halve ? DEFAULT_LOW_MEM_VIRQ : opt_low_mem_virq;
+
+    /* Dom0 has already been allocated by now. So check we won't be
+     * complaining immediately with whatever's left of the heap. */
+    threshold = min(threshold,
+                    ((paddr_t) total_avail_pages) << PAGE_SHIFT);
+
+    /* Then, cap to some predefined maximum */
+    threshold = min(threshold, MAX_LOW_MEM_VIRQ);
+
+    /* If the user specified no knob, and we are at the current available
+     * level, halve the threshold. */
+    if ( halve &&
+         (threshold == (((paddr_t) total_avail_pages) << PAGE_SHIFT)) )
+        threshold >>= 1;
+
+    /* Zero? Have to fire immediately */
+    threshold = max(threshold, (paddr_t) PAGE_SIZE);
+
+    /* Threshold bytes -> pages */
+    low_mem_virq_th = threshold >> PAGE_SHIFT;
+
+    /* Next, round the threshold down to the next order */
+    order = get_order_from_pages(low_mem_virq_th);
+    if ( (1UL << order) > low_mem_virq_th )
+        order--;
+
+    /* Set bounds, ready to go */
+    low_mem_virq_th = low_mem_virq_orig = 1UL << order;
+    low_mem_virq_th_order = order;
+
+    printk("Initial low memory virq threshold set at 0x%lx pages.\n",
+            low_mem_virq_th);
+}
+
+static void check_low_mem_virq(void)
+{
+    if ( unlikely(total_avail_pages <= low_mem_virq_th) )
+    {
+        send_global_virq(VIRQ_ENOMEM);
+
+        /* Update thresholds. Next warning will be when we drop below
+         * next order. However, we wait until we grow beyond one
+         * order above us to complain again at the current order */
+        low_mem_virq_high   = 1UL << (low_mem_virq_th_order + 1);
+        if ( low_mem_virq_th_order > 0 )
+            low_mem_virq_th_order--;
+        low_mem_virq_th     = 1UL << low_mem_virq_th_order;
+        return;
+    }
+
+    if ( unlikely(total_avail_pages >= low_mem_virq_high) )
+    {
+        /* Reset hysteresis. Bring threshold up one order.
+         * If we are back where originally set, set high
+         * threshold to -1 to avoid further growth of
+         * virq threshold. */
+        low_mem_virq_th_order++;
+        low_mem_virq_th = 1UL << low_mem_virq_th_order;
+        if ( low_mem_virq_th == low_mem_virq_orig )
+            low_mem_virq_high = -1UL;
+        else
+            low_mem_virq_high = 1UL << (low_mem_virq_th_order + 2);
+    }
+}
+
 /* Allocate 2^@order contiguous pages. */
 static struct page_info *alloc_heap_pages(
     unsigned int zone_lo, unsigned int zone_hi,
@@ -420,6 +522,8 @@
     total_avail_pages -= request;
     ASSERT(total_avail_pages >= 0);
 
+    check_low_mem_virq();
+
     if ( d != NULL )
         d->last_alloc_node = node;
 
@@ -1022,6 +1126,10 @@
     }
 
     printk("done.\n");
+
+    /* Now that the heap is initialized, run checks and set bounds
+     * for the low mem virq algorithm. */
+    setup_low_mem_virq();
 }
 
 
diff -r 01d95561350b -r 08392a9cde1e xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Mar 01 16:41:56 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Mar 01 16:48:36 2012 +0000
@@ -367,6 +367,8 @@
     u32 tail, head, *entry, tail_offest, head_offset;
 
     BUG_ON(!iommu || ((log != &iommu->event_log) && (log != &iommu->ppr_log)));
+    
+    spin_lock(&log->lock);
 
     /* make sure there's an entry in the log */
     tail_offest = ( log == &iommu->event_log ) ?
@@ -396,6 +398,8 @@
         writel(head, iommu->mmio_base + head_offset);
     }
 
+    spin_unlock(&log->lock);
+   
     return 0;
 }
 
@@ -618,11 +622,11 @@
     u32 entry;
     unsigned long flags;
 
-    spin_lock_irqsave(&iommu->lock, flags);
-
     iommu_read_log(iommu, &iommu->event_log,
                    sizeof(event_entry_t), parse_event_log_entry);
 
+    spin_lock_irqsave(&iommu->lock, flags);
+    
     /*check event overflow */
     entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
 
@@ -651,14 +655,10 @@
     bus = PCI_BUS(device_id);
     devfn = PCI_DEVFN2(device_id);
 
-    local_irq_enable();
-
     spin_lock(&pcidevs_lock);
     pdev = pci_get_pdev(iommu->seg, bus, devfn);
     spin_unlock(&pcidevs_lock);
 
-    local_irq_disable();
-
     if ( pdev == NULL )
         return;
 
@@ -672,10 +672,10 @@
     u32 entry;
     unsigned long flags;
 
-    spin_lock_irqsave(&iommu->lock, flags);
-
     iommu_read_log(iommu, &iommu->ppr_log,
                    sizeof(ppr_entry_t), parse_ppr_log_entry);
+    
+    spin_lock_irqsave(&iommu->lock, flags);
 
     /*check event overflow */
     entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
@@ -852,6 +852,8 @@
     ring_buf->head = 0;
     ring_buf->tail = 0;
 
+    spin_lock_init(&ring_buf->lock);
+    
     ring_buf->alloc_size = PAGE_SIZE << get_order_from_bytes(entries *
                                                              entry_size);
     ring_buf->entries = ring_buf->alloc_size / entry_size;
diff -r 01d95561350b -r 08392a9cde1e xen/include/asm-x86/amd-iommu.h
--- a/xen/include/asm-x86/amd-iommu.h	Thu Mar 01 16:41:56 2012 +0000
+++ b/xen/include/asm-x86/amd-iommu.h	Thu Mar 01 16:48:36 2012 +0000
@@ -65,6 +65,7 @@
     unsigned long alloc_size;
     uint32_t tail;
     uint32_t head;
+    spinlock_t lock;    /* protect buffer pointers */
 };
 
 typedef struct iommu_cap {
diff -r 01d95561350b -r 08392a9cde1e xen/include/public/xen.h
--- a/xen/include/public/xen.h	Thu Mar 01 16:41:56 2012 +0000
+++ b/xen/include/public/xen.h	Thu Mar 01 16:48:36 2012 +0000
@@ -158,6 +158,7 @@
 #define VIRQ_PCPU_STATE 9  /* G. (DOM0) PCPU state changed                   */
 #define VIRQ_MEM_EVENT  10 /* G. (DOM0) A memory event has occured           */
 #define VIRQ_XC_RESERVED 11 /* G. Reserved for XenClient                     */
+#define VIRQ_ENOMEM     12 /* G. (DOM0) Low on heap memory       */
 
 /* Architecture-specific VIRQ definitions. */
 #define VIRQ_ARCH_0    16

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf8-0000vK-5O; Sat, 03 Mar 2012 04:33:42 +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 1S3gf6-0000re-Jz
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:40 +0000
Received: from [85.158.139.83:19264] by server-3.bemta-5.messagelabs.com id
	5D/12-25237-32F915F4; Sat, 03 Mar 2012 04:33:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1330749217!16808810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12678 invoked from network); 3 Mar 2012 04:33:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf1-0004jD-P7
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf1-0003gv-Mz
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:35 +0000
Message-Id: <E1S3gf1-0003gv-Mz@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: xen-headers: Remove hard tabs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330620699 0
# Node ID cf744a33ae9aae45f77130d612ea6671dcfde680
# Parent  bad55a5879d5f5bfb8507f8d9080d5e984f935a3
docs: xen-headers: Remove hard tabs

Remove hard tabs from the Perl script.

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


diff -r bad55a5879d5 -r cf744a33ae9a docs/xen-headers
--- a/docs/xen-headers	Thu Mar 01 16:51:39 2012 +0000
+++ b/docs/xen-headers	Thu Mar 01 16:51:39 2012 +0000
@@ -86,13 +86,13 @@
     local ($_);
     my $f = "sub file_wanted (\$) {\n    local (\$_) = \"/\$leaf\";\n";
     foreach my $fglob (@fglobs) {
-	$_ = $fglob->[0];
-	$_ = "**$_**" unless m/[?*]/;
-	s/\W/\\$&/g;
-	s,\\\*\\\*,.*,g;
-	s,\\\*,[^/]*,g;
-	s,\\\?,[^/],g;
-	$f .= "    return $fglob->[1] if m,$_,o;\n";
+        $_ = $fglob->[0];
+        $_ = "**$_**" unless m/[?*]/;
+        s/\W/\\$&/g;
+        s,\\\*\\\*,.*,g;
+        s,\\\*,[^/]*,g;
+        s,\\\?,[^/],g;
+        $f .= "    return $fglob->[1] if m,$_,o;\n";
     }
     $f .= "    return 1;\n}\n1;\n";
     debug(3, $f);
@@ -136,15 +136,15 @@
     local ($_) = @_;
     my $no = '';
     while (length) {
-	if (s/^(?:\s|^\W)+//) {
-	    $no .= $&;
-	} elsif (s/^(struct|union|enum)\s+(\w+)\b//) {
-	    $no .= ahref($&, (ucfirst $1), $2);
-	} elsif (s/^\w+\b//) {
-	    $no .= ahref($&, [qw(Func Typedef)], $&);
-	} else {
-	    die "$_ ?";
-	}
+        if (s/^(?:\s|^\W)+//) {
+            $no .= $&;
+        } elsif (s/^(struct|union|enum)\s+(\w+)\b//) {
+            $no .= ahref($&, (ucfirst $1), $2);
+        } elsif (s/^\w+\b//) {
+            $no .= ahref($&, [qw(Func Typedef)], $&);
+        } else {
+            die "$_ ?";
+        }
     }
     return $no;
 }
@@ -195,25 +195,25 @@
 sub defmacro ($) {
     my ($valname) = @_;
     if (!$in_enum) {
-	return $valname;
+        return $valname;
     } elsif (substr($valname, 0, (length $in_enum->[0])) ne $in_enum->[0]) {
-	warning("in enum expecting $in_enum->[0]* got $valname");
-	return $valname;
+        warning("in enum expecting $in_enum->[0]* got $valname");
+        return $valname;
     } else {
-	my $reftype = $in_enum->[1];
-	my $refname = $in_enum->[2].substr($valname, (length $in_enum->[0]));
-	$sdef{$reftype}{$refname}{Xrefs}{$leaf,$.} =
-	    "[see <a href=\"$leaf_opath#EnumVal_$valname\">$valname</a>]";
-	$sdef{EnumVal}{$valname}{Used} = 1;
-	return defn($valname,'EnumVal',$valname, refhref($reftype,$refname));
+        my $reftype = $in_enum->[1];
+        my $refname = $in_enum->[2].substr($valname, (length $in_enum->[0]));
+        $sdef{$reftype}{$refname}{Xrefs}{$leaf,$.} =
+            "[see <a href=\"$leaf_opath#EnumVal_$valname\">$valname</a>]";
+        $sdef{EnumVal}{$valname}{Used} = 1;
+        return defn($valname,'EnumVal',$valname, refhref($reftype,$refname));
     }
 }
 
 sub out_xrefs ($) {
     my ($linemapfunc) = @_;
     foreach my $xref (@pending_xrefs) {
-	$o .= $linemapfunc->($xref);
-	$o .= "\n";
+        $o .= $linemapfunc->($xref);
+        $o .= "\n";
     }
     @pending_xrefs = ();
 }
@@ -222,11 +222,11 @@
     my ($text, $seq, $anchor) = @_;
     $anchor = "incontents_$anchor";
     if ($pass==2) {
-	push @incontents, { 
-	    Seq => $seq,
-	    Href => "$leaf_opath#$anchor",
-	    Title => $text,
-	};
+        push @incontents, { 
+            Seq => $seq,
+            Href => "$leaf_opath#$anchor",
+            Title => $text,
+        };
     }
     return "<a name=\"$anchor\"><strong>$text</strong></a>";
 }
@@ -250,41 +250,41 @@
     $o .= "<html><head><title>$leaf - $xtitle</title></head><body><pre>\n";
     
     while (<$in>) {
-	s/\&/\&amp;/g;
-	s/\</\&lt;/g;
-	s/\>/\&gt;/g;
+        s/\&/\&amp;/g;
+        s/\</\&lt;/g;
+        s/\>/\&gt;/g;
 
-	if (m/^(.*\`)[ \t]*$/) {
-	    my $lhs = $1;
-	    out_xrefs(sub { "$1 $_[0]"; });
-	} elsif (m/^\s*$/) {
-	    out_xrefs(sub { sprintf "/* %70s */", $_[0]; });
-	}
+        if (m/^(.*\`)[ \t]*$/) {
+            my $lhs = $1;
+            out_xrefs(sub { "$1 $_[0]"; });
+        } elsif (m/^\s*$/) {
+            out_xrefs(sub { sprintf "/* %70s */", $_[0]; });
+        }
 
-	# In case of comments, strip " /* ` " and " * ` ";
-	my $lstripped = s,^ \s* /? \* \s* \` \  ,,x ? $&: '';
+        # In case of comments, strip " /* ` " and " * ` ";
+        my $lstripped = s,^ \s* /? \* \s* \` \  ,,x ? $&: '';
 
-	# Strip trailing whitespace and perhaps trailing "*/" or "*"
-	s,(?: \s* \* /? )? \s* $,,x or die;
-	my $rstripped = $&;
+        # Strip trailing whitespace and perhaps trailing "*/" or "*"
+        s,(?: \s* \* /? )? \s* $,,x or die;
+        my $rstripped = $&;
 
-	# Now the actual functionality:
+        # Now the actual functionality:
 
-	debug(3,"$. $_");
+        debug(3,"$. $_");
 
-	if (!m/^(?: __attribute__ | __pragma__ )\b/x &&
-	    s/^( (?: \w+\  )? ) (\w+[a-z]\w+) ( \( .*)$
+        if (!m/^(?: __attribute__ | __pragma__ )\b/x &&
+            s/^( (?: \w+\  )? ) (\w+[a-z]\w+) ( \( .*)$
              / $1.defn($2,'Func',$2).norm($3) /xe) {
-	} elsif (s/^((struct|union|enum) \  (\w+)) ( \s+ \{ .* )$
+        } elsif (s/^((struct|union|enum) \  (\w+)) ( \s+ \{ .* )$
                   / defn($1,(ucfirst $2),$3).norm($4) /xe) {
-	    if ($2 eq 'enum') {
-		if (m,/[/*] (\w+)\* \=\&gt\; (\w+)\*\(\),) { 
-		    in_enum($1,'Func',$2)
-		} elsif (m,/[/*] (\w+)\* \=\&gt\; (struct) (\w+)\*,) { 
-		    in_enum($1,(ucfirst $2),$3);
-	        }
-	    }
-	} elsif (s/^(typedef \s+ )((struct|union|enum) \  (\w+))
+            if ($2 eq 'enum') {
+                if (m,/[/*] (\w+)\* \=\&gt\; (\w+)\*\(\),) { 
+                    in_enum($1,'Func',$2)
+                } elsif (m,/[/*] (\w+)\* \=\&gt\; (struct) (\w+)\*,) { 
+                    in_enum($1,(ucfirst $2),$3);
+                }
+            }
+        } elsif (s/^(typedef \s+ )((struct|union|enum) \  (\w+))
                       (\s+) (\w+)(\;)$
                   / norm($1).norm($2).$5.
                     defn($6,'Typedef',$6,undef,[(ucfirst $3),$4]).
@@ -292,32 +292,32 @@
         } elsif (s/^(typedef \s+) (\w+) (\s+) (\w+) (\;)$
                   / $1.norm($2).$3.
                     defn($4,'Typedef',$4,undef,['Typedef',$2]). $5 /xe) {
-	} elsif (s/^( \s* \#define \s+ ) (\w+) ( \s+\S )
+        } elsif (s/^( \s* \#define \s+ ) (\w+) ( \s+\S )
                   / $1.defmacro($2).norm($3) /xe) {
-	} elsif (s/( \`incontents \s+ (\d+) \s+ (\w+) \s+ )(\S .* \S)
+        } elsif (s/( \`incontents \s+ (\d+) \s+ (\w+) \s+ )(\S .* \S)
                  / norm($1).incontents($4, $2, $3) /xe) {
-	} else {
-	    if (m/^\s*\}/) {
-		$in_enum = undef;
-	    }
-	    $_ = norm($_);
-	}
+        } else {
+            if (m/^\s*\}/) {
+                $in_enum = undef;
+            }
+            $_ = norm($_);
+        }
 
-	# Write the line out
+        # Write the line out
 
-	if ($pass == 2) {
-	    $o .= $lstripped;
-	    $o .= $_;
-	    $o .= $rstripped;
-	}
+        if ($pass == 2) {
+            $o .= $lstripped;
+            $o .= $_;
+            $o .= $rstripped;
+        }
     }
 
     warning("pending xrefs at end of file") if @pending_xrefs;
 
     if ($pass == 2) {
-	push @outfiles, [ $leaf, $leaf_opath ];
-	$o .= "</pre></body></html>";
-	write_file($outfile, $o);
+        push @outfiles, [ $leaf, $leaf_opath ];
+        $o .= "</pre></body></html>";
+        write_file($outfile, $o);
     }
 }
 
@@ -332,18 +332,18 @@
 <ul>
 END
     foreach my $ic (sort { $a->{Seq} <=> $b->{Seq} } @incontents) {
-	$o .= "<li><a href=\"$ic->{Href}\">$ic->{Title}</a></li>\n";
+        $o .= "<li><a href=\"$ic->{Href}\">$ic->{Title}</a></li>\n";
     }
     $o .= "</ul>\n";
     my $forkind = sub {
-	my ($type,$desc,$pfx,$sfx) = @_;
-	$o .= "<h2>$desc</h2><ul>\n";
-	foreach my $name (sort keys %{ $sdef{$type} }) {
-	    my $href = refhref($type,$name);
-	    next unless $href =~ m/\S/;
-	    $o .= "<li><a $href>$pfx$name$sfx</a></li>\n";
-	}
-	$o .= "</ul>\n";
+        my ($type,$desc,$pfx,$sfx) = @_;
+        $o .= "<h2>$desc</h2><ul>\n";
+        foreach my $name (sort keys %{ $sdef{$type} }) {
+            my $href = refhref($type,$name);
+            next unless $href =~ m/\S/;
+            $o .= "<li><a $href>$pfx$name$sfx</a></li>\n";
+        }
+        $o .= "</ul>\n";
     };
     $forkind->('Func','Functions','','()');
     $forkind->('Struct','Structs','struct ','');
@@ -352,7 +352,7 @@
     $forkind->('EnumVal','Enum values and individual #defines','','');
     $o .= "</ul>\n<h2>Files</h2><ul>\n";
     foreach my $of (sort { $a->[0] cmp $b->[0] } @outfiles) {
-	$o .= "<li><a href=\"$of->[1]\">$of->[0]</a></li>\n";
+        $o .= "<li><a href=\"$of->[1]\">$of->[0]</a></li>\n";
     }
     $o .= "</ul></body></html>\n";
     write_file("$outdir/index.html", $o);
@@ -362,37 +362,37 @@
     my $depspath = "$outdir/.deps";
     my $depsout;
     if ($pass==2) {
-	$depsout = new IO::File "$depspath.new", 'w' or die $!;
+        $depsout = new IO::File "$depspath.new", 'w' or die $!;
     }
 
     find({ wanted => 
-	       sub {
-		   return unless m/\.h$/;
-		   lstat $File::Find::name or die "$File::Find::name $!";
-		   -f _ or die "$File::Find::name";
-		   substr($File::Find::name, 0, 1+length $basedir) 
-		       eq "$basedir/"
-		       or die "$File::Find::name $basedir";
-		   $leaf = substr($File::Find::name, 1+length $basedir);
-		   if (!file_wanted()) {
-		       debug(1,"$pass $File::Find::name excluded");
-		       return;
-		   }
-		   $leaf_opath = $leaf;
-		   $leaf_opath =~ s#/#,#g;
-		   $leaf_opath .= ".html";
-		   print $depsout "$outdir/index.html: $File::Find::name\n"
-		       or die $!
-		       if $pass==2;
-		   process_file($File::Find::name, $outdir.'/'.$leaf_opath);
-	   },
-	   no_chdir => 1,
-	 },
-	 map { "$basedir/$_" } @indirs);
+               sub {
+                   return unless m/\.h$/;
+                   lstat $File::Find::name or die "$File::Find::name $!";
+                   -f _ or die "$File::Find::name";
+                   substr($File::Find::name, 0, 1+length $basedir) 
+                       eq "$basedir/"
+                       or die "$File::Find::name $basedir";
+                   $leaf = substr($File::Find::name, 1+length $basedir);
+                   if (!file_wanted()) {
+                       debug(1,"$pass $File::Find::name excluded");
+                       return;
+                   }
+                   $leaf_opath = $leaf;
+                   $leaf_opath =~ s#/#,#g;
+                   $leaf_opath .= ".html";
+                   print $depsout "$outdir/index.html: $File::Find::name\n"
+                       or die $!
+                       if $pass==2;
+                   process_file($File::Find::name, $outdir.'/'.$leaf_opath);
+           },
+           no_chdir => 1,
+         },
+         map { "$basedir/$_" } @indirs);
 
     if ($pass==2) {
-	close $depsout or die $!;
-	rename "$depspath.new", "$depspath" or die $!;
+        close $depsout or die $!;
+        rename "$depspath.new", "$depspath" or die $!;
     }
 }
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf8-0000vK-5O; Sat, 03 Mar 2012 04:33:42 +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 1S3gf6-0000re-Jz
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:40 +0000
Received: from [85.158.139.83:19264] by server-3.bemta-5.messagelabs.com id
	5D/12-25237-32F915F4; Sat, 03 Mar 2012 04:33:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1330749217!16808810!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12678 invoked from network); 3 Mar 2012 04:33:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf1-0004jD-P7
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:35 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf1-0003gv-Mz
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:35 +0000
Message-Id: <E1S3gf1-0003gv-Mz@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: xen-headers: Remove hard tabs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330620699 0
# Node ID cf744a33ae9aae45f77130d612ea6671dcfde680
# Parent  bad55a5879d5f5bfb8507f8d9080d5e984f935a3
docs: xen-headers: Remove hard tabs

Remove hard tabs from the Perl script.

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


diff -r bad55a5879d5 -r cf744a33ae9a docs/xen-headers
--- a/docs/xen-headers	Thu Mar 01 16:51:39 2012 +0000
+++ b/docs/xen-headers	Thu Mar 01 16:51:39 2012 +0000
@@ -86,13 +86,13 @@
     local ($_);
     my $f = "sub file_wanted (\$) {\n    local (\$_) = \"/\$leaf\";\n";
     foreach my $fglob (@fglobs) {
-	$_ = $fglob->[0];
-	$_ = "**$_**" unless m/[?*]/;
-	s/\W/\\$&/g;
-	s,\\\*\\\*,.*,g;
-	s,\\\*,[^/]*,g;
-	s,\\\?,[^/],g;
-	$f .= "    return $fglob->[1] if m,$_,o;\n";
+        $_ = $fglob->[0];
+        $_ = "**$_**" unless m/[?*]/;
+        s/\W/\\$&/g;
+        s,\\\*\\\*,.*,g;
+        s,\\\*,[^/]*,g;
+        s,\\\?,[^/],g;
+        $f .= "    return $fglob->[1] if m,$_,o;\n";
     }
     $f .= "    return 1;\n}\n1;\n";
     debug(3, $f);
@@ -136,15 +136,15 @@
     local ($_) = @_;
     my $no = '';
     while (length) {
-	if (s/^(?:\s|^\W)+//) {
-	    $no .= $&;
-	} elsif (s/^(struct|union|enum)\s+(\w+)\b//) {
-	    $no .= ahref($&, (ucfirst $1), $2);
-	} elsif (s/^\w+\b//) {
-	    $no .= ahref($&, [qw(Func Typedef)], $&);
-	} else {
-	    die "$_ ?";
-	}
+        if (s/^(?:\s|^\W)+//) {
+            $no .= $&;
+        } elsif (s/^(struct|union|enum)\s+(\w+)\b//) {
+            $no .= ahref($&, (ucfirst $1), $2);
+        } elsif (s/^\w+\b//) {
+            $no .= ahref($&, [qw(Func Typedef)], $&);
+        } else {
+            die "$_ ?";
+        }
     }
     return $no;
 }
@@ -195,25 +195,25 @@
 sub defmacro ($) {
     my ($valname) = @_;
     if (!$in_enum) {
-	return $valname;
+        return $valname;
     } elsif (substr($valname, 0, (length $in_enum->[0])) ne $in_enum->[0]) {
-	warning("in enum expecting $in_enum->[0]* got $valname");
-	return $valname;
+        warning("in enum expecting $in_enum->[0]* got $valname");
+        return $valname;
     } else {
-	my $reftype = $in_enum->[1];
-	my $refname = $in_enum->[2].substr($valname, (length $in_enum->[0]));
-	$sdef{$reftype}{$refname}{Xrefs}{$leaf,$.} =
-	    "[see <a href=\"$leaf_opath#EnumVal_$valname\">$valname</a>]";
-	$sdef{EnumVal}{$valname}{Used} = 1;
-	return defn($valname,'EnumVal',$valname, refhref($reftype,$refname));
+        my $reftype = $in_enum->[1];
+        my $refname = $in_enum->[2].substr($valname, (length $in_enum->[0]));
+        $sdef{$reftype}{$refname}{Xrefs}{$leaf,$.} =
+            "[see <a href=\"$leaf_opath#EnumVal_$valname\">$valname</a>]";
+        $sdef{EnumVal}{$valname}{Used} = 1;
+        return defn($valname,'EnumVal',$valname, refhref($reftype,$refname));
     }
 }
 
 sub out_xrefs ($) {
     my ($linemapfunc) = @_;
     foreach my $xref (@pending_xrefs) {
-	$o .= $linemapfunc->($xref);
-	$o .= "\n";
+        $o .= $linemapfunc->($xref);
+        $o .= "\n";
     }
     @pending_xrefs = ();
 }
@@ -222,11 +222,11 @@
     my ($text, $seq, $anchor) = @_;
     $anchor = "incontents_$anchor";
     if ($pass==2) {
-	push @incontents, { 
-	    Seq => $seq,
-	    Href => "$leaf_opath#$anchor",
-	    Title => $text,
-	};
+        push @incontents, { 
+            Seq => $seq,
+            Href => "$leaf_opath#$anchor",
+            Title => $text,
+        };
     }
     return "<a name=\"$anchor\"><strong>$text</strong></a>";
 }
@@ -250,41 +250,41 @@
     $o .= "<html><head><title>$leaf - $xtitle</title></head><body><pre>\n";
     
     while (<$in>) {
-	s/\&/\&amp;/g;
-	s/\</\&lt;/g;
-	s/\>/\&gt;/g;
+        s/\&/\&amp;/g;
+        s/\</\&lt;/g;
+        s/\>/\&gt;/g;
 
-	if (m/^(.*\`)[ \t]*$/) {
-	    my $lhs = $1;
-	    out_xrefs(sub { "$1 $_[0]"; });
-	} elsif (m/^\s*$/) {
-	    out_xrefs(sub { sprintf "/* %70s */", $_[0]; });
-	}
+        if (m/^(.*\`)[ \t]*$/) {
+            my $lhs = $1;
+            out_xrefs(sub { "$1 $_[0]"; });
+        } elsif (m/^\s*$/) {
+            out_xrefs(sub { sprintf "/* %70s */", $_[0]; });
+        }
 
-	# In case of comments, strip " /* ` " and " * ` ";
-	my $lstripped = s,^ \s* /? \* \s* \` \  ,,x ? $&: '';
+        # In case of comments, strip " /* ` " and " * ` ";
+        my $lstripped = s,^ \s* /? \* \s* \` \  ,,x ? $&: '';
 
-	# Strip trailing whitespace and perhaps trailing "*/" or "*"
-	s,(?: \s* \* /? )? \s* $,,x or die;
-	my $rstripped = $&;
+        # Strip trailing whitespace and perhaps trailing "*/" or "*"
+        s,(?: \s* \* /? )? \s* $,,x or die;
+        my $rstripped = $&;
 
-	# Now the actual functionality:
+        # Now the actual functionality:
 
-	debug(3,"$. $_");
+        debug(3,"$. $_");
 
-	if (!m/^(?: __attribute__ | __pragma__ )\b/x &&
-	    s/^( (?: \w+\  )? ) (\w+[a-z]\w+) ( \( .*)$
+        if (!m/^(?: __attribute__ | __pragma__ )\b/x &&
+            s/^( (?: \w+\  )? ) (\w+[a-z]\w+) ( \( .*)$
              / $1.defn($2,'Func',$2).norm($3) /xe) {
-	} elsif (s/^((struct|union|enum) \  (\w+)) ( \s+ \{ .* )$
+        } elsif (s/^((struct|union|enum) \  (\w+)) ( \s+ \{ .* )$
                   / defn($1,(ucfirst $2),$3).norm($4) /xe) {
-	    if ($2 eq 'enum') {
-		if (m,/[/*] (\w+)\* \=\&gt\; (\w+)\*\(\),) { 
-		    in_enum($1,'Func',$2)
-		} elsif (m,/[/*] (\w+)\* \=\&gt\; (struct) (\w+)\*,) { 
-		    in_enum($1,(ucfirst $2),$3);
-	        }
-	    }
-	} elsif (s/^(typedef \s+ )((struct|union|enum) \  (\w+))
+            if ($2 eq 'enum') {
+                if (m,/[/*] (\w+)\* \=\&gt\; (\w+)\*\(\),) { 
+                    in_enum($1,'Func',$2)
+                } elsif (m,/[/*] (\w+)\* \=\&gt\; (struct) (\w+)\*,) { 
+                    in_enum($1,(ucfirst $2),$3);
+                }
+            }
+        } elsif (s/^(typedef \s+ )((struct|union|enum) \  (\w+))
                       (\s+) (\w+)(\;)$
                   / norm($1).norm($2).$5.
                     defn($6,'Typedef',$6,undef,[(ucfirst $3),$4]).
@@ -292,32 +292,32 @@
         } elsif (s/^(typedef \s+) (\w+) (\s+) (\w+) (\;)$
                   / $1.norm($2).$3.
                     defn($4,'Typedef',$4,undef,['Typedef',$2]). $5 /xe) {
-	} elsif (s/^( \s* \#define \s+ ) (\w+) ( \s+\S )
+        } elsif (s/^( \s* \#define \s+ ) (\w+) ( \s+\S )
                   / $1.defmacro($2).norm($3) /xe) {
-	} elsif (s/( \`incontents \s+ (\d+) \s+ (\w+) \s+ )(\S .* \S)
+        } elsif (s/( \`incontents \s+ (\d+) \s+ (\w+) \s+ )(\S .* \S)
                  / norm($1).incontents($4, $2, $3) /xe) {
-	} else {
-	    if (m/^\s*\}/) {
-		$in_enum = undef;
-	    }
-	    $_ = norm($_);
-	}
+        } else {
+            if (m/^\s*\}/) {
+                $in_enum = undef;
+            }
+            $_ = norm($_);
+        }
 
-	# Write the line out
+        # Write the line out
 
-	if ($pass == 2) {
-	    $o .= $lstripped;
-	    $o .= $_;
-	    $o .= $rstripped;
-	}
+        if ($pass == 2) {
+            $o .= $lstripped;
+            $o .= $_;
+            $o .= $rstripped;
+        }
     }
 
     warning("pending xrefs at end of file") if @pending_xrefs;
 
     if ($pass == 2) {
-	push @outfiles, [ $leaf, $leaf_opath ];
-	$o .= "</pre></body></html>";
-	write_file($outfile, $o);
+        push @outfiles, [ $leaf, $leaf_opath ];
+        $o .= "</pre></body></html>";
+        write_file($outfile, $o);
     }
 }
 
@@ -332,18 +332,18 @@
 <ul>
 END
     foreach my $ic (sort { $a->{Seq} <=> $b->{Seq} } @incontents) {
-	$o .= "<li><a href=\"$ic->{Href}\">$ic->{Title}</a></li>\n";
+        $o .= "<li><a href=\"$ic->{Href}\">$ic->{Title}</a></li>\n";
     }
     $o .= "</ul>\n";
     my $forkind = sub {
-	my ($type,$desc,$pfx,$sfx) = @_;
-	$o .= "<h2>$desc</h2><ul>\n";
-	foreach my $name (sort keys %{ $sdef{$type} }) {
-	    my $href = refhref($type,$name);
-	    next unless $href =~ m/\S/;
-	    $o .= "<li><a $href>$pfx$name$sfx</a></li>\n";
-	}
-	$o .= "</ul>\n";
+        my ($type,$desc,$pfx,$sfx) = @_;
+        $o .= "<h2>$desc</h2><ul>\n";
+        foreach my $name (sort keys %{ $sdef{$type} }) {
+            my $href = refhref($type,$name);
+            next unless $href =~ m/\S/;
+            $o .= "<li><a $href>$pfx$name$sfx</a></li>\n";
+        }
+        $o .= "</ul>\n";
     };
     $forkind->('Func','Functions','','()');
     $forkind->('Struct','Structs','struct ','');
@@ -352,7 +352,7 @@
     $forkind->('EnumVal','Enum values and individual #defines','','');
     $o .= "</ul>\n<h2>Files</h2><ul>\n";
     foreach my $of (sort { $a->[0] cmp $b->[0] } @outfiles) {
-	$o .= "<li><a href=\"$of->[1]\">$of->[0]</a></li>\n";
+        $o .= "<li><a href=\"$of->[1]\">$of->[0]</a></li>\n";
     }
     $o .= "</ul></body></html>\n";
     write_file("$outdir/index.html", $o);
@@ -362,37 +362,37 @@
     my $depspath = "$outdir/.deps";
     my $depsout;
     if ($pass==2) {
-	$depsout = new IO::File "$depspath.new", 'w' or die $!;
+        $depsout = new IO::File "$depspath.new", 'w' or die $!;
     }
 
     find({ wanted => 
-	       sub {
-		   return unless m/\.h$/;
-		   lstat $File::Find::name or die "$File::Find::name $!";
-		   -f _ or die "$File::Find::name";
-		   substr($File::Find::name, 0, 1+length $basedir) 
-		       eq "$basedir/"
-		       or die "$File::Find::name $basedir";
-		   $leaf = substr($File::Find::name, 1+length $basedir);
-		   if (!file_wanted()) {
-		       debug(1,"$pass $File::Find::name excluded");
-		       return;
-		   }
-		   $leaf_opath = $leaf;
-		   $leaf_opath =~ s#/#,#g;
-		   $leaf_opath .= ".html";
-		   print $depsout "$outdir/index.html: $File::Find::name\n"
-		       or die $!
-		       if $pass==2;
-		   process_file($File::Find::name, $outdir.'/'.$leaf_opath);
-	   },
-	   no_chdir => 1,
-	 },
-	 map { "$basedir/$_" } @indirs);
+               sub {
+                   return unless m/\.h$/;
+                   lstat $File::Find::name or die "$File::Find::name $!";
+                   -f _ or die "$File::Find::name";
+                   substr($File::Find::name, 0, 1+length $basedir) 
+                       eq "$basedir/"
+                       or die "$File::Find::name $basedir";
+                   $leaf = substr($File::Find::name, 1+length $basedir);
+                   if (!file_wanted()) {
+                       debug(1,"$pass $File::Find::name excluded");
+                       return;
+                   }
+                   $leaf_opath = $leaf;
+                   $leaf_opath =~ s#/#,#g;
+                   $leaf_opath .= ".html";
+                   print $depsout "$outdir/index.html: $File::Find::name\n"
+                       or die $!
+                       if $pass==2;
+                   process_file($File::Find::name, $outdir.'/'.$leaf_opath);
+           },
+           no_chdir => 1,
+         },
+         map { "$basedir/$_" } @indirs);
 
     if ($pass==2) {
-	close $depsout or die $!;
-	rename "$depspath.new", "$depspath" or die $!;
+        close $depsout or die $!;
+        rename "$depspath.new", "$depspath" or die $!;
     }
 }
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf8-0000va-7v; Sat, 03 Mar 2012 04:33:42 +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 1S3gf7-0000mg-MZ
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:41 +0000
Received: from [85.158.139.83:19296] by server-10.bemta-5.messagelabs.com id
	27/5D-08260-52F915F4; Sat, 03 Mar 2012 04:33:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1330749219!17669121!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20094 invoked from network); 3 Mar 2012 04:33:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf5-0004jm-1r
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf5-0003ju-0c
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:39 +0000
Message-Id: <E1S3gf5-0003ju-0c@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:38 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenstore: Portability: do not build
	init-xenstore-domain if stubdom disabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330627955 0
# Node ID 48da78c0bd3a9e02da86a6b38941b032bae80e11
# Parent  54a61fee00ebd276fcc1ef6078377145dadc5ac7
xenstore: Portability: do not build init-xenstore-domain if stubdom disabled

Build stubxenstore only when building stubdomains.
Fixes build failure on platforms w/o the relevant ioctl.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 54a61fee00eb -r 48da78c0bd3a tools/xenstore/Makefile
--- a/tools/xenstore/Makefile	Thu Mar 01 18:22:01 2012 +0000
+++ b/tools/xenstore/Makefile	Thu Mar 01 18:52:35 2012 +0000
@@ -27,10 +27,11 @@
 xenstore xenstore-control: CFLAGS += -static
 endif
 
-ALL_TARGETS = libxenstore.so libxenstore.a clients xs_tdb_dump xenstored init-xenstore-domain
+ALL_TARGETS = libxenstore.so libxenstore.a clients xs_tdb_dump xenstored
 
 ifdef CONFIG_STUBDOM
 CFLAGS += -DNO_SOCKETS=1
+ALL_TARGETS += init-xenstore-domain
 endif
 
 .PHONY: all

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:42 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:42 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gf8-0000va-7v; Sat, 03 Mar 2012 04:33:42 +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 1S3gf7-0000mg-MZ
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:41 +0000
Received: from [85.158.139.83:19296] by server-10.bemta-5.messagelabs.com id
	27/5D-08260-52F915F4; Sat, 03 Mar 2012 04:33:41 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1330749219!17669121!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20094 invoked from network); 3 Mar 2012 04:33:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf5-0004jm-1r
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf5-0003ju-0c
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:39 +0000
Message-Id: <E1S3gf5-0003ju-0c@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:38 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenstore: Portability: do not build
	init-xenstore-domain if stubdom disabled
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330627955 0
# Node ID 48da78c0bd3a9e02da86a6b38941b032bae80e11
# Parent  54a61fee00ebd276fcc1ef6078377145dadc5ac7
xenstore: Portability: do not build init-xenstore-domain if stubdom disabled

Build stubxenstore only when building stubdomains.
Fixes build failure on platforms w/o the relevant ioctl.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 54a61fee00eb -r 48da78c0bd3a tools/xenstore/Makefile
--- a/tools/xenstore/Makefile	Thu Mar 01 18:22:01 2012 +0000
+++ b/tools/xenstore/Makefile	Thu Mar 01 18:52:35 2012 +0000
@@ -27,10 +27,11 @@
 xenstore xenstore-control: CFLAGS += -static
 endif
 
-ALL_TARGETS = libxenstore.so libxenstore.a clients xs_tdb_dump xenstored init-xenstore-domain
+ALL_TARGETS = libxenstore.so libxenstore.a clients xs_tdb_dump xenstored
 
 ifdef CONFIG_STUBDOM
 CFLAGS += -DNO_SOCKETS=1
+ALL_TARGETS += init-xenstore-domain
 endif
 
 .PHONY: all

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:44 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gfA-0000zF-EC; Sat, 03 Mar 2012 04:33: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 1S3gf8-0000vW-Mx
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:43 +0000
Received: from [85.158.139.83:19313] by server-7.bemta-5.messagelabs.com id
	0B/9A-16195-62F915F4; Sat, 03 Mar 2012 04:33:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1330749219!17625953!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12722 invoked from network); 3 Mar 2012 04:33:40 -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;
	3 Mar 2012 04:33:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf3-0004jb-V3
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf3-0003iv-Tj
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:37 +0000
Message-Id: <E1S3gf3-0003iv-Tj@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: compile libxc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330623423 0
# Node ID 82957f09bc42f9ee409510b8d2909ca513b5960b
# Parent  d4b24f7266a7df28a5ae9c23f9739f5c1ec676af
arm: compile libxc

Introduce an empty implementation of the arch specific ARM functions in
xc_core_arm.c and xc_core_arm.h; define barriers on ARM.

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


diff -r d4b24f7266a7 -r 82957f09bc42 tools/libxc/Makefile
--- a/tools/libxc/Makefile	Thu Mar 01 17:37:03 2012 +0000
+++ b/tools/libxc/Makefile	Thu Mar 01 17:37:03 2012 +0000
@@ -8,6 +8,7 @@
 CTRL_SRCS-y       += xc_core.c
 CTRL_SRCS-$(CONFIG_X86) += xc_core_x86.c
 CTRL_SRCS-$(CONFIG_IA64) += xc_core_ia64.c
+CTRL_SRCS-$(CONFIG_ARM) += xc_core_arm.c
 CTRL_SRCS-y       += xc_cpupool.c
 CTRL_SRCS-y       += xc_domain.c
 CTRL_SRCS-y       += xc_evtchn.c
diff -r d4b24f7266a7 -r 82957f09bc42 tools/libxc/xc_core.h
--- a/tools/libxc/xc_core.h	Thu Mar 01 17:37:03 2012 +0000
+++ b/tools/libxc/xc_core.h	Thu Mar 01 17:37:03 2012 +0000
@@ -155,6 +155,8 @@
 # include "xc_core_x86.h"
 #elif defined (__ia64__)
 # include "xc_core_ia64.h"
+#elif defined (__arm__)
+# include "xc_core_arm.h"
 #else
 # error "unsupported architecture"
 #endif
diff -r d4b24f7266a7 -r 82957f09bc42 tools/libxc/xc_core_arm.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/libxc/xc_core_arm.c	Thu Mar 01 17:37:03 2012 +0000
@@ -0,0 +1,107 @@
+/*
+ * 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; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * 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
+ *
+ * Copyright (c) 2011 Citrix Systems
+ *
+ */
+
+#include "xg_private.h"
+#include "xc_core.h"
+
+int
+xc_core_arch_gpfn_may_present(struct xc_core_arch_context *arch_ctxt,
+                              unsigned long pfn)
+{
+    /* TODO: memory from DT */
+    if (pfn >= 0x80000 && pfn < 0x88000)
+        return 1;
+    return 0;
+}
+
+
+static int nr_gpfns(xc_interface *xch, domid_t domid)
+{
+    return xc_domain_maximum_gpfn(xch, domid) + 1;
+}
+
+int
+xc_core_arch_auto_translated_physmap(const xc_dominfo_t *info)
+{
+    return 1;
+}
+
+int
+xc_core_arch_memory_map_get(xc_interface *xch, struct xc_core_arch_context *unused,
+                            xc_dominfo_t *info, shared_info_any_t *live_shinfo,
+                            xc_core_memory_map_t **mapp,
+                            unsigned int *nr_entries)
+{
+    unsigned long p2m_size = nr_gpfns(xch, info->domid);
+    xc_core_memory_map_t *map;
+
+    map = malloc(sizeof(*map));
+    if ( map == NULL )
+    {
+        PERROR("Could not allocate memory");
+        return -1;
+    }
+
+    map->addr = 0;
+    map->size = ((uint64_t)p2m_size) << PAGE_SHIFT;
+
+    *mapp = map;
+    *nr_entries = 1;
+    return 0;
+}
+
+static int
+xc_core_arch_map_p2m_rw(xc_interface *xch, struct domain_info_context *dinfo, xc_dominfo_t *info,
+                        shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m,
+                        unsigned long *pfnp, int rw)
+{
+    errno = ENOSYS;
+    return -1;
+}
+
+int
+xc_core_arch_map_p2m(xc_interface *xch, unsigned int guest_width, xc_dominfo_t *info,
+                        shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m,
+                        unsigned long *pfnp)
+{
+    struct domain_info_context _dinfo = { .guest_width = guest_width };
+    struct domain_info_context *dinfo = &_dinfo;
+    return xc_core_arch_map_p2m_rw(xch, dinfo, info,
+                                   live_shinfo, live_p2m, pfnp, 0);
+}
+
+int
+xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_dominfo_t *info,
+                              shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m,
+                              unsigned long *pfnp)
+{
+    struct domain_info_context _dinfo = { .guest_width = guest_width };
+    struct domain_info_context *dinfo = &_dinfo;
+    return xc_core_arch_map_p2m_rw(xch, dinfo, info,
+                                   live_shinfo, live_p2m, pfnp, 1);
+}
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r d4b24f7266a7 -r 82957f09bc42 tools/libxc/xc_core_arm.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/libxc/xc_core_arm.h	Thu Mar 01 17:37:03 2012 +0000
@@ -0,0 +1,60 @@
+/*
+ * 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; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * 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
+ *
+ * Copyright (c) 2012 Citrix Systems
+ *
+ */
+
+#ifndef XC_CORE_ARM_H
+#define XC_CORE_ARM_H
+
+#define ELF_ARCH_DATA           ELFDATA2LSB
+#define ELF_ARCH_MACHINE        EM_ARM
+
+struct xc_core_arch_context {
+    /* nothing */
+};
+
+#define xc_core_arch_context_init(arch_ctxt)            do {} while (0)
+#define xc_core_arch_context_free(arch_ctxt)            do {} while (0)
+#define xc_core_arch_context_get(arch_ctxt, ctxt, xch, domid) \
+                                                                (0)
+#define xc_core_arch_context_dump(xch, arch_ctxt, args, dump_rtn)    (0)
+
+int
+xc_core_arch_gpfn_may_present(struct xc_core_arch_context *arch_ctxt,
+                              unsigned long pfn);
+static inline int
+xc_core_arch_context_get_shdr(xc_interface *xch,
+                              struct xc_core_arch_context *arch_ctxt, 
+                              struct xc_core_section_headers *sheaders,
+                              struct xc_core_strtab *strtab,
+                              uint64_t *filesz, uint64_t offset)
+{
+    *filesz = 0;
+    return 0;
+}
+
+#endif /* XC_CORE_ARM_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r d4b24f7266a7 -r 82957f09bc42 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Mar 01 17:37:03 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Mar 01 17:37:03 2012 +0000
@@ -83,6 +83,10 @@
 #define xen_mb()   asm volatile ("mf" ::: "memory")
 #define xen_rmb()  asm volatile ("mf" ::: "memory")
 #define xen_wmb()  asm volatile ("mf" ::: "memory")
+#elif defined(__arm__)
+#define xen_mb()   asm volatile ("dmb" : : : "memory")
+#define xen_rmb()  asm volatile ("dmb" : : : "memory")
+#define xen_wmb()  asm volatile ("dmb" : : : "memory")
 #else
 #error "Define barriers"
 #endif

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:44 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gfA-0000zF-EC; Sat, 03 Mar 2012 04:33: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 1S3gf8-0000vW-Mx
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:43 +0000
Received: from [85.158.139.83:19313] by server-7.bemta-5.messagelabs.com id
	0B/9A-16195-62F915F4; Sat, 03 Mar 2012 04:33:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1330749219!17625953!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12722 invoked from network); 3 Mar 2012 04:33:40 -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;
	3 Mar 2012 04:33:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf3-0004jb-V3
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf3-0003iv-Tj
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:37 +0000
Message-Id: <E1S3gf3-0003iv-Tj@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: compile libxc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330623423 0
# Node ID 82957f09bc42f9ee409510b8d2909ca513b5960b
# Parent  d4b24f7266a7df28a5ae9c23f9739f5c1ec676af
arm: compile libxc

Introduce an empty implementation of the arch specific ARM functions in
xc_core_arm.c and xc_core_arm.h; define barriers on ARM.

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


diff -r d4b24f7266a7 -r 82957f09bc42 tools/libxc/Makefile
--- a/tools/libxc/Makefile	Thu Mar 01 17:37:03 2012 +0000
+++ b/tools/libxc/Makefile	Thu Mar 01 17:37:03 2012 +0000
@@ -8,6 +8,7 @@
 CTRL_SRCS-y       += xc_core.c
 CTRL_SRCS-$(CONFIG_X86) += xc_core_x86.c
 CTRL_SRCS-$(CONFIG_IA64) += xc_core_ia64.c
+CTRL_SRCS-$(CONFIG_ARM) += xc_core_arm.c
 CTRL_SRCS-y       += xc_cpupool.c
 CTRL_SRCS-y       += xc_domain.c
 CTRL_SRCS-y       += xc_evtchn.c
diff -r d4b24f7266a7 -r 82957f09bc42 tools/libxc/xc_core.h
--- a/tools/libxc/xc_core.h	Thu Mar 01 17:37:03 2012 +0000
+++ b/tools/libxc/xc_core.h	Thu Mar 01 17:37:03 2012 +0000
@@ -155,6 +155,8 @@
 # include "xc_core_x86.h"
 #elif defined (__ia64__)
 # include "xc_core_ia64.h"
+#elif defined (__arm__)
+# include "xc_core_arm.h"
 #else
 # error "unsupported architecture"
 #endif
diff -r d4b24f7266a7 -r 82957f09bc42 tools/libxc/xc_core_arm.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/libxc/xc_core_arm.c	Thu Mar 01 17:37:03 2012 +0000
@@ -0,0 +1,107 @@
+/*
+ * 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; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * 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
+ *
+ * Copyright (c) 2011 Citrix Systems
+ *
+ */
+
+#include "xg_private.h"
+#include "xc_core.h"
+
+int
+xc_core_arch_gpfn_may_present(struct xc_core_arch_context *arch_ctxt,
+                              unsigned long pfn)
+{
+    /* TODO: memory from DT */
+    if (pfn >= 0x80000 && pfn < 0x88000)
+        return 1;
+    return 0;
+}
+
+
+static int nr_gpfns(xc_interface *xch, domid_t domid)
+{
+    return xc_domain_maximum_gpfn(xch, domid) + 1;
+}
+
+int
+xc_core_arch_auto_translated_physmap(const xc_dominfo_t *info)
+{
+    return 1;
+}
+
+int
+xc_core_arch_memory_map_get(xc_interface *xch, struct xc_core_arch_context *unused,
+                            xc_dominfo_t *info, shared_info_any_t *live_shinfo,
+                            xc_core_memory_map_t **mapp,
+                            unsigned int *nr_entries)
+{
+    unsigned long p2m_size = nr_gpfns(xch, info->domid);
+    xc_core_memory_map_t *map;
+
+    map = malloc(sizeof(*map));
+    if ( map == NULL )
+    {
+        PERROR("Could not allocate memory");
+        return -1;
+    }
+
+    map->addr = 0;
+    map->size = ((uint64_t)p2m_size) << PAGE_SHIFT;
+
+    *mapp = map;
+    *nr_entries = 1;
+    return 0;
+}
+
+static int
+xc_core_arch_map_p2m_rw(xc_interface *xch, struct domain_info_context *dinfo, xc_dominfo_t *info,
+                        shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m,
+                        unsigned long *pfnp, int rw)
+{
+    errno = ENOSYS;
+    return -1;
+}
+
+int
+xc_core_arch_map_p2m(xc_interface *xch, unsigned int guest_width, xc_dominfo_t *info,
+                        shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m,
+                        unsigned long *pfnp)
+{
+    struct domain_info_context _dinfo = { .guest_width = guest_width };
+    struct domain_info_context *dinfo = &_dinfo;
+    return xc_core_arch_map_p2m_rw(xch, dinfo, info,
+                                   live_shinfo, live_p2m, pfnp, 0);
+}
+
+int
+xc_core_arch_map_p2m_writable(xc_interface *xch, unsigned int guest_width, xc_dominfo_t *info,
+                              shared_info_any_t *live_shinfo, xen_pfn_t **live_p2m,
+                              unsigned long *pfnp)
+{
+    struct domain_info_context _dinfo = { .guest_width = guest_width };
+    struct domain_info_context *dinfo = &_dinfo;
+    return xc_core_arch_map_p2m_rw(xch, dinfo, info,
+                                   live_shinfo, live_p2m, pfnp, 1);
+}
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r d4b24f7266a7 -r 82957f09bc42 tools/libxc/xc_core_arm.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/libxc/xc_core_arm.h	Thu Mar 01 17:37:03 2012 +0000
@@ -0,0 +1,60 @@
+/*
+ * 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; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * 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
+ *
+ * Copyright (c) 2012 Citrix Systems
+ *
+ */
+
+#ifndef XC_CORE_ARM_H
+#define XC_CORE_ARM_H
+
+#define ELF_ARCH_DATA           ELFDATA2LSB
+#define ELF_ARCH_MACHINE        EM_ARM
+
+struct xc_core_arch_context {
+    /* nothing */
+};
+
+#define xc_core_arch_context_init(arch_ctxt)            do {} while (0)
+#define xc_core_arch_context_free(arch_ctxt)            do {} while (0)
+#define xc_core_arch_context_get(arch_ctxt, ctxt, xch, domid) \
+                                                                (0)
+#define xc_core_arch_context_dump(xch, arch_ctxt, args, dump_rtn)    (0)
+
+int
+xc_core_arch_gpfn_may_present(struct xc_core_arch_context *arch_ctxt,
+                              unsigned long pfn);
+static inline int
+xc_core_arch_context_get_shdr(xc_interface *xch,
+                              struct xc_core_arch_context *arch_ctxt, 
+                              struct xc_core_section_headers *sheaders,
+                              struct xc_core_strtab *strtab,
+                              uint64_t *filesz, uint64_t offset)
+{
+    *filesz = 0;
+    return 0;
+}
+
+#endif /* XC_CORE_ARM_H */
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r d4b24f7266a7 -r 82957f09bc42 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Mar 01 17:37:03 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Mar 01 17:37:03 2012 +0000
@@ -83,6 +83,10 @@
 #define xen_mb()   asm volatile ("mf" ::: "memory")
 #define xen_rmb()  asm volatile ("mf" ::: "memory")
 #define xen_wmb()  asm volatile ("mf" ::: "memory")
+#elif defined(__arm__)
+#define xen_mb()   asm volatile ("dmb" : : : "memory")
+#define xen_rmb()  asm volatile ("dmb" : : : "memory")
+#define xen_wmb()  asm volatile ("dmb" : : : "memory")
 #else
 #error "Define barriers"
 #endif

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:44 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gfA-0000zW-IR; Sat, 03 Mar 2012 04:33: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 1S3gf8-0000mg-Ul
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:43 +0000
Received: from [85.158.139.83:62330] by server-10.bemta-5.messagelabs.com id
	38/5D-08260-62F915F4; Sat, 03 Mar 2012 04:33:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1330749219!17592104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12679 invoked from network); 3 Mar 2012 04:33:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf5-0004jr-Iw
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf5-0003kP-Hk
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:39 +0000
Message-Id: <E1S3gf5-0003kP-Hk@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:39 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] add new bootloader xenpvnetboot for
	pv guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Zhigang Wang <zhigang.x.wang@oracle.com>
# Date 1330628077 0
# Node ID f0b5164455a8a63b18a58f43a4bfd20a88e9dde5
# Parent  48da78c0bd3a9e02da86a6b38941b032bae80e11
add new bootloader xenpvnetboot for pv guest

`xenpvnetboot' supports getting boot images from following locations:

 - http://host/path
 - https://host/path
 - ftp://host/path
 - file:///path
 - tftp://host/path
 - nfs:host:/path
 - /path
 - /path/file.iso
 - /path/filesystem.img
 - /dev/sda1
 - nfs+iso:host:/path/file.iso
 - nfs+iso:host:/path/filesystem.img

To use it, make `xenpvnetboot' as bootloader for PV guest::

    bootloader = '/usr/bin/xenpvnetboot'

To get boot images from various locations, set the right bootloader
arguments, e.g.:

    bootloarder_args = ['--location=http://192.168.0.1/fedora/x86_64']
    bootloarder_args = ['--location=ftp://192.168.0.1/fedora/x86_64']
    bootloarder_args = ['--location=file:///fedora/x86_64']
    bootloarder_args = ['--location=tftp://192.168.0.1/fedora/x86_64']
    bootloarder_args = ['--location=/fedora/x86_64']
    bootloarder_args = ['--location=/fedora/Fedora-16-x86_64-DVD.iso']
    bootloarder_args = ['--location=nfs:192.168.0.1:/fedora/x86_64']
    bootloarder_args = ['--location=nfs+iso:192.168.0.1:/fedora/Fedora-16-x86_64-DVD.iso']

You can use `kernel' and `ramdisk' to specify the relative path of
boot kernel and ramdisk. `xenpvnetboot' will join them with the
location to find the boot kernel and ramdisk, e.g.:

    kernel = 'images/pxeboot/vmlinuz'
    ramdisk = 'images/pxeboot/initrd.img'
    bootloarder_args = ['--location=http://192.168.0.1/fedora/x86_64']

    kernel = 'fedora/x86_64/images/pxeboot/vmlinuz'
    ramdisk = 'fedora/x86_64/images/pxeboot/initrd.img'
    bootloarder_args = ['--location=http://192.168.0.1/']

You can also omit the `--location' option and specify the full URL for
`kernel' and `ramdisk' directly, e.g.:

    kernel = 'http://192.168.0.1/fedora/x86_64/images/pxeboot/vmlinuz'
    ramdisk = 'http://192.168.0.1/fedora/x86_64/images/pxeboot/initrd.img'

If only `--location' is specified and `kernel' and `ramdisk' are not
specified, `xenpvnetboot' will search the following places for boot
images from the location::

    ('images/xen/vmlinuz', 'images/xen/initrd.img'), # Fedora <= 10 and OL = 5
    ('boot/i386/vmlinuz-xen', 'boot/i386/initrd-xen'), # openSUSE >= 10.2 and SLES >= 10
    ('boot/x86_64/vmlinuz-xen', 'boot/x86_64/initrd-xen'), # openSUSE >= 10.2 and SLES >= 10
    ('current/images/netboot/xen/vmlinuz', 'current/images/netboot/xen/initrd.gz'), # Debian
    ('images/pxeboot/vmlinuz', 'images/pxeboot/initrd.img'), # Fedora >=10 and OL >= 6
    ('isolinux/vmlinuz', 'isolinux/initrd.img'), # Fedora >= 10 and OL >= 6

`xenpvnetboot' requires python module `urlgrabber'
http://urlgrabber.baseurl.org/.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 48da78c0bd3a -r f0b5164455a8 tools/misc/Makefile
--- a/tools/misc/Makefile	Thu Mar 01 18:52:35 2012 +0000
+++ b/tools/misc/Makefile	Thu Mar 01 18:54:37 2012 +0000
@@ -18,7 +18,7 @@
 SUBDIRS-$(CONFIG_MINITERM) += miniterm
 SUBDIRS := $(SUBDIRS-y)
 
-INSTALL_BIN-y := xencons
+INSTALL_BIN-y := xencons xenpvnetboot
 INSTALL_BIN-$(CONFIG_X86) += xen-detect
 INSTALL_BIN := $(INSTALL_BIN-y)
 
diff -r 48da78c0bd3a -r f0b5164455a8 tools/misc/xenpvnetboot
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/misc/xenpvnetboot	Thu Mar 01 18:54:37 2012 +0000
@@ -0,0 +1,293 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2010 Oracle. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation, version 2.  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 021110-1307,
+# USA.
+
+import sys
+import os
+import stat
+import time
+import string
+import random
+import tempfile
+import commands
+import subprocess
+import urlgrabber
+from optparse import OptionParser
+
+
+XEN_PATHS = [
+    ('images/xen/vmlinuz', 'images/xen/initrd.img'), # Fedora <= 10 and OL = 5
+    ('boot/i386/vmlinuz-xen', 'boot/i386/initrd-xen'), # openSUSE >= 10.2 and SLES >= 10
+    ('boot/x86_64/vmlinuz-xen', 'boot/x86_64/initrd-xen'), # openSUSE >= 10.2 and SLES >= 10
+    ('current/images/netboot/xen/vmlinuz', 'current/images/netboot/xen/initrd.gz'), # Debian
+    ('images/pxeboot/vmlinuz', 'images/pxeboot/initrd.img'), # Fedora >=10 and OL >= 6
+    ('isolinux/vmlinuz', 'isolinux/initrd.img'), # Fedora >= 10 and OL >= 6
+]
+
+
+def format_sxp(kernel, ramdisk, args):
+    s = 'linux (kernel %s)' % kernel
+    if ramdisk:
+        s += '(ramdisk %s)' % ramdisk
+    if args:
+        s += '(args "%s")' % args
+    return s
+
+
+def format_simple(kernel, ramdisk, args, sep):
+    s = ('kernel %s' % kernel) + sep
+    if ramdisk:
+        s += ('ramdisk %s' % ramdisk) + sep
+    if args:
+        s += ('args %s' % args) + sep
+    s += sep
+    return s
+
+
+def mount(dev, path, option=''):
+    if os.uname()[0] == 'SunOS':
+        mountcmd = '/usr/sbin/mount'
+    else:
+        mountcmd = '/bin/mount'
+    cmd = ' '.join([mountcmd, option, dev, path])
+    (status, output) = commands.getstatusoutput(cmd)
+    if status != 0:
+        raise RuntimeError('Command: (%s) failed: (%s) %s' % (cmd, status, output))
+
+
+def umount(path):
+    if os.uname()[0] == 'SunOS':
+        cmd = ['/usr/sbin/umount', path]
+    else:
+        cmd = ['/bin/umount', path]
+    subprocess.call(cmd)
+
+
+class Fetcher:
+    def __init__(self, location, tmpdir):
+        self.location = location
+        self.tmpdir = tmpdir
+        self.srcdir = location
+
+    def prepare(self):
+        if not os.path.exists(self.tmpdir):
+            os.makedirs(self.tmpdir, 0750)
+
+    def cleanup(self):
+        pass
+
+    def get_file(self, filename):
+        url = os.path.join(self.srcdir, filename)
+        suffix = ''.join(random.sample(string.ascii_letters, 6))
+        local_name = os.path.join(self.tmpdir, 'xenpvboot.%s.%s' % (os.path.basename(filename), suffix))
+        try:
+            return urlgrabber.urlgrab(url, local_name, copy_local=1)
+        except Exception, err:
+            raise RuntimeError('Cannot get file %s: %s' % (url, err))
+
+
+class MountedFetcher(Fetcher):
+    def prepare(self):
+        Fetcher.prepare(self)
+        self.srcdir = tempfile.mkdtemp(prefix='xenpvboot.', dir=self.tmpdir)
+        if self.location.startswith('nfs:'):
+            mount(self.location[4:], self.srcdir, '-o ro')
+        else:
+            if stat.S_ISBLK(os.stat(self.location)[stat.ST_MODE]):
+                option = '-o ro'
+            else:
+                option = '-o ro,loop'
+            if os.uname()[0] == 'SunOS':
+                option += ' -F hsfs'
+            mount(self.location, self.srcdir, option)
+
+    def cleanup(self):
+        umount(self.srcdir)
+        try:
+            os.rmdir(self.srcdir)
+        except:
+            pass
+
+
+class NFSISOFetcher(MountedFetcher):
+    def __init__(self, location, tmpdir):
+        self.nfsdir = None
+        MountedFetcher.__init__(self, location, tmpdir)
+
+    def prepare(self):
+        Fetcher.prepare(self)
+        self.nfsdir = tempfile.mkdtemp(prefix='xenpvboot.', dir=self.tmpdir)
+        self.srcdir = tempfile.mkdtemp(prefix='xenpvboot.', dir=self.tmpdir)
+        nfs = os.path.dirname(self.location[8:])
+        iso = os.path.basename(self.location[8:])
+        mount(nfs, self.nfsdir, '-o ro')
+        option = '-o ro,loop'
+        if os.uname()[0] == 'SunOS':
+            option += ' -F hsfs'
+        mount(os.path.join(self.nfsdir, iso), self.srcdir, option)
+
+    def cleanup(self):
+        MountedFetcher.cleanup(self)
+        time.sleep(1)
+        umount(self.nfsdir)
+        try:
+            os.rmdir(self.nfsdir)
+        except:
+            pass
+
+
+class TFTPFetcher(Fetcher):
+    def get_file(self, filename):
+        if '/' in self.location[7:]:
+            host = self.location[7:].split('/', 1)[0].replace(':', ' ')
+            basedir = self.location[7:].split('/', 1)[1]
+        else:
+            host = self.location[7:].replace(':', ' ')
+            basedir = ''
+        suffix = ''.join(random.sample(string.ascii_letters, 6))
+        local_name = os.path.join(self.tmpdir, 'xenpvboot.%s.%s' % (os.path.basename(filename), suffix))
+        cmd = '/usr/bin/tftp %s -c get %s %s' % (host, os.path.join(basedir, filename), local_name)
+        (status, output) = commands.getstatusoutput(cmd)
+        if status != 0:
+            raise RuntimeError('Command: (%s) failed: (%s) %s' % (cmd, status, output))
+        return local_name
+
+
+def main():
+    usage = '''%prog [option]
+
+Get boot images from the given location and prepare for Xen to use.
+
+Supported locations:
+
+ - http://host/path
+ - https://host/path
+ - ftp://host/path
+ - file:///path
+ - tftp://host/path
+ - nfs:host:/path
+ - /path
+ - /path/file.iso
+ - /path/filesystem.img
+ - /dev/sda1
+ - nfs+iso:host:/path/file.iso
+ - nfs+iso:host:/path/filesystem.img'''
+    version = '%prog version 0.1'
+    parser = OptionParser(usage=usage, version=version)
+    parser.add_option('', '--location',
+                      help='The base url for kernel and ramdisk files.')
+    parser.add_option('', '--kernel',
+                      help='The kernel image file.')
+    parser.add_option('', '--ramdisk',
+                      help='The initial ramdisk file.')
+    parser.add_option('', '--args',
+                      help='Arguments pass to the kernel.')
+    parser.add_option('', '--output',
+                      help='Redirect output to this file instead of stdout.')
+    parser.add_option('', '--output-directory', default='/var/run/libxl',
+                      help='Output directory.')
+    parser.add_option('', '--output-format', default='sxp',
+                      help='Output format: sxp, simple or simple0.')
+    parser.add_option('-q', '--quiet', action='store_true',
+                      help='Be quiet.')
+    (opts, args) = parser.parse_args()
+
+    if not opts.location and not opts.kernel and not opts.ramdisk:
+        if not opts.quiet:
+            print >> sys.stderr, 'You should at least specify a location or kernel/ramdisk.'
+            parser.print_help(sys.stderr)
+        sys.exit(1)
+
+    if not opts.output or opts.output == '-':
+        fd = sys.stdout.fileno()
+    else:
+        fd = os.open(opts.output, os.O_WRONLY)
+
+    if opts.location:
+        location = opts.location
+    else:
+        location = ''
+    if (location == ''
+        or location.startswith('http://') or location.startswith('https://')
+        or location.startswith('ftp://') or location.startswith('file://')
+        or (os.path.exists(location) and os.path.isdir(location))):
+        fetcher = Fetcher(location, opts.output_directory)
+    elif location.startswith('nfs:') or (os.path.exists(location) and not os.path.isdir(location)):
+        fetcher = MountedFetcher(location, opts.output_directory)
+    elif location.startswith('nfs+iso:'):
+        fetcher = NFSISOFetcher(location, opts.output_directory)
+    elif location.startswith('tftp://'):
+        fetcher = TFTPFetcher(location, opts.output_directory)
+    else:
+        if not opts.quiet:
+            print >> sys.stderr, 'Unsupported location: %s' % location
+        sys.exit(1)
+
+    try:
+        fetcher.prepare()
+    except Exception, err:
+        if not opts.quiet:
+            print >> sys.stderr, str(err)
+        fetcher.cleanup()
+        sys.exit(1)
+
+    try:
+        kernel = None
+        if opts.kernel:
+            kernel = fetcher.get_file(opts.kernel)
+        else:
+            for (kernel_path, _) in XEN_PATHS:
+                try:
+                    kernel = fetcher.get_file(kernel_path)
+                except Exception, err:
+                    if not opts.quiet:
+                        print >> sys.stderr, str(err)
+                    continue
+                break
+
+        if not kernel:
+            if not opts.quiet:
+                print >> sys.stderr, 'Cannot get kernel from loacation: %s' % location
+            sys.exit(1)
+
+        ramdisk = None
+        if opts.ramdisk:
+            ramdisk = fetcher.get_file(opts.ramdisk)
+        else:
+            for (_, ramdisk_path) in XEN_PATHS:
+                try:
+                    ramdisk = fetcher.get_file(ramdisk_path)
+                except Exception, err:
+                    if not opts.quiet:
+                        print >> sys.stderr, str(err)
+                    continue
+                break
+    finally:
+        fetcher.cleanup()
+
+    if opts.output_format == 'sxp':
+        output = format_sxp(kernel, ramdisk, opts.args)
+    elif opts.output_format == 'simple':
+        output = format_simple(kernel, ramdisk, opts.args, '\n')
+    elif opts.output_format == 'simple0':
+        output = format_simple(kernel, ramdisk, opts.args, '\0')
+    else:
+        print >> sys.stderr, 'Unknown output format: %s' % opts.output_format
+        sys.exit(1)
+
+    sys.stdout.flush()
+    os.write(fd, output)
+
+
+if __name__ == '__main__':
+    main()

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:44 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:44 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gfA-0000zW-IR; Sat, 03 Mar 2012 04:33: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 1S3gf8-0000mg-Ul
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:43 +0000
Received: from [85.158.139.83:62330] by server-10.bemta-5.messagelabs.com id
	38/5D-08260-62F915F4; Sat, 03 Mar 2012 04:33:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1330749219!17592104!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12679 invoked from network); 3 Mar 2012 04:33:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf5-0004jr-Iw
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:39 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf5-0003kP-Hk
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:39 +0000
Message-Id: <E1S3gf5-0003kP-Hk@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:39 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] add new bootloader xenpvnetboot for
	pv guest
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Zhigang Wang <zhigang.x.wang@oracle.com>
# Date 1330628077 0
# Node ID f0b5164455a8a63b18a58f43a4bfd20a88e9dde5
# Parent  48da78c0bd3a9e02da86a6b38941b032bae80e11
add new bootloader xenpvnetboot for pv guest

`xenpvnetboot' supports getting boot images from following locations:

 - http://host/path
 - https://host/path
 - ftp://host/path
 - file:///path
 - tftp://host/path
 - nfs:host:/path
 - /path
 - /path/file.iso
 - /path/filesystem.img
 - /dev/sda1
 - nfs+iso:host:/path/file.iso
 - nfs+iso:host:/path/filesystem.img

To use it, make `xenpvnetboot' as bootloader for PV guest::

    bootloader = '/usr/bin/xenpvnetboot'

To get boot images from various locations, set the right bootloader
arguments, e.g.:

    bootloarder_args = ['--location=http://192.168.0.1/fedora/x86_64']
    bootloarder_args = ['--location=ftp://192.168.0.1/fedora/x86_64']
    bootloarder_args = ['--location=file:///fedora/x86_64']
    bootloarder_args = ['--location=tftp://192.168.0.1/fedora/x86_64']
    bootloarder_args = ['--location=/fedora/x86_64']
    bootloarder_args = ['--location=/fedora/Fedora-16-x86_64-DVD.iso']
    bootloarder_args = ['--location=nfs:192.168.0.1:/fedora/x86_64']
    bootloarder_args = ['--location=nfs+iso:192.168.0.1:/fedora/Fedora-16-x86_64-DVD.iso']

You can use `kernel' and `ramdisk' to specify the relative path of
boot kernel and ramdisk. `xenpvnetboot' will join them with the
location to find the boot kernel and ramdisk, e.g.:

    kernel = 'images/pxeboot/vmlinuz'
    ramdisk = 'images/pxeboot/initrd.img'
    bootloarder_args = ['--location=http://192.168.0.1/fedora/x86_64']

    kernel = 'fedora/x86_64/images/pxeboot/vmlinuz'
    ramdisk = 'fedora/x86_64/images/pxeboot/initrd.img'
    bootloarder_args = ['--location=http://192.168.0.1/']

You can also omit the `--location' option and specify the full URL for
`kernel' and `ramdisk' directly, e.g.:

    kernel = 'http://192.168.0.1/fedora/x86_64/images/pxeboot/vmlinuz'
    ramdisk = 'http://192.168.0.1/fedora/x86_64/images/pxeboot/initrd.img'

If only `--location' is specified and `kernel' and `ramdisk' are not
specified, `xenpvnetboot' will search the following places for boot
images from the location::

    ('images/xen/vmlinuz', 'images/xen/initrd.img'), # Fedora <= 10 and OL = 5
    ('boot/i386/vmlinuz-xen', 'boot/i386/initrd-xen'), # openSUSE >= 10.2 and SLES >= 10
    ('boot/x86_64/vmlinuz-xen', 'boot/x86_64/initrd-xen'), # openSUSE >= 10.2 and SLES >= 10
    ('current/images/netboot/xen/vmlinuz', 'current/images/netboot/xen/initrd.gz'), # Debian
    ('images/pxeboot/vmlinuz', 'images/pxeboot/initrd.img'), # Fedora >=10 and OL >= 6
    ('isolinux/vmlinuz', 'isolinux/initrd.img'), # Fedora >= 10 and OL >= 6

`xenpvnetboot' requires python module `urlgrabber'
http://urlgrabber.baseurl.org/.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 48da78c0bd3a -r f0b5164455a8 tools/misc/Makefile
--- a/tools/misc/Makefile	Thu Mar 01 18:52:35 2012 +0000
+++ b/tools/misc/Makefile	Thu Mar 01 18:54:37 2012 +0000
@@ -18,7 +18,7 @@
 SUBDIRS-$(CONFIG_MINITERM) += miniterm
 SUBDIRS := $(SUBDIRS-y)
 
-INSTALL_BIN-y := xencons
+INSTALL_BIN-y := xencons xenpvnetboot
 INSTALL_BIN-$(CONFIG_X86) += xen-detect
 INSTALL_BIN := $(INSTALL_BIN-y)
 
diff -r 48da78c0bd3a -r f0b5164455a8 tools/misc/xenpvnetboot
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/misc/xenpvnetboot	Thu Mar 01 18:54:37 2012 +0000
@@ -0,0 +1,293 @@
+#!/usr/bin/env python
+#
+# Copyright (C) 2010 Oracle. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation, version 2.  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 021110-1307,
+# USA.
+
+import sys
+import os
+import stat
+import time
+import string
+import random
+import tempfile
+import commands
+import subprocess
+import urlgrabber
+from optparse import OptionParser
+
+
+XEN_PATHS = [
+    ('images/xen/vmlinuz', 'images/xen/initrd.img'), # Fedora <= 10 and OL = 5
+    ('boot/i386/vmlinuz-xen', 'boot/i386/initrd-xen'), # openSUSE >= 10.2 and SLES >= 10
+    ('boot/x86_64/vmlinuz-xen', 'boot/x86_64/initrd-xen'), # openSUSE >= 10.2 and SLES >= 10
+    ('current/images/netboot/xen/vmlinuz', 'current/images/netboot/xen/initrd.gz'), # Debian
+    ('images/pxeboot/vmlinuz', 'images/pxeboot/initrd.img'), # Fedora >=10 and OL >= 6
+    ('isolinux/vmlinuz', 'isolinux/initrd.img'), # Fedora >= 10 and OL >= 6
+]
+
+
+def format_sxp(kernel, ramdisk, args):
+    s = 'linux (kernel %s)' % kernel
+    if ramdisk:
+        s += '(ramdisk %s)' % ramdisk
+    if args:
+        s += '(args "%s")' % args
+    return s
+
+
+def format_simple(kernel, ramdisk, args, sep):
+    s = ('kernel %s' % kernel) + sep
+    if ramdisk:
+        s += ('ramdisk %s' % ramdisk) + sep
+    if args:
+        s += ('args %s' % args) + sep
+    s += sep
+    return s
+
+
+def mount(dev, path, option=''):
+    if os.uname()[0] == 'SunOS':
+        mountcmd = '/usr/sbin/mount'
+    else:
+        mountcmd = '/bin/mount'
+    cmd = ' '.join([mountcmd, option, dev, path])
+    (status, output) = commands.getstatusoutput(cmd)
+    if status != 0:
+        raise RuntimeError('Command: (%s) failed: (%s) %s' % (cmd, status, output))
+
+
+def umount(path):
+    if os.uname()[0] == 'SunOS':
+        cmd = ['/usr/sbin/umount', path]
+    else:
+        cmd = ['/bin/umount', path]
+    subprocess.call(cmd)
+
+
+class Fetcher:
+    def __init__(self, location, tmpdir):
+        self.location = location
+        self.tmpdir = tmpdir
+        self.srcdir = location
+
+    def prepare(self):
+        if not os.path.exists(self.tmpdir):
+            os.makedirs(self.tmpdir, 0750)
+
+    def cleanup(self):
+        pass
+
+    def get_file(self, filename):
+        url = os.path.join(self.srcdir, filename)
+        suffix = ''.join(random.sample(string.ascii_letters, 6))
+        local_name = os.path.join(self.tmpdir, 'xenpvboot.%s.%s' % (os.path.basename(filename), suffix))
+        try:
+            return urlgrabber.urlgrab(url, local_name, copy_local=1)
+        except Exception, err:
+            raise RuntimeError('Cannot get file %s: %s' % (url, err))
+
+
+class MountedFetcher(Fetcher):
+    def prepare(self):
+        Fetcher.prepare(self)
+        self.srcdir = tempfile.mkdtemp(prefix='xenpvboot.', dir=self.tmpdir)
+        if self.location.startswith('nfs:'):
+            mount(self.location[4:], self.srcdir, '-o ro')
+        else:
+            if stat.S_ISBLK(os.stat(self.location)[stat.ST_MODE]):
+                option = '-o ro'
+            else:
+                option = '-o ro,loop'
+            if os.uname()[0] == 'SunOS':
+                option += ' -F hsfs'
+            mount(self.location, self.srcdir, option)
+
+    def cleanup(self):
+        umount(self.srcdir)
+        try:
+            os.rmdir(self.srcdir)
+        except:
+            pass
+
+
+class NFSISOFetcher(MountedFetcher):
+    def __init__(self, location, tmpdir):
+        self.nfsdir = None
+        MountedFetcher.__init__(self, location, tmpdir)
+
+    def prepare(self):
+        Fetcher.prepare(self)
+        self.nfsdir = tempfile.mkdtemp(prefix='xenpvboot.', dir=self.tmpdir)
+        self.srcdir = tempfile.mkdtemp(prefix='xenpvboot.', dir=self.tmpdir)
+        nfs = os.path.dirname(self.location[8:])
+        iso = os.path.basename(self.location[8:])
+        mount(nfs, self.nfsdir, '-o ro')
+        option = '-o ro,loop'
+        if os.uname()[0] == 'SunOS':
+            option += ' -F hsfs'
+        mount(os.path.join(self.nfsdir, iso), self.srcdir, option)
+
+    def cleanup(self):
+        MountedFetcher.cleanup(self)
+        time.sleep(1)
+        umount(self.nfsdir)
+        try:
+            os.rmdir(self.nfsdir)
+        except:
+            pass
+
+
+class TFTPFetcher(Fetcher):
+    def get_file(self, filename):
+        if '/' in self.location[7:]:
+            host = self.location[7:].split('/', 1)[0].replace(':', ' ')
+            basedir = self.location[7:].split('/', 1)[1]
+        else:
+            host = self.location[7:].replace(':', ' ')
+            basedir = ''
+        suffix = ''.join(random.sample(string.ascii_letters, 6))
+        local_name = os.path.join(self.tmpdir, 'xenpvboot.%s.%s' % (os.path.basename(filename), suffix))
+        cmd = '/usr/bin/tftp %s -c get %s %s' % (host, os.path.join(basedir, filename), local_name)
+        (status, output) = commands.getstatusoutput(cmd)
+        if status != 0:
+            raise RuntimeError('Command: (%s) failed: (%s) %s' % (cmd, status, output))
+        return local_name
+
+
+def main():
+    usage = '''%prog [option]
+
+Get boot images from the given location and prepare for Xen to use.
+
+Supported locations:
+
+ - http://host/path
+ - https://host/path
+ - ftp://host/path
+ - file:///path
+ - tftp://host/path
+ - nfs:host:/path
+ - /path
+ - /path/file.iso
+ - /path/filesystem.img
+ - /dev/sda1
+ - nfs+iso:host:/path/file.iso
+ - nfs+iso:host:/path/filesystem.img'''
+    version = '%prog version 0.1'
+    parser = OptionParser(usage=usage, version=version)
+    parser.add_option('', '--location',
+                      help='The base url for kernel and ramdisk files.')
+    parser.add_option('', '--kernel',
+                      help='The kernel image file.')
+    parser.add_option('', '--ramdisk',
+                      help='The initial ramdisk file.')
+    parser.add_option('', '--args',
+                      help='Arguments pass to the kernel.')
+    parser.add_option('', '--output',
+                      help='Redirect output to this file instead of stdout.')
+    parser.add_option('', '--output-directory', default='/var/run/libxl',
+                      help='Output directory.')
+    parser.add_option('', '--output-format', default='sxp',
+                      help='Output format: sxp, simple or simple0.')
+    parser.add_option('-q', '--quiet', action='store_true',
+                      help='Be quiet.')
+    (opts, args) = parser.parse_args()
+
+    if not opts.location and not opts.kernel and not opts.ramdisk:
+        if not opts.quiet:
+            print >> sys.stderr, 'You should at least specify a location or kernel/ramdisk.'
+            parser.print_help(sys.stderr)
+        sys.exit(1)
+
+    if not opts.output or opts.output == '-':
+        fd = sys.stdout.fileno()
+    else:
+        fd = os.open(opts.output, os.O_WRONLY)
+
+    if opts.location:
+        location = opts.location
+    else:
+        location = ''
+    if (location == ''
+        or location.startswith('http://') or location.startswith('https://')
+        or location.startswith('ftp://') or location.startswith('file://')
+        or (os.path.exists(location) and os.path.isdir(location))):
+        fetcher = Fetcher(location, opts.output_directory)
+    elif location.startswith('nfs:') or (os.path.exists(location) and not os.path.isdir(location)):
+        fetcher = MountedFetcher(location, opts.output_directory)
+    elif location.startswith('nfs+iso:'):
+        fetcher = NFSISOFetcher(location, opts.output_directory)
+    elif location.startswith('tftp://'):
+        fetcher = TFTPFetcher(location, opts.output_directory)
+    else:
+        if not opts.quiet:
+            print >> sys.stderr, 'Unsupported location: %s' % location
+        sys.exit(1)
+
+    try:
+        fetcher.prepare()
+    except Exception, err:
+        if not opts.quiet:
+            print >> sys.stderr, str(err)
+        fetcher.cleanup()
+        sys.exit(1)
+
+    try:
+        kernel = None
+        if opts.kernel:
+            kernel = fetcher.get_file(opts.kernel)
+        else:
+            for (kernel_path, _) in XEN_PATHS:
+                try:
+                    kernel = fetcher.get_file(kernel_path)
+                except Exception, err:
+                    if not opts.quiet:
+                        print >> sys.stderr, str(err)
+                    continue
+                break
+
+        if not kernel:
+            if not opts.quiet:
+                print >> sys.stderr, 'Cannot get kernel from loacation: %s' % location
+            sys.exit(1)
+
+        ramdisk = None
+        if opts.ramdisk:
+            ramdisk = fetcher.get_file(opts.ramdisk)
+        else:
+            for (_, ramdisk_path) in XEN_PATHS:
+                try:
+                    ramdisk = fetcher.get_file(ramdisk_path)
+                except Exception, err:
+                    if not opts.quiet:
+                        print >> sys.stderr, str(err)
+                    continue
+                break
+    finally:
+        fetcher.cleanup()
+
+    if opts.output_format == 'sxp':
+        output = format_sxp(kernel, ramdisk, opts.args)
+    elif opts.output_format == 'simple':
+        output = format_simple(kernel, ramdisk, opts.args, '\n')
+    elif opts.output_format == 'simple0':
+        output = format_simple(kernel, ramdisk, opts.args, '\0')
+    else:
+        print >> sys.stderr, 'Unknown output format: %s' % opts.output_format
+        sys.exit(1)
+
+    sys.stdout.flush()
+    os.write(fd, output)
+
+
+if __name__ == '__main__':
+    main()

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:51 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gfH-0001BA-Mi; Sat, 03 Mar 2012 04:33:51 +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 1S3gfG-00017b-1e
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:50 +0000
Received: from [85.158.143.99:30985] by server-2.bemta-4.messagelabs.com id
	72/BD-17550-D2F915F4; Sat, 03 Mar 2012 04:33:49 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1330749218!17462362!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15269 invoked from network); 3 Mar 2012 04:33:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf4-0004jh-Gv
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf4-0003jQ-FS
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:38 +0000
Message-Id: <E1S3gf4-0003jQ-FS@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Implement
	libxl_sched_credit_param_[gs]et
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330626121 0
# Node ID 54a61fee00ebd276fcc1ef6078377145dadc5ac7
# Parent  82957f09bc42f9ee409510b8d2909ca513b5960b
libxl: Implement libxl_sched_credit_param_[gs]et

Implement functions to set credit scheduler global parameters.

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


diff -r 82957f09bc42 -r 54a61fee00eb tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 17:37:03 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 18:22:01 2012 +0000
@@ -3105,6 +3105,67 @@
     return 0;
 }
 
+int libxl_sched_credit_params_get(libxl_ctx *ctx, uint32_t poolid,
+                                  libxl_sched_credit_params *scinfo)
+{
+    struct xen_sysctl_credit_schedule sparam;
+    int rc;
+
+    rc = xc_sched_credit_params_get(ctx->xch, poolid, &sparam);
+    if (rc != 0) {
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting sched credit param");
+        return ERROR_FAIL;
+    }
+
+    scinfo->tslice_ms = sparam.tslice_ms;
+    scinfo->ratelimit_us = sparam.ratelimit_us;
+
+    return 0;
+}
+
+int libxl_sched_credit_params_set(libxl_ctx *ctx, uint32_t poolid,
+                                  libxl_sched_credit_params *scinfo)
+{
+    struct xen_sysctl_credit_schedule sparam;
+    int rc=0;
+
+    if (scinfo->tslice_ms <  XEN_SYSCTL_CSCHED_TSLICE_MIN
+        || scinfo->tslice_ms > XEN_SYSCTL_CSCHED_TSLICE_MAX) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+            "Time slice out of range, valid range is from %d to %d",
+                            XEN_SYSCTL_CSCHED_TSLICE_MIN,
+                            XEN_SYSCTL_CSCHED_TSLICE_MAX);
+        return ERROR_INVAL;
+    }
+    if (scinfo->ratelimit_us <  XEN_SYSCTL_SCHED_RATELIMIT_MIN
+        || scinfo->ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+            "Ratelimit out of range, valid range is from %d to %d",
+                            XEN_SYSCTL_SCHED_RATELIMIT_MIN,
+                            XEN_SYSCTL_SCHED_RATELIMIT_MAX);
+        return ERROR_INVAL;
+    }
+    if (scinfo->ratelimit_us > scinfo->tslice_ms*1000) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "Ratelimit cannot be greater than timeslice\n");
+        return ERROR_INVAL;
+    }
+
+    sparam.tslice_ms = scinfo->tslice_ms;
+    sparam.ratelimit_us = scinfo->ratelimit_us;
+
+    rc = xc_sched_credit_params_set(ctx->xch, poolid, &sparam);
+    if ( rc < 0 ) {
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "setting sched credit param");
+        return ERROR_FAIL;
+    }
+
+    scinfo->tslice_ms = sparam.tslice_ms;
+    scinfo->ratelimit_us = sparam.ratelimit_us;
+
+    return 0;
+}
+
 int libxl_sched_credit2_domain_get(libxl_ctx *ctx, uint32_t domid,
                                    libxl_sched_credit2_domain *scinfo)
 {
diff -r 82957f09bc42 -r 54a61fee00eb tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 17:37:03 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 18:22:01 2012 +0000
@@ -648,6 +648,10 @@
                                   libxl_sched_credit_domain *scinfo);
 int libxl_sched_credit_domain_set(libxl_ctx *ctx, uint32_t domid,
                                   libxl_sched_credit_domain *scinfo);
+int libxl_sched_credit_params_get(libxl_ctx *ctx, uint32_t poolid,
+                                  libxl_sched_credit_params *scinfo);
+int libxl_sched_credit_params_set(libxl_ctx *ctx, uint32_t poolid,
+                                  libxl_sched_credit_params *scinfo);
 int libxl_sched_credit2_domain_get(libxl_ctx *ctx, uint32_t domid,
                                    libxl_sched_credit2_domain *scinfo);
 int libxl_sched_credit2_domain_set(libxl_ctx *ctx, uint32_t domid,
diff -r 82957f09bc42 -r 54a61fee00eb tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 17:37:03 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 18:22:01 2012 +0000
@@ -418,6 +418,11 @@
     ("cap", integer),
     ])
 
+libxl_sched_credit_params = Struct("sched_credit_params", [
+    ("tslice_ms", integer),
+    ("ratelimit_us", integer),
+    ], dispose_fn=None)
+
 libxl_sched_credit2_domain = Struct("sched_credit2_domain", [
     ("weight", integer),
     ])

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:51 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:51 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gfH-0001BA-Mi; Sat, 03 Mar 2012 04:33:51 +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 1S3gfG-00017b-1e
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:50 +0000
Received: from [85.158.143.99:30985] by server-2.bemta-4.messagelabs.com id
	72/BD-17550-D2F915F4; Sat, 03 Mar 2012 04:33:49 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1330749218!17462362!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15269 invoked from network); 3 Mar 2012 04:33:39 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf4-0004jh-Gv
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:38 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf4-0003jQ-FS
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:38 +0000
Message-Id: <E1S3gf4-0003jQ-FS@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:37 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: Implement
	libxl_sched_credit_param_[gs]et
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330626121 0
# Node ID 54a61fee00ebd276fcc1ef6078377145dadc5ac7
# Parent  82957f09bc42f9ee409510b8d2909ca513b5960b
libxl: Implement libxl_sched_credit_param_[gs]et

Implement functions to set credit scheduler global parameters.

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


diff -r 82957f09bc42 -r 54a61fee00eb tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Thu Mar 01 17:37:03 2012 +0000
+++ b/tools/libxl/libxl.c	Thu Mar 01 18:22:01 2012 +0000
@@ -3105,6 +3105,67 @@
     return 0;
 }
 
+int libxl_sched_credit_params_get(libxl_ctx *ctx, uint32_t poolid,
+                                  libxl_sched_credit_params *scinfo)
+{
+    struct xen_sysctl_credit_schedule sparam;
+    int rc;
+
+    rc = xc_sched_credit_params_get(ctx->xch, poolid, &sparam);
+    if (rc != 0) {
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "getting sched credit param");
+        return ERROR_FAIL;
+    }
+
+    scinfo->tslice_ms = sparam.tslice_ms;
+    scinfo->ratelimit_us = sparam.ratelimit_us;
+
+    return 0;
+}
+
+int libxl_sched_credit_params_set(libxl_ctx *ctx, uint32_t poolid,
+                                  libxl_sched_credit_params *scinfo)
+{
+    struct xen_sysctl_credit_schedule sparam;
+    int rc=0;
+
+    if (scinfo->tslice_ms <  XEN_SYSCTL_CSCHED_TSLICE_MIN
+        || scinfo->tslice_ms > XEN_SYSCTL_CSCHED_TSLICE_MAX) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+            "Time slice out of range, valid range is from %d to %d",
+                            XEN_SYSCTL_CSCHED_TSLICE_MIN,
+                            XEN_SYSCTL_CSCHED_TSLICE_MAX);
+        return ERROR_INVAL;
+    }
+    if (scinfo->ratelimit_us <  XEN_SYSCTL_SCHED_RATELIMIT_MIN
+        || scinfo->ratelimit_us > XEN_SYSCTL_SCHED_RATELIMIT_MAX) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+            "Ratelimit out of range, valid range is from %d to %d",
+                            XEN_SYSCTL_SCHED_RATELIMIT_MIN,
+                            XEN_SYSCTL_SCHED_RATELIMIT_MAX);
+        return ERROR_INVAL;
+    }
+    if (scinfo->ratelimit_us > scinfo->tslice_ms*1000) {
+        LIBXL__LOG(ctx, LIBXL__LOG_ERROR,
+                   "Ratelimit cannot be greater than timeslice\n");
+        return ERROR_INVAL;
+    }
+
+    sparam.tslice_ms = scinfo->tslice_ms;
+    sparam.ratelimit_us = scinfo->ratelimit_us;
+
+    rc = xc_sched_credit_params_set(ctx->xch, poolid, &sparam);
+    if ( rc < 0 ) {
+        LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "setting sched credit param");
+        return ERROR_FAIL;
+    }
+
+    scinfo->tslice_ms = sparam.tslice_ms;
+    scinfo->ratelimit_us = sparam.ratelimit_us;
+
+    return 0;
+}
+
 int libxl_sched_credit2_domain_get(libxl_ctx *ctx, uint32_t domid,
                                    libxl_sched_credit2_domain *scinfo)
 {
diff -r 82957f09bc42 -r 54a61fee00eb tools/libxl/libxl.h
--- a/tools/libxl/libxl.h	Thu Mar 01 17:37:03 2012 +0000
+++ b/tools/libxl/libxl.h	Thu Mar 01 18:22:01 2012 +0000
@@ -648,6 +648,10 @@
                                   libxl_sched_credit_domain *scinfo);
 int libxl_sched_credit_domain_set(libxl_ctx *ctx, uint32_t domid,
                                   libxl_sched_credit_domain *scinfo);
+int libxl_sched_credit_params_get(libxl_ctx *ctx, uint32_t poolid,
+                                  libxl_sched_credit_params *scinfo);
+int libxl_sched_credit_params_set(libxl_ctx *ctx, uint32_t poolid,
+                                  libxl_sched_credit_params *scinfo);
 int libxl_sched_credit2_domain_get(libxl_ctx *ctx, uint32_t domid,
                                    libxl_sched_credit2_domain *scinfo);
 int libxl_sched_credit2_domain_set(libxl_ctx *ctx, uint32_t domid,
diff -r 82957f09bc42 -r 54a61fee00eb tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Thu Mar 01 17:37:03 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Thu Mar 01 18:22:01 2012 +0000
@@ -418,6 +418,11 @@
     ("cap", integer),
     ])
 
+libxl_sched_credit_params = Struct("sched_credit_params", [
+    ("tslice_ms", integer),
+    ("ratelimit_us", integer),
+    ], dispose_fn=None)
+
 libxl_sched_credit2_domain = Struct("sched_credit2_domain", [
     ("weight", integer),
     ])

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:53 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gfI-0001DJ-Ts; Sat, 03 Mar 2012 04:33:52 +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 1S3gfH-00019j-EU
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:51 +0000
Received: from [85.158.143.99:62946] by server-1.bemta-4.messagelabs.com id
	5F/E9-20925-E2F915F4; Sat, 03 Mar 2012 04:33:50 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1330749217!17462360!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15245 invoked from network); 3 Mar 2012 04:33:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf3-0004jY-DK
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf3-0003iP-Bv
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:37 +0000
Message-Id: <E1S3gf3-0003iP-Bv@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:36 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: add stub hvm/save.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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330623423 0
# Node ID d4b24f7266a7df28a5ae9c23f9739f5c1ec676af
# Parent  6b003e5b398dc073c6086738ca023c997b18c7b0
arm: add stub hvm/save.h

From: Ian Campbell <ian.campbell@citrix.com>

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


diff -r 6b003e5b398d -r d4b24f7266a7 xen/include/public/arch-arm/hvm/save.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/public/arch-arm/hvm/save.h	Thu Mar 01 17:37:03 2012 +0000
@@ -0,0 +1,39 @@
+/*
+ * Structure definitions for HVM state that is held by Xen and must
+ * be saved along with the domain's memory and device-model state.
+ *
+ * Copyright (c) 2012 Citrix Systems Ltd.
+ *
+ * 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_HVM_SAVE_ARM_H__
+#define __XEN_PUBLIC_HVM_SAVE_ARM_H__
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 6b003e5b398d -r d4b24f7266a7 xen/include/public/hvm/save.h
--- a/xen/include/public/hvm/save.h	Thu Mar 01 17:23:51 2012 +0000
+++ b/xen/include/public/hvm/save.h	Thu Mar 01 17:37:03 2012 +0000
@@ -104,6 +104,8 @@
 #include "../arch-x86/hvm/save.h"
 #elif defined(__ia64__)
 #include "../arch-ia64/hvm/save.h"
+#elif defined(__arm__)
+#include "../arch-arm/hvm/save.h"
 #else
 #error "unsupported architecture"
 #endif

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:33:53 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:33:53 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gfI-0001DJ-Ts; Sat, 03 Mar 2012 04:33:52 +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 1S3gfH-00019j-EU
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:51 +0000
Received: from [85.158.143.99:62946] by server-1.bemta-4.messagelabs.com id
	5F/E9-20925-E2F915F4; Sat, 03 Mar 2012 04:33:50 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1330749217!17462360!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15245 invoked from network); 3 Mar 2012 04:33:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf3-0004jY-DK
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:37 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf3-0003iP-Bv
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:37 +0000
Message-Id: <E1S3gf3-0003iP-Bv@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:36 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: add stub hvm/save.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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330623423 0
# Node ID d4b24f7266a7df28a5ae9c23f9739f5c1ec676af
# Parent  6b003e5b398dc073c6086738ca023c997b18c7b0
arm: add stub hvm/save.h

From: Ian Campbell <ian.campbell@citrix.com>

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


diff -r 6b003e5b398d -r d4b24f7266a7 xen/include/public/arch-arm/hvm/save.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/public/arch-arm/hvm/save.h	Thu Mar 01 17:37:03 2012 +0000
@@ -0,0 +1,39 @@
+/*
+ * Structure definitions for HVM state that is held by Xen and must
+ * be saved along with the domain's memory and device-model state.
+ *
+ * Copyright (c) 2012 Citrix Systems Ltd.
+ *
+ * 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_HVM_SAVE_ARM_H__
+#define __XEN_PUBLIC_HVM_SAVE_ARM_H__
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 6b003e5b398d -r d4b24f7266a7 xen/include/public/hvm/save.h
--- a/xen/include/public/hvm/save.h	Thu Mar 01 17:23:51 2012 +0000
+++ b/xen/include/public/hvm/save.h	Thu Mar 01 17:37:03 2012 +0000
@@ -104,6 +104,8 @@
 #include "../arch-x86/hvm/save.h"
 #elif defined(__ia64__)
 #include "../arch-ia64/hvm/save.h"
+#elif defined(__arm__)
+#include "../arch-arm/hvm/save.h"
 #else
 #error "unsupported architecture"
 #endif

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:46:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:46: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 1S3grN-0001wV-UR; Sat, 03 Mar 2012 04:46: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 1S3gf9-0000ET-5c
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:43 +0000
Received: from [85.158.143.99:62892] by server-2.bemta-4.messagelabs.com id
	EA/AD-17550-62F915F4; Sat, 03 Mar 2012 04:33:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1330749221!16904946!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4871 invoked from network); 3 Mar 2012 04:33:42 -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;
	3 Mar 2012 04:33:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf6-0004jx-M5
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf6-0003m7-Jg
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:40 +0000
Message-Id: <E1S3gf6-0003m7-Jg@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:40 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: only set b_info->u.hvm.bios
	if type if 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330691605 0
# Node ID 33659563f5897b3dabc93284252f8570ed825e63
# Parent  5e38c834f7958bf8fbd4330d27369e8571285063
libxl: only set b_info->u.hvm.bios if type if HVM

This fixes a PV guest breakage causes by 24932:6eac4a1ee646 "libxl: Select BIOS
using libxl_domain_build_info_setdefaults".

I have also included a sanity check on b_info->type.

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 5e38c834f795 -r 33659563f589 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 19:00:09 2012 +0000
+++ b/tools/libxl/libxl_create.c	Fri Mar 02 12:33:25 2012 +0000
@@ -67,28 +67,34 @@
 int libxl__domain_build_info_setdefault(libxl__gc *gc,
                                         libxl_domain_build_info *b_info)
 {
+    if (b_info->type != LIBXL_DOMAIN_TYPE_HVM &&
+        b_info->type != LIBXL_DOMAIN_TYPE_PV)
+        return ERROR_INVAL;
+
     if (!b_info->device_model_version)
         b_info->device_model_version =
             LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
 
-    if (!b_info->u.hvm.bios)
+    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
+        if (!b_info->u.hvm.bios)
+            switch (b_info->device_model_version) {
+            case 1: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_ROMBIOS; break;
+            case 2: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_SEABIOS; break;
+            default:return ERROR_INVAL;
+            }
+
+        /* Enforce BIOS<->Device Model version relationship */
         switch (b_info->device_model_version) {
-        case 1: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_ROMBIOS; break;
-        case 2: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_SEABIOS; break;
-        default:return ERROR_INVAL;
-    }
-
-    /* Enforce BIOS<->Device Model version relationship */
-    switch (b_info->device_model_version) {
-    case 1:
-        if (b_info->u.hvm.bios != LIBXL_BIOS_TYPE_ROMBIOS)
-            return ERROR_INVAL;
-        break;
-    case 2:
-        if (b_info->u.hvm.bios == LIBXL_BIOS_TYPE_ROMBIOS)
-            return ERROR_INVAL;
-        break;
-    default:abort();
+        case 1:
+            if (b_info->u.hvm.bios != LIBXL_BIOS_TYPE_ROMBIOS)
+                return ERROR_INVAL;
+            break;
+        case 2:
+            if (b_info->u.hvm.bios == LIBXL_BIOS_TYPE_ROMBIOS)
+                return ERROR_INVAL;
+            break;
+        default:abort();
+        }
     }
 
     libxl_defbool_setdefault(&b_info->device_model_stubdomain, false);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:46:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:46: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 1S3grN-0001wV-UR; Sat, 03 Mar 2012 04:46: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 1S3gf9-0000ET-5c
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:43 +0000
Received: from [85.158.143.99:62892] by server-2.bemta-4.messagelabs.com id
	EA/AD-17550-62F915F4; Sat, 03 Mar 2012 04:33:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1330749221!16904946!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4871 invoked from network); 3 Mar 2012 04:33:42 -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;
	3 Mar 2012 04:33:42 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf6-0004jx-M5
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf6-0003m7-Jg
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:40 +0000
Message-Id: <E1S3gf6-0003m7-Jg@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:40 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: only set b_info->u.hvm.bios
	if type if 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330691605 0
# Node ID 33659563f5897b3dabc93284252f8570ed825e63
# Parent  5e38c834f7958bf8fbd4330d27369e8571285063
libxl: only set b_info->u.hvm.bios if type if HVM

This fixes a PV guest breakage causes by 24932:6eac4a1ee646 "libxl: Select BIOS
using libxl_domain_build_info_setdefaults".

I have also included a sanity check on b_info->type.

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 5e38c834f795 -r 33659563f589 tools/libxl/libxl_create.c
--- a/tools/libxl/libxl_create.c	Thu Mar 01 19:00:09 2012 +0000
+++ b/tools/libxl/libxl_create.c	Fri Mar 02 12:33:25 2012 +0000
@@ -67,28 +67,34 @@
 int libxl__domain_build_info_setdefault(libxl__gc *gc,
                                         libxl_domain_build_info *b_info)
 {
+    if (b_info->type != LIBXL_DOMAIN_TYPE_HVM &&
+        b_info->type != LIBXL_DOMAIN_TYPE_PV)
+        return ERROR_INVAL;
+
     if (!b_info->device_model_version)
         b_info->device_model_version =
             LIBXL_DEVICE_MODEL_VERSION_QEMU_XEN_TRADITIONAL;
 
-    if (!b_info->u.hvm.bios)
+    if (b_info->type == LIBXL_DOMAIN_TYPE_HVM) {
+        if (!b_info->u.hvm.bios)
+            switch (b_info->device_model_version) {
+            case 1: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_ROMBIOS; break;
+            case 2: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_SEABIOS; break;
+            default:return ERROR_INVAL;
+            }
+
+        /* Enforce BIOS<->Device Model version relationship */
         switch (b_info->device_model_version) {
-        case 1: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_ROMBIOS; break;
-        case 2: b_info->u.hvm.bios = LIBXL_BIOS_TYPE_SEABIOS; break;
-        default:return ERROR_INVAL;
-    }
-
-    /* Enforce BIOS<->Device Model version relationship */
-    switch (b_info->device_model_version) {
-    case 1:
-        if (b_info->u.hvm.bios != LIBXL_BIOS_TYPE_ROMBIOS)
-            return ERROR_INVAL;
-        break;
-    case 2:
-        if (b_info->u.hvm.bios == LIBXL_BIOS_TYPE_ROMBIOS)
-            return ERROR_INVAL;
-        break;
-    default:abort();
+        case 1:
+            if (b_info->u.hvm.bios != LIBXL_BIOS_TYPE_ROMBIOS)
+                return ERROR_INVAL;
+            break;
+        case 2:
+            if (b_info->u.hvm.bios == LIBXL_BIOS_TYPE_ROMBIOS)
+                return ERROR_INVAL;
+            break;
+        default:abort();
+        }
     }
 
     libxl_defbool_setdefault(&b_info->device_model_stubdomain, false);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:47:02 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:47:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gs2-00020U-26; Sat, 03 Mar 2012 04:47:02 +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 1S3gf2-0000B5-8u
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:36 +0000
Received: from [85.158.143.35:63034] by server-1.bemta-4.messagelabs.com id
	5C/D9-20925-F1F915F4; Sat, 03 Mar 2012 04:33:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1330749213!10349507!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20262 invoked from network); 3 Mar 2012 04:33:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gez-0004ip-Ih
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gez-0003es-HB
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:33 +0000
Message-Id: <E1S3gez-0003es-HB@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: autoconf: remove python xml
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1330620075 0
# Node ID f5bef22b3619f9eb5db941e70222c5b0c36a7254
# Parent  ed898c1d80881e9e3fb07ad7d9b30b70ac407543
build: autoconf: remove python xml check

Remove the xml module check from autoconf and move it to xend init
script (in a later patch), since it's a run time dependency.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r ed898c1d8088 -r f5bef22b3619 tools/configure
--- a/tools/configure	Thu Mar 01 16:19:29 2012 +0000
+++ b/tools/configure	Thu Mar 01 16:41:15 2012 +0000
@@ -3843,8 +3843,6 @@
 
 
 
-
-
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 # serial 1 (pkg-config-0.24)
 #
@@ -6141,18 +6139,6 @@
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python xml.dom.minidom" >&5
-$as_echo_n "checking for python xml.dom.minidom... " >&6; }
-`$PYTHON -c 'import xml.dom.minidom'`
-if test "$?" != "0"
-then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    as_fn_error $? "Unable to find xml.dom.minidom module" "$LINENO" 5
-else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python devel" >&5
 $as_echo_n "checking for python devel... " >&6; }
 
diff -r ed898c1d8088 -r f5bef22b3619 tools/configure.ac
--- a/tools/configure.ac	Thu Mar 01 16:19:29 2012 +0000
+++ b/tools/configure.ac	Thu Mar 01 16:41:15 2012 +0000
@@ -26,7 +26,6 @@
 m4_include([m4/enable_feature.m4])
 m4_include([m4/disable_feature.m4])
 m4_include([m4/path_or_fail.m4])
-m4_include([m4/python_xml.m4])
 m4_include([m4/python_version.m4])
 m4_include([m4/python_devel.m4])
 m4_include([m4/ocaml.m4])
@@ -95,7 +94,6 @@
     [AC_MSG_ERROR([PYTHON specified, but is not an absolute path])])
     AX_PATH_PROG_OR_FAIL([PYTHONPATH], [$PYTHON])
     AX_CHECK_PYTHON_VERSION([2], [3])
-    AX_CHECK_PYTHON_XML()
     AX_CHECK_PYTHON_DEVEL()
 ])
 AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
diff -r ed898c1d8088 -r f5bef22b3619 tools/m4/python_xml.m4
--- a/tools/m4/python_xml.m4	Thu Mar 01 16:19:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-AC_DEFUN([AX_CHECK_PYTHON_XML],
-[AC_MSG_CHECKING([for python xml.dom.minidom])
-`$PYTHON -c 'import xml.dom.minidom'`
-if test "$?" != "0"
-then
-    AC_MSG_RESULT([no])
-    AC_MSG_ERROR([Unable to find xml.dom.minidom module])
-else
-    AC_MSG_RESULT([yes])
-fi])

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:47:02 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:47:02 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gs2-00020U-26; Sat, 03 Mar 2012 04:47:02 +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 1S3gf2-0000B5-8u
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:36 +0000
Received: from [85.158.143.35:63034] by server-1.bemta-4.messagelabs.com id
	5C/D9-20925-F1F915F4; Sat, 03 Mar 2012 04:33:35 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1330749213!10349507!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20262 invoked from network); 3 Mar 2012 04:33:34 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:34 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gez-0004ip-Ih
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:33 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gez-0003es-HB
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:33 +0000
Message-Id: <E1S3gez-0003es-HB@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: autoconf: remove python xml
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1330620075 0
# Node ID f5bef22b3619f9eb5db941e70222c5b0c36a7254
# Parent  ed898c1d80881e9e3fb07ad7d9b30b70ac407543
build: autoconf: remove python xml check

Remove the xml module check from autoconf and move it to xend init
script (in a later patch), since it's a run time dependency.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r ed898c1d8088 -r f5bef22b3619 tools/configure
--- a/tools/configure	Thu Mar 01 16:19:29 2012 +0000
+++ b/tools/configure	Thu Mar 01 16:41:15 2012 +0000
@@ -3843,8 +3843,6 @@
 
 
 
-
-
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 # serial 1 (pkg-config-0.24)
 #
@@ -6141,18 +6139,6 @@
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python xml.dom.minidom" >&5
-$as_echo_n "checking for python xml.dom.minidom... " >&6; }
-`$PYTHON -c 'import xml.dom.minidom'`
-if test "$?" != "0"
-then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    as_fn_error $? "Unable to find xml.dom.minidom module" "$LINENO" 5
-else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python devel" >&5
 $as_echo_n "checking for python devel... " >&6; }
 
diff -r ed898c1d8088 -r f5bef22b3619 tools/configure.ac
--- a/tools/configure.ac	Thu Mar 01 16:19:29 2012 +0000
+++ b/tools/configure.ac	Thu Mar 01 16:41:15 2012 +0000
@@ -26,7 +26,6 @@
 m4_include([m4/enable_feature.m4])
 m4_include([m4/disable_feature.m4])
 m4_include([m4/path_or_fail.m4])
-m4_include([m4/python_xml.m4])
 m4_include([m4/python_version.m4])
 m4_include([m4/python_devel.m4])
 m4_include([m4/ocaml.m4])
@@ -95,7 +94,6 @@
     [AC_MSG_ERROR([PYTHON specified, but is not an absolute path])])
     AX_PATH_PROG_OR_FAIL([PYTHONPATH], [$PYTHON])
     AX_CHECK_PYTHON_VERSION([2], [3])
-    AX_CHECK_PYTHON_XML()
     AX_CHECK_PYTHON_DEVEL()
 ])
 AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
diff -r ed898c1d8088 -r f5bef22b3619 tools/m4/python_xml.m4
--- a/tools/m4/python_xml.m4	Thu Mar 01 16:19:29 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-AC_DEFUN([AX_CHECK_PYTHON_XML],
-[AC_MSG_CHECKING([for python xml.dom.minidom])
-`$PYTHON -c 'import xml.dom.minidom'`
-if test "$?" != "0"
-then
-    AC_MSG_RESULT([no])
-    AC_MSG_ERROR([Unable to find xml.dom.minidom module])
-else
-    AC_MSG_RESULT([yes])
-fi])

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:47:03 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:47:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gs3-00020q-4v; Sat, 03 Mar 2012 04:47:03 +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 1S3gf2-0000ET-IL
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:36 +0000
Received: from [85.158.143.99:30816] by server-2.bemta-4.messagelabs.com id
	02/AD-17550-02F915F4; Sat, 03 Mar 2012 04:33:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1330749214!16844925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2110 invoked from network); 3 Mar 2012 04:33:35 -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;
	3 Mar 2012 04:33:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf0-0004iz-3M
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf0-0003fM-1o
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:34 +0000
Message-Id: <E1S3gf0-0003fM-1o@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: autoconf: remove (yet
	another) brctl leftover
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1330620116 0
# Node ID 01d95561350bd249fa0fe67741b3eacea66ee153
# Parent  f5bef22b3619f9eb5db941e70222c5b0c36a7254
build: autoconf: remove (yet another) brctl leftover

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r f5bef22b3619 -r 01d95561350b config/Tools.mk.in
--- a/config/Tools.mk.in	Thu Mar 01 16:41:15 2012 +0000
+++ b/config/Tools.mk.in	Thu Mar 01 16:41:56 2012 +0000
@@ -11,7 +11,6 @@
 PYTHON              := @PYTHON@
 PYTHON_PATH         := @PYTHONPATH@
 PERL                := @PERL@
-BRCTL               := @BRCTL@
 IP                  := @IP@
 CURL_CONFIG         := @CURL@
 XML2_CONFIG         := @XML@

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:47:03 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:47:03 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gs3-00020q-4v; Sat, 03 Mar 2012 04:47:03 +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 1S3gf2-0000ET-IL
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:36 +0000
Received: from [85.158.143.99:30816] by server-2.bemta-4.messagelabs.com id
	02/AD-17550-02F915F4; Sat, 03 Mar 2012 04:33:36 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1330749214!16844925!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2110 invoked from network); 3 Mar 2012 04:33:35 -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;
	3 Mar 2012 04:33:35 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf0-0004iz-3M
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:34 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf0-0003fM-1o
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:34 +0000
Message-Id: <E1S3gf0-0003fM-1o@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:33 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: autoconf: remove (yet
	another) brctl leftover
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1330620116 0
# Node ID 01d95561350bd249fa0fe67741b3eacea66ee153
# Parent  f5bef22b3619f9eb5db941e70222c5b0c36a7254
build: autoconf: remove (yet another) brctl leftover

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r f5bef22b3619 -r 01d95561350b config/Tools.mk.in
--- a/config/Tools.mk.in	Thu Mar 01 16:41:15 2012 +0000
+++ b/config/Tools.mk.in	Thu Mar 01 16:41:56 2012 +0000
@@ -11,7 +11,6 @@
 PYTHON              := @PYTHON@
 PYTHON_PATH         := @PYTHONPATH@
 PERL                := @PERL@
-BRCTL               := @BRCTL@
 IP                  := @IP@
 CURL_CONFIG         := @CURL@
 XML2_CONFIG         := @XML@

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:48:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:48: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 1S3gtU-000261-Am; Sat, 03 Mar 2012 04:48:32 +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 1S3gf5-0000ET-Gd
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:39 +0000
Received: from [85.158.143.35:29083] by server-2.bemta-4.messagelabs.com id
	46/AD-17550-32F915F4; Sat, 03 Mar 2012 04:33:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1330749217!9240404!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10831 invoked from network); 3 Mar 2012 04:33:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf2-0004jT-Ss
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf2-0003hv-RW
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:36 +0000
Message-Id: <E1S3gf2-0003hv-RW@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:36 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: fix python version checking
	issue
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Yongjie Ren <yongjie.ren@intel.com>
# Date 1330622631 0
# Node ID 6b003e5b398dc073c6086738ca023c997b18c7b0
# Parent  d86f2a45701d50ef919139303195adcb703d18b2
tools: fix python version checking issue

Even if python version is 2.4.3 which is newer than the required
version 2.3, the configure script still raises a version issue.  I
tested my patch with python 2.6.6 and 2.4.3. It will fix a syntax
error like the following.

 checking for python version >= 2.3 ... Traceback (most recent call last):
   File "<string>", line 1, in ?
 TypeError: 'str' object is not callable
 no
 configure: error: Python 2.4.3 is too old, minimum required version is 2.3

Signed-off-by: Yongjie Ren <yongjie.ren@intel.com>
Acked-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r d86f2a45701d -r 6b003e5b398d tools/configure
--- a/tools/configure	Thu Mar 01 16:59:33 2012 +0000
+++ b/tools/configure	Thu Mar 01 17:23:51 2012 +0000
@@ -6127,7 +6127,7 @@
 fi
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python version >= 2.3 " >&5
 $as_echo_n "checking for python version >= 2.3 ... " >&6; }
-`$PYTHON -c 'import sys; exit(eval("sys.version_info < (2, 3)"))'`
+`$PYTHON -c 'import sys; sys.exit(eval("sys.version_info < (2, 3)"))'`
 if test "$?" != "0"
 then
     python_version=`$PYTHON -V 2>&1`
diff -r d86f2a45701d -r 6b003e5b398d tools/m4/python_version.m4
--- a/tools/m4/python_version.m4	Thu Mar 01 16:59:33 2012 +0000
+++ b/tools/m4/python_version.m4	Thu Mar 01 17:23:51 2012 +0000
@@ -1,6 +1,6 @@
 AC_DEFUN([AX_CHECK_PYTHON_VERSION],
 [AC_MSG_CHECKING([for python version >= $1.$2 ])
-`$PYTHON -c 'import sys; exit(eval("sys.version_info < ($1, $2)"))'`
+`$PYTHON -c 'import sys; sys.exit(eval("sys.version_info < ($1, $2)"))'`
 if test "$?" != "0"
 then
     python_version=`$PYTHON -V 2>&1`

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:48:33 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:48: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 1S3gtU-000261-Am; Sat, 03 Mar 2012 04:48:32 +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 1S3gf5-0000ET-Gd
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:39 +0000
Received: from [85.158.143.35:29083] by server-2.bemta-4.messagelabs.com id
	46/AD-17550-32F915F4; Sat, 03 Mar 2012 04:33:39 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1330749217!9240404!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10831 invoked from network); 3 Mar 2012 04:33:38 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:38 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf2-0004jT-Ss
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf2-0003hv-RW
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:36 +0000
Message-Id: <E1S3gf2-0003hv-RW@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:36 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: fix python version checking
	issue
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Yongjie Ren <yongjie.ren@intel.com>
# Date 1330622631 0
# Node ID 6b003e5b398dc073c6086738ca023c997b18c7b0
# Parent  d86f2a45701d50ef919139303195adcb703d18b2
tools: fix python version checking issue

Even if python version is 2.4.3 which is newer than the required
version 2.3, the configure script still raises a version issue.  I
tested my patch with python 2.6.6 and 2.4.3. It will fix a syntax
error like the following.

 checking for python version >= 2.3 ... Traceback (most recent call last):
   File "<string>", line 1, in ?
 TypeError: 'str' object is not callable
 no
 configure: error: Python 2.4.3 is too old, minimum required version is 2.3

Signed-off-by: Yongjie Ren <yongjie.ren@intel.com>
Acked-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r d86f2a45701d -r 6b003e5b398d tools/configure
--- a/tools/configure	Thu Mar 01 16:59:33 2012 +0000
+++ b/tools/configure	Thu Mar 01 17:23:51 2012 +0000
@@ -6127,7 +6127,7 @@
 fi
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python version >= 2.3 " >&5
 $as_echo_n "checking for python version >= 2.3 ... " >&6; }
-`$PYTHON -c 'import sys; exit(eval("sys.version_info < (2, 3)"))'`
+`$PYTHON -c 'import sys; sys.exit(eval("sys.version_info < (2, 3)"))'`
 if test "$?" != "0"
 then
     python_version=`$PYTHON -V 2>&1`
diff -r d86f2a45701d -r 6b003e5b398d tools/m4/python_version.m4
--- a/tools/m4/python_version.m4	Thu Mar 01 16:59:33 2012 +0000
+++ b/tools/m4/python_version.m4	Thu Mar 01 17:23:51 2012 +0000
@@ -1,6 +1,6 @@
 AC_DEFUN([AX_CHECK_PYTHON_VERSION],
 [AC_MSG_CHECKING([for python version >= $1.$2 ])
-`$PYTHON -c 'import sys; exit(eval("sys.version_info < ($1, $2)"))'`
+`$PYTHON -c 'import sys; sys.exit(eval("sys.version_info < ($1, $2)"))'`
 if test "$?" != "0"
 then
     python_version=`$PYTHON -V 2>&1`

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:48:49 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:48:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gtk-00027j-EQ; Sat, 03 Mar 2012 04:48:48 +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 1S3gf8-0000B5-NY
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:42 +0000
Received: from [85.158.143.35:29128] by server-1.bemta-4.messagelabs.com id
	56/E9-20925-62F915F4; Sat, 03 Mar 2012 04:33:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1330749220!8629797!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6535 invoked from network); 3 Mar 2012 04:33:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf6-0004ju-40
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf6-0003lb-2l
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:40 +0000
Message-Id: <E1S3gf6-0003lb-2l@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:39 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330628409 0
# Node ID 5e38c834f7958bf8fbd4330d27369e8571285063
# Parent  f0b5164455a8a63b18a58f43a4bfd20a88e9dde5
QEMU_TAG update
---


diff -r f0b5164455a8 -r 5e38c834f795 Config.mk
--- a/Config.mk	Thu Mar 01 18:54:37 2012 +0000
+++ b/Config.mk	Thu Mar 01 19:00:09 2012 +0000
@@ -213,9 +213,9 @@
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 128de2549c5f24e4a437b86bd2e46f023976d50a
-# Mon Feb 20 16:21:47 2012 +0000
-# Intel GPU passthrough: Host bridge config space
+QEMU_TAG ?= 2503d4d5a29e7af8dffd1e11229e11c1917d2ccf
+# Thu Mar 1 18:58:27 2012 +0000
+# qemu-xen: ignore console disconnect events for console/0
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:48:49 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:48:49 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S3gtk-00027j-EQ; Sat, 03 Mar 2012 04:48:48 +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 1S3gf8-0000B5-NY
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:42 +0000
Received: from [85.158.143.35:29128] by server-1.bemta-4.messagelabs.com id
	56/E9-20925-62F915F4; Sat, 03 Mar 2012 04:33:42 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1330749220!8629797!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6535 invoked from network); 3 Mar 2012 04:33:41 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	3 Mar 2012 04:33:41 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf6-0004ju-40
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:40 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf6-0003lb-2l
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:40 +0000
Message-Id: <E1S3gf6-0003lb-2l@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:39 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1330628409 0
# Node ID 5e38c834f7958bf8fbd4330d27369e8571285063
# Parent  f0b5164455a8a63b18a58f43a4bfd20a88e9dde5
QEMU_TAG update
---


diff -r f0b5164455a8 -r 5e38c834f795 Config.mk
--- a/Config.mk	Thu Mar 01 18:54:37 2012 +0000
+++ b/Config.mk	Thu Mar 01 19:00:09 2012 +0000
@@ -213,9 +213,9 @@
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 128de2549c5f24e4a437b86bd2e46f023976d50a
-# Mon Feb 20 16:21:47 2012 +0000
-# Intel GPU passthrough: Host bridge config space
+QEMU_TAG ?= 2503d4d5a29e7af8dffd1e11229e11c1917d2ccf
+# Thu Mar 1 18:58:27 2012 +0000
+# qemu-xen: ignore console disconnect events for console/0
 
 # Short answer -- do not enable this unless you know what you are
 # doing and are prepared for some pain.

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:50:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:50: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 1S3gvJ-0002Cm-Mr; Sat, 03 Mar 2012 04:50: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 1S3gf4-0000B5-Ut
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:39 +0000
Received: from [85.158.143.99:30844] by server-1.bemta-4.messagelabs.com id
	31/E9-20925-22F915F4; Sat, 03 Mar 2012 04:33:38 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1330749216!17391548!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19612 invoked from network); 3 Mar 2012 04:33:37 -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;
	3 Mar 2012 04:33:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf2-0004jL-B6
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf2-0003hQ-9c
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:36 +0000
Message-Id: <E1S3gf2-0003hQ-9c@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: autoconf: fix libdir detection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1330621173 0
# Node ID d86f2a45701d50ef919139303195adcb703d18b2
# Parent  cf744a33ae9aae45f77130d612ea6671dcfde680
build: autoconf: fix libdir detection

If user specifies a libdir it is used, if no libdir is specified
configure checks if $exec_prefix/lib64 is a directory and uses that,
if not lib is used.

$prefix is set by passing the command line option or by default when
calling AC_OUTPUT, but since AC_OUTPUT is called at the end, this is
not really helpful, so we have to set $exec_prefix manually to the
correct value, either $prefix if different than NONE or
$ac_default_prefix.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r cf744a33ae9a -r d86f2a45701d tools/configure
--- a/tools/configure	Thu Mar 01 16:51:39 2012 +0000
+++ b/tools/configure	Thu Mar 01 16:59:33 2012 +0000
@@ -3842,7 +3842,6 @@
 
 
 
-
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 # serial 1 (pkg-config-0.24)
 #
@@ -6437,13 +6436,26 @@
 fi
 
 # Check library path
-if test -d "$prefix/lib64"; then :
-
-    LIB_PATH="lib64"
-
-else
-
-    LIB_PATH="lib"
+if test "\${exec_prefix}/lib" = "$libdir"; then :
+  if test "$exec_prefix" = "NONE" && test "$prefix" != "NONE"; then :
+  exec_prefix=$prefix
+fi
+    if test "$exec_prefix" = "NONE"; then :
+  exec_prefix=$ac_default_prefix
+fi
+    if test -d "${exec_prefix}/lib64"; then :
+
+        LIB_PATH="lib64"
+
+else
+
+        LIB_PATH="lib"
+
+fi
+
+else
+
+    LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}"
 
 fi
 
diff -r cf744a33ae9a -r d86f2a45701d tools/m4/default_lib.m4
--- a/tools/m4/default_lib.m4	Thu Mar 01 16:51:39 2012 +0000
+++ b/tools/m4/default_lib.m4	Thu Mar 01 16:59:33 2012 +0000
@@ -1,8 +1,14 @@
 AC_DEFUN([AX_DEFAULT_LIB],
-[AS_IF([test -d "$prefix/lib64"], [
-    LIB_PATH="lib64"
-],[
-    LIB_PATH="lib"
+[AS_IF([test "\${exec_prefix}/lib" = "$libdir"],
+    [AS_IF([test "$exec_prefix" = "NONE" && test "$prefix" != "NONE"],
+        [exec_prefix=$prefix])
+    AS_IF([test "$exec_prefix" = "NONE"], [exec_prefix=$ac_default_prefix])
+    AS_IF([test -d "${exec_prefix}/lib64"], [
+        LIB_PATH="lib64"
+    ],[
+        LIB_PATH="lib"
+    ])
+], [
+    LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}"
 ])
 AC_SUBST(LIB_PATH)])
-

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

From xen-changelog-bounces@lists.xen.org Sat Mar 03 04:50:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 03 Mar 2012 04:50: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 1S3gvJ-0002Cm-Mr; Sat, 03 Mar 2012 04:50: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 1S3gf4-0000B5-Ut
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:39 +0000
Received: from [85.158.143.99:30844] by server-1.bemta-4.messagelabs.com id
	31/E9-20925-22F915F4; Sat, 03 Mar 2012 04:33:38 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1330749216!17391548!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19612 invoked from network); 3 Mar 2012 04:33:37 -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;
	3 Mar 2012 04:33:37 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf2-0004jL-B6
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:36 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S3gf2-0003hQ-9c
	for xen-changelog@lists.xensource.com; Sat, 03 Mar 2012 04:33:36 +0000
Message-Id: <E1S3gf2-0003hQ-9c@xenbits.xen.org>
Date: Sat, 03 Mar 2012 04:33:35 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: autoconf: fix libdir detection
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1330621173 0
# Node ID d86f2a45701d50ef919139303195adcb703d18b2
# Parent  cf744a33ae9aae45f77130d612ea6671dcfde680
build: autoconf: fix libdir detection

If user specifies a libdir it is used, if no libdir is specified
configure checks if $exec_prefix/lib64 is a directory and uses that,
if not lib is used.

$prefix is set by passing the command line option or by default when
calling AC_OUTPUT, but since AC_OUTPUT is called at the end, this is
not really helpful, so we have to set $exec_prefix manually to the
correct value, either $prefix if different than NONE or
$ac_default_prefix.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r cf744a33ae9a -r d86f2a45701d tools/configure
--- a/tools/configure	Thu Mar 01 16:51:39 2012 +0000
+++ b/tools/configure	Thu Mar 01 16:59:33 2012 +0000
@@ -3842,7 +3842,6 @@
 
 
 
-
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
 # serial 1 (pkg-config-0.24)
 #
@@ -6437,13 +6436,26 @@
 fi
 
 # Check library path
-if test -d "$prefix/lib64"; then :
-
-    LIB_PATH="lib64"
-
-else
-
-    LIB_PATH="lib"
+if test "\${exec_prefix}/lib" = "$libdir"; then :
+  if test "$exec_prefix" = "NONE" && test "$prefix" != "NONE"; then :
+  exec_prefix=$prefix
+fi
+    if test "$exec_prefix" = "NONE"; then :
+  exec_prefix=$ac_default_prefix
+fi
+    if test -d "${exec_prefix}/lib64"; then :
+
+        LIB_PATH="lib64"
+
+else
+
+        LIB_PATH="lib"
+
+fi
+
+else
+
+    LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}"
 
 fi
 
diff -r cf744a33ae9a -r d86f2a45701d tools/m4/default_lib.m4
--- a/tools/m4/default_lib.m4	Thu Mar 01 16:51:39 2012 +0000
+++ b/tools/m4/default_lib.m4	Thu Mar 01 16:59:33 2012 +0000
@@ -1,8 +1,14 @@
 AC_DEFUN([AX_DEFAULT_LIB],
-[AS_IF([test -d "$prefix/lib64"], [
-    LIB_PATH="lib64"
-],[
-    LIB_PATH="lib"
+[AS_IF([test "\${exec_prefix}/lib" = "$libdir"],
+    [AS_IF([test "$exec_prefix" = "NONE" && test "$prefix" != "NONE"],
+        [exec_prefix=$prefix])
+    AS_IF([test "$exec_prefix" = "NONE"], [exec_prefix=$ac_default_prefix])
+    AS_IF([test -d "${exec_prefix}/lib64"], [
+        LIB_PATH="lib64"
+    ],[
+        LIB_PATH="lib"
+    ])
+], [
+    LIB_PATH="${libdir:`expr length "$exec_prefix" + 1`}"
 ])
 AC_SUBST(LIB_PATH)])
-

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 00:22:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 00:22:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S54dw-0006A4-7W; Wed, 07 Mar 2012 00: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 1S54dv-00069x-C5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 00:22:11 +0000
Received: from [85.158.139.83:44267] by server-4.bemta-5.messagelabs.com id
	1A/DE-10788-23AA65F4; Wed, 07 Mar 2012 00:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1331079728!18102664!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11168 invoked from network); 7 Mar 2012 00:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 00: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 1S54ds-0006Cm-D4
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 00:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S54ds-000074-6o
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 00:22:08 +0000
Message-Id: <E1S54ds-000074-6o@xenbits.xen.org>
Date: Wed, 07 Mar 2012 00:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Use deep C states for off-lined
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Boris Ostrovsky <boris.ostrovsky@amd.com>
# Date 1331045493 -3600
# Node ID 8964c223836c2889364aa75cb1a662ff5eacd5d8
# Parent  33659563f5897b3dabc93284252f8570ed825e63
x86: Use deep C states for off-lined CPUs

Currently when a core is taken off-line it is placed in C1 state (unless
MONITOR/MWAIT is used). This patch allows a core to go to deeper C states
resulting in significantly higher power savings.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 33659563f589 -r 8964c223836c xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Fri Mar 02 12:33:25 2012 +0000
+++ b/xen/arch/x86/acpi/cpu_idle.c	Tue Mar 06 15:51:33 2012 +0100
@@ -602,6 +602,23 @@
             __mwait(cx->address, 0);
         }
     }
+    else if ( current_cpu_data.x86_vendor == X86_VENDOR_AMD &&
+              cx->entry_method == ACPI_CSTATE_EM_SYSIO )
+    {
+        /* Intel prefers not to use SYSIO */
+
+        /* Avoid references to shared data after the cache flush */
+        u32 address = cx->address;
+        u32 pmtmr_ioport_local = pmtmr_ioport;
+
+        wbinvd();
+
+        while ( 1 )
+        {
+            inb(address);
+            inl(pmtmr_ioport_local);
+        }
+    }
 
 default_halt:
     for ( ; ; )

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 00:22:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 00:22:15 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S54dw-0006A4-7W; Wed, 07 Mar 2012 00: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 1S54dv-00069x-C5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 00:22:11 +0000
Received: from [85.158.139.83:44267] by server-4.bemta-5.messagelabs.com id
	1A/DE-10788-23AA65F4; Wed, 07 Mar 2012 00:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1331079728!18102664!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11168 invoked from network); 7 Mar 2012 00:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 00: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 1S54ds-0006Cm-D4
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 00:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S54ds-000074-6o
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 00:22:08 +0000
Message-Id: <E1S54ds-000074-6o@xenbits.xen.org>
Date: Wed, 07 Mar 2012 00:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Use deep C states for off-lined
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Boris Ostrovsky <boris.ostrovsky@amd.com>
# Date 1331045493 -3600
# Node ID 8964c223836c2889364aa75cb1a662ff5eacd5d8
# Parent  33659563f5897b3dabc93284252f8570ed825e63
x86: Use deep C states for off-lined CPUs

Currently when a core is taken off-line it is placed in C1 state (unless
MONITOR/MWAIT is used). This patch allows a core to go to deeper C states
resulting in significantly higher power savings.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 33659563f589 -r 8964c223836c xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Fri Mar 02 12:33:25 2012 +0000
+++ b/xen/arch/x86/acpi/cpu_idle.c	Tue Mar 06 15:51:33 2012 +0100
@@ -602,6 +602,23 @@
             __mwait(cx->address, 0);
         }
     }
+    else if ( current_cpu_data.x86_vendor == X86_VENDOR_AMD &&
+              cx->entry_method == ACPI_CSTATE_EM_SYSIO )
+    {
+        /* Intel prefers not to use SYSIO */
+
+        /* Avoid references to shared data after the cache flush */
+        u32 address = cx->address;
+        u32 pmtmr_ioport_local = pmtmr_ioport;
+
+        wbinvd();
+
+        while ( 1 )
+        {
+            inb(address);
+            inl(pmtmr_ioport_local);
+        }
+    }
 
 default_halt:
     for ( ; ; )

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 13:44:12 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 13:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5HA0-0003Up-Fr; Wed, 07 Mar 2012 13:44:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5H9z-0003UY-IV
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:07 +0000
Received: from [193.109.254.147:14984] by server-3.bemta-14.messagelabs.com id
	DC/C5-31466-626675F4; Wed, 07 Mar 2012 13:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1331127791!63731216!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18162 invoked from network); 7 Mar 2012 13:43:12 -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;
	7 Mar 2012 13:43: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 1S5H9w-0007ej-Fm
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5H9w-00031M-6E
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:04 +0000
Message-Id: <E1S5H9w-00031M-6E@xenbits.xen.org>
Date: Wed, 07 Mar 2012 13: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] xenbus: don't free other end
	details too early
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331126863 -3600
# Node ID 504cb8e1146656ef83a7cccfe6c2bcbf24bb2e34
# Parent  151972c92963e10b7943bc6b6381a79caf566b5d
xenbus: don't free other end details too early

The individual drivers' remove functions could legitimately attempt to
access this information (for logging messages if nothing else). Note
that I did not in fact observe a problem anywhere, but I came across
this while looking into the reasons for what turned out to need the
fix at https://lkml.org/lkml/2012/3/5/336 to vsprintf().

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


diff -r 151972c92963 -r 504cb8e11466 drivers/xen/xenbus/xenbus_probe.c
--- a/drivers/xen/xenbus/xenbus_probe.c	Mon Feb 27 17:51:49 2012 +0100
+++ b/drivers/xen/xenbus/xenbus_probe.c	Wed Mar 07 14:27:43 2012 +0100
@@ -332,11 +332,12 @@
 	DPRINTK("%s", dev->nodename);
 
 	free_otherend_watch(dev);
-	free_otherend_details(dev);
 
 	if (drv->remove)
 		drv->remove(dev);
 
+	free_otherend_details(dev);
+
 	xenbus_switch_state(dev, XenbusStateClosed);
 	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 Mar 07 13:44:12 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 13:44:12 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5HA0-0003Up-Fr; Wed, 07 Mar 2012 13:44:08 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5H9z-0003UY-IV
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:07 +0000
Received: from [193.109.254.147:14984] by server-3.bemta-14.messagelabs.com id
	DC/C5-31466-626675F4; Wed, 07 Mar 2012 13:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1331127791!63731216!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18162 invoked from network); 7 Mar 2012 13:43:12 -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;
	7 Mar 2012 13:43: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 1S5H9w-0007ej-Fm
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5H9w-00031M-6E
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:04 +0000
Message-Id: <E1S5H9w-00031M-6E@xenbits.xen.org>
Date: Wed, 07 Mar 2012 13: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] xenbus: don't free other end
	details too early
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331126863 -3600
# Node ID 504cb8e1146656ef83a7cccfe6c2bcbf24bb2e34
# Parent  151972c92963e10b7943bc6b6381a79caf566b5d
xenbus: don't free other end details too early

The individual drivers' remove functions could legitimately attempt to
access this information (for logging messages if nothing else). Note
that I did not in fact observe a problem anywhere, but I came across
this while looking into the reasons for what turned out to need the
fix at https://lkml.org/lkml/2012/3/5/336 to vsprintf().

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


diff -r 151972c92963 -r 504cb8e11466 drivers/xen/xenbus/xenbus_probe.c
--- a/drivers/xen/xenbus/xenbus_probe.c	Mon Feb 27 17:51:49 2012 +0100
+++ b/drivers/xen/xenbus/xenbus_probe.c	Wed Mar 07 14:27:43 2012 +0100
@@ -332,11 +332,12 @@
 	DPRINTK("%s", dev->nodename);
 
 	free_otherend_watch(dev);
-	free_otherend_details(dev);
 
 	if (drv->remove)
 		drv->remove(dev);
 
+	free_otherend_details(dev);
+
 	xenbus_switch_state(dev, XenbusStateClosed);
 	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 Mar 07 13:44:14 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 13: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 1S5HA1-0003VD-L4; Wed, 07 Mar 2012 13:44:09 +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 1S5HA0-0003Ui-Ft
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:08 +0000
Received: from [193.109.254.147:15084] by server-4.bemta-14.messagelabs.com id
	C3/3C-08205-726675F4; Wed, 07 Mar 2012 13:44:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1331127812!59902883!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17288 invoked from network); 7 Mar 2012 13:43:33 -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;
	7 Mar 2012 13:43:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5H9x-0007en-5K
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5H9x-00032G-0O
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:05 +0000
Message-Id: <E1S5H9x-00032G-0O@xenbits.xen.org>
Date: Wed, 07 Mar 2012 13:44: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] blkfront: properly name all
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331127193 -3600
# Node ID 0db21b31377ffd8e08d5aa43e346be6a8e9a304f
# Parent  99dc6737898bb6f83bcaa78db18aa0253fc08c24
blkfront: properly name all devices

- devices beyond xvdzz didn't get proper names assigned at all
- devices using SCSI_CDROM_MAJOR got named sdXX rather than srNN
- devices with unknown majors got mistakenly converted to use major 202
- extended devices with minors not representable within the kernel's
  major/minor bit split spilled into foreign majors

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


diff -r 99dc6737898b -r 0db21b31377f drivers/xen/blkfront/block.h
--- a/drivers/xen/blkfront/block.h	Wed Mar 07 14:28:54 2012 +0100
+++ b/drivers/xen/blkfront/block.h	Wed Mar 07 14:33:13 2012 +0100
@@ -64,20 +64,12 @@
 #define DPRINTK_IOCTL(_f, _a...) ((void)0)
 #endif
 
-struct xlbd_type_info
-{
-	int partn_shift;
-	int disks_per_major;
-	char *devname;
-	char *diskname;
-};
-
 struct xlbd_major_info
 {
 	int major;
 	int index;
 	int usage;
-	struct xlbd_type_info *type;
+	const struct xlbd_type_info *type;
 	struct xlbd_minor_state *minors;
 };
 
diff -r 99dc6737898b -r 0db21b31377f drivers/xen/blkfront/vbd.c
--- a/drivers/xen/blkfront/vbd.c	Wed Mar 07 14:28:54 2012 +0100
+++ b/drivers/xen/blkfront/vbd.c	Wed Mar 07 14:33:13 2012 +0100
@@ -65,46 +65,63 @@
  */
 
 #define NUM_IDE_MAJORS 10
-#define NUM_SCSI_MAJORS 17
+#define NUM_SD_MAJORS 16
 #define NUM_VBD_MAJORS 2
 
-static struct xlbd_type_info xlbd_ide_type = {
+struct xlbd_type_info
+{
+	int partn_shift;
+	int disks_per_major;
+	char *devname;
+	char *diskname;
+};
+
+static const struct xlbd_type_info xlbd_ide_type = {
 	.partn_shift = 6,
 	.disks_per_major = 2,
 	.devname = "ide",
 	.diskname = "hd",
 };
 
-static struct xlbd_type_info xlbd_scsi_type = {
+static const struct xlbd_type_info xlbd_sd_type = {
 	.partn_shift = 4,
 	.disks_per_major = 16,
 	.devname = "sd",
 	.diskname = "sd",
 };
 
-static struct xlbd_type_info xlbd_vbd_type = {
+static const struct xlbd_type_info xlbd_sr_type = {
+	.partn_shift = 0,
+	.disks_per_major = 256,
+	.devname = "sr",
+	.diskname = "sr",
+};
+
+static const struct xlbd_type_info xlbd_vbd_type = {
 	.partn_shift = 4,
 	.disks_per_major = 16,
 	.devname = "xvd",
 	.diskname = "xvd",
 };
 
-static struct xlbd_type_info xlbd_vbd_type_ext = {
+static const struct xlbd_type_info xlbd_vbd_type_ext = {
 	.partn_shift = 8,
 	.disks_per_major = 256,
 	.devname = "xvd",
 	.diskname = "xvd",
 };
 
-static struct xlbd_major_info *major_info[NUM_IDE_MAJORS + NUM_SCSI_MAJORS +
+static struct xlbd_major_info *major_info[NUM_IDE_MAJORS + NUM_SD_MAJORS + 1 +
 					 NUM_VBD_MAJORS];
 
 #define XLBD_MAJOR_IDE_START	0
-#define XLBD_MAJOR_SCSI_START	(NUM_IDE_MAJORS)
-#define XLBD_MAJOR_VBD_START	(NUM_IDE_MAJORS + NUM_SCSI_MAJORS)
+#define XLBD_MAJOR_SD_START	(NUM_IDE_MAJORS)
+#define XLBD_MAJOR_SR_START	(NUM_IDE_MAJORS + NUM_SD_MAJORS)
+#define XLBD_MAJOR_VBD_START	(NUM_IDE_MAJORS + NUM_SD_MAJORS + 1)
 
-#define XLBD_MAJOR_IDE_RANGE	XLBD_MAJOR_IDE_START ... XLBD_MAJOR_SCSI_START - 1
-#define XLBD_MAJOR_SCSI_RANGE	XLBD_MAJOR_SCSI_START ... XLBD_MAJOR_VBD_START - 1
+#define XLBD_MAJOR_IDE_RANGE	XLBD_MAJOR_IDE_START ... XLBD_MAJOR_SD_START - 1
+#define XLBD_MAJOR_SD_RANGE	XLBD_MAJOR_SD_START ... XLBD_MAJOR_SR_START - 1
+#define XLBD_MAJOR_SR_RANGE	XLBD_MAJOR_SR_START
 #define XLBD_MAJOR_VBD_RANGE	XLBD_MAJOR_VBD_START ... XLBD_MAJOR_VBD_START + NUM_VBD_MAJORS - 1
 
 #define XLBD_MAJOR_VBD_ALT(idx) ((idx) ^ XLBD_MAJOR_VBD_START ^ (XLBD_MAJOR_VBD_START + 1))
@@ -155,9 +172,13 @@
 		ptr->type = &xlbd_ide_type;
 		ptr->index = index - XLBD_MAJOR_IDE_START;
 		break;
-	case XLBD_MAJOR_SCSI_RANGE:
-		ptr->type = &xlbd_scsi_type;
-		ptr->index = index - XLBD_MAJOR_SCSI_START;
+	case XLBD_MAJOR_SD_RANGE:
+		ptr->type = &xlbd_sd_type;
+		ptr->index = index - XLBD_MAJOR_SD_START;
+		break;
+	case XLBD_MAJOR_SR_RANGE:
+		ptr->type = &xlbd_sr_type;
+		ptr->index = index - XLBD_MAJOR_SR_START;
 		break;
 	case XLBD_MAJOR_VBD_RANGE:
 		ptr->index = 0;
@@ -212,20 +233,21 @@
 	case IDE7_MAJOR: index = 7; break;
 	case IDE8_MAJOR: index = 8; break;
 	case IDE9_MAJOR: index = 9; break;
-	case SCSI_DISK0_MAJOR: index = 10; break;
+	case SCSI_DISK0_MAJOR: index = XLBD_MAJOR_SD_START; break;
 	case SCSI_DISK1_MAJOR ... SCSI_DISK7_MAJOR:
-		index = 11 + major - SCSI_DISK1_MAJOR;
+		index = XLBD_MAJOR_SD_START + 1 + major - SCSI_DISK1_MAJOR;
 		break;
-        case SCSI_DISK8_MAJOR ... SCSI_DISK15_MAJOR:
-                index = 18 + major - SCSI_DISK8_MAJOR;
-                break;
-        case SCSI_CDROM_MAJOR: index = 26; break;
-        default:
-		if (!VDEV_IS_EXTENDED(vdevice))
-			index = 27;
-		else
-			index = 28;
+	case SCSI_DISK8_MAJOR ... SCSI_DISK15_MAJOR:
+		index = XLBD_MAJOR_SD_START + 8 + major - SCSI_DISK8_MAJOR;
 		break;
+	case SCSI_CDROM_MAJOR:
+		index = XLBD_MAJOR_SR_START;
+		break;
+	case XENVBD_MAJOR:
+		index = XLBD_MAJOR_VBD_START + !!VDEV_IS_EXTENDED(vdevice);
+		break;
+	default:
+		return NULL;
 	}
 
 	mi = ((major_info[index] != NULL) ? major_info[index] :
@@ -323,6 +345,14 @@
 	spin_unlock(&ms->lock);
 }
 
+static char *encode_disk_name(char *ptr, unsigned int n)
+{
+	if (n >= 26)
+		ptr = encode_disk_name(ptr, n / 26 - 1);
+	*ptr = 'a' + n % 26;
+	return ptr + 1;
+}
+
 static int
 xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size,
 		     struct blkfront_info *info)
@@ -366,6 +396,7 @@
 	struct xlbd_major_info *mi;
 	int nr_minors = 1;
 	int err = -ENODEV;
+	char *ptr;
 	unsigned int offset;
 
 	BUG_ON(info->gd != NULL);
@@ -389,33 +420,21 @@
 	if (gd == NULL)
 		goto release;
 
-	offset =  mi->index * mi->type->disks_per_major +
-			(minor >> mi->type->partn_shift);
-	if (nr_minors > 1) {
-		if (offset < 26) {
-			sprintf(gd->disk_name, "%s%c",
-				 mi->type->diskname, 'a' + offset );
-		}
-		else {
-			sprintf(gd->disk_name, "%s%c%c",
-				mi->type->diskname,
-				'a' + ((offset/26)-1), 'a' + (offset%26) );
-		}
-	}
-	else {
-		if (offset < 26) {
-			sprintf(gd->disk_name, "%s%c%d",
-				mi->type->diskname,
-				'a' + offset,
-				minor & ((1 << mi->type->partn_shift) - 1));
-		}
-		else {
-			sprintf(gd->disk_name, "%s%c%c%d",
-				mi->type->diskname,
-				'a' + ((offset/26)-1), 'a' + (offset%26),
-				minor & ((1 << mi->type->partn_shift) - 1));
-		}
-	}
+	strcpy(gd->disk_name, mi->type->diskname);
+	ptr = gd->disk_name + strlen(mi->type->diskname);
+	offset = mi->index * mi->type->disks_per_major +
+		 (minor >> mi->type->partn_shift);
+	if (mi->type->partn_shift) {
+		ptr = encode_disk_name(ptr, offset);
+		offset = minor & ((1 << mi->type->partn_shift) - 1);
+	} else
+		gd->flags |= GENHD_FL_CD;
+	BUG_ON(ptr >= gd->disk_name + ARRAY_SIZE(gd->disk_name));
+	if (nr_minors > 1)
+		*ptr = 0;
+	else
+		snprintf(ptr, gd->disk_name + ARRAY_SIZE(gd->disk_name) - ptr,
+			 "%u", offset);
 
 	gd->major = mi->major;
 	gd->first_minor = minor;
@@ -475,6 +494,11 @@
 	else {
 		major = XENVBD_MAJOR;
 		minor = BLKIF_MINOR_EXT(vdevice);
+		if (minor >> MINORBITS) {
+			printk(KERN_WARNING "blkfront: %#x's minor (%#x)"
+			       " out of range; ignoring\n", vdevice, minor);
+			return -ENODEV;
+		}
 	}
 
 	info->dev = MKDEV(major, minor);

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 13:44:14 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 13: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 1S5HA1-0003VD-L4; Wed, 07 Mar 2012 13:44:09 +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 1S5HA0-0003Ui-Ft
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:08 +0000
Received: from [193.109.254.147:15084] by server-4.bemta-14.messagelabs.com id
	C3/3C-08205-726675F4; Wed, 07 Mar 2012 13:44:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1331127812!59902883!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17288 invoked from network); 7 Mar 2012 13:43:33 -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;
	7 Mar 2012 13:43:33 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5H9x-0007en-5K
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5H9x-00032G-0O
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:05 +0000
Message-Id: <E1S5H9x-00032G-0O@xenbits.xen.org>
Date: Wed, 07 Mar 2012 13:44: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] blkfront: properly name all
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331127193 -3600
# Node ID 0db21b31377ffd8e08d5aa43e346be6a8e9a304f
# Parent  99dc6737898bb6f83bcaa78db18aa0253fc08c24
blkfront: properly name all devices

- devices beyond xvdzz didn't get proper names assigned at all
- devices using SCSI_CDROM_MAJOR got named sdXX rather than srNN
- devices with unknown majors got mistakenly converted to use major 202
- extended devices with minors not representable within the kernel's
  major/minor bit split spilled into foreign majors

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


diff -r 99dc6737898b -r 0db21b31377f drivers/xen/blkfront/block.h
--- a/drivers/xen/blkfront/block.h	Wed Mar 07 14:28:54 2012 +0100
+++ b/drivers/xen/blkfront/block.h	Wed Mar 07 14:33:13 2012 +0100
@@ -64,20 +64,12 @@
 #define DPRINTK_IOCTL(_f, _a...) ((void)0)
 #endif
 
-struct xlbd_type_info
-{
-	int partn_shift;
-	int disks_per_major;
-	char *devname;
-	char *diskname;
-};
-
 struct xlbd_major_info
 {
 	int major;
 	int index;
 	int usage;
-	struct xlbd_type_info *type;
+	const struct xlbd_type_info *type;
 	struct xlbd_minor_state *minors;
 };
 
diff -r 99dc6737898b -r 0db21b31377f drivers/xen/blkfront/vbd.c
--- a/drivers/xen/blkfront/vbd.c	Wed Mar 07 14:28:54 2012 +0100
+++ b/drivers/xen/blkfront/vbd.c	Wed Mar 07 14:33:13 2012 +0100
@@ -65,46 +65,63 @@
  */
 
 #define NUM_IDE_MAJORS 10
-#define NUM_SCSI_MAJORS 17
+#define NUM_SD_MAJORS 16
 #define NUM_VBD_MAJORS 2
 
-static struct xlbd_type_info xlbd_ide_type = {
+struct xlbd_type_info
+{
+	int partn_shift;
+	int disks_per_major;
+	char *devname;
+	char *diskname;
+};
+
+static const struct xlbd_type_info xlbd_ide_type = {
 	.partn_shift = 6,
 	.disks_per_major = 2,
 	.devname = "ide",
 	.diskname = "hd",
 };
 
-static struct xlbd_type_info xlbd_scsi_type = {
+static const struct xlbd_type_info xlbd_sd_type = {
 	.partn_shift = 4,
 	.disks_per_major = 16,
 	.devname = "sd",
 	.diskname = "sd",
 };
 
-static struct xlbd_type_info xlbd_vbd_type = {
+static const struct xlbd_type_info xlbd_sr_type = {
+	.partn_shift = 0,
+	.disks_per_major = 256,
+	.devname = "sr",
+	.diskname = "sr",
+};
+
+static const struct xlbd_type_info xlbd_vbd_type = {
 	.partn_shift = 4,
 	.disks_per_major = 16,
 	.devname = "xvd",
 	.diskname = "xvd",
 };
 
-static struct xlbd_type_info xlbd_vbd_type_ext = {
+static const struct xlbd_type_info xlbd_vbd_type_ext = {
 	.partn_shift = 8,
 	.disks_per_major = 256,
 	.devname = "xvd",
 	.diskname = "xvd",
 };
 
-static struct xlbd_major_info *major_info[NUM_IDE_MAJORS + NUM_SCSI_MAJORS +
+static struct xlbd_major_info *major_info[NUM_IDE_MAJORS + NUM_SD_MAJORS + 1 +
 					 NUM_VBD_MAJORS];
 
 #define XLBD_MAJOR_IDE_START	0
-#define XLBD_MAJOR_SCSI_START	(NUM_IDE_MAJORS)
-#define XLBD_MAJOR_VBD_START	(NUM_IDE_MAJORS + NUM_SCSI_MAJORS)
+#define XLBD_MAJOR_SD_START	(NUM_IDE_MAJORS)
+#define XLBD_MAJOR_SR_START	(NUM_IDE_MAJORS + NUM_SD_MAJORS)
+#define XLBD_MAJOR_VBD_START	(NUM_IDE_MAJORS + NUM_SD_MAJORS + 1)
 
-#define XLBD_MAJOR_IDE_RANGE	XLBD_MAJOR_IDE_START ... XLBD_MAJOR_SCSI_START - 1
-#define XLBD_MAJOR_SCSI_RANGE	XLBD_MAJOR_SCSI_START ... XLBD_MAJOR_VBD_START - 1
+#define XLBD_MAJOR_IDE_RANGE	XLBD_MAJOR_IDE_START ... XLBD_MAJOR_SD_START - 1
+#define XLBD_MAJOR_SD_RANGE	XLBD_MAJOR_SD_START ... XLBD_MAJOR_SR_START - 1
+#define XLBD_MAJOR_SR_RANGE	XLBD_MAJOR_SR_START
 #define XLBD_MAJOR_VBD_RANGE	XLBD_MAJOR_VBD_START ... XLBD_MAJOR_VBD_START + NUM_VBD_MAJORS - 1
 
 #define XLBD_MAJOR_VBD_ALT(idx) ((idx) ^ XLBD_MAJOR_VBD_START ^ (XLBD_MAJOR_VBD_START + 1))
@@ -155,9 +172,13 @@
 		ptr->type = &xlbd_ide_type;
 		ptr->index = index - XLBD_MAJOR_IDE_START;
 		break;
-	case XLBD_MAJOR_SCSI_RANGE:
-		ptr->type = &xlbd_scsi_type;
-		ptr->index = index - XLBD_MAJOR_SCSI_START;
+	case XLBD_MAJOR_SD_RANGE:
+		ptr->type = &xlbd_sd_type;
+		ptr->index = index - XLBD_MAJOR_SD_START;
+		break;
+	case XLBD_MAJOR_SR_RANGE:
+		ptr->type = &xlbd_sr_type;
+		ptr->index = index - XLBD_MAJOR_SR_START;
 		break;
 	case XLBD_MAJOR_VBD_RANGE:
 		ptr->index = 0;
@@ -212,20 +233,21 @@
 	case IDE7_MAJOR: index = 7; break;
 	case IDE8_MAJOR: index = 8; break;
 	case IDE9_MAJOR: index = 9; break;
-	case SCSI_DISK0_MAJOR: index = 10; break;
+	case SCSI_DISK0_MAJOR: index = XLBD_MAJOR_SD_START; break;
 	case SCSI_DISK1_MAJOR ... SCSI_DISK7_MAJOR:
-		index = 11 + major - SCSI_DISK1_MAJOR;
+		index = XLBD_MAJOR_SD_START + 1 + major - SCSI_DISK1_MAJOR;
 		break;
-        case SCSI_DISK8_MAJOR ... SCSI_DISK15_MAJOR:
-                index = 18 + major - SCSI_DISK8_MAJOR;
-                break;
-        case SCSI_CDROM_MAJOR: index = 26; break;
-        default:
-		if (!VDEV_IS_EXTENDED(vdevice))
-			index = 27;
-		else
-			index = 28;
+	case SCSI_DISK8_MAJOR ... SCSI_DISK15_MAJOR:
+		index = XLBD_MAJOR_SD_START + 8 + major - SCSI_DISK8_MAJOR;
 		break;
+	case SCSI_CDROM_MAJOR:
+		index = XLBD_MAJOR_SR_START;
+		break;
+	case XENVBD_MAJOR:
+		index = XLBD_MAJOR_VBD_START + !!VDEV_IS_EXTENDED(vdevice);
+		break;
+	default:
+		return NULL;
 	}
 
 	mi = ((major_info[index] != NULL) ? major_info[index] :
@@ -323,6 +345,14 @@
 	spin_unlock(&ms->lock);
 }
 
+static char *encode_disk_name(char *ptr, unsigned int n)
+{
+	if (n >= 26)
+		ptr = encode_disk_name(ptr, n / 26 - 1);
+	*ptr = 'a' + n % 26;
+	return ptr + 1;
+}
+
 static int
 xlvbd_init_blk_queue(struct gendisk *gd, u16 sector_size,
 		     struct blkfront_info *info)
@@ -366,6 +396,7 @@
 	struct xlbd_major_info *mi;
 	int nr_minors = 1;
 	int err = -ENODEV;
+	char *ptr;
 	unsigned int offset;
 
 	BUG_ON(info->gd != NULL);
@@ -389,33 +420,21 @@
 	if (gd == NULL)
 		goto release;
 
-	offset =  mi->index * mi->type->disks_per_major +
-			(minor >> mi->type->partn_shift);
-	if (nr_minors > 1) {
-		if (offset < 26) {
-			sprintf(gd->disk_name, "%s%c",
-				 mi->type->diskname, 'a' + offset );
-		}
-		else {
-			sprintf(gd->disk_name, "%s%c%c",
-				mi->type->diskname,
-				'a' + ((offset/26)-1), 'a' + (offset%26) );
-		}
-	}
-	else {
-		if (offset < 26) {
-			sprintf(gd->disk_name, "%s%c%d",
-				mi->type->diskname,
-				'a' + offset,
-				minor & ((1 << mi->type->partn_shift) - 1));
-		}
-		else {
-			sprintf(gd->disk_name, "%s%c%c%d",
-				mi->type->diskname,
-				'a' + ((offset/26)-1), 'a' + (offset%26),
-				minor & ((1 << mi->type->partn_shift) - 1));
-		}
-	}
+	strcpy(gd->disk_name, mi->type->diskname);
+	ptr = gd->disk_name + strlen(mi->type->diskname);
+	offset = mi->index * mi->type->disks_per_major +
+		 (minor >> mi->type->partn_shift);
+	if (mi->type->partn_shift) {
+		ptr = encode_disk_name(ptr, offset);
+		offset = minor & ((1 << mi->type->partn_shift) - 1);
+	} else
+		gd->flags |= GENHD_FL_CD;
+	BUG_ON(ptr >= gd->disk_name + ARRAY_SIZE(gd->disk_name));
+	if (nr_minors > 1)
+		*ptr = 0;
+	else
+		snprintf(ptr, gd->disk_name + ARRAY_SIZE(gd->disk_name) - ptr,
+			 "%u", offset);
 
 	gd->major = mi->major;
 	gd->first_minor = minor;
@@ -475,6 +494,11 @@
 	else {
 		major = XENVBD_MAJOR;
 		minor = BLKIF_MINOR_EXT(vdevice);
+		if (minor >> MINORBITS) {
+			printk(KERN_WARNING "blkfront: %#x's minor (%#x)"
+			       " out of range; ignoring\n", vdevice, minor);
+			return -ENODEV;
+		}
 	}
 
 	info->dev = MKDEV(major, minor);

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 13:44:14 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 13: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 1S5HA0-0003Uu-IT; Wed, 07 Mar 2012 13:44:08 +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 1S5H9z-0003Ua-Q2
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:08 +0000
Received: from [85.158.143.99:9707] by server-2.bemta-4.messagelabs.com id
	35/C1-17550-726675F4; Wed, 07 Mar 2012 13:44:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1331127845!17181825!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5603 invoked from network); 7 Mar 2012 13:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 13: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 1S5H9w-0007ek-SZ
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5H9w-00031o-Jc
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:04 +0000
Message-Id: <E1S5H9w-00031o-Jc@xenbits.xen.org>
Date: Wed, 07 Mar 2012 13:44: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] blkfront: module exit handling
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331126934 -3600
# Node ID 99dc6737898bb6f83bcaa78db18aa0253fc08c24
# Parent  504cb8e1146656ef83a7cccfe6c2bcbf24bb2e34
blkfront: module exit handling adjustments

blkdev majors and minor tracking data must be released upon exit, or
else the module can't attach to devices using the same majors upon
being loaded again.

Also replace the literal uses of 202 for the Xen VBD major with the
upstream manifest constant.

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


diff -r 504cb8e11466 -r 99dc6737898b drivers/xen/blkfront/blkfront.c
--- a/drivers/xen/blkfront/blkfront.c	Wed Mar 07 14:27:43 2012 +0100
+++ b/drivers/xen/blkfront/blkfront.c	Wed Mar 07 14:28:54 2012 +0100
@@ -962,7 +962,8 @@
 
 static void __exit xlblk_exit(void)
 {
-	return xenbus_unregister_driver(&blkfront_driver);
+	xenbus_unregister_driver(&blkfront_driver);
+	xlbd_release_major_info();
 }
 module_exit(xlblk_exit);
 
diff -r 504cb8e11466 -r 99dc6737898b drivers/xen/blkfront/block.h
--- a/drivers/xen/blkfront/block.h	Wed Mar 07 14:27:43 2012 +0100
+++ b/drivers/xen/blkfront/block.h	Wed Mar 07 14:28:54 2012 +0100
@@ -156,4 +156,6 @@
 }
 #endif
 
+void xlbd_release_major_info(void);
+
 #endif /* __XEN_DRIVERS_BLOCK_H__ */
diff -r 504cb8e11466 -r 99dc6737898b drivers/xen/blkfront/vbd.c
--- a/drivers/xen/blkfront/vbd.c	Wed Mar 07 14:27:43 2012 +0100
+++ b/drivers/xen/blkfront/vbd.c	Wed Mar 07 14:28:54 2012 +0100
@@ -40,6 +40,10 @@
 #include <xen/platform-compat.h>
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+#define XENVBD_MAJOR 202
+#endif
+
 #define BLKIF_MAJOR(dev) ((dev)>>8)
 #define BLKIF_MINOR(dev) ((dev) & 0xff)
 
@@ -163,7 +167,7 @@
 			ptr->type = &xlbd_vbd_type_ext;
 
 		/* 
-		 * if someone already registered block major 202,
+		 * if someone already registered block major XENVBD_MAJOR,
 		 * don't try to register it again
 		 */
 		if (major_info[XLBD_MAJOR_VBD_ALT(index)] != NULL) {
@@ -238,6 +242,32 @@
 	/* XXX: release major if 0 */
 }
 
+void __exit
+xlbd_release_major_info(void)
+{
+	unsigned int i;
+	int vbd_done = 0;
+
+	for (i = 0; i < ARRAY_SIZE(major_info); ++i) {
+		struct xlbd_major_info *mi = major_info[i];
+
+		if (!mi)
+			continue;
+		if (mi->usage)
+			printk(KERN_WARNING
+			       "vbd: major %u still in use (%u times)\n",
+			       mi->major, mi->usage);
+		if (mi->major != XENVBD_MAJOR || !vbd_done) {
+			unregister_blkdev(mi->major, mi->type->devname);
+			kfree(mi->minors->bitmap);
+			kfree(mi->minors);
+		}
+		if (mi->major == XENVBD_MAJOR)
+			vbd_done = 1;
+		kfree(mi);
+	}
+}
+
 static int
 xlbd_reserve_minors(struct xlbd_major_info *mi, unsigned int minor,
 		    unsigned int nr_minors)
@@ -443,7 +473,7 @@
 		minor = BLKIF_MINOR(vdevice);
 	}
 	else {
-		major = 202;
+		major = XENVBD_MAJOR;
 		minor = BLKIF_MINOR_EXT(vdevice);
 	}
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 13:44:14 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 13: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 1S5HA0-0003Uu-IT; Wed, 07 Mar 2012 13:44:08 +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 1S5H9z-0003Ua-Q2
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:08 +0000
Received: from [85.158.143.99:9707] by server-2.bemta-4.messagelabs.com id
	35/C1-17550-726675F4; Wed, 07 Mar 2012 13:44:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1331127845!17181825!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5603 invoked from network); 7 Mar 2012 13:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 13: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 1S5H9w-0007ek-SZ
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5H9w-00031o-Jc
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 13:44:04 +0000
Message-Id: <E1S5H9w-00031o-Jc@xenbits.xen.org>
Date: Wed, 07 Mar 2012 13:44: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] blkfront: module exit handling
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331126934 -3600
# Node ID 99dc6737898bb6f83bcaa78db18aa0253fc08c24
# Parent  504cb8e1146656ef83a7cccfe6c2bcbf24bb2e34
blkfront: module exit handling adjustments

blkdev majors and minor tracking data must be released upon exit, or
else the module can't attach to devices using the same majors upon
being loaded again.

Also replace the literal uses of 202 for the Xen VBD major with the
upstream manifest constant.

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


diff -r 504cb8e11466 -r 99dc6737898b drivers/xen/blkfront/blkfront.c
--- a/drivers/xen/blkfront/blkfront.c	Wed Mar 07 14:27:43 2012 +0100
+++ b/drivers/xen/blkfront/blkfront.c	Wed Mar 07 14:28:54 2012 +0100
@@ -962,7 +962,8 @@
 
 static void __exit xlblk_exit(void)
 {
-	return xenbus_unregister_driver(&blkfront_driver);
+	xenbus_unregister_driver(&blkfront_driver);
+	xlbd_release_major_info();
 }
 module_exit(xlblk_exit);
 
diff -r 504cb8e11466 -r 99dc6737898b drivers/xen/blkfront/block.h
--- a/drivers/xen/blkfront/block.h	Wed Mar 07 14:27:43 2012 +0100
+++ b/drivers/xen/blkfront/block.h	Wed Mar 07 14:28:54 2012 +0100
@@ -156,4 +156,6 @@
 }
 #endif
 
+void xlbd_release_major_info(void);
+
 #endif /* __XEN_DRIVERS_BLOCK_H__ */
diff -r 504cb8e11466 -r 99dc6737898b drivers/xen/blkfront/vbd.c
--- a/drivers/xen/blkfront/vbd.c	Wed Mar 07 14:27:43 2012 +0100
+++ b/drivers/xen/blkfront/vbd.c	Wed Mar 07 14:28:54 2012 +0100
@@ -40,6 +40,10 @@
 #include <xen/platform-compat.h>
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,23)
+#define XENVBD_MAJOR 202
+#endif
+
 #define BLKIF_MAJOR(dev) ((dev)>>8)
 #define BLKIF_MINOR(dev) ((dev) & 0xff)
 
@@ -163,7 +167,7 @@
 			ptr->type = &xlbd_vbd_type_ext;
 
 		/* 
-		 * if someone already registered block major 202,
+		 * if someone already registered block major XENVBD_MAJOR,
 		 * don't try to register it again
 		 */
 		if (major_info[XLBD_MAJOR_VBD_ALT(index)] != NULL) {
@@ -238,6 +242,32 @@
 	/* XXX: release major if 0 */
 }
 
+void __exit
+xlbd_release_major_info(void)
+{
+	unsigned int i;
+	int vbd_done = 0;
+
+	for (i = 0; i < ARRAY_SIZE(major_info); ++i) {
+		struct xlbd_major_info *mi = major_info[i];
+
+		if (!mi)
+			continue;
+		if (mi->usage)
+			printk(KERN_WARNING
+			       "vbd: major %u still in use (%u times)\n",
+			       mi->major, mi->usage);
+		if (mi->major != XENVBD_MAJOR || !vbd_done) {
+			unregister_blkdev(mi->major, mi->type->devname);
+			kfree(mi->minors->bitmap);
+			kfree(mi->minors);
+		}
+		if (mi->major == XENVBD_MAJOR)
+			vbd_done = 1;
+		kfree(mi);
+	}
+}
+
 static int
 xlbd_reserve_minors(struct xlbd_major_info *mi, unsigned int minor,
 		    unsigned int nr_minors)
@@ -443,7 +473,7 @@
 		minor = BLKIF_MINOR(vdevice);
 	}
 	else {
-		major = 202;
+		major = XENVBD_MAJOR;
 		minor = BLKIF_MINOR_EXT(vdevice);
 	}
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGX-0004Qc-Pc; Wed, 07 Mar 2012 19: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 1S5MGW-0004Q6-8b
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:12 +0000
Received: from [85.158.143.99:50200] by server-1.bemta-4.messagelabs.com id
	6E/E1-20925-FC2B75F4; Wed, 07 Mar 2012 19:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1331147469!17529190!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7320 invoked from network); 7 Mar 2012 19:11: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;
	7 Mar 2012 19: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 1S5MGT-0003Wj-8c
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGT-0001Y5-3D
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:09 +0000
Message-Id: <E1S5MGT-0001Y5-3D@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/xenoprof: fix 32-bit guest stack
	handling after c/s 24537:3c0a533d3af0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331048581 -3600
# Node ID e88a4995121200850e153b7f8554dbbd091482ce
# Parent  33980e36597b9f780ef515210863034b5e3080bf
x86/xenoprof: fix 32-bit guest stack handling after c/s 24537:3c0a533d3af0

32-bit guests don't have 64-bit precudrure return addresses - both
elements of struct frame_head_32bit should be 32 bits wide, not just
the frame link pointer.

Further, consolidate the whole handling here (also in the native size
guest case) to properly use guest handles and guest memory accessors.

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


diff -r 33980e36597b -r e88a49951212 xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Tue Mar 06 16:41:41 2012 +0100
+++ b/xen/arch/x86/oprofile/backtrace.c	Tue Mar 06 16:43:01 2012 +0100
@@ -13,18 +13,22 @@
 #include<xen/types.h>
 #include<asm/page.h>
 #include<xen/xenoprof.h>
-#include<asm/guest_access.h>
+#include<xen/guest_access.h>
 
 struct frame_head {
     struct frame_head * ebp;
     unsigned long ret;
 } __attribute__((packed));
+typedef struct frame_head frame_head_t;
+DEFINE_XEN_GUEST_HANDLE(frame_head_t);
 
 #ifdef CONFIG_X86_64
 struct frame_head_32bit {
     uint32_t ebp;
-    unsigned long ret;
+    uint32_t ret;
 } __attribute__((packed));
+typedef struct frame_head_32bit frame_head32_t;
+DEFINE_COMPAT_HANDLE(frame_head32_t);
 #endif
 
 static struct frame_head *
@@ -54,44 +58,47 @@
 
 static struct frame_head *
 dump_guest_backtrace(struct domain *d, struct vcpu *vcpu, 
-		     struct frame_head * head, int mode)
+		     const struct frame_head *head, int mode)
 {
-    struct frame_head bufhead[2];
-    XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char);
+    frame_head_t bufhead;
 
 #ifdef CONFIG_X86_64
     if ( is_32bit_vcpu(vcpu) )
     {
-        struct frame_head_32bit bufhead32[2];
+        __compat_handle_const_frame_head32_t guest_head =
+            { .c = (unsigned long)head };
+        frame_head32_t bufhead32;
+
         /* Also check accessibility of one struct frame_head beyond */
-        if (!guest_handle_okay(guest_head, sizeof(bufhead32)))
+        if (!compat_handle_okay(guest_head, 2))
             return 0;
-        if (__copy_from_guest_offset((char *)bufhead32, guest_head, 0, 
-                                     sizeof(bufhead32)))
+        if (__copy_from_compat(&bufhead32, guest_head, 1))
             return 0;
-        bufhead[0].ebp=(struct frame_head *)(unsigned long)bufhead32[0].ebp;
-        bufhead[0].ret=bufhead32[0].ret;
+        bufhead.ebp = (struct frame_head *)(unsigned long)bufhead32.ebp;
+        bufhead.ret = bufhead32.ret;
     }
     else
 #endif
     {
+        XEN_GUEST_HANDLE(const_frame_head_t) guest_head =
+            const_guest_handle_from_ptr(head, frame_head_t);
+
         /* Also check accessibility of one struct frame_head beyond */
-        if (!guest_handle_okay(guest_head, sizeof(bufhead)))
+        if (!guest_handle_okay(guest_head, 2))
             return 0;
-        if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
-                                     sizeof(bufhead)))
+        if (__copy_from_guest(&bufhead, guest_head, 1))
             return 0;
     }
     
-    if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode))
+    if (!xenoprof_add_trace(d, vcpu, bufhead.ret, mode))
         return 0;
     
     /* frame pointers should strictly progress back up the stack
      * (towards higher addresses) */
-    if (head >= bufhead[0].ebp)
+    if (head >= bufhead.ebp)
         return NULL;
     
-    return bufhead[0].ebp;
+    return bufhead.ebp;
 }
 
 /*

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGW-0004QG-He; Wed, 07 Mar 2012 19:11: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 1S5MGU-0004Px-Qh
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:10 +0000
Received: from [193.109.254.147:64374] by server-2.bemta-14.messagelabs.com id
	C3/67-11301-EC2B75F4; Wed, 07 Mar 2012 19:11:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1331147398!58983474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22893 invoked from network); 7 Mar 2012 19:09:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 19:09:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGS-0003Wd-57
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGR-0001X5-VU
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:08 +0000
Message-Id: <E1S5MGR-0001X5-VU@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/cpuidle: restrict scope of
	mwait_ptr in acpi_dead_idle()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331046719 -3600
# Node ID fb70e48ee3c2ea7060a97d9ddaa6dfc864f1efc0
# Parent  8964c223836c2889364aa75cb1a662ff5eacd5d8
x86/cpuidle: restrict scope of mwait_ptr in acpi_dead_idle()

... just to make sure it doesn't get used improperly (resulting from
the discussion around what became c/s 24968:8964c223836c).

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


diff -r 8964c223836c -r fb70e48ee3c2 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Tue Mar 06 15:51:33 2012 +0100
+++ b/xen/arch/x86/acpi/cpu_idle.c	Tue Mar 06 16:11:59 2012 +0100
@@ -565,7 +565,6 @@
 {
     struct acpi_processor_power *power;
     struct acpi_processor_cx *cx;
-    void *mwait_ptr;
 
     if ( (power = processor_powers[smp_processor_id()]) == NULL )
         goto default_halt;
@@ -573,10 +572,10 @@
     if ( (cx = &power->states[power->count-1]) == NULL )
         goto default_halt;
 
-    mwait_ptr = (void *)&mwait_wakeup(smp_processor_id());
-
     if ( cx->entry_method == ACPI_CSTATE_EM_FFH )
     {
+        void *mwait_ptr = &mwait_wakeup(smp_processor_id());
+
         /*
          * Cache must be flushed as the last operation before sleeping.
          * Otherwise, CPU may still hold dirty data, breaking cache coherency,

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGX-0004Qc-Pc; Wed, 07 Mar 2012 19: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 1S5MGW-0004Q6-8b
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:12 +0000
Received: from [85.158.143.99:50200] by server-1.bemta-4.messagelabs.com id
	6E/E1-20925-FC2B75F4; Wed, 07 Mar 2012 19:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1331147469!17529190!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7320 invoked from network); 7 Mar 2012 19:11: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;
	7 Mar 2012 19: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 1S5MGT-0003Wj-8c
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGT-0001Y5-3D
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:09 +0000
Message-Id: <E1S5MGT-0001Y5-3D@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/xenoprof: fix 32-bit guest stack
	handling after c/s 24537:3c0a533d3af0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331048581 -3600
# Node ID e88a4995121200850e153b7f8554dbbd091482ce
# Parent  33980e36597b9f780ef515210863034b5e3080bf
x86/xenoprof: fix 32-bit guest stack handling after c/s 24537:3c0a533d3af0

32-bit guests don't have 64-bit precudrure return addresses - both
elements of struct frame_head_32bit should be 32 bits wide, not just
the frame link pointer.

Further, consolidate the whole handling here (also in the native size
guest case) to properly use guest handles and guest memory accessors.

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


diff -r 33980e36597b -r e88a49951212 xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Tue Mar 06 16:41:41 2012 +0100
+++ b/xen/arch/x86/oprofile/backtrace.c	Tue Mar 06 16:43:01 2012 +0100
@@ -13,18 +13,22 @@
 #include<xen/types.h>
 #include<asm/page.h>
 #include<xen/xenoprof.h>
-#include<asm/guest_access.h>
+#include<xen/guest_access.h>
 
 struct frame_head {
     struct frame_head * ebp;
     unsigned long ret;
 } __attribute__((packed));
+typedef struct frame_head frame_head_t;
+DEFINE_XEN_GUEST_HANDLE(frame_head_t);
 
 #ifdef CONFIG_X86_64
 struct frame_head_32bit {
     uint32_t ebp;
-    unsigned long ret;
+    uint32_t ret;
 } __attribute__((packed));
+typedef struct frame_head_32bit frame_head32_t;
+DEFINE_COMPAT_HANDLE(frame_head32_t);
 #endif
 
 static struct frame_head *
@@ -54,44 +58,47 @@
 
 static struct frame_head *
 dump_guest_backtrace(struct domain *d, struct vcpu *vcpu, 
-		     struct frame_head * head, int mode)
+		     const struct frame_head *head, int mode)
 {
-    struct frame_head bufhead[2];
-    XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char);
+    frame_head_t bufhead;
 
 #ifdef CONFIG_X86_64
     if ( is_32bit_vcpu(vcpu) )
     {
-        struct frame_head_32bit bufhead32[2];
+        __compat_handle_const_frame_head32_t guest_head =
+            { .c = (unsigned long)head };
+        frame_head32_t bufhead32;
+
         /* Also check accessibility of one struct frame_head beyond */
-        if (!guest_handle_okay(guest_head, sizeof(bufhead32)))
+        if (!compat_handle_okay(guest_head, 2))
             return 0;
-        if (__copy_from_guest_offset((char *)bufhead32, guest_head, 0, 
-                                     sizeof(bufhead32)))
+        if (__copy_from_compat(&bufhead32, guest_head, 1))
             return 0;
-        bufhead[0].ebp=(struct frame_head *)(unsigned long)bufhead32[0].ebp;
-        bufhead[0].ret=bufhead32[0].ret;
+        bufhead.ebp = (struct frame_head *)(unsigned long)bufhead32.ebp;
+        bufhead.ret = bufhead32.ret;
     }
     else
 #endif
     {
+        XEN_GUEST_HANDLE(const_frame_head_t) guest_head =
+            const_guest_handle_from_ptr(head, frame_head_t);
+
         /* Also check accessibility of one struct frame_head beyond */
-        if (!guest_handle_okay(guest_head, sizeof(bufhead)))
+        if (!guest_handle_okay(guest_head, 2))
             return 0;
-        if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
-                                     sizeof(bufhead)))
+        if (__copy_from_guest(&bufhead, guest_head, 1))
             return 0;
     }
     
-    if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode))
+    if (!xenoprof_add_trace(d, vcpu, bufhead.ret, mode))
         return 0;
     
     /* frame pointers should strictly progress back up the stack
      * (towards higher addresses) */
-    if (head >= bufhead[0].ebp)
+    if (head >= bufhead.ebp)
         return NULL;
     
-    return bufhead[0].ebp;
+    return bufhead.ebp;
 }
 
 /*

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGW-0004QG-He; Wed, 07 Mar 2012 19:11: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 1S5MGU-0004Px-Qh
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:10 +0000
Received: from [193.109.254.147:64374] by server-2.bemta-14.messagelabs.com id
	C3/67-11301-EC2B75F4; Wed, 07 Mar 2012 19:11:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1331147398!58983474!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22893 invoked from network); 7 Mar 2012 19:09:59 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 19:09:59 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGS-0003Wd-57
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGR-0001X5-VU
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:08 +0000
Message-Id: <E1S5MGR-0001X5-VU@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/cpuidle: restrict scope of
	mwait_ptr in acpi_dead_idle()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331046719 -3600
# Node ID fb70e48ee3c2ea7060a97d9ddaa6dfc864f1efc0
# Parent  8964c223836c2889364aa75cb1a662ff5eacd5d8
x86/cpuidle: restrict scope of mwait_ptr in acpi_dead_idle()

... just to make sure it doesn't get used improperly (resulting from
the discussion around what became c/s 24968:8964c223836c).

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


diff -r 8964c223836c -r fb70e48ee3c2 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Tue Mar 06 15:51:33 2012 +0100
+++ b/xen/arch/x86/acpi/cpu_idle.c	Tue Mar 06 16:11:59 2012 +0100
@@ -565,7 +565,6 @@
 {
     struct acpi_processor_power *power;
     struct acpi_processor_cx *cx;
-    void *mwait_ptr;
 
     if ( (power = processor_powers[smp_processor_id()]) == NULL )
         goto default_halt;
@@ -573,10 +572,10 @@
     if ( (cx = &power->states[power->count-1]) == NULL )
         goto default_halt;
 
-    mwait_ptr = (void *)&mwait_wakeup(smp_processor_id());
-
     if ( cx->entry_method == ACPI_CSTATE_EM_FFH )
     {
+        void *mwait_ptr = &mwait_wakeup(smp_processor_id());
+
         /*
          * Cache must be flushed as the last operation before sleeping.
          * Otherwise, CPU may still hold dirty data, breaking cache coherency,

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGZ-0004RX-UQ; Wed, 07 Mar 2012 19: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 1S5MGY-0004QS-6x
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:14 +0000
Received: from [85.158.138.51:37399] by server-1.bemta-3.messagelabs.com id
	72/B4-02415-1D2B75F4; Wed, 07 Mar 2012 19:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1331147471!16581150!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32524 invoked from network); 7 Mar 2012 19:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 19: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 1S5MGU-0003XG-AB
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGU-0001Z3-5p
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:10 +0000
Message-Id: <E1S5MGU-0001Z3-5p@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Use deep C states for off-lined
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Boris Ostrovsky <boris.ostrovsky@amd.com>
# Date 1331105430 0
# Node ID 50a70b652b43aacbf923007ba8f645c5024ab698
# Parent  031e696b03d75320dab652a9ec50ef2d91b5a5d0
x86: Use deep C states for off-lined CPUs

Currently when a core is taken off-line it is placed in C1 state
(unless MONITOR/MWAIT is used). This patch allows a core to go to
deeper C states resulting in significantly higher power savings.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 031e696b03d7 -r 50a70b652b43 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Wed Mar 07 07:28:12 2012 +0000
+++ b/xen/arch/x86/acpi/cpu_idle.c	Wed Mar 07 07:30:30 2012 +0000
@@ -566,6 +566,7 @@
 {
     struct acpi_processor_power *power;
     struct acpi_processor_cx *cx;
+    struct cpuinfo_x86 *c = &current_cpu_data;
 
     if ( (power = processor_powers[smp_processor_id()]) == NULL )
         goto default_halt;
@@ -601,6 +602,23 @@
             mb();
             __mwait(cx->address, 0);
         }
+    } 
+    else if ( c->x86_vendor == X86_VENDOR_AMD && 
+              cx->entry_method == ACPI_CSTATE_EM_SYSIO )
+    {
+        /* Intel prefers not to use SYSIO */
+
+        /* Avoid references to shared data after the cache flush */
+        u32 address = cx->address;
+        u32 pmtmr_ioport_local = pmtmr_ioport;
+
+        wbinvd();
+
+        while ( 1 )
+        {
+            inb(address);
+            inl(pmtmr_ioport_local);
+        }
     }
     else if ( current_cpu_data.x86_vendor == X86_VENDOR_AMD &&
               cx->entry_method == ACPI_CSTATE_EM_SYSIO )

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGZ-0004RX-UQ; Wed, 07 Mar 2012 19: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 1S5MGY-0004QS-6x
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:14 +0000
Received: from [85.158.138.51:37399] by server-1.bemta-3.messagelabs.com id
	72/B4-02415-1D2B75F4; Wed, 07 Mar 2012 19:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1331147471!16581150!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32524 invoked from network); 7 Mar 2012 19:11:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 19: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 1S5MGU-0003XG-AB
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGU-0001Z3-5p
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:10 +0000
Message-Id: <E1S5MGU-0001Z3-5p@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Use deep C states for off-lined
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Boris Ostrovsky <boris.ostrovsky@amd.com>
# Date 1331105430 0
# Node ID 50a70b652b43aacbf923007ba8f645c5024ab698
# Parent  031e696b03d75320dab652a9ec50ef2d91b5a5d0
x86: Use deep C states for off-lined CPUs

Currently when a core is taken off-line it is placed in C1 state
(unless MONITOR/MWAIT is used). This patch allows a core to go to
deeper C states resulting in significantly higher power savings.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 031e696b03d7 -r 50a70b652b43 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Wed Mar 07 07:28:12 2012 +0000
+++ b/xen/arch/x86/acpi/cpu_idle.c	Wed Mar 07 07:30:30 2012 +0000
@@ -566,6 +566,7 @@
 {
     struct acpi_processor_power *power;
     struct acpi_processor_cx *cx;
+    struct cpuinfo_x86 *c = &current_cpu_data;
 
     if ( (power = processor_powers[smp_processor_id()]) == NULL )
         goto default_halt;
@@ -601,6 +602,23 @@
             mb();
             __mwait(cx->address, 0);
         }
+    } 
+    else if ( c->x86_vendor == X86_VENDOR_AMD && 
+              cx->entry_method == ACPI_CSTATE_EM_SYSIO )
+    {
+        /* Intel prefers not to use SYSIO */
+
+        /* Avoid references to shared data after the cache flush */
+        u32 address = cx->address;
+        u32 pmtmr_ioport_local = pmtmr_ioport;
+
+        wbinvd();
+
+        while ( 1 )
+        {
+            inb(address);
+            inl(pmtmr_ioport_local);
+        }
     }
     else if ( current_cpu_data.x86_vendor == X86_VENDOR_AMD &&
               cx->entry_method == ACPI_CSTATE_EM_SYSIO )

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGZ-0004Qy-2r; Wed, 07 Mar 2012 19:11:15 +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 1S5MGW-0004QB-ON
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:12 +0000
Received: from [193.109.254.147:52516] by server-8.bemta-14.messagelabs.com id
	85/CA-04087-0D2B75F4; Wed, 07 Mar 2012 19:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1331147444!66725953!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16605 invoked from network); 7 Mar 2012 19:10:45 -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;
	7 Mar 2012 19:10:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGU-0003XE-5j
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGT-0001Ya-Kg
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:09 +0000
Message-Id: <E1S5MGT-0001Ya-Kg@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Add gtags target for xen/Makefile.
	Also update .hgignore.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Liu <wei.liu2@citrix.com>
# Date 1331105292 0
# Node ID 031e696b03d75320dab652a9ec50ef2d91b5a5d0
# Parent  e88a4995121200850e153b7f8554dbbd091482ce
Add gtags target for xen/Makefile. Also update .hgignore.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r e88a49951212 -r 031e696b03d7 .hgignore
--- a/.hgignore	Tue Mar 06 16:43:01 2012 +0100
+++ b/.hgignore	Wed Mar 07 07:28:12 2012 +0000
@@ -23,6 +23,7 @@
 ^\.config$
 ^\.pc
 (^|/)(tags|TAGS)$
+(^|/)(GTAGS|GPATH|GSYMS|GRTAGS)$
 ^build-.*$
 ^dist/.*$
 ^docs/.*\.aux$
diff -r e88a49951212 -r 031e696b03d7 xen/Makefile
--- a/xen/Makefile	Tue Mar 06 16:43:01 2012 +0100
+++ b/xen/Makefile	Wed Mar 07 07:28:12 2012 +0000
@@ -20,8 +20,8 @@
 .PHONY: dist
 dist: install
 
-.PHONY: build install clean distclean cscope TAGS tags MAP
-build install debug clean distclean cscope TAGS tags MAP::
+.PHONY: build install clean distclean cscope TAGS tags MAP gtags
+build install debug clean distclean cscope TAGS tags MAP gtags::
 	$(MAKE) -f Rules.mk _$@
 
 .PHONY: _build
@@ -67,7 +67,7 @@
 
 .PHONY: _distclean
 _distclean: clean
-	rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out
+	rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out GTAGS GPATH GRTAGS GSYMS
 
 $(TARGET).gz: $(TARGET)
 	gzip -f -9 < $< > $@.new
@@ -159,6 +159,11 @@
 	$(call set_exuberant_flags,ctags); \
 	$(all_sources) | xargs ctags $$exuberant_flags -a
 
+.PHONY: _gtags
+_gtags:
+	set -e; rm -f GTAGS GSYMS GPATH GRTAGS
+	$(all_sources) | gtags -f -
+
 .PHONY: _cscope
 _cscope:
 	$(all_sources) > cscope.files

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGZ-0004Qy-2r; Wed, 07 Mar 2012 19:11:15 +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 1S5MGW-0004QB-ON
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:12 +0000
Received: from [193.109.254.147:52516] by server-8.bemta-14.messagelabs.com id
	85/CA-04087-0D2B75F4; Wed, 07 Mar 2012 19:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1331147444!66725953!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16605 invoked from network); 7 Mar 2012 19:10:45 -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;
	7 Mar 2012 19:10:45 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGU-0003XE-5j
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGT-0001Ya-Kg
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:09 +0000
Message-Id: <E1S5MGT-0001Ya-Kg@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Add gtags target for xen/Makefile.
	Also update .hgignore.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Liu <wei.liu2@citrix.com>
# Date 1331105292 0
# Node ID 031e696b03d75320dab652a9ec50ef2d91b5a5d0
# Parent  e88a4995121200850e153b7f8554dbbd091482ce
Add gtags target for xen/Makefile. Also update .hgignore.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r e88a49951212 -r 031e696b03d7 .hgignore
--- a/.hgignore	Tue Mar 06 16:43:01 2012 +0100
+++ b/.hgignore	Wed Mar 07 07:28:12 2012 +0000
@@ -23,6 +23,7 @@
 ^\.config$
 ^\.pc
 (^|/)(tags|TAGS)$
+(^|/)(GTAGS|GPATH|GSYMS|GRTAGS)$
 ^build-.*$
 ^dist/.*$
 ^docs/.*\.aux$
diff -r e88a49951212 -r 031e696b03d7 xen/Makefile
--- a/xen/Makefile	Tue Mar 06 16:43:01 2012 +0100
+++ b/xen/Makefile	Wed Mar 07 07:28:12 2012 +0000
@@ -20,8 +20,8 @@
 .PHONY: dist
 dist: install
 
-.PHONY: build install clean distclean cscope TAGS tags MAP
-build install debug clean distclean cscope TAGS tags MAP::
+.PHONY: build install clean distclean cscope TAGS tags MAP gtags
+build install debug clean distclean cscope TAGS tags MAP gtags::
 	$(MAKE) -f Rules.mk _$@
 
 .PHONY: _build
@@ -67,7 +67,7 @@
 
 .PHONY: _distclean
 _distclean: clean
-	rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out
+	rm -f tags TAGS cscope.files cscope.in.out cscope.out cscope.po.out GTAGS GPATH GRTAGS GSYMS
 
 $(TARGET).gz: $(TARGET)
 	gzip -f -9 < $< > $@.new
@@ -159,6 +159,11 @@
 	$(call set_exuberant_flags,ctags); \
 	$(all_sources) | xargs ctags $$exuberant_flags -a
 
+.PHONY: _gtags
+_gtags:
+	set -e; rm -f GTAGS GSYMS GPATH GRTAGS
+	$(all_sources) | gtags -f -
+
 .PHONY: _cscope
 _cscope:
 	$(all_sources) > cscope.files

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGX-0004QT-NE; Wed, 07 Mar 2012 19: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 1S5MGW-0004Q5-1K
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:12 +0000
Received: from [85.158.139.83:21759] by server-6.bemta-5.messagelabs.com id
	F0/75-13222-FC2B75F4; Wed, 07 Mar 2012 19:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1331147469!18336162!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31638 invoked from network); 7 Mar 2012 19:11:10 -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;
	7 Mar 2012 19: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 1S5MGS-0003Wg-LK
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGS-0001Xc-Ij
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:08 +0000
Message-Id: <E1S5MGS-0001Xc-Ij@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/cpuidle: deny access to the I/O
	port used for EM_SYSIO
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331048501 -3600
# Node ID 33980e36597b9f780ef515210863034b5e3080bf
# Parent  fb70e48ee3c2ea7060a97d9ddaa6dfc864f1efc0
x86/cpuidle: deny access to the I/O port used for EM_SYSIO

Nothing, not even Dom0, should fiddle with this.

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


diff -r fb70e48ee3c2 -r 33980e36597b xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Tue Mar 06 16:11:59 2012 +0100
+++ b/xen/arch/x86/acpi/cpu_idle.c	Tue Mar 06 16:41:41 2012 +0100
@@ -45,6 +45,7 @@
 #include <xen/irq.h>
 #include <asm/cache.h>
 #include <asm/io.h>
+#include <asm/iocap.h>
 #include <asm/hpet.h>
 #include <asm/processor.h>
 #include <xen/pmstat.h>
@@ -907,6 +908,9 @@
             cx->entry_method = ACPI_CSTATE_EM_HALT;
         break;
     case ACPI_ADR_SPACE_SYSTEM_IO:
+        if ( ioports_deny_access(dom0, cx->address, cx->address) )
+            printk(XENLOG_WARNING "Could not deny access to port %04x\n",
+                   cx->address);
         cx->entry_method = ACPI_CSTATE_EM_SYSIO;
         break;
     default:

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGX-0004QT-NE; Wed, 07 Mar 2012 19: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 1S5MGW-0004Q5-1K
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:12 +0000
Received: from [85.158.139.83:21759] by server-6.bemta-5.messagelabs.com id
	F0/75-13222-FC2B75F4; Wed, 07 Mar 2012 19:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1331147469!18336162!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31638 invoked from network); 7 Mar 2012 19:11:10 -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;
	7 Mar 2012 19: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 1S5MGS-0003Wg-LK
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGS-0001Xc-Ij
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:08 +0000
Message-Id: <E1S5MGS-0001Xc-Ij@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/cpuidle: deny access to the I/O
	port used for EM_SYSIO
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331048501 -3600
# Node ID 33980e36597b9f780ef515210863034b5e3080bf
# Parent  fb70e48ee3c2ea7060a97d9ddaa6dfc864f1efc0
x86/cpuidle: deny access to the I/O port used for EM_SYSIO

Nothing, not even Dom0, should fiddle with this.

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


diff -r fb70e48ee3c2 -r 33980e36597b xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Tue Mar 06 16:11:59 2012 +0100
+++ b/xen/arch/x86/acpi/cpu_idle.c	Tue Mar 06 16:41:41 2012 +0100
@@ -45,6 +45,7 @@
 #include <xen/irq.h>
 #include <asm/cache.h>
 #include <asm/io.h>
+#include <asm/iocap.h>
 #include <asm/hpet.h>
 #include <asm/processor.h>
 #include <xen/pmstat.h>
@@ -907,6 +908,9 @@
             cx->entry_method = ACPI_CSTATE_EM_HALT;
         break;
     case ACPI_ADR_SPACE_SYSTEM_IO:
+        if ( ioports_deny_access(dom0, cx->address, cx->address) )
+            printk(XENLOG_WARNING "Could not deny access to port %04x\n",
+                   cx->address);
         cx->entry_method = ACPI_CSTATE_EM_SYSIO;
         break;
     default:

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGZ-0004RC-Lu; Wed, 07 Mar 2012 19:11:15 +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 1S5MGX-0004QP-FE
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:13 +0000
Received: from [193.109.254.147:52531] by server-7.bemta-14.messagelabs.com id
	42/BD-09610-0D2B75F4; Wed, 07 Mar 2012 19:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1331147413!52431436!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10484 invoked from network); 7 Mar 2012 19:10:14 -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;
	7 Mar 2012 19:10: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 1S5MGU-0003XK-P6
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGU-0001ZZ-NC
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:10 +0000
Message-Id: <E1S5MGU-0001ZZ-NC@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] RTC: use offset to caculate rtc clock
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Yang Zhang <yang.z.zhang@Intel.com>
# Date 1331105660 0
# Node ID 6deb0b626f3f5fba073da01035e3b5864e54938c
# Parent  50a70b652b43aacbf923007ba8f645c5024ab698
RTC: use offset to caculate rtc clock

There has no need to run two periodic timer to update RTC time.
Use the offset instead.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 50a70b652b43 -r 6deb0b626f3f xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:30:30 2012 +0000
+++ b/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:34:20 2012 +0000
@@ -36,6 +36,8 @@
 #define epoch_year     1900
 #define get_year(x)    (x + epoch_year)
 
+static void rtc_copy_date(RTCState *s);
+
 static void rtc_periodic_cb(struct vcpu *v, void *opaque)
 {
     RTCState *s = opaque;
@@ -75,6 +77,7 @@
 static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
 {
     RTCState *s = opaque;
+    struct domain *d = vrtc_domain(s);
 
     spin_lock(&s->lock);
 
@@ -122,6 +125,12 @@
         {
             /* set mode: reset UIP mode */
             s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP;
+            /* adjust cmos before stopping */
+            if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+            {
+                s->current_tm = gmtime(get_localtime(d));
+                rtc_copy_date(s);
+            }
         }
         else
         {
@@ -218,156 +227,10 @@
     s->hw.cmos_data[RTC_YEAR] = to_bcd(s, tm->tm_year % 100);
 }
 
-/* month is between 0 and 11. */
-static int get_days_in_month(int month, int year)
-{
-    static const int days_tab[12] = { 
-        31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 
-    };
-    int d;
-    if ( (unsigned)month >= 12 )
-        return 31;
-    d = days_tab[month];
-    if ( month == 1 )
-        if ( (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0) )
-            d++;
-    return d;
-}
-
-/* update 'tm' to the next second */
-static void rtc_next_second(RTCState *s)
-{
-    struct tm *tm = &s->current_tm;
-    int days_in_month;
-
-    ASSERT(spin_is_locked(&s->lock));
-
-    tm->tm_sec++;
-    if ( (unsigned)tm->tm_sec >= 60 )
-    {
-        tm->tm_sec = 0;
-        tm->tm_min++;
-        if ( (unsigned)tm->tm_min >= 60 )
-        {
-            tm->tm_min = 0;
-            tm->tm_hour++;
-            if ( (unsigned)tm->tm_hour >= 24 )
-            {
-                tm->tm_hour = 0;
-                /* next day */
-                tm->tm_wday++;
-                if ( (unsigned)tm->tm_wday >= 7 )
-                    tm->tm_wday = 0;
-                days_in_month = get_days_in_month(tm->tm_mon, 
-                                                  get_year(tm->tm_year));
-                tm->tm_mday++;
-                if ( tm->tm_mday < 1 )
-                {
-                    tm->tm_mday = 1;
-                }
-                else if ( tm->tm_mday > days_in_month )
-                {
-                    tm->tm_mday = 1;
-                    tm->tm_mon++;
-                    if ( tm->tm_mon >= 12 )
-                    {
-                        tm->tm_mon = 0;
-                        tm->tm_year++;
-                    }
-                }
-            }
-        }
-    }
-}
-
-static void rtc_update_second(void *opaque)
-{
-    RTCState *s = opaque;
-    s_time_t now = NOW();
-
-    spin_lock(&s->lock);
-
-    /* If we somehow get way out of sync (say, Xen time leaps forward), 
-     * don't livelock the system trying to emulate every second.  Time 
-     * is already in bad trouble, so just skip forward rather than 
-     * trying to sync the RTC registers */
-    if ( unlikely(now - s->next_second_time > SECONDS(86400)) )
-    {
-        dprintk(XENLOG_WARNING, "HVM RTC: dom %u skipping %"PRId64" seconds\n",
-                vrtc_domain(s)->domain_id, 
-                (int64_t)((now - s->next_second_time) / SYSTEM_TIME_HZ));
-        s->next_second_time = now;
-    }
-
-    /* if the oscillator is not in normal operation, we do not update */
-    if ( (s->hw.cmos_data[RTC_REG_A] & RTC_DIV_CTL) != RTC_REF_CLCK_32KHZ )
-    {
-        s->next_second_time += 1000000000ULL;
-        set_timer(&s->second_timer, s->next_second_time);
-    }
-    else
-    {
-        rtc_next_second(s);
-        
-        if ( !(s->hw.cmos_data[RTC_REG_B] & RTC_SET) )
-            s->hw.cmos_data[RTC_REG_A] |= RTC_UIP;
-
-        /* Delay time before update cycle */
-        set_timer(&s->second_timer2, s->next_second_time + 244000);
-    }
-
-    spin_unlock(&s->lock);
-}
-
-static void rtc_update_second2(void *opaque)
-{
-    RTCState *s = opaque;
-    struct domain *d = vrtc_domain(s);
-
-    spin_lock(&s->lock);
-
-    if ( !(s->hw.cmos_data[RTC_REG_B] & RTC_SET) )
-        rtc_copy_date(s);
-
-    /* check alarm */
-    if ( s->hw.cmos_data[RTC_REG_B] & RTC_AIE )
-    {
-        if ( ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0 ||
-              from_bcd(s, s->hw.cmos_data[RTC_SECONDS_ALARM]) ==
-              s->current_tm.tm_sec) &&
-             ((s->hw.cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0 ||
-              from_bcd(s, s->hw.cmos_data[RTC_MINUTES_ALARM]) ==
-              s->current_tm.tm_min) &&
-             ((s->hw.cmos_data[RTC_HOURS_ALARM] & 0xc0) == 0xc0 ||
-              from_bcd(s, s->hw.cmos_data[RTC_HOURS_ALARM]) ==
-              s->current_tm.tm_hour) )
-        {
-            s->hw.cmos_data[RTC_REG_C] |= 0xa0; 
-            hvm_isa_irq_deassert(d, RTC_IRQ);
-            hvm_isa_irq_assert(d, RTC_IRQ);
-        }
-    }
-
-    /* update ended interrupt */
-    if ( (s->hw.cmos_data[RTC_REG_B] & (RTC_UIE|RTC_SET)) == RTC_UIE )
-    {
-        s->hw.cmos_data[RTC_REG_C] |= 0x90; 
-        hvm_isa_irq_deassert(d, RTC_IRQ);
-        hvm_isa_irq_assert(d, RTC_IRQ);
-    }
-
-    /* clear update in progress bit */
-    s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP;
-
-    s->next_second_time += 1000000000ULL;
-    set_timer(&s->second_timer, s->next_second_time);
-
-    spin_unlock(&s->lock);
-}
-
 static uint32_t rtc_ioport_read(RTCState *s, uint32_t addr)
 {
     int ret;
+    struct domain *d = vrtc_domain(s);
 
     if ( (addr & 1) == 0 )
         return 0xff;
@@ -383,6 +246,12 @@
     case RTC_DAY_OF_MONTH:
     case RTC_MONTH:
     case RTC_YEAR:
+        /* if not in set mode, adjust cmos before reading*/
+        if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+        {
+            s->current_tm = gmtime(get_localtime(d));
+            rtc_copy_date(s);
+        }
         ret = s->hw.cmos_data[s->hw.cmos_index];
         break;
     case RTC_REG_A:
@@ -430,12 +299,9 @@
 
 void rtc_migrate_timers(struct vcpu *v)
 {
-    RTCState *s = vcpu_vrtc(v);
-
     if ( v->vcpu_id == 0 )
     {
-        migrate_timer(&s->second_timer, v->processor);
-        migrate_timer(&s->second_timer2, v->processor);
+        ;
     }
 }
 
@@ -468,9 +334,6 @@
      * time, so let's keep doing that. */
     s->current_tm = gmtime(get_localtime(d));
     rtc_copy_date(s);
-    s->next_second_time = NOW() + 1000000000ULL;
-    stop_timer(&s->second_timer);
-    set_timer(&s->second_timer2, s->next_second_time);
 
     /* Reset the periodic interrupt timer based on the registers */
     rtc_timer_update(s);
@@ -496,9 +359,6 @@
 
     spin_lock_init(&s->lock);
 
-    init_timer(&s->second_timer, rtc_update_second, s, smp_processor_id());
-    init_timer(&s->second_timer2, rtc_update_second2, s, smp_processor_id());
-
     register_portio_handler(d, RTC_PORT(0), 2, handle_rtc_io);
 
     rtc_reset(d);
@@ -514,10 +374,6 @@
 
     rtc_copy_date(s);
 
-    s->next_second_time = NOW() + 1000000000ULL;
-    stop_timer(&s->second_timer);
-    set_timer(&s->second_timer2, s->next_second_time);
-
     spin_unlock(&s->lock);
 }
 
@@ -528,8 +384,6 @@
     spin_barrier(&s->lock);
 
     destroy_periodic_time(&s->pt);
-    kill_timer(&s->second_timer);
-    kill_timer(&s->second_timer2);
 }
 
 void rtc_update_clock(struct domain *d)
diff -r 50a70b652b43 -r 6deb0b626f3f xen/include/asm-x86/hvm/vpt.h
--- a/xen/include/asm-x86/hvm/vpt.h	Wed Mar 07 07:30:30 2012 +0000
+++ b/xen/include/asm-x86/hvm/vpt.h	Wed Mar 07 07:34:20 2012 +0000
@@ -106,8 +106,6 @@
     struct tm current_tm;
     /* second update */
     int64_t next_second_time;
-    struct timer second_timer;
-    struct timer second_timer2;
     struct periodic_time pt;
     spinlock_t lock;
 } RTCState;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGZ-0004RC-Lu; Wed, 07 Mar 2012 19:11:15 +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 1S5MGX-0004QP-FE
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:13 +0000
Received: from [193.109.254.147:52531] by server-7.bemta-14.messagelabs.com id
	42/BD-09610-0D2B75F4; Wed, 07 Mar 2012 19:11:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1331147413!52431436!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10484 invoked from network); 7 Mar 2012 19:10:14 -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;
	7 Mar 2012 19:10: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 1S5MGU-0003XK-P6
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGU-0001ZZ-NC
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:10 +0000
Message-Id: <E1S5MGU-0001ZZ-NC@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] RTC: use offset to caculate rtc clock
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Yang Zhang <yang.z.zhang@Intel.com>
# Date 1331105660 0
# Node ID 6deb0b626f3f5fba073da01035e3b5864e54938c
# Parent  50a70b652b43aacbf923007ba8f645c5024ab698
RTC: use offset to caculate rtc clock

There has no need to run two periodic timer to update RTC time.
Use the offset instead.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 50a70b652b43 -r 6deb0b626f3f xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:30:30 2012 +0000
+++ b/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:34:20 2012 +0000
@@ -36,6 +36,8 @@
 #define epoch_year     1900
 #define get_year(x)    (x + epoch_year)
 
+static void rtc_copy_date(RTCState *s);
+
 static void rtc_periodic_cb(struct vcpu *v, void *opaque)
 {
     RTCState *s = opaque;
@@ -75,6 +77,7 @@
 static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
 {
     RTCState *s = opaque;
+    struct domain *d = vrtc_domain(s);
 
     spin_lock(&s->lock);
 
@@ -122,6 +125,12 @@
         {
             /* set mode: reset UIP mode */
             s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP;
+            /* adjust cmos before stopping */
+            if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+            {
+                s->current_tm = gmtime(get_localtime(d));
+                rtc_copy_date(s);
+            }
         }
         else
         {
@@ -218,156 +227,10 @@
     s->hw.cmos_data[RTC_YEAR] = to_bcd(s, tm->tm_year % 100);
 }
 
-/* month is between 0 and 11. */
-static int get_days_in_month(int month, int year)
-{
-    static const int days_tab[12] = { 
-        31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 
-    };
-    int d;
-    if ( (unsigned)month >= 12 )
-        return 31;
-    d = days_tab[month];
-    if ( month == 1 )
-        if ( (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0) )
-            d++;
-    return d;
-}
-
-/* update 'tm' to the next second */
-static void rtc_next_second(RTCState *s)
-{
-    struct tm *tm = &s->current_tm;
-    int days_in_month;
-
-    ASSERT(spin_is_locked(&s->lock));
-
-    tm->tm_sec++;
-    if ( (unsigned)tm->tm_sec >= 60 )
-    {
-        tm->tm_sec = 0;
-        tm->tm_min++;
-        if ( (unsigned)tm->tm_min >= 60 )
-        {
-            tm->tm_min = 0;
-            tm->tm_hour++;
-            if ( (unsigned)tm->tm_hour >= 24 )
-            {
-                tm->tm_hour = 0;
-                /* next day */
-                tm->tm_wday++;
-                if ( (unsigned)tm->tm_wday >= 7 )
-                    tm->tm_wday = 0;
-                days_in_month = get_days_in_month(tm->tm_mon, 
-                                                  get_year(tm->tm_year));
-                tm->tm_mday++;
-                if ( tm->tm_mday < 1 )
-                {
-                    tm->tm_mday = 1;
-                }
-                else if ( tm->tm_mday > days_in_month )
-                {
-                    tm->tm_mday = 1;
-                    tm->tm_mon++;
-                    if ( tm->tm_mon >= 12 )
-                    {
-                        tm->tm_mon = 0;
-                        tm->tm_year++;
-                    }
-                }
-            }
-        }
-    }
-}
-
-static void rtc_update_second(void *opaque)
-{
-    RTCState *s = opaque;
-    s_time_t now = NOW();
-
-    spin_lock(&s->lock);
-
-    /* If we somehow get way out of sync (say, Xen time leaps forward), 
-     * don't livelock the system trying to emulate every second.  Time 
-     * is already in bad trouble, so just skip forward rather than 
-     * trying to sync the RTC registers */
-    if ( unlikely(now - s->next_second_time > SECONDS(86400)) )
-    {
-        dprintk(XENLOG_WARNING, "HVM RTC: dom %u skipping %"PRId64" seconds\n",
-                vrtc_domain(s)->domain_id, 
-                (int64_t)((now - s->next_second_time) / SYSTEM_TIME_HZ));
-        s->next_second_time = now;
-    }
-
-    /* if the oscillator is not in normal operation, we do not update */
-    if ( (s->hw.cmos_data[RTC_REG_A] & RTC_DIV_CTL) != RTC_REF_CLCK_32KHZ )
-    {
-        s->next_second_time += 1000000000ULL;
-        set_timer(&s->second_timer, s->next_second_time);
-    }
-    else
-    {
-        rtc_next_second(s);
-        
-        if ( !(s->hw.cmos_data[RTC_REG_B] & RTC_SET) )
-            s->hw.cmos_data[RTC_REG_A] |= RTC_UIP;
-
-        /* Delay time before update cycle */
-        set_timer(&s->second_timer2, s->next_second_time + 244000);
-    }
-
-    spin_unlock(&s->lock);
-}
-
-static void rtc_update_second2(void *opaque)
-{
-    RTCState *s = opaque;
-    struct domain *d = vrtc_domain(s);
-
-    spin_lock(&s->lock);
-
-    if ( !(s->hw.cmos_data[RTC_REG_B] & RTC_SET) )
-        rtc_copy_date(s);
-
-    /* check alarm */
-    if ( s->hw.cmos_data[RTC_REG_B] & RTC_AIE )
-    {
-        if ( ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0 ||
-              from_bcd(s, s->hw.cmos_data[RTC_SECONDS_ALARM]) ==
-              s->current_tm.tm_sec) &&
-             ((s->hw.cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0 ||
-              from_bcd(s, s->hw.cmos_data[RTC_MINUTES_ALARM]) ==
-              s->current_tm.tm_min) &&
-             ((s->hw.cmos_data[RTC_HOURS_ALARM] & 0xc0) == 0xc0 ||
-              from_bcd(s, s->hw.cmos_data[RTC_HOURS_ALARM]) ==
-              s->current_tm.tm_hour) )
-        {
-            s->hw.cmos_data[RTC_REG_C] |= 0xa0; 
-            hvm_isa_irq_deassert(d, RTC_IRQ);
-            hvm_isa_irq_assert(d, RTC_IRQ);
-        }
-    }
-
-    /* update ended interrupt */
-    if ( (s->hw.cmos_data[RTC_REG_B] & (RTC_UIE|RTC_SET)) == RTC_UIE )
-    {
-        s->hw.cmos_data[RTC_REG_C] |= 0x90; 
-        hvm_isa_irq_deassert(d, RTC_IRQ);
-        hvm_isa_irq_assert(d, RTC_IRQ);
-    }
-
-    /* clear update in progress bit */
-    s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP;
-
-    s->next_second_time += 1000000000ULL;
-    set_timer(&s->second_timer, s->next_second_time);
-
-    spin_unlock(&s->lock);
-}
-
 static uint32_t rtc_ioport_read(RTCState *s, uint32_t addr)
 {
     int ret;
+    struct domain *d = vrtc_domain(s);
 
     if ( (addr & 1) == 0 )
         return 0xff;
@@ -383,6 +246,12 @@
     case RTC_DAY_OF_MONTH:
     case RTC_MONTH:
     case RTC_YEAR:
+        /* if not in set mode, adjust cmos before reading*/
+        if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+        {
+            s->current_tm = gmtime(get_localtime(d));
+            rtc_copy_date(s);
+        }
         ret = s->hw.cmos_data[s->hw.cmos_index];
         break;
     case RTC_REG_A:
@@ -430,12 +299,9 @@
 
 void rtc_migrate_timers(struct vcpu *v)
 {
-    RTCState *s = vcpu_vrtc(v);
-
     if ( v->vcpu_id == 0 )
     {
-        migrate_timer(&s->second_timer, v->processor);
-        migrate_timer(&s->second_timer2, v->processor);
+        ;
     }
 }
 
@@ -468,9 +334,6 @@
      * time, so let's keep doing that. */
     s->current_tm = gmtime(get_localtime(d));
     rtc_copy_date(s);
-    s->next_second_time = NOW() + 1000000000ULL;
-    stop_timer(&s->second_timer);
-    set_timer(&s->second_timer2, s->next_second_time);
 
     /* Reset the periodic interrupt timer based on the registers */
     rtc_timer_update(s);
@@ -496,9 +359,6 @@
 
     spin_lock_init(&s->lock);
 
-    init_timer(&s->second_timer, rtc_update_second, s, smp_processor_id());
-    init_timer(&s->second_timer2, rtc_update_second2, s, smp_processor_id());
-
     register_portio_handler(d, RTC_PORT(0), 2, handle_rtc_io);
 
     rtc_reset(d);
@@ -514,10 +374,6 @@
 
     rtc_copy_date(s);
 
-    s->next_second_time = NOW() + 1000000000ULL;
-    stop_timer(&s->second_timer);
-    set_timer(&s->second_timer2, s->next_second_time);
-
     spin_unlock(&s->lock);
 }
 
@@ -528,8 +384,6 @@
     spin_barrier(&s->lock);
 
     destroy_periodic_time(&s->pt);
-    kill_timer(&s->second_timer);
-    kill_timer(&s->second_timer2);
 }
 
 void rtc_update_clock(struct domain *d)
diff -r 50a70b652b43 -r 6deb0b626f3f xen/include/asm-x86/hvm/vpt.h
--- a/xen/include/asm-x86/hvm/vpt.h	Wed Mar 07 07:30:30 2012 +0000
+++ b/xen/include/asm-x86/hvm/vpt.h	Wed Mar 07 07:34:20 2012 +0000
@@ -106,8 +106,6 @@
     struct tm current_tm;
     /* second update */
     int64_t next_second_time;
-    struct timer second_timer;
-    struct timer second_timer2;
     struct periodic_time pt;
     spinlock_t lock;
 } RTCState;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGa-0004Rc-0r; Wed, 07 Mar 2012 19: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 1S5MGY-0004QP-Jt
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:14 +0000
Received: from [193.109.254.147:64478] by server-7.bemta-14.messagelabs.com id
	85/BD-09610-2D2B75F4; Wed, 07 Mar 2012 19:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1331147439!59953445!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2837 invoked from network); 7 Mar 2012 19:10:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 19:10:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGW-0003XT-DO
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGW-0001b2-CE
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:12 +0000
Message-Id: <E1S5MGW-0001b2-CE@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] RTC: Add RTC update-ended interrupt
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Yang Zhang <yang.z.zhang@Intel.com>
# Date 1331105841 0
# Node ID b098111c0a2f88a708914b0553eb7153286c9e63
# Parent  f06a031fdaf9b6d5192265c9458356190ca23085
RTC: Add RTC update-ended interrupt support

Use a timer to emulate update cycle. When update cycle ended and UIE
is set, raise an interrupt. The timer runs only when AF is cleared.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r f06a031fdaf9 -r b098111c0a2f xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:36:15 2012 +0000
+++ b/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:37:21 2012 +0000
@@ -29,6 +29,7 @@
 #include <asm/current.h>
 
 #define USEC_PER_SEC    1000000UL
+#define NS_PER_USEC     1000UL
 
 #define domain_vrtc(x) (&(x)->arch.hvm_domain.pl_time.vrtc)
 #define vcpu_vrtc(x)   (domain_vrtc((x)->domain))
@@ -74,6 +75,84 @@
     }
 }
 
+/* handle update-ended timer */
+static void check_update_timer(RTCState *s)
+{
+    uint64_t next_update_time, expire_time;
+    uint64_t guest_usec;
+    struct domain *d = vrtc_domain(s);
+    stop_timer(&s->update_timer);
+    stop_timer(&s->update_timer2);
+
+    ASSERT(spin_is_locked(&s->lock));
+
+    if (!(s->hw.cmos_data[RTC_REG_C] & RTC_UF) &&
+            !(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+    {
+        s->use_timer = 1;
+        guest_usec = get_localtime_us(d) % USEC_PER_SEC;
+        if (guest_usec >= (USEC_PER_SEC - 244))
+        {
+            /* RTC is in update cycle when enabling UIE */
+            s->hw.cmos_data[RTC_REG_A] |= RTC_UIP;
+            next_update_time = (USEC_PER_SEC - guest_usec) * NS_PER_USEC;
+            expire_time = NOW() + next_update_time;
+            /* release lock before set timer */
+            spin_unlock(&s->lock);
+            set_timer(&s->update_timer2, expire_time);
+            /* fetch lock again */
+            spin_lock(&s->lock);
+        }
+        else
+        {
+            next_update_time = (USEC_PER_SEC - guest_usec - 244) * NS_PER_USEC;
+            expire_time = NOW() + next_update_time;
+            s->next_update_time = expire_time;
+            /* release lock before set timer */
+            spin_unlock(&s->lock);
+            set_timer(&s->update_timer, expire_time);
+            /* fetch lock again */
+            spin_lock(&s->lock);
+        }
+    }
+    else
+        s->use_timer = 0;
+}
+
+static void rtc_update_timer(void *opaque)
+{
+    RTCState *s = opaque;
+
+    spin_lock(&s->lock);
+    if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+    {
+        s->hw.cmos_data[RTC_REG_A] |= RTC_UIP;
+        set_timer(&s->update_timer2, s->next_update_time + 244000UL);
+    }
+    spin_unlock(&s->lock);
+}
+
+static void rtc_update_timer2(void *opaque)
+{
+    RTCState *s = opaque;
+    struct domain *d = vrtc_domain(s);
+
+    spin_lock(&s->lock);
+    if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+    {
+        s->hw.cmos_data[RTC_REG_C] |= RTC_UF;
+        s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP;
+        if ((s->hw.cmos_data[RTC_REG_B] & RTC_UIE))
+        {
+            s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
+            hvm_isa_irq_deassert(d, RTC_IRQ);
+            hvm_isa_irq_assert(d, RTC_IRQ);
+        }
+        check_update_timer(s);
+    }
+    spin_unlock(&s->lock);
+}
+
 static void rtc_set_time(RTCState *s);
 
 static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
@@ -140,8 +219,17 @@
             if ( s->hw.cmos_data[RTC_REG_B] & RTC_SET )
                 rtc_set_time(s);
         }
+        /* if the interrupt is already set when the interrupt become
+         * enabled, raise an interrupt immediately*/
+        if ((data & RTC_UIE) && !(s->hw.cmos_data[RTC_REG_B] & RTC_UIE))
+            if (s->hw.cmos_data[RTC_REG_C] & RTC_UF)
+            {
+                hvm_isa_irq_deassert(d, RTC_IRQ);
+                hvm_isa_irq_assert(d, RTC_IRQ);
+            }
         s->hw.cmos_data[RTC_REG_B] = data;
         rtc_timer_update(s);
+        check_update_timer(s);
         break;
     case RTC_REG_C:
     case RTC_REG_D:
@@ -286,13 +374,14 @@
         break;
     case RTC_REG_A:
         ret = s->hw.cmos_data[s->hw.cmos_index];
-        if (update_in_progress(s))
+        if ((s->use_timer == 0) && update_in_progress(s))
             ret |= RTC_UIP;
         break;
     case RTC_REG_C:
         ret = s->hw.cmos_data[s->hw.cmos_index];
         hvm_isa_irq_deassert(vrtc_domain(s), RTC_IRQ);
         s->hw.cmos_data[RTC_REG_C] = 0x00;
+        check_update_timer(s);
         break;
     default:
         ret = s->hw.cmos_data[s->hw.cmos_index];
@@ -331,9 +420,12 @@
 
 void rtc_migrate_timers(struct vcpu *v)
 {
+    RTCState *s = vcpu_vrtc(v);
+
     if ( v->vcpu_id == 0 )
     {
-        ;
+        migrate_timer(&s->update_timer, v->processor);;
+        migrate_timer(&s->update_timer2, v->processor);;
     }
 }
 
@@ -369,6 +461,7 @@
 
     /* Reset the periodic interrupt timer based on the registers */
     rtc_timer_update(s);
+    check_update_timer(s);
 
     spin_unlock(&s->lock);
 
@@ -391,10 +484,14 @@
 
     spin_lock_init(&s->lock);
 
+    init_timer(&s->update_timer, rtc_update_timer, s, smp_processor_id());
+    init_timer(&s->update_timer2, rtc_update_timer2, s, smp_processor_id());
+
     register_portio_handler(d, RTC_PORT(0), 2, handle_rtc_io);
 
     rtc_reset(d);
 
+
     spin_lock(&s->lock);
 
     s->hw.cmos_data[RTC_REG_A] = RTC_REF_CLCK_32KHZ | 6; /* ~1kHz */
@@ -406,6 +503,7 @@
 
     rtc_copy_date(s);
 
+    check_update_timer(s);
     spin_unlock(&s->lock);
 }
 
@@ -416,6 +514,8 @@
     spin_barrier(&s->lock);
 
     destroy_periodic_time(&s->pt);
+    kill_timer(&s->update_timer);
+    kill_timer(&s->update_timer2);
 }
 
 void rtc_update_clock(struct domain *d)
diff -r f06a031fdaf9 -r b098111c0a2f xen/include/asm-x86/hvm/vpt.h
--- a/xen/include/asm-x86/hvm/vpt.h	Wed Mar 07 07:36:15 2012 +0000
+++ b/xen/include/asm-x86/hvm/vpt.h	Wed Mar 07 07:37:21 2012 +0000
@@ -107,6 +107,11 @@
     /* second update */
     int64_t next_second_time;
     struct periodic_time pt;
+    /* update-ended timer */
+    struct timer update_timer;
+    struct timer update_timer2;
+    uint64_t next_update_time;
+    uint32_t use_timer;
     spinlock_t lock;
 } RTCState;
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGa-0004Rc-0r; Wed, 07 Mar 2012 19: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 1S5MGY-0004QP-Jt
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:14 +0000
Received: from [193.109.254.147:64478] by server-7.bemta-14.messagelabs.com id
	85/BD-09610-2D2B75F4; Wed, 07 Mar 2012 19:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1331147439!59953445!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2837 invoked from network); 7 Mar 2012 19:10:40 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 19:10:40 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGW-0003XT-DO
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGW-0001b2-CE
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:12 +0000
Message-Id: <E1S5MGW-0001b2-CE@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] RTC: Add RTC update-ended interrupt
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Yang Zhang <yang.z.zhang@Intel.com>
# Date 1331105841 0
# Node ID b098111c0a2f88a708914b0553eb7153286c9e63
# Parent  f06a031fdaf9b6d5192265c9458356190ca23085
RTC: Add RTC update-ended interrupt support

Use a timer to emulate update cycle. When update cycle ended and UIE
is set, raise an interrupt. The timer runs only when AF is cleared.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r f06a031fdaf9 -r b098111c0a2f xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:36:15 2012 +0000
+++ b/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:37:21 2012 +0000
@@ -29,6 +29,7 @@
 #include <asm/current.h>
 
 #define USEC_PER_SEC    1000000UL
+#define NS_PER_USEC     1000UL
 
 #define domain_vrtc(x) (&(x)->arch.hvm_domain.pl_time.vrtc)
 #define vcpu_vrtc(x)   (domain_vrtc((x)->domain))
@@ -74,6 +75,84 @@
     }
 }
 
+/* handle update-ended timer */
+static void check_update_timer(RTCState *s)
+{
+    uint64_t next_update_time, expire_time;
+    uint64_t guest_usec;
+    struct domain *d = vrtc_domain(s);
+    stop_timer(&s->update_timer);
+    stop_timer(&s->update_timer2);
+
+    ASSERT(spin_is_locked(&s->lock));
+
+    if (!(s->hw.cmos_data[RTC_REG_C] & RTC_UF) &&
+            !(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+    {
+        s->use_timer = 1;
+        guest_usec = get_localtime_us(d) % USEC_PER_SEC;
+        if (guest_usec >= (USEC_PER_SEC - 244))
+        {
+            /* RTC is in update cycle when enabling UIE */
+            s->hw.cmos_data[RTC_REG_A] |= RTC_UIP;
+            next_update_time = (USEC_PER_SEC - guest_usec) * NS_PER_USEC;
+            expire_time = NOW() + next_update_time;
+            /* release lock before set timer */
+            spin_unlock(&s->lock);
+            set_timer(&s->update_timer2, expire_time);
+            /* fetch lock again */
+            spin_lock(&s->lock);
+        }
+        else
+        {
+            next_update_time = (USEC_PER_SEC - guest_usec - 244) * NS_PER_USEC;
+            expire_time = NOW() + next_update_time;
+            s->next_update_time = expire_time;
+            /* release lock before set timer */
+            spin_unlock(&s->lock);
+            set_timer(&s->update_timer, expire_time);
+            /* fetch lock again */
+            spin_lock(&s->lock);
+        }
+    }
+    else
+        s->use_timer = 0;
+}
+
+static void rtc_update_timer(void *opaque)
+{
+    RTCState *s = opaque;
+
+    spin_lock(&s->lock);
+    if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+    {
+        s->hw.cmos_data[RTC_REG_A] |= RTC_UIP;
+        set_timer(&s->update_timer2, s->next_update_time + 244000UL);
+    }
+    spin_unlock(&s->lock);
+}
+
+static void rtc_update_timer2(void *opaque)
+{
+    RTCState *s = opaque;
+    struct domain *d = vrtc_domain(s);
+
+    spin_lock(&s->lock);
+    if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+    {
+        s->hw.cmos_data[RTC_REG_C] |= RTC_UF;
+        s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP;
+        if ((s->hw.cmos_data[RTC_REG_B] & RTC_UIE))
+        {
+            s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
+            hvm_isa_irq_deassert(d, RTC_IRQ);
+            hvm_isa_irq_assert(d, RTC_IRQ);
+        }
+        check_update_timer(s);
+    }
+    spin_unlock(&s->lock);
+}
+
 static void rtc_set_time(RTCState *s);
 
 static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
@@ -140,8 +219,17 @@
             if ( s->hw.cmos_data[RTC_REG_B] & RTC_SET )
                 rtc_set_time(s);
         }
+        /* if the interrupt is already set when the interrupt become
+         * enabled, raise an interrupt immediately*/
+        if ((data & RTC_UIE) && !(s->hw.cmos_data[RTC_REG_B] & RTC_UIE))
+            if (s->hw.cmos_data[RTC_REG_C] & RTC_UF)
+            {
+                hvm_isa_irq_deassert(d, RTC_IRQ);
+                hvm_isa_irq_assert(d, RTC_IRQ);
+            }
         s->hw.cmos_data[RTC_REG_B] = data;
         rtc_timer_update(s);
+        check_update_timer(s);
         break;
     case RTC_REG_C:
     case RTC_REG_D:
@@ -286,13 +374,14 @@
         break;
     case RTC_REG_A:
         ret = s->hw.cmos_data[s->hw.cmos_index];
-        if (update_in_progress(s))
+        if ((s->use_timer == 0) && update_in_progress(s))
             ret |= RTC_UIP;
         break;
     case RTC_REG_C:
         ret = s->hw.cmos_data[s->hw.cmos_index];
         hvm_isa_irq_deassert(vrtc_domain(s), RTC_IRQ);
         s->hw.cmos_data[RTC_REG_C] = 0x00;
+        check_update_timer(s);
         break;
     default:
         ret = s->hw.cmos_data[s->hw.cmos_index];
@@ -331,9 +420,12 @@
 
 void rtc_migrate_timers(struct vcpu *v)
 {
+    RTCState *s = vcpu_vrtc(v);
+
     if ( v->vcpu_id == 0 )
     {
-        ;
+        migrate_timer(&s->update_timer, v->processor);;
+        migrate_timer(&s->update_timer2, v->processor);;
     }
 }
 
@@ -369,6 +461,7 @@
 
     /* Reset the periodic interrupt timer based on the registers */
     rtc_timer_update(s);
+    check_update_timer(s);
 
     spin_unlock(&s->lock);
 
@@ -391,10 +484,14 @@
 
     spin_lock_init(&s->lock);
 
+    init_timer(&s->update_timer, rtc_update_timer, s, smp_processor_id());
+    init_timer(&s->update_timer2, rtc_update_timer2, s, smp_processor_id());
+
     register_portio_handler(d, RTC_PORT(0), 2, handle_rtc_io);
 
     rtc_reset(d);
 
+
     spin_lock(&s->lock);
 
     s->hw.cmos_data[RTC_REG_A] = RTC_REF_CLCK_32KHZ | 6; /* ~1kHz */
@@ -406,6 +503,7 @@
 
     rtc_copy_date(s);
 
+    check_update_timer(s);
     spin_unlock(&s->lock);
 }
 
@@ -416,6 +514,8 @@
     spin_barrier(&s->lock);
 
     destroy_periodic_time(&s->pt);
+    kill_timer(&s->update_timer);
+    kill_timer(&s->update_timer2);
 }
 
 void rtc_update_clock(struct domain *d)
diff -r f06a031fdaf9 -r b098111c0a2f xen/include/asm-x86/hvm/vpt.h
--- a/xen/include/asm-x86/hvm/vpt.h	Wed Mar 07 07:36:15 2012 +0000
+++ b/xen/include/asm-x86/hvm/vpt.h	Wed Mar 07 07:37:21 2012 +0000
@@ -107,6 +107,11 @@
     /* second update */
     int64_t next_second_time;
     struct periodic_time pt;
+    /* update-ended timer */
+    struct timer update_timer;
+    struct timer update_timer2;
+    uint64_t next_update_time;
+    uint32_t use_timer;
     spinlock_t lock;
 } RTCState;
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGZ-0004RN-Pm; Wed, 07 Mar 2012 19: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 1S5MGX-0004Q6-P9
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:13 +0000
Received: from [85.158.143.99:55181] by server-1.bemta-4.messagelabs.com id
	E6/F1-20925-1D2B75F4; Wed, 07 Mar 2012 19:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1331147471!18122856!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17141 invoked from network); 7 Mar 2012 19:11:12 -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;
	7 Mar 2012 19: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 1S5MGV-0003XN-9c
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGV-0001a2-8D
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:11 +0000
Message-Id: <E1S5MGV-0001a2-8D@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] RTC: fix 12-hour mode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Yang Zhang <yang.z.zhang@Intel.com>
# Date 1331105695 0
# Node ID c343c98ed82d5d7f28ccd5949ade78660c4b313b
# Parent  6deb0b626f3f5fba073da01035e3b5864e54938c
RTC: fix 12-hour mode

Hours in 12-hour mode are in the 1-12 range, not 0-11.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 6deb0b626f3f -r c343c98ed82d xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:34:20 2012 +0000
+++ b/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:34:55 2012 +0000
@@ -168,6 +168,19 @@
         return ((a >> 4) * 10) + (a & 0x0f);
 }
 
+/* Hours in 12 hour mode are in 1-12 range, not 0-11.
+ * So we need convert it before using it*/
+static inline int convert_hour(RTCState *s, int hour)
+{
+    if (!(s->hw.cmos_data[RTC_REG_B] & RTC_24H))
+    {
+        hour %= 12;
+        if (s->hw.cmos_data[RTC_HOURS] & 0x80)
+            hour += 12;
+    }
+    return hour;
+}
+
 static void rtc_set_time(RTCState *s)
 {
     struct tm *tm = &s->current_tm;
@@ -182,9 +195,7 @@
     tm->tm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
     tm->tm_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES]);
     tm->tm_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS] & 0x7f);
-    if ( !(s->hw.cmos_data[RTC_REG_B] & 0x02) &&
-         (s->hw.cmos_data[RTC_HOURS] & 0x80) )
-        tm->tm_hour += 12;
+    tm->tm_hour = convert_hour(s, tm->tm_hour);
     tm->tm_wday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_WEEK]);
     tm->tm_mday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_MONTH]);
     tm->tm_mon = from_bcd(s, s->hw.cmos_data[RTC_MONTH]) - 1;
@@ -217,7 +228,8 @@
     else
     {
         /* 12 hour format */
-        s->hw.cmos_data[RTC_HOURS] = to_bcd(s, tm->tm_hour % 12);
+        int h = (tm->tm_hour % 12) ? tm->tm_hour % 12 : 12;
+        s->hw.cmos_data[RTC_HOURS] = to_bcd(s, h);
         if ( tm->tm_hour >= 12 )
             s->hw.cmos_data[RTC_HOURS] |= 0x80;
     }

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGZ-0004RN-Pm; Wed, 07 Mar 2012 19: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 1S5MGX-0004Q6-P9
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:13 +0000
Received: from [85.158.143.99:55181] by server-1.bemta-4.messagelabs.com id
	E6/F1-20925-1D2B75F4; Wed, 07 Mar 2012 19:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1331147471!18122856!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17141 invoked from network); 7 Mar 2012 19:11:12 -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;
	7 Mar 2012 19: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 1S5MGV-0003XN-9c
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGV-0001a2-8D
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:11 +0000
Message-Id: <E1S5MGV-0001a2-8D@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] RTC: fix 12-hour mode
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Yang Zhang <yang.z.zhang@Intel.com>
# Date 1331105695 0
# Node ID c343c98ed82d5d7f28ccd5949ade78660c4b313b
# Parent  6deb0b626f3f5fba073da01035e3b5864e54938c
RTC: fix 12-hour mode

Hours in 12-hour mode are in the 1-12 range, not 0-11.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 6deb0b626f3f -r c343c98ed82d xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:34:20 2012 +0000
+++ b/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:34:55 2012 +0000
@@ -168,6 +168,19 @@
         return ((a >> 4) * 10) + (a & 0x0f);
 }
 
+/* Hours in 12 hour mode are in 1-12 range, not 0-11.
+ * So we need convert it before using it*/
+static inline int convert_hour(RTCState *s, int hour)
+{
+    if (!(s->hw.cmos_data[RTC_REG_B] & RTC_24H))
+    {
+        hour %= 12;
+        if (s->hw.cmos_data[RTC_HOURS] & 0x80)
+            hour += 12;
+    }
+    return hour;
+}
+
 static void rtc_set_time(RTCState *s)
 {
     struct tm *tm = &s->current_tm;
@@ -182,9 +195,7 @@
     tm->tm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
     tm->tm_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES]);
     tm->tm_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS] & 0x7f);
-    if ( !(s->hw.cmos_data[RTC_REG_B] & 0x02) &&
-         (s->hw.cmos_data[RTC_HOURS] & 0x80) )
-        tm->tm_hour += 12;
+    tm->tm_hour = convert_hour(s, tm->tm_hour);
     tm->tm_wday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_WEEK]);
     tm->tm_mday = from_bcd(s, s->hw.cmos_data[RTC_DAY_OF_MONTH]);
     tm->tm_mon = from_bcd(s, s->hw.cmos_data[RTC_MONTH]) - 1;
@@ -217,7 +228,8 @@
     else
     {
         /* 12 hour format */
-        s->hw.cmos_data[RTC_HOURS] = to_bcd(s, tm->tm_hour % 12);
+        int h = (tm->tm_hour % 12) ? tm->tm_hour % 12 : 12;
+        s->hw.cmos_data[RTC_HOURS] = to_bcd(s, h);
         if ( tm->tm_hour >= 12 )
             s->hw.cmos_data[RTC_HOURS] |= 0x80;
     }

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGb-0004SE-8T; Wed, 07 Mar 2012 19:11:17 +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 1S5MGZ-0004R8-VU
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:16 +0000
Received: from [193.109.254.147:52564] by server-1.bemta-14.messagelabs.com id
	92/34-12485-3D2B75F4; Wed, 07 Mar 2012 19:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1331147416!52431440!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10589 invoked from network); 7 Mar 2012 19:10:17 -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;
	7 Mar 2012 19:10: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 1S5MGX-0003XZ-Fz
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGX-0001c3-Ei
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:13 +0000
Message-Id: <E1S5MGX-0001c3-Ei@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: Add xenversion as a top-level
	target
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331106129 0
# Node ID 0f51f175fb5757cca6cb319ef3709c2ffbd26280
# Parent  f29e4080ea6bcdb6838a24db5e840c9caa98eee5
build: Add xenversion as a top-level target

We already have xenversion as a target in the xen subdirectory;
simply extend it so that "make xenversion" does what you'd expect.

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


diff -r f29e4080ea6b -r 0f51f175fb57 Makefile
--- a/Makefile	Wed Mar 07 07:38:05 2012 +0000
+++ b/Makefile	Wed Mar 07 07:42:09 2012 +0000
@@ -257,6 +257,9 @@
 linux26:
 	$(MAKE) 'KERNELS=linux-2.6*' kernels
 
+.PHONY: xenversion
+xenversion:
+	@$(MAKE) --no-print-directory -C xen xenversion
 
 #
 # tboot targets

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGb-0004SE-8T; Wed, 07 Mar 2012 19:11:17 +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 1S5MGZ-0004R8-VU
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:16 +0000
Received: from [193.109.254.147:52564] by server-1.bemta-14.messagelabs.com id
	92/34-12485-3D2B75F4; Wed, 07 Mar 2012 19:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1331147416!52431440!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10589 invoked from network); 7 Mar 2012 19:10:17 -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;
	7 Mar 2012 19:10: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 1S5MGX-0003XZ-Fz
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGX-0001c3-Ei
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:13 +0000
Message-Id: <E1S5MGX-0001c3-Ei@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: Add xenversion as a top-level
	target
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331106129 0
# Node ID 0f51f175fb5757cca6cb319ef3709c2ffbd26280
# Parent  f29e4080ea6bcdb6838a24db5e840c9caa98eee5
build: Add xenversion as a top-level target

We already have xenversion as a target in the xen subdirectory;
simply extend it so that "make xenversion" does what you'd expect.

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


diff -r f29e4080ea6b -r 0f51f175fb57 Makefile
--- a/Makefile	Wed Mar 07 07:38:05 2012 +0000
+++ b/Makefile	Wed Mar 07 07:42:09 2012 +0000
@@ -257,6 +257,9 @@
 linux26:
 	$(MAKE) 'KERNELS=linux-2.6*' kernels
 
+.PHONY: xenversion
+xenversion:
+	@$(MAKE) --no-print-directory -C xen xenversion
 
 #
 # tboot targets

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGZ-0004RS-S4; Wed, 07 Mar 2012 19:11:15 +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 1S5MGX-0004QB-Rz
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:14 +0000
Received: from [193.109.254.147:42177] by server-8.bemta-14.messagelabs.com id
	19/CA-04087-1D2B75F4; Wed, 07 Mar 2012 19:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1331147424!58180086!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25408 invoked from network); 7 Mar 2012 19:10:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 19:10: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 1S5MGV-0003XQ-Uz
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGV-0001aX-Qu
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:11 +0000
Message-Id: <E1S5MGV-0001aX-Qu@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] RTC: Add UIP(update in progress)
	check logic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Yang Zhang <yang.z.zhang@Intel.com>
# Date 1331105775 0
# Node ID f06a031fdaf9b6d5192265c9458356190ca23085
# Parent  c343c98ed82d5d7f28ccd5949ade78660c4b313b
RTC: Add UIP(update in progress) check logic

The UIP(update in progress) is set when RTC is in updating. And the
update cycle begins 244us later after UIP is set.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r c343c98ed82d -r f06a031fdaf9 xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:34:55 2012 +0000
+++ b/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:36:15 2012 +0000
@@ -28,6 +28,8 @@
 #include <asm/hvm/support.h>
 #include <asm/current.h>
 
+#define USEC_PER_SEC    1000000UL
+
 #define domain_vrtc(x) (&(x)->arch.hvm_domain.pl_time.vrtc)
 #define vcpu_vrtc(x)   (domain_vrtc((x)->domain))
 #define vrtc_domain(x) (container_of((x), struct domain, \
@@ -239,6 +241,22 @@
     s->hw.cmos_data[RTC_YEAR] = to_bcd(s, tm->tm_year % 100);
 }
 
+static int update_in_progress(RTCState *s)
+{
+    uint64_t guest_usec;
+    struct domain *d = vrtc_domain(s);
+
+    if (s->hw.cmos_data[RTC_REG_B] & RTC_SET)
+        return 0;
+
+    guest_usec = get_localtime_us(d);
+    /* UIP bit will be set at last 244us of every second. */
+    if ((guest_usec % USEC_PER_SEC) >= (USEC_PER_SEC - 244))
+        return 1;
+
+    return 0;
+}
+
 static uint32_t rtc_ioport_read(RTCState *s, uint32_t addr)
 {
     int ret;
@@ -268,6 +286,8 @@
         break;
     case RTC_REG_A:
         ret = s->hw.cmos_data[s->hw.cmos_index];
+        if (update_in_progress(s))
+            ret |= RTC_UIP;
         break;
     case RTC_REG_C:
         ret = s->hw.cmos_data[s->hw.cmos_index];
diff -r c343c98ed82d -r f06a031fdaf9 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c	Wed Mar 07 07:34:55 2012 +0000
+++ b/xen/arch/x86/time.c	Wed Mar 07 07:36:15 2012 +0000
@@ -1601,6 +1601,13 @@
         + d->time_offset_seconds;
 }
 
+/* Return microsecs after 00:00:00 localtime, 1 January, 1970. */
+uint64_t get_localtime_us(struct domain *d)
+{
+    return ((wc_sec + d->time_offset_seconds) * 1000000000ULL
+        + wc_nsec + NOW()) / 1000UL;
+}
+
 unsigned long get_sec(void)
 {
     return wc_sec + (wc_nsec + NOW()) / 1000000000ULL;
diff -r c343c98ed82d -r f06a031fdaf9 xen/include/xen/time.h
--- a/xen/include/xen/time.h	Wed Mar 07 07:34:55 2012 +0000
+++ b/xen/include/xen/time.h	Wed Mar 07 07:36:15 2012 +0000
@@ -34,6 +34,7 @@
 
 s_time_t get_s_time(void);
 unsigned long get_localtime(struct domain *d);
+uint64_t get_localtime_us(struct domain *d);
 
 struct tm {
     int     tm_sec;         /* seconds */

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGZ-0004RS-S4; Wed, 07 Mar 2012 19:11:15 +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 1S5MGX-0004QB-Rz
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:14 +0000
Received: from [193.109.254.147:42177] by server-8.bemta-14.messagelabs.com id
	19/CA-04087-1D2B75F4; Wed, 07 Mar 2012 19:11:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1331147424!58180086!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25408 invoked from network); 7 Mar 2012 19:10:25 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 19:10: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 1S5MGV-0003XQ-Uz
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGV-0001aX-Qu
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:11 +0000
Message-Id: <E1S5MGV-0001aX-Qu@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] RTC: Add UIP(update in progress)
	check logic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Yang Zhang <yang.z.zhang@Intel.com>
# Date 1331105775 0
# Node ID f06a031fdaf9b6d5192265c9458356190ca23085
# Parent  c343c98ed82d5d7f28ccd5949ade78660c4b313b
RTC: Add UIP(update in progress) check logic

The UIP(update in progress) is set when RTC is in updating. And the
update cycle begins 244us later after UIP is set.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r c343c98ed82d -r f06a031fdaf9 xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:34:55 2012 +0000
+++ b/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:36:15 2012 +0000
@@ -28,6 +28,8 @@
 #include <asm/hvm/support.h>
 #include <asm/current.h>
 
+#define USEC_PER_SEC    1000000UL
+
 #define domain_vrtc(x) (&(x)->arch.hvm_domain.pl_time.vrtc)
 #define vcpu_vrtc(x)   (domain_vrtc((x)->domain))
 #define vrtc_domain(x) (container_of((x), struct domain, \
@@ -239,6 +241,22 @@
     s->hw.cmos_data[RTC_YEAR] = to_bcd(s, tm->tm_year % 100);
 }
 
+static int update_in_progress(RTCState *s)
+{
+    uint64_t guest_usec;
+    struct domain *d = vrtc_domain(s);
+
+    if (s->hw.cmos_data[RTC_REG_B] & RTC_SET)
+        return 0;
+
+    guest_usec = get_localtime_us(d);
+    /* UIP bit will be set at last 244us of every second. */
+    if ((guest_usec % USEC_PER_SEC) >= (USEC_PER_SEC - 244))
+        return 1;
+
+    return 0;
+}
+
 static uint32_t rtc_ioport_read(RTCState *s, uint32_t addr)
 {
     int ret;
@@ -268,6 +286,8 @@
         break;
     case RTC_REG_A:
         ret = s->hw.cmos_data[s->hw.cmos_index];
+        if (update_in_progress(s))
+            ret |= RTC_UIP;
         break;
     case RTC_REG_C:
         ret = s->hw.cmos_data[s->hw.cmos_index];
diff -r c343c98ed82d -r f06a031fdaf9 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c	Wed Mar 07 07:34:55 2012 +0000
+++ b/xen/arch/x86/time.c	Wed Mar 07 07:36:15 2012 +0000
@@ -1601,6 +1601,13 @@
         + d->time_offset_seconds;
 }
 
+/* Return microsecs after 00:00:00 localtime, 1 January, 1970. */
+uint64_t get_localtime_us(struct domain *d)
+{
+    return ((wc_sec + d->time_offset_seconds) * 1000000000ULL
+        + wc_nsec + NOW()) / 1000UL;
+}
+
 unsigned long get_sec(void)
 {
     return wc_sec + (wc_nsec + NOW()) / 1000000000ULL;
diff -r c343c98ed82d -r f06a031fdaf9 xen/include/xen/time.h
--- a/xen/include/xen/time.h	Wed Mar 07 07:34:55 2012 +0000
+++ b/xen/include/xen/time.h	Wed Mar 07 07:36:15 2012 +0000
@@ -34,6 +34,7 @@
 
 s_time_t get_s_time(void);
 unsigned long get_localtime(struct domain *d);
+uint64_t get_localtime_us(struct domain *d);
 
 struct tm {
     int     tm_sec;         /* seconds */

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGc-0004Uu-Jk; Wed, 07 Mar 2012 19: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 1S5MGa-0004Q6-Mf
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:16 +0000
Received: from [85.158.143.99:55245] by server-1.bemta-4.messagelabs.com id
	D2/02-20925-4D2B75F4; Wed, 07 Mar 2012 19:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1331147474!17529201!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7482 invoked from network); 7 Mar 2012 19:11:15 -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;
	7 Mar 2012 19: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 1S5MGY-0003Xc-4n
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGY-0001cX-03
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:14 +0000
Message-Id: <E1S5MGY-0001cX-03@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: Don't remove user-supplied
	xen-version during make clean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331106182 0
# Node ID 9b152ebe9843c41b45953be7778c51d0e788594e
# Parent  0f51f175fb5757cca6cb319ef3709c2ffbd26280
build: Don't remove user-supplied xen-version during make clean

xen/Makefile is designed to allow the user to supply a file named
xen/xen-include to change the format of xen version strings.
Unfortunately, "make clean" removes xen/xen*, which will remove this
file.

Make the clean process more targeted.

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


diff -r 0f51f175fb57 -r 9b152ebe9843 xen/Makefile
--- a/xen/Makefile	Wed Mar 07 07:42:09 2012 +0000
+++ b/xen/Makefile	Wed Mar 07 07:43:02 2012 +0000
@@ -61,7 +61,7 @@
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	rm -f include/asm *.o $(TARGET)* *~ core
+	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET)-syms *~ core
 	rm -f include/asm-*/asm-offsets.h
 	[ -d tools/figlet ] && rm -f .banner*
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGc-0004Uu-Jk; Wed, 07 Mar 2012 19: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 1S5MGa-0004Q6-Mf
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:16 +0000
Received: from [85.158.143.99:55245] by server-1.bemta-4.messagelabs.com id
	D2/02-20925-4D2B75F4; Wed, 07 Mar 2012 19:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1331147474!17529201!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7482 invoked from network); 7 Mar 2012 19:11:15 -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;
	7 Mar 2012 19: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 1S5MGY-0003Xc-4n
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGY-0001cX-03
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:14 +0000
Message-Id: <E1S5MGY-0001cX-03@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] build: Don't remove user-supplied
	xen-version during make clean
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331106182 0
# Node ID 9b152ebe9843c41b45953be7778c51d0e788594e
# Parent  0f51f175fb5757cca6cb319ef3709c2ffbd26280
build: Don't remove user-supplied xen-version during make clean

xen/Makefile is designed to allow the user to supply a file named
xen/xen-include to change the format of xen version strings.
Unfortunately, "make clean" removes xen/xen*, which will remove this
file.

Make the clean process more targeted.

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


diff -r 0f51f175fb57 -r 9b152ebe9843 xen/Makefile
--- a/xen/Makefile	Wed Mar 07 07:42:09 2012 +0000
+++ b/xen/Makefile	Wed Mar 07 07:43:02 2012 +0000
@@ -61,7 +61,7 @@
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	rm -f include/asm *.o $(TARGET)* *~ core
+	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET)-syms *~ core
 	rm -f include/asm-*/asm-offsets.h
 	[ -d tools/figlet ] && rm -f .banner*
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGc-0004VR-Sz; Wed, 07 Mar 2012 19: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 1S5MGb-0004QP-FI
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:17 +0000
Received: from [193.109.254.147:64550] by server-7.bemta-14.messagelabs.com id
	9C/BD-09610-5D2B75F4; Wed, 07 Mar 2012 19:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1331147404!58983482!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23164 invoked from network); 7 Mar 2012 19:10:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 19:10: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 1S5MGY-0003Xf-J5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGY-0001d2-Hd
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:14 +0000
Message-Id: <E1S5MGY-0001d2-Hd@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] DOCS: Initial document regarding
	Xen's command line parameters
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331106273 0
# Node ID 39aff519e7d43dcc58273f6e62310e2cdffa1b1f
# Parent  9b152ebe9843c41b45953be7778c51d0e788594e
DOCS: Initial document regarding Xen's command line parameters

Still a work in progress, but submitted as a start.

Changes since v1:
  - Include all up to date information from the wiki.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 9b152ebe9843 -r 39aff519e7d4 docs/misc/xen-command-line.markdown
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/misc/xen-command-line.markdown	Wed Mar 07 07:44:33 2012 +0000
@@ -0,0 +1,399 @@
+# Xen Hypervisor Command Line Options
+
+**This document is still a work in progress.  There are currently some command line options listed twice, and they are defined in separate arch trees, and some options are currently separate from their legacy versions.  Please remove this notice when complete.**
+
+This document coveres the command line options which the Xen Hypervisor.
+
+## Types of parameter
+
+Most parameters take the form `option=value`.  Different options on the command line should be space delimited.
+
+### Boolean
+
+All boolean option may be explicitly enabled using a `value` of
+> `yes`, `on`, `true`, `enable` or `1`
+
+They may be explicitly disabled using a `value` of
+> `no`, `off`, `false`, `disable` or `0`
+
+In addition, a boolean option may be enabled by simply stating its name, and may be disabled by prefixing its name with `no-`.
+
+####Examples
+
+Enable noreboot mode
+> `noreboot=true`
+
+Disable x2apic support (if present)
+> `x2apic=off`
+
+Enable synchronous console mode
+> `sync_console`
+
+### Integer
+
+An integer parameter will default to decimal and may be prefixed with a `-` for negative numbers.  Alternativly, a hexidecimal number may be used by prefixing the number with `0x`, or an octal number may be used if a leading `0` is present.
+
+### Size
+
+A size parameter may be any integer, with a size suffix
+
+* `G` or `g`: Giga (2^30)
+* `M` or `m`: Mega (2^20)
+* `K` or `k`: Kilo (2^10)
+* `B` or `b`: Bytes
+
+Without a size suffix, the default will be kilo.
+
+### String
+
+Many parameters are more complicated and require more intricate configuration.  The detailed description of each individual paramter specify which values are valid.
+
+### List
+
+Some options take a comma separated list of values.
+
+### Combination
+
+Some parameters act as combinations of the above, most commonly a mix of Boolean and String.  These are noted in the relevant sections.
+
+## Parameter details
+
+### acpi
+> `= force | ht | noirq | <boolean>`
+
+**String**, or **Boolean** to disable.
+
+The `acpi` option is used to control a set of four related boolean flags; `acpi_force`, `acpi_ht`, `acpi_noirq` and `acpi_disabled`.
+
+By default, Xen will scan the DMI data and blacklist certain systems which are known to have broken ACPI setups.  Providing `acpi=force` will cause Xen to ignore the blacklist and attempt to use all ACPI features.
+
+Using `acpi=ht` causes Xen to parse the ACPI tables enough to enumerate all CPUs, but will not use other ACPI features.  This is not common, and only has an effect if your system is blacklisted.
+
+The `acpi=noirq` option causes Xen to not parse the ACPI MADT table looking for IO-APIC entries.  This is also not common, and any system which requries this option to function should be blacklisted.  Additionally, this will not prevent Xen from finding IO-APIC entries from the MP tables.
+
+Finally, any of the boolean false options can be used to disable ACPI usage entirely.
+
+### acpi\_apic\_instance
+> `= <integer>`
+
+Specify which ACPI MADT table to parse for APIC information, if more than one is present.
+
+### acpi\_pstate\_strict
+### acpi\_skip\_timer\_override
+### acpi\_sleep
+### additional\_cpus
+### allowsuperpage
+### apic
+> `= summit | bigsmp | default`
+
+Override Xen's logic for choosing the APIC driver.  By default, if there are more than 8 CPUs, Xen will switch to `bigsmp` over `default`.
+
+### apic\_verbosity
+> `= verbose | debug`
+
+Increase the verbosity of the APIC code from the default value.
+
+### ats
+### availmem
+### badpage
+> `= List of [ <integer> | <ingeter>-<integer> ]`
+
+Specify that certain pages, or certain ranges of pages contain bad bytes and should not be used.  For example, if your memory tester says that byte `0x12345678` is bad, you would place `badpage=0x12345` on Xen's command line.
+
+### bootscrub
+### cachesize
+### clocksource
+### com1,com2
+> `= <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]] | pci | amt ] `
+
+Both option `com1` and `com2` follow the same format.
+
+* `<baud>` may be either an integer baud rate, or the string `auto` if the bootloader or other earlier firmware has already set it up.
+* Optionally, a clock speed measured in hz can be specified.
+* `DPS` represents the number of data bits, the parity, and the number of stop bits.
+
+  `D` is an integer between 5 and 8 for the number of data bits.
+
+  `P` is a single character representing the type of parity:
+
+   * `n` No
+   * `o` Odd
+   * `e` Even
+   * `m` Mark
+   * `s` Space
+
+  `S` is an integer 1 or 2 for the number of stop bits.
+
+* `<io-base>` is an integer which specifies the IO base port for UART registers.
+* `<irq> ` is the IRQ number to use, or `0` to use the UART in poll mode only.
+* `<port-bdf>` is the PCI location of the UART, in `<bus>:<device>.<function>` notation.
+* `<bridge-bdf>` is the PCI bridge behind which is the UART, in `<bus>:<device>.<function>` notation.
+* `pci` indicates that Xen should scan the PCI bus for the UART, avoiding Intel AMT devices.
+* `amt` indicated that Xen should scan the PCI bus for the UART, including Intel AMT devices if presetn.
+
+A typical setup for most situations might be `com1=115200,8n1`
+
+
+### conring\_size
+> `= <size>`
+
+> Default: `conring_size=16k`
+
+Specify the size of the console ring buffer.
+
+### console
+> `= List of [ vga | com1[H,L] | com2[H,L] | none ]`
+
+> Default: `console=com1,vga`
+
+Specify which console(s) Xen should use.
+
+`vga` indicates that Xen should try and use the vga graphics adapter.
+
+`com1` and `com2` indicates that Xen should use serial ports 1 and 2 respectivly.  Optionally, these arguments may be followed by an `H` or `L`.  `H` indicates that transmitted characters will have their MSB set, while recieved characters must have their MSB set.  `L` indicates the converse; transmitted and recieved characters will have their MSB cleared.  This allows a single port to be shared by two subsystems (e.g. console and debugger).
+
+`none` indicates that Xen should not use a console.  This option only makes sense on its own.
+
+### console\_timestamps
+> `= <boolean>`
+
+> Default: `false`
+
+Flag to indicate whether include a timestamp with each console line.
+
+### console\_to\_ring
+> `= <boolean>`
+
+> Default: `false`
+
+Flag to indicate whether all guest console output should be copied into the console ring buffer.
+
+### conswitch
+> `= <switch char>[,x]`
+
+> Default `conswitch=a`
+
+Specify which character should be used to switch serial input between Xen and dom0.  The required sequence is CTRL-&lt;switch char&gt; three times.
+
+The optional trailing `x` indicates that Xen should not automatically switch the console input to dom0 during boot.  Any other value, including omission, causes Xen to automatically switch to the dom0 console during dom0 boot.
+
+### contig\_mem
+### cpu\_type
+### cpufreq
+### cpuid\_mask\_cpu
+### cpuid\_mask\_ecx
+### cpuid\_mask\_edx
+### cpuid\_mask\_ext\_ecx
+### cpuid\_mask\_ext\_edx
+### cpuid\_mask\_xsave\_eax
+### cpuidle
+### cpuinfo
+### crashkernel
+### credit2\_balance\_over
+### credit2\_balance\_under
+### credit2\_load\_window\_shift
+### debug\_stack\_lines
+### debug\_stack\_lines
+### debugtrace
+### dma\_bits
+> `= <integer>`
+
+Specify the bit width of the DMA heap.
+
+### dom0\_ioports\_disable
+### dom0\_max\_vcpus
+> `= <integer>`
+
+Specifiy the maximum number of vcpus to give to dom0.  This defaults to the number of pcpus on the host.
+
+### dom0\_mem (ia64)
+> `= <size>`
+
+Specify the total size for dom0.
+
+### dom0\_mem (x86)
+> `= List of ( min:<value> | max: <value> | <value> )`
+
+each `<value>` is a size parameter.  If the size is positive, it represents an absolute value.  If the size is negative, the size specified is subtracted from the total available memory.
+
+* `min:<value>` specifies the minimum amount of memory allocated to dom0.
+* `max:<value>` specifies the maximum amount of memory allocated to dom0.
+* `<value>` specified the exact amount of memory allocated to dom0.
+
+### dom0\_shadow
+### dom0\_vcpus\_pin
+> `= <boolean>`
+
+> Default: `false`
+
+Pin dom0 vcpus to their respective pcpus
+
+### dom0\_vhpt\_size\_log2
+### dom\_rid\_bits
+### e820-mtrr-clip
+### e820-verbose
+### efi\_print
+### extra\_guest\_irqs
+### flask\_enabled
+### flask\_enforcing
+### font
+### gdb
+### gnttab\_max\_nr\_frames
+### guest\_loglvl
+> `= <level>[/<rate-limited level>]` where level is `none | error | warning | info | debug | all`
+
+> Default: `guest_loglvl=none/warning`
+
+Set the logging level for Xen guests.  Any log message with equal more more importance will be printed.
+
+The optional `<rate-limited level>` options instructs which severities should be rate limited.
+### hap\_1gb
+### hap\_2mb
+### hpetbroadcast
+### hvm\_debug
+### hvm\_port80
+### idle\_latency\_factor
+### ioapic\_ack
+### iommu
+### iommu\_inclusive\_mapping
+### irq\_ratelimit
+### irq\_vector\_map
+### lapic
+
+Force the use of use of the local APIC on a uniprocessor system, even if left disabled by the BIOS.  This option will accept any value at all.
+
+### lapic\_timer\_c2\_ok
+### ler
+### loglvl
+> `= <level>[/<rate-limited level>]` where level is `none | error | warning | info | debug | all`
+
+> Default: `loglvl=warning`
+
+Set the logging level for Xen.  Any log message with equal more more importance will be printed.
+
+The optional `<rate-limited level>` options instructs which severities should be rate limited.
+
+### max\_cstate
+### max\_gsi\_irqs
+### maxcpus
+### maxcpus
+### mce
+### mce\_fb
+### mce\_verbosity
+### mem
+> `= <size>`
+
+Specifies the maximum address of physical RAM.  Any RAM beyond this limit is ignored by Xen.
+
+### mmcfg
+### nmi
+> `= ignore | dom0 | fatal`
+
+> Default: `nmi=fatal`
+
+Specify what Xen should do in the event of an NMI parity or I/O error.  `ignore` discards the error; `dom0` causes Xen to report the error to dom0, while 'fatal' causes Xen to print diagnostics and then hang.
+
+### noapic
+### nofxsr
+### noirqbalance
+> `= <boolean>`
+
+Disable software IRQ balancing and affinity. This can be used on systems such as Dell 1850/2850 that have workarounds in hardware for IRQ routing issues.
+
+### nolapic
+
+Ignore the local APIC on a uniprocessor system, even if enabled by the BIOS.  This option will accept value.
+
+### noreboot
+> `= <boolean>`
+
+Do not automatically reboot after an error.  This is useful for catching debug output.  Defaults to automatically reboot after 5 seconds.
+
+### noserialnumber
+### nosmp
+> `= <boolean>`
+
+Disable SMP support.  No secondary processors will be booted.  Defaults to booting secondary processors.
+
+### nr\_irqs
+### numa
+### pervcpu\_vhpt
+### ple\_gap
+### ple\_window
+### reboot
+### sched
+> `= credit | credit2 | sedf | arinc653`
+
+> Default: `sched=credit`
+
+Choose the default scheduler.
+
+### sched\_credit2\_migrate\_resist
+### sched\_credit\_default\_yield
+### sched\_credit\_tslice\_ms
+### sched\_ratelimit\_us
+### sched\_smt\_power\_savings
+### serial\_tx\_buffer
+> `= <size>`
+
+Set the serial tramsit buffer size.  Defaults to 16kB.
+### smep
+### snb\_igd\_quirk
+### sync\_console
+> `= <boolean>`
+
+> Default: `false`
+
+Flag to force synchronous console output.  Useful for debugging, but not suitable for production environments due to incurred overhead.
+
+### tboot
+### tbuf\_size
+> `= <integer>`
+
+Specify the per-cpu trace buffer size in pages.
+
+### tdt
+### tevt\_mask
+### tickle\_one\_idle\_cpu
+### timer\_slop
+### tmem
+### tmem\_compress
+### tmem\_dedup
+### tmem\_lock
+### tmem\_shared\_auth
+### tmem\_tze
+### tsc
+### ucode
+### unrestricted\_guest
+### vcpu\_migration\_delay
+### vesa-map
+### vesa-mtrr
+### vesa-ram
+### vga
+> `= ( ask | current | text-80x<rows> | gfx-<width>x<height>x<depth> | mode-<mode> )[,keep]`
+
+`ask` causes Xen to display a menu of available modes and request the user to choose one of them.
+
+`current` causes Xen to use the graphics adapter in its current state, without further setup.
+
+`text-80x<rows>` instructs Xen to set up text mode.  Valid values for `<rows>` are `25, 28, 30, 34, 43, 50, 80`
+
+`gfx-<width>x<height>x<depth>` instructs Xen to set up graphics mode with the specified width, height and depth.
+
+`mode-<mode>` instructs Xen to use a specific mode, as shown with the `ask` option.  (N.B menu modes are displayed in hex, so `<mode>` should be a hexidecimal number)
+
+The optional `keep` parameter causes Xen to continue using the vga console even after dom0 has been started.  The default behaviour is to relinquish control to dom0.
+
+### vpid
+### vpmu
+### vti\_vhpt\_size
+### vti\_vtlb\_size
+### watchdog
+> `= <boolean>`
+
+Run an NMI watchdog on each processor.  Defaults to disabled.
+### x2apic
+### x2apic\_phys
+### xencons
+### xencons\_poll
+### xsave

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGc-0004VA-MS; Wed, 07 Mar 2012 19:11: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 1S5MGa-0004S0-Tz
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:17 +0000
Received: from [85.158.139.83:47629] by server-1.bemta-5.messagelabs.com id
	4E/9C-28458-3D2B75F4; Wed, 07 Mar 2012 19:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1331147473!17675440!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15782 invoked from network); 7 Mar 2012 19:11:14 -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;
	7 Mar 2012 19: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 1S5MGX-0003XW-50
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGW-0001bY-Tp
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:12 +0000
Message-Id: <E1S5MGW-0001bY-Tp@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] RTC: Add alarm 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Yang Zhang <yang.z.zhang@Intel.com>
# Date 1331105885 0
# Node ID f29e4080ea6bcdb6838a24db5e840c9caa98eee5
# Parent  b098111c0a2f88a708914b0553eb7153286c9e63
RTC: Add alarm support

Use a timer to emulate update cycle. The timer runs only when AIE is
set.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r b098111c0a2f -r f29e4080ea6b xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:37:21 2012 +0000
+++ b/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:38:05 2012 +0000
@@ -30,6 +30,12 @@
 
 #define USEC_PER_SEC    1000000UL
 #define NS_PER_USEC     1000UL
+#define NS_PER_SEC      1000000000ULL
+
+#define SEC_PER_MIN     60
+#define SEC_PER_HOUR    3600
+#define MIN_PER_HOUR    60
+#define HOUR_PER_DAY    24
 
 #define domain_vrtc(x) (&(x)->arch.hvm_domain.pl_time.vrtc)
 #define vcpu_vrtc(x)   (domain_vrtc((x)->domain))
@@ -40,6 +46,9 @@
 #define get_year(x)    (x + epoch_year)
 
 static void rtc_copy_date(RTCState *s);
+static void rtc_set_time(RTCState *s);
+static inline int from_bcd(RTCState *s, int a);
+static inline int convert_hour(RTCState *s, int hour);
 
 static void rtc_periodic_cb(struct vcpu *v, void *opaque)
 {
@@ -153,7 +162,204 @@
     spin_unlock(&s->lock);
 }
 
-static void rtc_set_time(RTCState *s);
+/* handle alarm timer */
+static void alarm_timer_update(RTCState *s)
+{
+    uint64_t next_update_time, next_alarm_sec;
+    uint64_t expire_time;
+    int32_t alarm_sec, alarm_min, alarm_hour, cur_hour, cur_min, cur_sec;
+    int32_t hour, min;
+    struct domain *d = vrtc_domain(s);
+
+    ASSERT(spin_is_locked(&s->lock));
+
+    stop_timer(&s->alarm_timer);
+
+    if ((s->hw.cmos_data[RTC_REG_B] & RTC_AIE) &&
+            !(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+    {
+        s->current_tm = gmtime(get_localtime(d));
+        rtc_copy_date(s);
+
+        alarm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS_ALARM]);
+        alarm_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES_ALARM]);
+        alarm_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS_ALARM]);
+        alarm_hour = convert_hour(s, alarm_hour);
+
+        cur_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
+        cur_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES]);
+        cur_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS]);
+        cur_hour = convert_hour(s, cur_hour);
+
+        next_update_time = USEC_PER_SEC - (get_localtime_us(d) % USEC_PER_SEC);
+        next_update_time = next_update_time * NS_PER_USEC + NOW();
+
+        if ((s->hw.cmos_data[RTC_HOURS_ALARM] & 0xc0) == 0xc0)
+        {
+            if ((s->hw.cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0)
+            {
+                if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                    next_alarm_sec = 1;
+                else if (cur_sec < alarm_sec)
+                    next_alarm_sec = alarm_sec - cur_sec;
+                else
+                    next_alarm_sec = alarm_sec + SEC_PER_MIN - cur_sec;
+            }
+            else
+            {
+                if (cur_min < alarm_min)
+                {
+                    min = alarm_min - cur_min;
+                    next_alarm_sec = min * SEC_PER_MIN - cur_sec;
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+                else if (cur_min == alarm_min)
+                {
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec = 1;
+                    else if (cur_sec < alarm_sec)
+                        next_alarm_sec = alarm_sec - cur_sec;
+                    else
+                    {
+                        min = alarm_min + MIN_PER_HOUR - cur_min;
+                        next_alarm_sec =
+                            alarm_sec + min * SEC_PER_MIN - cur_sec;
+                    }
+                }
+                else
+                {
+                    min = alarm_min + MIN_PER_HOUR - cur_min;
+                    next_alarm_sec = min * SEC_PER_MIN - cur_sec;
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+            }
+        }
+        else
+        {
+            if (cur_hour < alarm_hour)
+            {
+                hour = alarm_hour - cur_hour;
+                next_alarm_sec = hour * SEC_PER_HOUR -
+                    cur_min * SEC_PER_MIN - cur_sec;
+                if ((s->hw.cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0)
+                {
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+                else
+                {
+                    next_alarm_sec += alarm_min * SEC_PER_MIN;
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+            }
+            else if (cur_hour == alarm_hour)
+            {
+                if ((s->hw.cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0)
+                {
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec = 1;
+                    else if (cur_sec < alarm_sec)
+                        next_alarm_sec = alarm_sec - cur_sec;
+                    else
+                        next_alarm_sec = alarm_sec + SEC_PER_MIN - cur_sec;
+                }
+                else if (cur_min < alarm_min)
+                {
+                    min = alarm_min - cur_min;
+                    next_alarm_sec = min * SEC_PER_MIN - cur_sec;
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+                else if (cur_min == alarm_min)
+                {
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec = 1;
+                    else if (cur_sec < alarm_sec)
+                        next_alarm_sec = alarm_sec - cur_sec;
+                    else
+                    {
+                        hour = alarm_hour + HOUR_PER_DAY - cur_hour;
+                        next_alarm_sec = hour * SEC_PER_HOUR -
+                            cur_min * SEC_PER_MIN - cur_sec;
+                        next_alarm_sec += alarm_min * SEC_PER_MIN + alarm_sec;
+                    }
+                }
+                else
+                {
+                    hour = alarm_hour + HOUR_PER_DAY - cur_hour;
+                    next_alarm_sec = hour * SEC_PER_HOUR -
+                        cur_min * SEC_PER_MIN - cur_sec;
+                    next_alarm_sec += alarm_min * SEC_PER_MIN;
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+            }
+            else
+            {
+                hour = alarm_hour + HOUR_PER_DAY - cur_hour;
+                next_alarm_sec = hour * SEC_PER_HOUR -
+                    cur_min * SEC_PER_MIN - cur_sec;
+                if ((s->hw.cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0)
+                {
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+                else
+                {
+                    next_alarm_sec += alarm_min * SEC_PER_MIN;
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+            }
+        }
+        expire_time = (next_alarm_sec - 1) * NS_PER_SEC + next_update_time;
+        /* release lock before set timer */
+        spin_unlock(&s->lock);
+        set_timer(&s->alarm_timer, expire_time);
+        /* fetch lock again */
+        spin_lock(&s->lock);
+    }
+}
+
+static void rtc_alarm_cb(void *opaque)
+{
+    RTCState *s = opaque;
+    struct domain *d = vrtc_domain(s);
+
+    spin_lock(&s->lock);
+    if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+    {
+        s->hw.cmos_data[RTC_REG_C] |= RTC_AF;
+        /* alarm interrupt */
+        if (s->hw.cmos_data[RTC_REG_B] & RTC_AIE)
+        {
+            s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
+            hvm_isa_irq_deassert(d, RTC_IRQ);
+            hvm_isa_irq_assert(d, RTC_IRQ);
+        }
+        alarm_timer_update(s);
+    }
+    spin_unlock(&s->lock);
+}
 
 static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
 {
@@ -182,6 +388,7 @@
     case RTC_MINUTES_ALARM:
     case RTC_HOURS_ALARM:
         s->hw.cmos_data[s->hw.cmos_index] = data;
+        alarm_timer_update(s);
         break;
     case RTC_SECONDS:
     case RTC_MINUTES:
@@ -194,6 +401,7 @@
         /* if in set mode, do not update the time */
         if ( !(s->hw.cmos_data[RTC_REG_B] & RTC_SET) )
             rtc_set_time(s);
+        alarm_timer_update(s);
         break;
     case RTC_REG_A:
         /* UIP bit is read only */
@@ -230,6 +438,7 @@
         s->hw.cmos_data[RTC_REG_B] = data;
         rtc_timer_update(s);
         check_update_timer(s);
+        alarm_timer_update(s);
         break;
     case RTC_REG_C:
     case RTC_REG_D:
@@ -426,6 +635,7 @@
     {
         migrate_timer(&s->update_timer, v->processor);;
         migrate_timer(&s->update_timer2, v->processor);;
+        migrate_timer(&s->alarm_timer, v->processor);;
     }
 }
 
@@ -462,6 +672,7 @@
     /* Reset the periodic interrupt timer based on the registers */
     rtc_timer_update(s);
     check_update_timer(s);
+    alarm_timer_update(s);
 
     spin_unlock(&s->lock);
 
@@ -486,12 +697,12 @@
 
     init_timer(&s->update_timer, rtc_update_timer, s, smp_processor_id());
     init_timer(&s->update_timer2, rtc_update_timer2, s, smp_processor_id());
+    init_timer(&s->alarm_timer, rtc_alarm_cb, s, smp_processor_id());
 
     register_portio_handler(d, RTC_PORT(0), 2, handle_rtc_io);
 
     rtc_reset(d);
 
-
     spin_lock(&s->lock);
 
     s->hw.cmos_data[RTC_REG_A] = RTC_REF_CLCK_32KHZ | 6; /* ~1kHz */
@@ -516,6 +727,7 @@
     destroy_periodic_time(&s->pt);
     kill_timer(&s->update_timer);
     kill_timer(&s->update_timer2);
+    kill_timer(&s->alarm_timer);
 }
 
 void rtc_update_clock(struct domain *d)
diff -r b098111c0a2f -r f29e4080ea6b xen/include/asm-x86/hvm/vpt.h
--- a/xen/include/asm-x86/hvm/vpt.h	Wed Mar 07 07:37:21 2012 +0000
+++ b/xen/include/asm-x86/hvm/vpt.h	Wed Mar 07 07:38:05 2012 +0000
@@ -110,6 +110,8 @@
     /* update-ended timer */
     struct timer update_timer;
     struct timer update_timer2;
+    /* alarm timer */
+    struct timer alarm_timer;
     uint64_t next_update_time;
     uint32_t use_timer;
     spinlock_t lock;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGc-0004VR-Sz; Wed, 07 Mar 2012 19: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 1S5MGb-0004QP-FI
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:17 +0000
Received: from [193.109.254.147:64550] by server-7.bemta-14.messagelabs.com id
	9C/BD-09610-5D2B75F4; Wed, 07 Mar 2012 19:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1331147404!58983482!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23164 invoked from network); 7 Mar 2012 19:10:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 19:10: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 1S5MGY-0003Xf-J5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGY-0001d2-Hd
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:14 +0000
Message-Id: <E1S5MGY-0001d2-Hd@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] DOCS: Initial document regarding
	Xen's command line parameters
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331106273 0
# Node ID 39aff519e7d43dcc58273f6e62310e2cdffa1b1f
# Parent  9b152ebe9843c41b45953be7778c51d0e788594e
DOCS: Initial document regarding Xen's command line parameters

Still a work in progress, but submitted as a start.

Changes since v1:
  - Include all up to date information from the wiki.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 9b152ebe9843 -r 39aff519e7d4 docs/misc/xen-command-line.markdown
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/misc/xen-command-line.markdown	Wed Mar 07 07:44:33 2012 +0000
@@ -0,0 +1,399 @@
+# Xen Hypervisor Command Line Options
+
+**This document is still a work in progress.  There are currently some command line options listed twice, and they are defined in separate arch trees, and some options are currently separate from their legacy versions.  Please remove this notice when complete.**
+
+This document coveres the command line options which the Xen Hypervisor.
+
+## Types of parameter
+
+Most parameters take the form `option=value`.  Different options on the command line should be space delimited.
+
+### Boolean
+
+All boolean option may be explicitly enabled using a `value` of
+> `yes`, `on`, `true`, `enable` or `1`
+
+They may be explicitly disabled using a `value` of
+> `no`, `off`, `false`, `disable` or `0`
+
+In addition, a boolean option may be enabled by simply stating its name, and may be disabled by prefixing its name with `no-`.
+
+####Examples
+
+Enable noreboot mode
+> `noreboot=true`
+
+Disable x2apic support (if present)
+> `x2apic=off`
+
+Enable synchronous console mode
+> `sync_console`
+
+### Integer
+
+An integer parameter will default to decimal and may be prefixed with a `-` for negative numbers.  Alternativly, a hexidecimal number may be used by prefixing the number with `0x`, or an octal number may be used if a leading `0` is present.
+
+### Size
+
+A size parameter may be any integer, with a size suffix
+
+* `G` or `g`: Giga (2^30)
+* `M` or `m`: Mega (2^20)
+* `K` or `k`: Kilo (2^10)
+* `B` or `b`: Bytes
+
+Without a size suffix, the default will be kilo.
+
+### String
+
+Many parameters are more complicated and require more intricate configuration.  The detailed description of each individual paramter specify which values are valid.
+
+### List
+
+Some options take a comma separated list of values.
+
+### Combination
+
+Some parameters act as combinations of the above, most commonly a mix of Boolean and String.  These are noted in the relevant sections.
+
+## Parameter details
+
+### acpi
+> `= force | ht | noirq | <boolean>`
+
+**String**, or **Boolean** to disable.
+
+The `acpi` option is used to control a set of four related boolean flags; `acpi_force`, `acpi_ht`, `acpi_noirq` and `acpi_disabled`.
+
+By default, Xen will scan the DMI data and blacklist certain systems which are known to have broken ACPI setups.  Providing `acpi=force` will cause Xen to ignore the blacklist and attempt to use all ACPI features.
+
+Using `acpi=ht` causes Xen to parse the ACPI tables enough to enumerate all CPUs, but will not use other ACPI features.  This is not common, and only has an effect if your system is blacklisted.
+
+The `acpi=noirq` option causes Xen to not parse the ACPI MADT table looking for IO-APIC entries.  This is also not common, and any system which requries this option to function should be blacklisted.  Additionally, this will not prevent Xen from finding IO-APIC entries from the MP tables.
+
+Finally, any of the boolean false options can be used to disable ACPI usage entirely.
+
+### acpi\_apic\_instance
+> `= <integer>`
+
+Specify which ACPI MADT table to parse for APIC information, if more than one is present.
+
+### acpi\_pstate\_strict
+### acpi\_skip\_timer\_override
+### acpi\_sleep
+### additional\_cpus
+### allowsuperpage
+### apic
+> `= summit | bigsmp | default`
+
+Override Xen's logic for choosing the APIC driver.  By default, if there are more than 8 CPUs, Xen will switch to `bigsmp` over `default`.
+
+### apic\_verbosity
+> `= verbose | debug`
+
+Increase the verbosity of the APIC code from the default value.
+
+### ats
+### availmem
+### badpage
+> `= List of [ <integer> | <ingeter>-<integer> ]`
+
+Specify that certain pages, or certain ranges of pages contain bad bytes and should not be used.  For example, if your memory tester says that byte `0x12345678` is bad, you would place `badpage=0x12345` on Xen's command line.
+
+### bootscrub
+### cachesize
+### clocksource
+### com1,com2
+> `= <baud>[/<clock_hz>][,DPS[,<io-base>[,<irq>[,<port-bdf>[,<bridge-bdf>]]]] | pci | amt ] `
+
+Both option `com1` and `com2` follow the same format.
+
+* `<baud>` may be either an integer baud rate, or the string `auto` if the bootloader or other earlier firmware has already set it up.
+* Optionally, a clock speed measured in hz can be specified.
+* `DPS` represents the number of data bits, the parity, and the number of stop bits.
+
+  `D` is an integer between 5 and 8 for the number of data bits.
+
+  `P` is a single character representing the type of parity:
+
+   * `n` No
+   * `o` Odd
+   * `e` Even
+   * `m` Mark
+   * `s` Space
+
+  `S` is an integer 1 or 2 for the number of stop bits.
+
+* `<io-base>` is an integer which specifies the IO base port for UART registers.
+* `<irq> ` is the IRQ number to use, or `0` to use the UART in poll mode only.
+* `<port-bdf>` is the PCI location of the UART, in `<bus>:<device>.<function>` notation.
+* `<bridge-bdf>` is the PCI bridge behind which is the UART, in `<bus>:<device>.<function>` notation.
+* `pci` indicates that Xen should scan the PCI bus for the UART, avoiding Intel AMT devices.
+* `amt` indicated that Xen should scan the PCI bus for the UART, including Intel AMT devices if presetn.
+
+A typical setup for most situations might be `com1=115200,8n1`
+
+
+### conring\_size
+> `= <size>`
+
+> Default: `conring_size=16k`
+
+Specify the size of the console ring buffer.
+
+### console
+> `= List of [ vga | com1[H,L] | com2[H,L] | none ]`
+
+> Default: `console=com1,vga`
+
+Specify which console(s) Xen should use.
+
+`vga` indicates that Xen should try and use the vga graphics adapter.
+
+`com1` and `com2` indicates that Xen should use serial ports 1 and 2 respectivly.  Optionally, these arguments may be followed by an `H` or `L`.  `H` indicates that transmitted characters will have their MSB set, while recieved characters must have their MSB set.  `L` indicates the converse; transmitted and recieved characters will have their MSB cleared.  This allows a single port to be shared by two subsystems (e.g. console and debugger).
+
+`none` indicates that Xen should not use a console.  This option only makes sense on its own.
+
+### console\_timestamps
+> `= <boolean>`
+
+> Default: `false`
+
+Flag to indicate whether include a timestamp with each console line.
+
+### console\_to\_ring
+> `= <boolean>`
+
+> Default: `false`
+
+Flag to indicate whether all guest console output should be copied into the console ring buffer.
+
+### conswitch
+> `= <switch char>[,x]`
+
+> Default `conswitch=a`
+
+Specify which character should be used to switch serial input between Xen and dom0.  The required sequence is CTRL-&lt;switch char&gt; three times.
+
+The optional trailing `x` indicates that Xen should not automatically switch the console input to dom0 during boot.  Any other value, including omission, causes Xen to automatically switch to the dom0 console during dom0 boot.
+
+### contig\_mem
+### cpu\_type
+### cpufreq
+### cpuid\_mask\_cpu
+### cpuid\_mask\_ecx
+### cpuid\_mask\_edx
+### cpuid\_mask\_ext\_ecx
+### cpuid\_mask\_ext\_edx
+### cpuid\_mask\_xsave\_eax
+### cpuidle
+### cpuinfo
+### crashkernel
+### credit2\_balance\_over
+### credit2\_balance\_under
+### credit2\_load\_window\_shift
+### debug\_stack\_lines
+### debug\_stack\_lines
+### debugtrace
+### dma\_bits
+> `= <integer>`
+
+Specify the bit width of the DMA heap.
+
+### dom0\_ioports\_disable
+### dom0\_max\_vcpus
+> `= <integer>`
+
+Specifiy the maximum number of vcpus to give to dom0.  This defaults to the number of pcpus on the host.
+
+### dom0\_mem (ia64)
+> `= <size>`
+
+Specify the total size for dom0.
+
+### dom0\_mem (x86)
+> `= List of ( min:<value> | max: <value> | <value> )`
+
+each `<value>` is a size parameter.  If the size is positive, it represents an absolute value.  If the size is negative, the size specified is subtracted from the total available memory.
+
+* `min:<value>` specifies the minimum amount of memory allocated to dom0.
+* `max:<value>` specifies the maximum amount of memory allocated to dom0.
+* `<value>` specified the exact amount of memory allocated to dom0.
+
+### dom0\_shadow
+### dom0\_vcpus\_pin
+> `= <boolean>`
+
+> Default: `false`
+
+Pin dom0 vcpus to their respective pcpus
+
+### dom0\_vhpt\_size\_log2
+### dom\_rid\_bits
+### e820-mtrr-clip
+### e820-verbose
+### efi\_print
+### extra\_guest\_irqs
+### flask\_enabled
+### flask\_enforcing
+### font
+### gdb
+### gnttab\_max\_nr\_frames
+### guest\_loglvl
+> `= <level>[/<rate-limited level>]` where level is `none | error | warning | info | debug | all`
+
+> Default: `guest_loglvl=none/warning`
+
+Set the logging level for Xen guests.  Any log message with equal more more importance will be printed.
+
+The optional `<rate-limited level>` options instructs which severities should be rate limited.
+### hap\_1gb
+### hap\_2mb
+### hpetbroadcast
+### hvm\_debug
+### hvm\_port80
+### idle\_latency\_factor
+### ioapic\_ack
+### iommu
+### iommu\_inclusive\_mapping
+### irq\_ratelimit
+### irq\_vector\_map
+### lapic
+
+Force the use of use of the local APIC on a uniprocessor system, even if left disabled by the BIOS.  This option will accept any value at all.
+
+### lapic\_timer\_c2\_ok
+### ler
+### loglvl
+> `= <level>[/<rate-limited level>]` where level is `none | error | warning | info | debug | all`
+
+> Default: `loglvl=warning`
+
+Set the logging level for Xen.  Any log message with equal more more importance will be printed.
+
+The optional `<rate-limited level>` options instructs which severities should be rate limited.
+
+### max\_cstate
+### max\_gsi\_irqs
+### maxcpus
+### maxcpus
+### mce
+### mce\_fb
+### mce\_verbosity
+### mem
+> `= <size>`
+
+Specifies the maximum address of physical RAM.  Any RAM beyond this limit is ignored by Xen.
+
+### mmcfg
+### nmi
+> `= ignore | dom0 | fatal`
+
+> Default: `nmi=fatal`
+
+Specify what Xen should do in the event of an NMI parity or I/O error.  `ignore` discards the error; `dom0` causes Xen to report the error to dom0, while 'fatal' causes Xen to print diagnostics and then hang.
+
+### noapic
+### nofxsr
+### noirqbalance
+> `= <boolean>`
+
+Disable software IRQ balancing and affinity. This can be used on systems such as Dell 1850/2850 that have workarounds in hardware for IRQ routing issues.
+
+### nolapic
+
+Ignore the local APIC on a uniprocessor system, even if enabled by the BIOS.  This option will accept value.
+
+### noreboot
+> `= <boolean>`
+
+Do not automatically reboot after an error.  This is useful for catching debug output.  Defaults to automatically reboot after 5 seconds.
+
+### noserialnumber
+### nosmp
+> `= <boolean>`
+
+Disable SMP support.  No secondary processors will be booted.  Defaults to booting secondary processors.
+
+### nr\_irqs
+### numa
+### pervcpu\_vhpt
+### ple\_gap
+### ple\_window
+### reboot
+### sched
+> `= credit | credit2 | sedf | arinc653`
+
+> Default: `sched=credit`
+
+Choose the default scheduler.
+
+### sched\_credit2\_migrate\_resist
+### sched\_credit\_default\_yield
+### sched\_credit\_tslice\_ms
+### sched\_ratelimit\_us
+### sched\_smt\_power\_savings
+### serial\_tx\_buffer
+> `= <size>`
+
+Set the serial tramsit buffer size.  Defaults to 16kB.
+### smep
+### snb\_igd\_quirk
+### sync\_console
+> `= <boolean>`
+
+> Default: `false`
+
+Flag to force synchronous console output.  Useful for debugging, but not suitable for production environments due to incurred overhead.
+
+### tboot
+### tbuf\_size
+> `= <integer>`
+
+Specify the per-cpu trace buffer size in pages.
+
+### tdt
+### tevt\_mask
+### tickle\_one\_idle\_cpu
+### timer\_slop
+### tmem
+### tmem\_compress
+### tmem\_dedup
+### tmem\_lock
+### tmem\_shared\_auth
+### tmem\_tze
+### tsc
+### ucode
+### unrestricted\_guest
+### vcpu\_migration\_delay
+### vesa-map
+### vesa-mtrr
+### vesa-ram
+### vga
+> `= ( ask | current | text-80x<rows> | gfx-<width>x<height>x<depth> | mode-<mode> )[,keep]`
+
+`ask` causes Xen to display a menu of available modes and request the user to choose one of them.
+
+`current` causes Xen to use the graphics adapter in its current state, without further setup.
+
+`text-80x<rows>` instructs Xen to set up text mode.  Valid values for `<rows>` are `25, 28, 30, 34, 43, 50, 80`
+
+`gfx-<width>x<height>x<depth>` instructs Xen to set up graphics mode with the specified width, height and depth.
+
+`mode-<mode>` instructs Xen to use a specific mode, as shown with the `ask` option.  (N.B menu modes are displayed in hex, so `<mode>` should be a hexidecimal number)
+
+The optional `keep` parameter causes Xen to continue using the vga console even after dom0 has been started.  The default behaviour is to relinquish control to dom0.
+
+### vpid
+### vpmu
+### vti\_vhpt\_size
+### vti\_vtlb\_size
+### watchdog
+> `= <boolean>`
+
+Run an NMI watchdog on each processor.  Defaults to disabled.
+### x2apic
+### x2apic\_phys
+### xencons
+### xencons\_poll
+### xsave

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGc-0004VA-MS; Wed, 07 Mar 2012 19:11: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 1S5MGa-0004S0-Tz
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:17 +0000
Received: from [85.158.139.83:47629] by server-1.bemta-5.messagelabs.com id
	4E/9C-28458-3D2B75F4; Wed, 07 Mar 2012 19:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1331147473!17675440!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15782 invoked from network); 7 Mar 2012 19:11:14 -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;
	7 Mar 2012 19: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 1S5MGX-0003XW-50
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGW-0001bY-Tp
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:12 +0000
Message-Id: <E1S5MGW-0001bY-Tp@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] RTC: Add alarm 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Yang Zhang <yang.z.zhang@Intel.com>
# Date 1331105885 0
# Node ID f29e4080ea6bcdb6838a24db5e840c9caa98eee5
# Parent  b098111c0a2f88a708914b0553eb7153286c9e63
RTC: Add alarm support

Use a timer to emulate update cycle. The timer runs only when AIE is
set.

Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r b098111c0a2f -r f29e4080ea6b xen/arch/x86/hvm/rtc.c
--- a/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:37:21 2012 +0000
+++ b/xen/arch/x86/hvm/rtc.c	Wed Mar 07 07:38:05 2012 +0000
@@ -30,6 +30,12 @@
 
 #define USEC_PER_SEC    1000000UL
 #define NS_PER_USEC     1000UL
+#define NS_PER_SEC      1000000000ULL
+
+#define SEC_PER_MIN     60
+#define SEC_PER_HOUR    3600
+#define MIN_PER_HOUR    60
+#define HOUR_PER_DAY    24
 
 #define domain_vrtc(x) (&(x)->arch.hvm_domain.pl_time.vrtc)
 #define vcpu_vrtc(x)   (domain_vrtc((x)->domain))
@@ -40,6 +46,9 @@
 #define get_year(x)    (x + epoch_year)
 
 static void rtc_copy_date(RTCState *s);
+static void rtc_set_time(RTCState *s);
+static inline int from_bcd(RTCState *s, int a);
+static inline int convert_hour(RTCState *s, int hour);
 
 static void rtc_periodic_cb(struct vcpu *v, void *opaque)
 {
@@ -153,7 +162,204 @@
     spin_unlock(&s->lock);
 }
 
-static void rtc_set_time(RTCState *s);
+/* handle alarm timer */
+static void alarm_timer_update(RTCState *s)
+{
+    uint64_t next_update_time, next_alarm_sec;
+    uint64_t expire_time;
+    int32_t alarm_sec, alarm_min, alarm_hour, cur_hour, cur_min, cur_sec;
+    int32_t hour, min;
+    struct domain *d = vrtc_domain(s);
+
+    ASSERT(spin_is_locked(&s->lock));
+
+    stop_timer(&s->alarm_timer);
+
+    if ((s->hw.cmos_data[RTC_REG_B] & RTC_AIE) &&
+            !(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+    {
+        s->current_tm = gmtime(get_localtime(d));
+        rtc_copy_date(s);
+
+        alarm_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS_ALARM]);
+        alarm_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES_ALARM]);
+        alarm_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS_ALARM]);
+        alarm_hour = convert_hour(s, alarm_hour);
+
+        cur_sec = from_bcd(s, s->hw.cmos_data[RTC_SECONDS]);
+        cur_min = from_bcd(s, s->hw.cmos_data[RTC_MINUTES]);
+        cur_hour = from_bcd(s, s->hw.cmos_data[RTC_HOURS]);
+        cur_hour = convert_hour(s, cur_hour);
+
+        next_update_time = USEC_PER_SEC - (get_localtime_us(d) % USEC_PER_SEC);
+        next_update_time = next_update_time * NS_PER_USEC + NOW();
+
+        if ((s->hw.cmos_data[RTC_HOURS_ALARM] & 0xc0) == 0xc0)
+        {
+            if ((s->hw.cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0)
+            {
+                if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                    next_alarm_sec = 1;
+                else if (cur_sec < alarm_sec)
+                    next_alarm_sec = alarm_sec - cur_sec;
+                else
+                    next_alarm_sec = alarm_sec + SEC_PER_MIN - cur_sec;
+            }
+            else
+            {
+                if (cur_min < alarm_min)
+                {
+                    min = alarm_min - cur_min;
+                    next_alarm_sec = min * SEC_PER_MIN - cur_sec;
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+                else if (cur_min == alarm_min)
+                {
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec = 1;
+                    else if (cur_sec < alarm_sec)
+                        next_alarm_sec = alarm_sec - cur_sec;
+                    else
+                    {
+                        min = alarm_min + MIN_PER_HOUR - cur_min;
+                        next_alarm_sec =
+                            alarm_sec + min * SEC_PER_MIN - cur_sec;
+                    }
+                }
+                else
+                {
+                    min = alarm_min + MIN_PER_HOUR - cur_min;
+                    next_alarm_sec = min * SEC_PER_MIN - cur_sec;
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+            }
+        }
+        else
+        {
+            if (cur_hour < alarm_hour)
+            {
+                hour = alarm_hour - cur_hour;
+                next_alarm_sec = hour * SEC_PER_HOUR -
+                    cur_min * SEC_PER_MIN - cur_sec;
+                if ((s->hw.cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0)
+                {
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+                else
+                {
+                    next_alarm_sec += alarm_min * SEC_PER_MIN;
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+            }
+            else if (cur_hour == alarm_hour)
+            {
+                if ((s->hw.cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0)
+                {
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec = 1;
+                    else if (cur_sec < alarm_sec)
+                        next_alarm_sec = alarm_sec - cur_sec;
+                    else
+                        next_alarm_sec = alarm_sec + SEC_PER_MIN - cur_sec;
+                }
+                else if (cur_min < alarm_min)
+                {
+                    min = alarm_min - cur_min;
+                    next_alarm_sec = min * SEC_PER_MIN - cur_sec;
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+                else if (cur_min == alarm_min)
+                {
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec = 1;
+                    else if (cur_sec < alarm_sec)
+                        next_alarm_sec = alarm_sec - cur_sec;
+                    else
+                    {
+                        hour = alarm_hour + HOUR_PER_DAY - cur_hour;
+                        next_alarm_sec = hour * SEC_PER_HOUR -
+                            cur_min * SEC_PER_MIN - cur_sec;
+                        next_alarm_sec += alarm_min * SEC_PER_MIN + alarm_sec;
+                    }
+                }
+                else
+                {
+                    hour = alarm_hour + HOUR_PER_DAY - cur_hour;
+                    next_alarm_sec = hour * SEC_PER_HOUR -
+                        cur_min * SEC_PER_MIN - cur_sec;
+                    next_alarm_sec += alarm_min * SEC_PER_MIN;
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+            }
+            else
+            {
+                hour = alarm_hour + HOUR_PER_DAY - cur_hour;
+                next_alarm_sec = hour * SEC_PER_HOUR -
+                    cur_min * SEC_PER_MIN - cur_sec;
+                if ((s->hw.cmos_data[RTC_MINUTES_ALARM] & 0xc0) == 0xc0)
+                {
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+                else
+                {
+                    next_alarm_sec += alarm_min * SEC_PER_MIN;
+                    if ((s->hw.cmos_data[RTC_SECONDS_ALARM] & 0xc0) == 0xc0)
+                        next_alarm_sec += 0;
+                    else
+                        next_alarm_sec += alarm_sec;
+                }
+            }
+        }
+        expire_time = (next_alarm_sec - 1) * NS_PER_SEC + next_update_time;
+        /* release lock before set timer */
+        spin_unlock(&s->lock);
+        set_timer(&s->alarm_timer, expire_time);
+        /* fetch lock again */
+        spin_lock(&s->lock);
+    }
+}
+
+static void rtc_alarm_cb(void *opaque)
+{
+    RTCState *s = opaque;
+    struct domain *d = vrtc_domain(s);
+
+    spin_lock(&s->lock);
+    if (!(s->hw.cmos_data[RTC_REG_B] & RTC_SET))
+    {
+        s->hw.cmos_data[RTC_REG_C] |= RTC_AF;
+        /* alarm interrupt */
+        if (s->hw.cmos_data[RTC_REG_B] & RTC_AIE)
+        {
+            s->hw.cmos_data[RTC_REG_C] |= RTC_IRQF;
+            hvm_isa_irq_deassert(d, RTC_IRQ);
+            hvm_isa_irq_assert(d, RTC_IRQ);
+        }
+        alarm_timer_update(s);
+    }
+    spin_unlock(&s->lock);
+}
 
 static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data)
 {
@@ -182,6 +388,7 @@
     case RTC_MINUTES_ALARM:
     case RTC_HOURS_ALARM:
         s->hw.cmos_data[s->hw.cmos_index] = data;
+        alarm_timer_update(s);
         break;
     case RTC_SECONDS:
     case RTC_MINUTES:
@@ -194,6 +401,7 @@
         /* if in set mode, do not update the time */
         if ( !(s->hw.cmos_data[RTC_REG_B] & RTC_SET) )
             rtc_set_time(s);
+        alarm_timer_update(s);
         break;
     case RTC_REG_A:
         /* UIP bit is read only */
@@ -230,6 +438,7 @@
         s->hw.cmos_data[RTC_REG_B] = data;
         rtc_timer_update(s);
         check_update_timer(s);
+        alarm_timer_update(s);
         break;
     case RTC_REG_C:
     case RTC_REG_D:
@@ -426,6 +635,7 @@
     {
         migrate_timer(&s->update_timer, v->processor);;
         migrate_timer(&s->update_timer2, v->processor);;
+        migrate_timer(&s->alarm_timer, v->processor);;
     }
 }
 
@@ -462,6 +672,7 @@
     /* Reset the periodic interrupt timer based on the registers */
     rtc_timer_update(s);
     check_update_timer(s);
+    alarm_timer_update(s);
 
     spin_unlock(&s->lock);
 
@@ -486,12 +697,12 @@
 
     init_timer(&s->update_timer, rtc_update_timer, s, smp_processor_id());
     init_timer(&s->update_timer2, rtc_update_timer2, s, smp_processor_id());
+    init_timer(&s->alarm_timer, rtc_alarm_cb, s, smp_processor_id());
 
     register_portio_handler(d, RTC_PORT(0), 2, handle_rtc_io);
 
     rtc_reset(d);
 
-
     spin_lock(&s->lock);
 
     s->hw.cmos_data[RTC_REG_A] = RTC_REF_CLCK_32KHZ | 6; /* ~1kHz */
@@ -516,6 +727,7 @@
     destroy_periodic_time(&s->pt);
     kill_timer(&s->update_timer);
     kill_timer(&s->update_timer2);
+    kill_timer(&s->alarm_timer);
 }
 
 void rtc_update_clock(struct domain *d)
diff -r b098111c0a2f -r f29e4080ea6b xen/include/asm-x86/hvm/vpt.h
--- a/xen/include/asm-x86/hvm/vpt.h	Wed Mar 07 07:37:21 2012 +0000
+++ b/xen/include/asm-x86/hvm/vpt.h	Wed Mar 07 07:38:05 2012 +0000
@@ -110,6 +110,8 @@
     /* update-ended timer */
     struct timer update_timer;
     struct timer update_timer2;
+    /* alarm timer */
+    struct timer alarm_timer;
     uint64_t next_update_time;
     uint32_t use_timer;
     spinlock_t lock;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGd-0004Va-0T; Wed, 07 Mar 2012 19:11: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 1S5MGb-0004Sl-Uo
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:18 +0000
Received: from [85.158.143.99:55282] by server-2.bemta-4.messagelabs.com id
	C3/04-17550-5D2B75F4; Wed, 07 Mar 2012 19:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1331147475!19774311!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29528 invoked from network); 7 Mar 2012 19:11:16 -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;
	7 Mar 2012 19: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 1S5MGZ-0003Xi-71
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGZ-0001dW-2t
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:15 +0000
Message-Id: <E1S5MGZ-0001dW-2t@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Revert 24973:50a70b652b43 "x86: Use
	deep C states for off-lined 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331111543 0
# Node ID e0d944b501512fe3b9866f79e95ad0f29cd5caca
# Parent  39aff519e7d43dcc58273f6e62310e2cdffa1b1f
Revert 24973:50a70b652b43 "x86: Use deep C states for off-lined CPUs"

applied already

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


diff -r 39aff519e7d4 -r e0d944b50151 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Wed Mar 07 07:44:33 2012 +0000
+++ b/xen/arch/x86/acpi/cpu_idle.c	Wed Mar 07 09:12:23 2012 +0000
@@ -566,7 +566,6 @@
 {
     struct acpi_processor_power *power;
     struct acpi_processor_cx *cx;
-    struct cpuinfo_x86 *c = &current_cpu_data;
 
     if ( (power = processor_powers[smp_processor_id()]) == NULL )
         goto default_halt;
@@ -602,23 +601,6 @@
             mb();
             __mwait(cx->address, 0);
         }
-    } 
-    else if ( c->x86_vendor == X86_VENDOR_AMD && 
-              cx->entry_method == ACPI_CSTATE_EM_SYSIO )
-    {
-        /* Intel prefers not to use SYSIO */
-
-        /* Avoid references to shared data after the cache flush */
-        u32 address = cx->address;
-        u32 pmtmr_ioport_local = pmtmr_ioport;
-
-        wbinvd();
-
-        while ( 1 )
-        {
-            inb(address);
-            inl(pmtmr_ioport_local);
-        }
     }
     else if ( current_cpu_data.x86_vendor == X86_VENDOR_AMD &&
               cx->entry_method == ACPI_CSTATE_EM_SYSIO )

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGd-0004Va-0T; Wed, 07 Mar 2012 19:11: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 1S5MGb-0004Sl-Uo
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:18 +0000
Received: from [85.158.143.99:55282] by server-2.bemta-4.messagelabs.com id
	C3/04-17550-5D2B75F4; Wed, 07 Mar 2012 19:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1331147475!19774311!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29528 invoked from network); 7 Mar 2012 19:11:16 -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;
	7 Mar 2012 19: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 1S5MGZ-0003Xi-71
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGZ-0001dW-2t
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:15 +0000
Message-Id: <E1S5MGZ-0001dW-2t@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Revert 24973:50a70b652b43 "x86: Use
	deep C states for off-lined 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331111543 0
# Node ID e0d944b501512fe3b9866f79e95ad0f29cd5caca
# Parent  39aff519e7d43dcc58273f6e62310e2cdffa1b1f
Revert 24973:50a70b652b43 "x86: Use deep C states for off-lined CPUs"

applied already

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


diff -r 39aff519e7d4 -r e0d944b50151 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Wed Mar 07 07:44:33 2012 +0000
+++ b/xen/arch/x86/acpi/cpu_idle.c	Wed Mar 07 09:12:23 2012 +0000
@@ -566,7 +566,6 @@
 {
     struct acpi_processor_power *power;
     struct acpi_processor_cx *cx;
-    struct cpuinfo_x86 *c = &current_cpu_data;
 
     if ( (power = processor_powers[smp_processor_id()]) == NULL )
         goto default_halt;
@@ -602,23 +601,6 @@
             mb();
             __mwait(cx->address, 0);
         }
-    } 
-    else if ( c->x86_vendor == X86_VENDOR_AMD && 
-              cx->entry_method == ACPI_CSTATE_EM_SYSIO )
-    {
-        /* Intel prefers not to use SYSIO */
-
-        /* Avoid references to shared data after the cache flush */
-        u32 address = cx->address;
-        u32 pmtmr_ioport_local = pmtmr_ioport;
-
-        wbinvd();
-
-        while ( 1 )
-        {
-            inb(address);
-            inl(pmtmr_ioport_local);
-        }
     }
     else if ( current_cpu_data.x86_vendor == X86_VENDOR_AMD &&
               cx->entry_method == ACPI_CSTATE_EM_SYSIO )

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGc-0004VM-Pl; Wed, 07 Mar 2012 19: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 1S5MGb-0004QB-Hs
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:17 +0000
Received: from [193.109.254.147:64554] by server-8.bemta-14.messagelabs.com id
	F0/DA-04087-5D2B75F4; Wed, 07 Mar 2012 19:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1331147418!52431444!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10700 invoked from network); 7 Mar 2012 19:10:19 -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;
	7 Mar 2012 19:10: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 1S5MGZ-0003Xl-L5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGZ-0001e0-Jn
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:15 +0000
Message-Id: <E1S5MGZ-0001e0-Jn@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] passthrough: fix domain ref leak
	after 24888:71159fb049f2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331114358 -3600
# Node ID f234e34ea28f753bba92980f367cf545666d69a1
# Parent  e0d944b501512fe3b9866f79e95ad0f29cd5caca
passthrough: fix domain ref leak after 24888:71159fb049f2

As pointed out by Keir.

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


diff -r e0d944b50151 -r f234e34ea28f xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Wed Mar 07 09:12:23 2012 +0000
+++ b/xen/drivers/passthrough/iommu.c	Wed Mar 07 10:59:18 2012 +0100
@@ -580,6 +580,8 @@
             printk(XENLOG_G_ERR
                    "XEN_DOMCTL_assign_device: get_domain_by_id() failed\n");
             ret = -EINVAL;
+            if ( d )
+                goto assign_device_out;
             break;
         }
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 19:11:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 19: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 1S5MGc-0004VM-Pl; Wed, 07 Mar 2012 19: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 1S5MGb-0004QB-Hs
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:17 +0000
Received: from [193.109.254.147:64554] by server-8.bemta-14.messagelabs.com id
	F0/DA-04087-5D2B75F4; Wed, 07 Mar 2012 19:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1331147418!52431444!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10700 invoked from network); 7 Mar 2012 19:10:19 -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;
	7 Mar 2012 19:10: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 1S5MGZ-0003Xl-L5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5MGZ-0001e0-Jn
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 19:11:15 +0000
Message-Id: <E1S5MGZ-0001e0-Jn@xenbits.xen.org>
Date: Wed, 07 Mar 2012 19:11:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] passthrough: fix domain ref leak
	after 24888:71159fb049f2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331114358 -3600
# Node ID f234e34ea28f753bba92980f367cf545666d69a1
# Parent  e0d944b501512fe3b9866f79e95ad0f29cd5caca
passthrough: fix domain ref leak after 24888:71159fb049f2

As pointed out by Keir.

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


diff -r e0d944b50151 -r f234e34ea28f xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Wed Mar 07 09:12:23 2012 +0000
+++ b/xen/drivers/passthrough/iommu.c	Wed Mar 07 10:59:18 2012 +0100
@@ -580,6 +580,8 @@
             printk(XENLOG_G_ERR
                    "XEN_DOMCTL_assign_device: get_domain_by_id() failed\n");
             ret = -EINVAL;
+            if ( d )
+                goto assign_device_out;
             break;
         }
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWk-0007g0-F9; Wed, 07 Mar 2012 23:44: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 1S5QWi-0007fV-8T
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:12 +0000
Received: from [85.158.143.99:38936] by server-2.bemta-4.messagelabs.com id
	DC/7C-17550-BC2F75F4; Wed, 07 Mar 2012 23:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1331163849!17253401!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23665 invoked from network); 7 Mar 2012 23:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 23: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 1S5QWf-0006hq-2l
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWe-000311-QT
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:08 +0000
Message-Id: <E1S5QWe-000311-QT@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] p2m: query/modify p2mt with
	p2m_lock held
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331107198 0
# Node ID 637eaa1421d1ae9808f1cc56c39b2d9e1fe64eb9
# Parent  7ee4016eeb9fb1c05f033e2b9da78cf5564c3e54
p2m: query/modify p2mt with p2m_lock held

Query and update the p2mt in set_mmio_p2m_entry, clear_mmio_p2m_entry
and set_shared_p2m_entry with the p2m_lock held.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   23908:88b6e08b8aa8
xen-unstable date:        Thu Oct 06 14:15:43 2011 +0100
---


diff -r 7ee4016eeb9f -r 637eaa1421d1 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Wed Mar 07 07:55:10 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Wed Mar 07 07:59:58 2012 +0000
@@ -2752,9 +2752,11 @@
     if ( !paging_mode_translate(p2m->domain) )
         return 0;
 
+    p2m_lock(p2m);
     omfn = gfn_to_mfn_query(p2m, gfn, &ot);
     if ( p2m_is_grant(ot) )
     {
+        p2m_unlock(p2m);
         domain_crash(p2m->domain);
         return 0;
     }
@@ -2765,7 +2767,6 @@
     }
 
     P2M_DEBUG("set mmio %lx %lx\n", gfn, mfn_x(mfn));
-    p2m_lock(p2m);
     rc = set_p2m_entry(p2m, gfn, mfn, 0, p2m_mmio_direct, p2m->default_access);
     audit_p2m(p2m, 1);
     p2m_unlock(p2m);
@@ -2786,18 +2787,20 @@
     if ( !paging_mode_translate(p2m->domain) )
         return 0;
 
-    mfn = gfn_to_mfn(p2m, gfn, &t);
+    p2m_lock(p2m);
+    mfn = gfn_to_mfn_query(p2m, gfn, &t);
 
     /* Do not use mfn_valid() here as it will usually fail for MMIO pages. */
     if ( (INVALID_MFN == mfn_x(mfn)) || (t != p2m_mmio_direct) )
     {
         gdprintk(XENLOG_ERR,
             "clear_mmio_p2m_entry: gfn_to_mfn failed! gfn=%08lx\n", gfn);
-        return 0;
+        goto out;
     }
-    p2m_lock(p2m);
     rc = set_p2m_entry(p2m, gfn, _mfn(INVALID_MFN), 0, p2m_invalid, p2m->default_access);
     audit_p2m(p2m, 1);
+
+out:
     p2m_unlock(p2m);
 
     return rc;
@@ -2814,6 +2817,8 @@
     if ( !paging_mode_translate(p2m->domain) )
         return 0;
 
+    if ( need_lock ) 
+        p2m_lock(p2m);
     omfn = gfn_to_mfn_query(p2m, gfn, &ot);
     /* At the moment we only allow p2m change if gfn has already been made
      * sharable first */
@@ -2823,8 +2828,6 @@
     set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
 
     P2M_DEBUG("set shared %lx %lx\n", gfn, mfn_x(mfn));
-    if ( need_lock ) 
-        p2m_lock(p2m);
     rc = set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_shared, p2m->default_access);
     if ( need_lock ) 
         p2m_unlock(p2m);

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWk-0007g0-F9; Wed, 07 Mar 2012 23:44: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 1S5QWi-0007fV-8T
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:12 +0000
Received: from [85.158.143.99:38936] by server-2.bemta-4.messagelabs.com id
	DC/7C-17550-BC2F75F4; Wed, 07 Mar 2012 23:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1331163849!17253401!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23665 invoked from network); 7 Mar 2012 23:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 23: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 1S5QWf-0006hq-2l
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWe-000311-QT
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:08 +0000
Message-Id: <E1S5QWe-000311-QT@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] p2m: query/modify p2mt with
	p2m_lock held
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331107198 0
# Node ID 637eaa1421d1ae9808f1cc56c39b2d9e1fe64eb9
# Parent  7ee4016eeb9fb1c05f033e2b9da78cf5564c3e54
p2m: query/modify p2mt with p2m_lock held

Query and update the p2mt in set_mmio_p2m_entry, clear_mmio_p2m_entry
and set_shared_p2m_entry with the p2m_lock held.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   23908:88b6e08b8aa8
xen-unstable date:        Thu Oct 06 14:15:43 2011 +0100
---


diff -r 7ee4016eeb9f -r 637eaa1421d1 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Wed Mar 07 07:55:10 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Wed Mar 07 07:59:58 2012 +0000
@@ -2752,9 +2752,11 @@
     if ( !paging_mode_translate(p2m->domain) )
         return 0;
 
+    p2m_lock(p2m);
     omfn = gfn_to_mfn_query(p2m, gfn, &ot);
     if ( p2m_is_grant(ot) )
     {
+        p2m_unlock(p2m);
         domain_crash(p2m->domain);
         return 0;
     }
@@ -2765,7 +2767,6 @@
     }
 
     P2M_DEBUG("set mmio %lx %lx\n", gfn, mfn_x(mfn));
-    p2m_lock(p2m);
     rc = set_p2m_entry(p2m, gfn, mfn, 0, p2m_mmio_direct, p2m->default_access);
     audit_p2m(p2m, 1);
     p2m_unlock(p2m);
@@ -2786,18 +2787,20 @@
     if ( !paging_mode_translate(p2m->domain) )
         return 0;
 
-    mfn = gfn_to_mfn(p2m, gfn, &t);
+    p2m_lock(p2m);
+    mfn = gfn_to_mfn_query(p2m, gfn, &t);
 
     /* Do not use mfn_valid() here as it will usually fail for MMIO pages. */
     if ( (INVALID_MFN == mfn_x(mfn)) || (t != p2m_mmio_direct) )
     {
         gdprintk(XENLOG_ERR,
             "clear_mmio_p2m_entry: gfn_to_mfn failed! gfn=%08lx\n", gfn);
-        return 0;
+        goto out;
     }
-    p2m_lock(p2m);
     rc = set_p2m_entry(p2m, gfn, _mfn(INVALID_MFN), 0, p2m_invalid, p2m->default_access);
     audit_p2m(p2m, 1);
+
+out:
     p2m_unlock(p2m);
 
     return rc;
@@ -2814,6 +2817,8 @@
     if ( !paging_mode_translate(p2m->domain) )
         return 0;
 
+    if ( need_lock ) 
+        p2m_lock(p2m);
     omfn = gfn_to_mfn_query(p2m, gfn, &ot);
     /* At the moment we only allow p2m change if gfn has already been made
      * sharable first */
@@ -2823,8 +2828,6 @@
     set_gpfn_from_mfn(mfn_x(omfn), INVALID_M2P_ENTRY);
 
     P2M_DEBUG("set shared %lx %lx\n", gfn, mfn_x(mfn));
-    if ( need_lock ) 
-        p2m_lock(p2m);
     rc = set_p2m_entry(p2m, gfn, mfn, 0, p2m_ram_shared, p2m->default_access);
     if ( need_lock ) 
         p2m_unlock(p2m);

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWk-0007g5-Ha; Wed, 07 Mar 2012 23:44: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 1S5QWi-0007fV-Rj
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:12 +0000
Received: from [85.158.143.35:58417] by server-2.bemta-4.messagelabs.com id
	3E/7C-17550-CC2F75F4; Wed, 07 Mar 2012 23:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1331163850!4021875!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4743 invoked from network); 7 Mar 2012 23:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 23: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 1S5QWf-0006hw-V1
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWf-00031i-Qf
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:09 +0000
Message-Id: <E1S5QWf-00031i-Qf@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/mm: change return code for
	log-dirty disabling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331107858 0
# Node ID dab13447cd8cdf2e1623538a182dcacbb6ef2077
# Parent  a43a31a976037bd9ea3b34f827dcc35d0f484d77
x86/mm: change return code for log-dirty disabling

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

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24190:6b3d8250ee2c
xen-unstable date:        Thu Nov 24 15:20:57 2011 +0000
---


diff -r a43a31a97603 -r dab13447cd8c xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Wed Mar 07 08:02:59 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Mar 07 08:10:58 2012 +0000
@@ -710,6 +710,8 @@
         return rc;
     case XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION:
         sc->mb = hap_get_allocation(d);
+        /* Fall through... */
+    case XEN_DOMCTL_SHADOW_OP_OFF:
         return 0;
     default:
         HAP_ERROR("Bad hap domctl op %u\n", sc->op);

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWk-0007g5-Ha; Wed, 07 Mar 2012 23:44: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 1S5QWi-0007fV-Rj
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:12 +0000
Received: from [85.158.143.35:58417] by server-2.bemta-4.messagelabs.com id
	3E/7C-17550-CC2F75F4; Wed, 07 Mar 2012 23:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1331163850!4021875!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4743 invoked from network); 7 Mar 2012 23:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 23: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 1S5QWf-0006hw-V1
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWf-00031i-Qf
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:09 +0000
Message-Id: <E1S5QWf-00031i-Qf@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/mm: change return code for
	log-dirty disabling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331107858 0
# Node ID dab13447cd8cdf2e1623538a182dcacbb6ef2077
# Parent  a43a31a976037bd9ea3b34f827dcc35d0f484d77
x86/mm: change return code for log-dirty disabling

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

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24190:6b3d8250ee2c
xen-unstable date:        Thu Nov 24 15:20:57 2011 +0000
---


diff -r a43a31a97603 -r dab13447cd8c xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Wed Mar 07 08:02:59 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Mar 07 08:10:58 2012 +0000
@@ -710,6 +710,8 @@
         return rc;
     case XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION:
         sc->mb = hap_get_allocation(d);
+        /* Fall through... */
+    case XEN_DOMCTL_SHADOW_OP_OFF:
         return 0;
     default:
         HAP_ERROR("Bad hap domctl op %u\n", sc->op);

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWk-0007gT-Pa; Wed, 07 Mar 2012 23:44:14 +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 1S5QWj-0007fc-Dh
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:13 +0000
Received: from [193.109.254.147:21772] by server-3.bemta-14.messagelabs.com id
	B9/B5-31466-CC2F75F4; Wed, 07 Mar 2012 23:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1331163803!58199523!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26084 invoked from network); 7 Mar 2012 23:43:24 -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;
	7 Mar 2012 23:43:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWg-0006i2-Rx
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWg-00032R-QZ
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:10 +0000
Message-Id: <E1S5QWg-00032R-QZ@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44: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/mm: Don't lose track of the
	log dirty bitmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331108027 0
# Node ID a6bbda6dc322c4581d45fb98b005129a0acb9d62
# Parent  ffda50fa20ab376821e19edcdf9042df31fabffe
x86/mm: Don't lose track of the log dirty bitmap

hap_log_dirty_init unconditionally sets the top of the log dirty
bitmap to INVALID_MFN. If there had been a bitmap allocated, it is
then leaked, and the host crashes on an ASSERT when the domain is
cleaned up.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24282:a06cda9fb25f
xen-unstable date:        Thu Dec 01 14:17:16 2011 +0000
---


diff -r ffda50fa20ab -r a6bbda6dc322 xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Wed Mar 07 08:13:00 2012 +0000
+++ b/xen/arch/x86/mm/paging.c	Wed Mar 07 08:13:47 2012 +0000
@@ -665,7 +665,6 @@
     d->arch.paging.log_dirty.enable_log_dirty = enable_log_dirty;
     d->arch.paging.log_dirty.disable_log_dirty = disable_log_dirty;
     d->arch.paging.log_dirty.clean_dirty_bitmap = clean_dirty_bitmap;
-    d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
 }
 
 /* This function fress log dirty bitmap resources. */
@@ -686,6 +685,11 @@
     if ( (rc = p2m_init(d)) != 0 )
         return rc;
 
+    /* This must be initialized separately from the rest of the
+     * log-dirty init code as that can be called more than once and we
+     * don't want to leak any active log-dirty bitmaps */
+    d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
+
     /* The order of the *_init calls below is important, as the later
      * ones may rewrite some common fields.  Shadow pagetables are the
      * default... */

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWk-0007gT-Pa; Wed, 07 Mar 2012 23:44:14 +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 1S5QWj-0007fc-Dh
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:13 +0000
Received: from [193.109.254.147:21772] by server-3.bemta-14.messagelabs.com id
	B9/B5-31466-CC2F75F4; Wed, 07 Mar 2012 23:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1331163803!58199523!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26084 invoked from network); 7 Mar 2012 23:43:24 -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;
	7 Mar 2012 23:43:24 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWg-0006i2-Rx
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWg-00032R-QZ
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:10 +0000
Message-Id: <E1S5QWg-00032R-QZ@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44: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/mm: Don't lose track of the
	log dirty bitmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331108027 0
# Node ID a6bbda6dc322c4581d45fb98b005129a0acb9d62
# Parent  ffda50fa20ab376821e19edcdf9042df31fabffe
x86/mm: Don't lose track of the log dirty bitmap

hap_log_dirty_init unconditionally sets the top of the log dirty
bitmap to INVALID_MFN. If there had been a bitmap allocated, it is
then leaked, and the host crashes on an ASSERT when the domain is
cleaned up.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24282:a06cda9fb25f
xen-unstable date:        Thu Dec 01 14:17:16 2011 +0000
---


diff -r ffda50fa20ab -r a6bbda6dc322 xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Wed Mar 07 08:13:00 2012 +0000
+++ b/xen/arch/x86/mm/paging.c	Wed Mar 07 08:13:47 2012 +0000
@@ -665,7 +665,6 @@
     d->arch.paging.log_dirty.enable_log_dirty = enable_log_dirty;
     d->arch.paging.log_dirty.disable_log_dirty = disable_log_dirty;
     d->arch.paging.log_dirty.clean_dirty_bitmap = clean_dirty_bitmap;
-    d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
 }
 
 /* This function fress log dirty bitmap resources. */
@@ -686,6 +685,11 @@
     if ( (rc = p2m_init(d)) != 0 )
         return rc;
 
+    /* This must be initialized separately from the rest of the
+     * log-dirty init code as that can be called more than once and we
+     * don't want to leak any active log-dirty bitmaps */
+    d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
+
     /* The order of the *_init calls below is important, as the later
      * ones may rewrite some common fields.  Shadow pagetables are the
      * default... */

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWm-0007hL-8U; Wed, 07 Mar 2012 23:44: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 1S5QWl-0007gQ-7S
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:15 +0000
Received: from [193.109.254.147:18529] by server-1.bemta-14.messagelabs.com id
	E0/FA-12485-EC2F75F4; Wed, 07 Mar 2012 23:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1331163798!53044599!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14720 invoked from network); 7 Mar 2012 23:43:19 -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;
	7 Mar 2012 23:43: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 1S5QWi-0006iE-T9
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWi-00033x-Rc
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:12 +0000
Message-Id: <E1S5QWi-00033x-Rc@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44: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/passthrough: don't leak guest
	IRQs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331108388 0
# Node ID d21100f1d00e57649b24c8781be2133a74503f4b
# Parent  0bea45ab39f716d9d3d370f33ebb92a92f27e7ad
x86/passthrough: don't leak guest IRQs

As unmap_domain_pirq_emuirq() fails on a never mapped pIRQ, it must
not
be called for the non-emu-IRQ case (to prevent the entire unmap
operation failing).

Based on a suggestion from Stefano.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Yongjie Ren <yongjie.ren@intel.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen-unstable changeset:   24448:3a22ed3ec534
xen-unstable date:        Mon Jan 02 09:26:19 2012 +0100
---


diff -r 0bea45ab39f7 -r d21100f1d00e xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Mar 07 08:17:44 2012 +0000
+++ b/xen/arch/x86/physdev.c	Wed Mar 07 08:19:48 2012 +0000
@@ -233,7 +233,8 @@
     if ( is_hvm_domain(d) )
     {
         spin_lock(&d->event_lock);
-        ret = unmap_domain_pirq_emuirq(d, unmap->pirq);
+        if ( domain_pirq_to_emuirq(d, unmap->pirq) != IRQ_UNBOUND )
+            ret = unmap_domain_pirq_emuirq(d, unmap->pirq);
         spin_unlock(&d->event_lock);
         if ( unmap->domid == DOMID_SELF || ret )
             goto free_domain;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWm-0007hL-8U; Wed, 07 Mar 2012 23:44: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 1S5QWl-0007gQ-7S
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:15 +0000
Received: from [193.109.254.147:18529] by server-1.bemta-14.messagelabs.com id
	E0/FA-12485-EC2F75F4; Wed, 07 Mar 2012 23:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-27.messagelabs.com!1331163798!53044599!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14720 invoked from network); 7 Mar 2012 23:43:19 -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;
	7 Mar 2012 23:43: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 1S5QWi-0006iE-T9
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWi-00033x-Rc
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:12 +0000
Message-Id: <E1S5QWi-00033x-Rc@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44: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/passthrough: don't leak guest
	IRQs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331108388 0
# Node ID d21100f1d00e57649b24c8781be2133a74503f4b
# Parent  0bea45ab39f716d9d3d370f33ebb92a92f27e7ad
x86/passthrough: don't leak guest IRQs

As unmap_domain_pirq_emuirq() fails on a never mapped pIRQ, it must
not
be called for the non-emu-IRQ case (to prevent the entire unmap
operation failing).

Based on a suggestion from Stefano.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Yongjie Ren <yongjie.ren@intel.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
xen-unstable changeset:   24448:3a22ed3ec534
xen-unstable date:        Mon Jan 02 09:26:19 2012 +0100
---


diff -r 0bea45ab39f7 -r d21100f1d00e xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Wed Mar 07 08:17:44 2012 +0000
+++ b/xen/arch/x86/physdev.c	Wed Mar 07 08:19:48 2012 +0000
@@ -233,7 +233,8 @@
     if ( is_hvm_domain(d) )
     {
         spin_lock(&d->event_lock);
-        ret = unmap_domain_pirq_emuirq(d, unmap->pirq);
+        if ( domain_pirq_to_emuirq(d, unmap->pirq) != IRQ_UNBOUND )
+            ret = unmap_domain_pirq_emuirq(d, unmap->pirq);
         spin_unlock(&d->event_lock);
         if ( unmap->domid == DOMID_SELF || ret )
             goto free_domain;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWk-0007gI-Ki; Wed, 07 Mar 2012 23:44: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 1S5QWi-0007fW-PV
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:12 +0000
Received: from [85.158.139.83:41344] by server-3.bemta-5.messagelabs.com id
	CE/88-25237-BC2F75F4; Wed, 07 Mar 2012 23:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1331163850!18309815!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17177 invoked from network); 7 Mar 2012 23:44:11 -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;
	7 Mar 2012 23: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 1S5QWf-0006ht-FO
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWf-00031N-B4
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:09 +0000
Message-Id: <E1S5QWf-00031N-B4@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/IO-APIC: refine EOI-ing of
	migrating level interrupts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331107379 0
# Node ID a43a31a976037bd9ea3b34f827dcc35d0f484d77
# Parent  637eaa1421d1ae9808f1cc56c39b2d9e1fe64eb9
x86/IO-APIC: refine EOI-ing of migrating level interrupts

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

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

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen-unstable changeset:   24155:0d50e704834f
xen-unstable date:        Fri Nov 18 09:18:41 2011 +0100
---


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

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWk-0007gd-Uo; Wed, 07 Mar 2012 23: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 1S5QWk-0007fv-A5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:14 +0000
Received: from [85.158.138.51:64731] by server-10.bemta-3.messagelabs.com id
	D9/30-13338-DC2F75F4; Wed, 07 Mar 2012 23:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1331163850!12404462!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11795 invoked from network); 7 Mar 2012 23:44:11 -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;
	7 Mar 2012 23: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 1S5QWg-0006hz-ES
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWg-000324-A6
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:10 +0000
Message-Id: <E1S5QWg-000324-A6@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: small fixes to pcpu platform
	op handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331107980 0
# Node ID ffda50fa20ab376821e19edcdf9042df31fabffe
# Parent  dab13447cd8cdf2e1623538a182dcacbb6ef2077
x86: small fixes to pcpu platform op handling

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

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

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

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24201:9c6bea25f712
xen-unstable date:        Thu Nov 24 17:56:26 2011 +0100
---


diff -r dab13447cd8c -r ffda50fa20ab xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Wed Mar 07 08:10:58 2012 +0000
+++ b/xen/arch/x86/platform_hypercall.c	Wed Mar 07 08:13:00 2012 +0000
@@ -420,13 +420,14 @@
         if ( (g_info->xen_cpuid >= NR_CPUS) ||
              !cpu_present(g_info->xen_cpuid) )
         {
-            g_info->flags |= XEN_PCPU_FLAGS_INVALID;
+            g_info->flags = XEN_PCPU_FLAGS_INVALID;
         }
         else
         {
             g_info->apic_id = x86_cpu_to_apicid[g_info->xen_cpuid];
             g_info->acpi_id = acpi_get_processor_id(g_info->xen_cpuid);
             ASSERT(g_info->apic_id != BAD_APICID);
+            g_info->flags = 0;
             if (cpu_online(g_info->xen_cpuid))
                 g_info->flags |= XEN_PCPU_FLAGS_ONLINE;
         }
@@ -443,7 +444,7 @@
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        if ( !cpu_present(cpu) )
+        if ( cpu >= NR_CPUS || !cpu_present(cpu) )
         {
             ret = -EINVAL;
             break;
@@ -464,7 +465,13 @@
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        if ( !cpu_present(cpu) )
+        if ( cpu == 0 )
+        {
+            ret = -EOPNOTSUPP;
+            break;
+        }
+
+        if ( cpu >= NR_CPUS || !cpu_present(cpu) )
         {
             ret = -EINVAL;
             break;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWk-0007gN-ND; Wed, 07 Mar 2012 23: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 1S5QWj-0007fb-95
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:13 +0000
Received: from [85.158.138.51:64681] by server-5.bemta-3.messagelabs.com id
	9F/09-09139-AC2F75F4; Wed, 07 Mar 2012 23:44:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1331163849!16597795!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17339 invoked from network); 7 Mar 2012 23:44:10 -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;
	7 Mar 2012 23: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 1S5QWe-0006hn-IC
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWe-00030d-7n
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:08 +0000
Message-Id: <E1S5QWe-00030d-7n@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Fix PV CPUID virtualization of
	XSave
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Shan Haitao <haitao.shan@intel.com>
# Date 1331106910 0
# Node ID 7ee4016eeb9fb1c05f033e2b9da78cf5564c3e54
# Parent  04d72f81775d66d159f4f2aea7723bb1ad432564
Fix PV CPUID virtualization of XSave

The patch will fix XSave CPUID virtualization for PV guests. The XSave
area size returned by CPUID leaf D is changed dynamically depending on
the XCR0. Tools/libxc only assigns a static value. The fix will adjust
xsave area size during runtime.

Note: This fix is already in HVM cpuid virtualization. And Dom0 is not
affected, either.

Signed-off-by:  Shan Haitao <haitao.shan@intel.com>
xen-unstable changeset:   23853:b78235de5c64
xen-unstable date:        Sun Sep 18 00:01:58 2011 +0100

x86: Further fixes for xsave leaf in pv_cpuid().

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23955:bbde1453cbd9
xen-unstable date:        Thu Oct 13 15:58:55 2011 +0100
---


diff -r 04d72f81775d -r 7ee4016eeb9f xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Feb 23 10:37:13 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Wed Mar 07 07:55:10 2012 +0000
@@ -2230,7 +2230,7 @@
         {
             /* reset EBX to default value first */
             *ebx = XSAVE_AREA_MIN_SIZE; 
-            for ( sub_leaf = 2; sub_leaf < 64; sub_leaf++ )
+            for ( sub_leaf = 2; sub_leaf < 63; sub_leaf++ )
             {
                 if ( !(v->arch.xcr0 & (1ULL << sub_leaf)) )
                     continue;
diff -r 04d72f81775d -r 7ee4016eeb9f xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Thu Feb 23 10:37:13 2012 +0000
+++ b/xen/arch/x86/traps.c	Wed Mar 07 07:55:10 2012 +0000
@@ -734,8 +734,34 @@
 
     if ( current->domain->domain_id != 0 )
     {
+        unsigned int cpuid_leaf = a, sub_leaf = c;
+
         if ( !cpuid_hypervisor_leaves(a, c, &a, &b, &c, &d) )
             domain_cpuid(current->domain, a, c, &a, &b, &c, &d);
+
+        switch ( cpuid_leaf )
+        {
+        case 0xd:
+        {
+            unsigned int _eax, _ebx, _ecx, _edx;
+            /* EBX value of main leaf 0 depends on enabled xsave features */
+            if ( sub_leaf == 0 && current->arch.xcr0 )
+            {
+                /* reset EBX to default value first */
+                b = XSAVE_AREA_MIN_SIZE;
+                for ( sub_leaf = 2; sub_leaf < 63; sub_leaf++ )
+                {
+                    if ( !(current->arch.xcr0 & (1ULL << sub_leaf)) )
+                        continue;
+                    domain_cpuid(current->domain, cpuid_leaf, sub_leaf,
+                                 &_eax, &_ebx, &_ecx, &_edx);
+                    if ( (_eax + _ebx) > b )
+                        b = _eax + _ebx;
+                }
+            }
+        break;
+        }
+        }
         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 Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWk-0007gd-Uo; Wed, 07 Mar 2012 23: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 1S5QWk-0007fv-A5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:14 +0000
Received: from [85.158.138.51:64731] by server-10.bemta-3.messagelabs.com id
	D9/30-13338-DC2F75F4; Wed, 07 Mar 2012 23:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1331163850!12404462!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11795 invoked from network); 7 Mar 2012 23:44:11 -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;
	7 Mar 2012 23: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 1S5QWg-0006hz-ES
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWg-000324-A6
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:10 +0000
Message-Id: <E1S5QWg-000324-A6@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: small fixes to pcpu platform
	op handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331107980 0
# Node ID ffda50fa20ab376821e19edcdf9042df31fabffe
# Parent  dab13447cd8cdf2e1623538a182dcacbb6ef2077
x86: small fixes to pcpu platform op handling

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

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

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

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24201:9c6bea25f712
xen-unstable date:        Thu Nov 24 17:56:26 2011 +0100
---


diff -r dab13447cd8c -r ffda50fa20ab xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Wed Mar 07 08:10:58 2012 +0000
+++ b/xen/arch/x86/platform_hypercall.c	Wed Mar 07 08:13:00 2012 +0000
@@ -420,13 +420,14 @@
         if ( (g_info->xen_cpuid >= NR_CPUS) ||
              !cpu_present(g_info->xen_cpuid) )
         {
-            g_info->flags |= XEN_PCPU_FLAGS_INVALID;
+            g_info->flags = XEN_PCPU_FLAGS_INVALID;
         }
         else
         {
             g_info->apic_id = x86_cpu_to_apicid[g_info->xen_cpuid];
             g_info->acpi_id = acpi_get_processor_id(g_info->xen_cpuid);
             ASSERT(g_info->apic_id != BAD_APICID);
+            g_info->flags = 0;
             if (cpu_online(g_info->xen_cpuid))
                 g_info->flags |= XEN_PCPU_FLAGS_ONLINE;
         }
@@ -443,7 +444,7 @@
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        if ( !cpu_present(cpu) )
+        if ( cpu >= NR_CPUS || !cpu_present(cpu) )
         {
             ret = -EINVAL;
             break;
@@ -464,7 +465,13 @@
     {
         int cpu = op->u.cpu_ol.cpuid;
 
-        if ( !cpu_present(cpu) )
+        if ( cpu == 0 )
+        {
+            ret = -EOPNOTSUPP;
+            break;
+        }
+
+        if ( cpu >= NR_CPUS || !cpu_present(cpu) )
         {
             ret = -EINVAL;
             break;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWm-0007hG-5l; Wed, 07 Mar 2012 23: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 1S5QWk-0007fW-Na
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:14 +0000
Received: from [85.158.139.83:50648] by server-3.bemta-5.messagelabs.com id
	B4/98-25237-EC2F75F4; Wed, 07 Mar 2012 23:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1331163852!18309820!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17232 invoked from network); 7 Mar 2012 23:44:13 -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;
	7 Mar 2012 23: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 1S5QWi-0006iB-Cc
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWi-00033a-BD
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:12 +0000
Message-Id: <E1S5QWi-00033a-BD@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44: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/emulator: workaround for AMD
	erratum 573
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331108264 0
# Node ID 0bea45ab39f716d9d3d370f33ebb92a92f27e7ad
# Parent  04e5091cc08fc9a2420aa2f5f6526422097dc172
x86/emulator: workaround for AMD erratum 573

The only cases where we might end up emulating fsincos (as any other
x87 operations without memory operands) are
- when a HVM guest is in real mode (not applicable on AMD)
- between two half page table updates in PAE mode (unlikely, and not
  doing the emulation here does affect only performance, not
  correctness)
- when a guest maliciously (or erroneously) modifies an (MMIO or page
  table update) instruction under emulation (unspecified behavior)

Hence, in order to avoid the erratum to cause harm to the entire host,
don't emulate fsincos on the affected AMD CPU families.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24417:1452fb248cd5
xen-unstable date:        Fri Dec 16 15:45:40 2011 +0100
---


diff -r 04e5091cc08f -r 0bea45ab39f7 tools/tests/x86_emulator/x86_emulate.c
--- a/tools/tests/x86_emulator/x86_emulate.c	Wed Mar 07 08:16:53 2012 +0000
+++ b/tools/tests/x86_emulator/x86_emulate.c	Wed Mar 07 08:17:44 2012 +0000
@@ -3,5 +3,7 @@
 #include <string.h>
 #include <public/xen.h>
 
+#define cpu_has_amd_erratum(nr) 0
+
 #include "x86_emulate/x86_emulate.h"
 #include "x86_emulate/x86_emulate.c"
diff -r 04e5091cc08f -r 0bea45ab39f7 xen/arch/x86/x86_emulate.c
--- a/xen/arch/x86/x86_emulate.c	Wed Mar 07 08:16:53 2012 +0000
+++ b/xen/arch/x86/x86_emulate.c	Wed Mar 07 08:17:44 2012 +0000
@@ -10,8 +10,14 @@
  */
 
 #include <asm/x86_emulate.h>
+#include <asm/processor.h> /* current_cpu_info */
+#include <asm/amd.h> /* cpu_has_amd_erratum() */
 
 /* Avoid namespace pollution. */
 #undef cmpxchg
+#undef cpuid
+
+#define cpu_has_amd_erratum(nr) \
+        cpu_has_amd_erratum(&current_cpu_data, AMD_ERRATUM_##nr)
 
 #include "x86_emulate/x86_emulate.c"
diff -r 04e5091cc08f -r 0bea45ab39f7 xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Wed Mar 07 08:16:53 2012 +0000
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Wed Mar 07 08:17:44 2012 +0000
@@ -2578,6 +2578,9 @@
     case 0xd9: /* FPU 0xd9 */
         switch ( modrm )
         {
+        case 0xfb: /* fsincos */
+            fail_if(cpu_has_amd_erratum(573));
+            /* fall through */
         case 0xc0 ... 0xc7: /* fld %stN */
         case 0xc8 ... 0xcf: /* fxch %stN */
         case 0xd0: /* fnop */
@@ -2603,7 +2606,6 @@
         case 0xf8: /* fprem */
         case 0xf9: /* fyl2xp1 */
         case 0xfa: /* fsqrt */
-        case 0xfb: /* fsincos */
         case 0xfc: /* frndint */
         case 0xfd: /* fscale */
         case 0xfe: /* fsin */
diff -r 04e5091cc08f -r 0bea45ab39f7 xen/include/asm-x86/amd.h
--- a/xen/include/asm-x86/amd.h	Wed Mar 07 08:16:53 2012 +0000
+++ b/xen/include/asm-x86/amd.h	Wed Mar 07 08:17:44 2012 +0000
@@ -138,6 +138,12 @@
     AMD_OSVW_ERRATUM(1, AMD_MODEL_RANGE(0xf, 0x41, 0x2, 0xff, 0xf),     \
                         AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf))
 
+#define AMD_ERRATUM_573							\
+    AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0xff, 0xf),	\
+                       AMD_MODEL_RANGE(0x10, 0x0, 0x0, 0xff, 0xf),	\
+                       AMD_MODEL_RANGE(0x11, 0x0, 0x0, 0xff, 0xf),	\
+                       AMD_MODEL_RANGE(0x12, 0x0, 0x0, 0xff, 0xf))
+
 struct cpuinfo_x86;
 int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWk-0007gI-Ki; Wed, 07 Mar 2012 23:44: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 1S5QWi-0007fW-PV
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:12 +0000
Received: from [85.158.139.83:41344] by server-3.bemta-5.messagelabs.com id
	CE/88-25237-BC2F75F4; Wed, 07 Mar 2012 23:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1331163850!18309815!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17177 invoked from network); 7 Mar 2012 23:44:11 -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;
	7 Mar 2012 23: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 1S5QWf-0006ht-FO
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWf-00031N-B4
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:09 +0000
Message-Id: <E1S5QWf-00031N-B4@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/IO-APIC: refine EOI-ing of
	migrating level interrupts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331107379 0
# Node ID a43a31a976037bd9ea3b34f827dcc35d0f484d77
# Parent  637eaa1421d1ae9808f1cc56c39b2d9e1fe64eb9
x86/IO-APIC: refine EOI-ing of migrating level interrupts

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

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

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen-unstable changeset:   24155:0d50e704834f
xen-unstable date:        Fri Nov 18 09:18:41 2011 +0100
---


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

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWk-0007gY-SG; Wed, 07 Mar 2012 23:44: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 1S5QWk-0007fV-04
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:14 +0000
Received: from [85.158.143.35:20181] by server-2.bemta-4.messagelabs.com id
	92/8C-17550-DC2F75F4; Wed, 07 Mar 2012 23:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1331163852!9435868!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14214 invoked from network); 7 Mar 2012 23:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 23: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 1S5QWh-0006i8-SF
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWh-00033C-Qv
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:11 +0000
Message-Id: <E1S5QWh-00033C-Qv@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44: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: Disable GartTlbWlkErr when BIOS forgets it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331108213 0
# Node ID 04e5091cc08fc9a2420aa2f5f6526422097dc172
# Parent  95f48f40299f52cf52adfbc03b29ecbc66fda4d2
x86, amd: Disable GartTlbWlkErr when BIOS forgets it

This patch disables GartTlbWlk errors on AMD Fam10h CPUs if the BIOS
forgets to do is (or is just too old). Letting these errors enabled
can cause a sync-flood on the CPU causing a reboot.

The AMD BKDG recommends disabling GART TLB Wlk Error completely.

Based on a Linux patch from Joerg Roedel <joerg.roedel@amd.com>; see
e.g.
https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=patch;h=5bbc097d890409d8eff4e3f1d26f11a9d6b7c07e

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24389:868d82faf651
xen-unstable date:        Tue Dec 13 09:45:11 2011 +0100
---


diff -r 95f48f40299f -r 04e5091cc08f xen/arch/x86/cpu/mcheck/amd_f10.c
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c	Wed Mar 07 08:15:50 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c	Wed Mar 07 08:16:53 2012 +0000
@@ -46,6 +46,7 @@
 #include <asm/msr.h>
 
 #include "mce.h"
+#include "mce_quirks.h"
 #include "x86_mca.h"
 
 
@@ -91,9 +92,14 @@
 /* AMD Family10 machine check */
 enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c)
 { 
+	enum mcequirk_amd_flags quirkflag = mcequirk_lookup_amd_quirkdata(c);
+
 	if (amd_k8_mcheck_init(c) == mcheck_none)
 		return mcheck_none;
 
+	if (quirkflag == MCEQUIRK_F10_GART)
+		mcequirk_amd_apply(quirkflag);
+
 	x86_mce_callback_register(amd_f10_handler);
 
 	return mcheck_amd_famXX;
diff -r 95f48f40299f -r 04e5091cc08f xen/arch/x86/cpu/mcheck/mce_amd_quirks.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Wed Mar 07 08:15:50 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Wed Mar 07 08:16:53 2012 +0000
@@ -29,6 +29,8 @@
 	  MCEQUIRK_K7_BANK0 },
 	{ 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
@@ -54,6 +56,8 @@
 
 int mcequirk_amd_apply(enum mcequirk_amd_flags flags)
 {
+	u64 val;
+
 	switch (flags) {
 	case MCEQUIRK_K7_BANK0:
 		return 1; /* first bank */
@@ -67,6 +71,10 @@
 		wrmsrl(MSR_IA32_MC4_CTL, ~(1ULL << 10));
 		wrmsrl(MSR_IA32_MC4_STATUS, 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;
diff -r 95f48f40299f -r 04e5091cc08f xen/arch/x86/cpu/mcheck/mce_quirks.h
--- a/xen/arch/x86/cpu/mcheck/mce_quirks.h	Wed Mar 07 08:15:50 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce_quirks.h	Wed Mar 07 08:16:53 2012 +0000
@@ -33,8 +33,9 @@
  */
 
 enum mcequirk_amd_flags {
-	MCEQUIRK_K7_BANK0 = 0x1,
-	MCEQUIRK_K8_GART = 0x2,
+	MCEQUIRK_K7_BANK0 = 1,
+	MCEQUIRK_K8_GART,
+	MCEQUIRK_F10_GART
 };
 
 enum mcequirk_intel_flags {
diff -r 95f48f40299f -r 04e5091cc08f xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Wed Mar 07 08:15:50 2012 +0000
+++ b/xen/include/asm-x86/msr-index.h	Wed Mar 07 08:16:53 2012 +0000
@@ -98,6 +98,8 @@
 #define CMCI_EN 			(1UL<<30)
 #define CMCI_THRESHOLD_MASK		0x7FFF
 
+#define MSR_AMD64_MC0_MASK		0xc0010044
+
 #define MSR_IA32_MC1_CTL		0x00000404
 #define MSR_IA32_MC1_CTL2		0x00000281
 #define MSR_IA32_MC1_STATUS		0x00000405
@@ -151,6 +153,8 @@
 #define MSR_IA32_MCx_ADDR(x)		(MSR_IA32_MC0_ADDR + 4*(x))
 #define MSR_IA32_MCx_MISC(x)		(MSR_IA32_MC0_MISC + 4*(x)) 
 
+#define MSR_AMD64_MCx_MASK(x)		(MSR_AMD64_MC0_MASK + (x))
+
 #define MSR_P6_PERFCTR0			0x000000c1
 #define MSR_P6_PERFCTR1			0x000000c2
 #define MSR_P6_EVNTSEL0			0x00000186

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWk-0007gN-ND; Wed, 07 Mar 2012 23: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 1S5QWj-0007fb-95
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:13 +0000
Received: from [85.158.138.51:64681] by server-5.bemta-3.messagelabs.com id
	9F/09-09139-AC2F75F4; Wed, 07 Mar 2012 23:44:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1331163849!16597795!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17339 invoked from network); 7 Mar 2012 23:44:10 -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;
	7 Mar 2012 23: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 1S5QWe-0006hn-IC
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWe-00030d-7n
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:08 +0000
Message-Id: <E1S5QWe-00030d-7n@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Fix PV CPUID virtualization of
	XSave
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Shan Haitao <haitao.shan@intel.com>
# Date 1331106910 0
# Node ID 7ee4016eeb9fb1c05f033e2b9da78cf5564c3e54
# Parent  04d72f81775d66d159f4f2aea7723bb1ad432564
Fix PV CPUID virtualization of XSave

The patch will fix XSave CPUID virtualization for PV guests. The XSave
area size returned by CPUID leaf D is changed dynamically depending on
the XCR0. Tools/libxc only assigns a static value. The fix will adjust
xsave area size during runtime.

Note: This fix is already in HVM cpuid virtualization. And Dom0 is not
affected, either.

Signed-off-by:  Shan Haitao <haitao.shan@intel.com>
xen-unstable changeset:   23853:b78235de5c64
xen-unstable date:        Sun Sep 18 00:01:58 2011 +0100

x86: Further fixes for xsave leaf in pv_cpuid().

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23955:bbde1453cbd9
xen-unstable date:        Thu Oct 13 15:58:55 2011 +0100
---


diff -r 04d72f81775d -r 7ee4016eeb9f xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Feb 23 10:37:13 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Wed Mar 07 07:55:10 2012 +0000
@@ -2230,7 +2230,7 @@
         {
             /* reset EBX to default value first */
             *ebx = XSAVE_AREA_MIN_SIZE; 
-            for ( sub_leaf = 2; sub_leaf < 64; sub_leaf++ )
+            for ( sub_leaf = 2; sub_leaf < 63; sub_leaf++ )
             {
                 if ( !(v->arch.xcr0 & (1ULL << sub_leaf)) )
                     continue;
diff -r 04d72f81775d -r 7ee4016eeb9f xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c	Thu Feb 23 10:37:13 2012 +0000
+++ b/xen/arch/x86/traps.c	Wed Mar 07 07:55:10 2012 +0000
@@ -734,8 +734,34 @@
 
     if ( current->domain->domain_id != 0 )
     {
+        unsigned int cpuid_leaf = a, sub_leaf = c;
+
         if ( !cpuid_hypervisor_leaves(a, c, &a, &b, &c, &d) )
             domain_cpuid(current->domain, a, c, &a, &b, &c, &d);
+
+        switch ( cpuid_leaf )
+        {
+        case 0xd:
+        {
+            unsigned int _eax, _ebx, _ecx, _edx;
+            /* EBX value of main leaf 0 depends on enabled xsave features */
+            if ( sub_leaf == 0 && current->arch.xcr0 )
+            {
+                /* reset EBX to default value first */
+                b = XSAVE_AREA_MIN_SIZE;
+                for ( sub_leaf = 2; sub_leaf < 63; sub_leaf++ )
+                {
+                    if ( !(current->arch.xcr0 & (1ULL << sub_leaf)) )
+                        continue;
+                    domain_cpuid(current->domain, cpuid_leaf, sub_leaf,
+                                 &_eax, &_ebx, &_ecx, &_edx);
+                    if ( (_eax + _ebx) > b )
+                        b = _eax + _ebx;
+                }
+            }
+        break;
+        }
+        }
         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 Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWm-0007hG-5l; Wed, 07 Mar 2012 23: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 1S5QWk-0007fW-Na
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:14 +0000
Received: from [85.158.139.83:50648] by server-3.bemta-5.messagelabs.com id
	B4/98-25237-EC2F75F4; Wed, 07 Mar 2012 23:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1331163852!18309820!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17232 invoked from network); 7 Mar 2012 23:44:13 -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;
	7 Mar 2012 23: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 1S5QWi-0006iB-Cc
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWi-00033a-BD
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:12 +0000
Message-Id: <E1S5QWi-00033a-BD@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44: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/emulator: workaround for AMD
	erratum 573
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331108264 0
# Node ID 0bea45ab39f716d9d3d370f33ebb92a92f27e7ad
# Parent  04e5091cc08fc9a2420aa2f5f6526422097dc172
x86/emulator: workaround for AMD erratum 573

The only cases where we might end up emulating fsincos (as any other
x87 operations without memory operands) are
- when a HVM guest is in real mode (not applicable on AMD)
- between two half page table updates in PAE mode (unlikely, and not
  doing the emulation here does affect only performance, not
  correctness)
- when a guest maliciously (or erroneously) modifies an (MMIO or page
  table update) instruction under emulation (unspecified behavior)

Hence, in order to avoid the erratum to cause harm to the entire host,
don't emulate fsincos on the affected AMD CPU families.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24417:1452fb248cd5
xen-unstable date:        Fri Dec 16 15:45:40 2011 +0100
---


diff -r 04e5091cc08f -r 0bea45ab39f7 tools/tests/x86_emulator/x86_emulate.c
--- a/tools/tests/x86_emulator/x86_emulate.c	Wed Mar 07 08:16:53 2012 +0000
+++ b/tools/tests/x86_emulator/x86_emulate.c	Wed Mar 07 08:17:44 2012 +0000
@@ -3,5 +3,7 @@
 #include <string.h>
 #include <public/xen.h>
 
+#define cpu_has_amd_erratum(nr) 0
+
 #include "x86_emulate/x86_emulate.h"
 #include "x86_emulate/x86_emulate.c"
diff -r 04e5091cc08f -r 0bea45ab39f7 xen/arch/x86/x86_emulate.c
--- a/xen/arch/x86/x86_emulate.c	Wed Mar 07 08:16:53 2012 +0000
+++ b/xen/arch/x86/x86_emulate.c	Wed Mar 07 08:17:44 2012 +0000
@@ -10,8 +10,14 @@
  */
 
 #include <asm/x86_emulate.h>
+#include <asm/processor.h> /* current_cpu_info */
+#include <asm/amd.h> /* cpu_has_amd_erratum() */
 
 /* Avoid namespace pollution. */
 #undef cmpxchg
+#undef cpuid
+
+#define cpu_has_amd_erratum(nr) \
+        cpu_has_amd_erratum(&current_cpu_data, AMD_ERRATUM_##nr)
 
 #include "x86_emulate/x86_emulate.c"
diff -r 04e5091cc08f -r 0bea45ab39f7 xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Wed Mar 07 08:16:53 2012 +0000
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Wed Mar 07 08:17:44 2012 +0000
@@ -2578,6 +2578,9 @@
     case 0xd9: /* FPU 0xd9 */
         switch ( modrm )
         {
+        case 0xfb: /* fsincos */
+            fail_if(cpu_has_amd_erratum(573));
+            /* fall through */
         case 0xc0 ... 0xc7: /* fld %stN */
         case 0xc8 ... 0xcf: /* fxch %stN */
         case 0xd0: /* fnop */
@@ -2603,7 +2606,6 @@
         case 0xf8: /* fprem */
         case 0xf9: /* fyl2xp1 */
         case 0xfa: /* fsqrt */
-        case 0xfb: /* fsincos */
         case 0xfc: /* frndint */
         case 0xfd: /* fscale */
         case 0xfe: /* fsin */
diff -r 04e5091cc08f -r 0bea45ab39f7 xen/include/asm-x86/amd.h
--- a/xen/include/asm-x86/amd.h	Wed Mar 07 08:16:53 2012 +0000
+++ b/xen/include/asm-x86/amd.h	Wed Mar 07 08:17:44 2012 +0000
@@ -138,6 +138,12 @@
     AMD_OSVW_ERRATUM(1, AMD_MODEL_RANGE(0xf, 0x41, 0x2, 0xff, 0xf),     \
                         AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf))
 
+#define AMD_ERRATUM_573							\
+    AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0xff, 0xf),	\
+                       AMD_MODEL_RANGE(0x10, 0x0, 0x0, 0xff, 0xf),	\
+                       AMD_MODEL_RANGE(0x11, 0x0, 0x0, 0xff, 0xf),	\
+                       AMD_MODEL_RANGE(0x12, 0x0, 0x0, 0xff, 0xf))
+
 struct cpuinfo_x86;
 int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWk-0007gY-SG; Wed, 07 Mar 2012 23:44: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 1S5QWk-0007fV-04
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:14 +0000
Received: from [85.158.143.35:20181] by server-2.bemta-4.messagelabs.com id
	92/8C-17550-DC2F75F4; Wed, 07 Mar 2012 23:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1331163852!9435868!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14214 invoked from network); 7 Mar 2012 23:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 23: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 1S5QWh-0006i8-SF
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWh-00033C-Qv
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:11 +0000
Message-Id: <E1S5QWh-00033C-Qv@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44: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: Disable GartTlbWlkErr when BIOS forgets it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331108213 0
# Node ID 04e5091cc08fc9a2420aa2f5f6526422097dc172
# Parent  95f48f40299f52cf52adfbc03b29ecbc66fda4d2
x86, amd: Disable GartTlbWlkErr when BIOS forgets it

This patch disables GartTlbWlk errors on AMD Fam10h CPUs if the BIOS
forgets to do is (or is just too old). Letting these errors enabled
can cause a sync-flood on the CPU causing a reboot.

The AMD BKDG recommends disabling GART TLB Wlk Error completely.

Based on a Linux patch from Joerg Roedel <joerg.roedel@amd.com>; see
e.g.
https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=patch;h=5bbc097d890409d8eff4e3f1d26f11a9d6b7c07e

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24389:868d82faf651
xen-unstable date:        Tue Dec 13 09:45:11 2011 +0100
---


diff -r 95f48f40299f -r 04e5091cc08f xen/arch/x86/cpu/mcheck/amd_f10.c
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c	Wed Mar 07 08:15:50 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c	Wed Mar 07 08:16:53 2012 +0000
@@ -46,6 +46,7 @@
 #include <asm/msr.h>
 
 #include "mce.h"
+#include "mce_quirks.h"
 #include "x86_mca.h"
 
 
@@ -91,9 +92,14 @@
 /* AMD Family10 machine check */
 enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c)
 { 
+	enum mcequirk_amd_flags quirkflag = mcequirk_lookup_amd_quirkdata(c);
+
 	if (amd_k8_mcheck_init(c) == mcheck_none)
 		return mcheck_none;
 
+	if (quirkflag == MCEQUIRK_F10_GART)
+		mcequirk_amd_apply(quirkflag);
+
 	x86_mce_callback_register(amd_f10_handler);
 
 	return mcheck_amd_famXX;
diff -r 95f48f40299f -r 04e5091cc08f xen/arch/x86/cpu/mcheck/mce_amd_quirks.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Wed Mar 07 08:15:50 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Wed Mar 07 08:16:53 2012 +0000
@@ -29,6 +29,8 @@
 	  MCEQUIRK_K7_BANK0 },
 	{ 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
@@ -54,6 +56,8 @@
 
 int mcequirk_amd_apply(enum mcequirk_amd_flags flags)
 {
+	u64 val;
+
 	switch (flags) {
 	case MCEQUIRK_K7_BANK0:
 		return 1; /* first bank */
@@ -67,6 +71,10 @@
 		wrmsrl(MSR_IA32_MC4_CTL, ~(1ULL << 10));
 		wrmsrl(MSR_IA32_MC4_STATUS, 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;
diff -r 95f48f40299f -r 04e5091cc08f xen/arch/x86/cpu/mcheck/mce_quirks.h
--- a/xen/arch/x86/cpu/mcheck/mce_quirks.h	Wed Mar 07 08:15:50 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce_quirks.h	Wed Mar 07 08:16:53 2012 +0000
@@ -33,8 +33,9 @@
  */
 
 enum mcequirk_amd_flags {
-	MCEQUIRK_K7_BANK0 = 0x1,
-	MCEQUIRK_K8_GART = 0x2,
+	MCEQUIRK_K7_BANK0 = 1,
+	MCEQUIRK_K8_GART,
+	MCEQUIRK_F10_GART
 };
 
 enum mcequirk_intel_flags {
diff -r 95f48f40299f -r 04e5091cc08f xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Wed Mar 07 08:15:50 2012 +0000
+++ b/xen/include/asm-x86/msr-index.h	Wed Mar 07 08:16:53 2012 +0000
@@ -98,6 +98,8 @@
 #define CMCI_EN 			(1UL<<30)
 #define CMCI_THRESHOLD_MASK		0x7FFF
 
+#define MSR_AMD64_MC0_MASK		0xc0010044
+
 #define MSR_IA32_MC1_CTL		0x00000404
 #define MSR_IA32_MC1_CTL2		0x00000281
 #define MSR_IA32_MC1_STATUS		0x00000405
@@ -151,6 +153,8 @@
 #define MSR_IA32_MCx_ADDR(x)		(MSR_IA32_MC0_ADDR + 4*(x))
 #define MSR_IA32_MCx_MISC(x)		(MSR_IA32_MC0_MISC + 4*(x)) 
 
+#define MSR_AMD64_MCx_MASK(x)		(MSR_AMD64_MC0_MASK + (x))
+
 #define MSR_P6_PERFCTR0			0x000000c1
 #define MSR_P6_PERFCTR1			0x000000c2
 #define MSR_P6_EVNTSEL0			0x00000186

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWl-0007gm-1L; Wed, 07 Mar 2012 23:44: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 1S5QWk-0007fl-BG
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:14 +0000
Received: from [85.158.139.83:41376] by server-7.bemta-5.messagelabs.com id
	93/51-16195-DC2F75F4; Wed, 07 Mar 2012 23:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1331163851!17695751!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27704 invoked from network); 7 Mar 2012 23:44:12 -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;
	7 Mar 2012 23: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 1S5QWh-0006i5-BR
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWh-00032m-9y
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:11 +0000
Message-Id: <E1S5QWh-00032m-9y@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] tools/firmware: remove "_PS0/3"
	Method
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Xudong Hao <xudong.hao@intel.com>
# Date 1331108150 0
# Node ID 95f48f40299f52cf52adfbc03b29ecbc66fda4d2
# Parent  a6bbda6dc322c4581d45fb98b005129a0acb9d62
tools/firmware: remove "_PS0/3" Method

Do not expose the ACPI power management "_PS0/3" Method to guest
firmware.  According to section 3.4 of the APCI specification 4.0, PCI
device control the device power through its own specification but not
through APCI.

Qemu pushes "_PS0/3" to guest will cause a mess between ACPI PM and
PCI PM as a result of incorrect ACPI table shipped with the guest
BIOS, it may cause a failure of PCI device PM state transition(from
PCI_UNKNOWN to PCI_D0).

Signed-off-by: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: Haitao Shan <haitao.shan@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24357:832fa3f35432
xen-unstable date:        Mon Dec 05 19:35:06 2011 +0000
---


diff -r a6bbda6dc322 -r 95f48f40299f tools/firmware/hvmloader/acpi/mk_dsdt.c
--- a/tools/firmware/hvmloader/acpi/mk_dsdt.c	Wed Mar 07 08:13:47 2012 +0000
+++ b/tools/firmware/hvmloader/acpi/mk_dsdt.c	Wed Mar 07 08:15:50 2012 +0000
@@ -251,8 +251,6 @@
      * the ACPI event:
      *  _EJ0: eject a device
      *  _STA: return a device's status, e.g. enabled or removed
-     * Other methods are optional: 
-     *  _PS0/3: put them here for debug purpose
      * 
      * Eject button would generate a general-purpose event, then the
      * control method for this event uses Notify() to inform OSPM which
@@ -271,14 +269,6 @@
         stmt("Name", "_ADR, 0x%08x", ((slot & ~7) << 13) | (slot & 7));
         /* _SUN == dev */
         stmt("Name", "_SUN, 0x%08x", slot >> 3);
-        push_block("Method", "_PS0, 0");
-        stmt("Store", "0x%02x, \\_GPE.DPT1", slot);
-        stmt("Store", "0x80, \\_GPE.DPT2");
-        pop_block();
-        push_block("Method", "_PS3, 0");
-        stmt("Store", "0x%02x, \\_GPE.DPT1", slot);
-        stmt("Store", "0x83, \\_GPE.DPT2");
-        pop_block();
         push_block("Method", "_EJ0, 1");
         stmt("Store", "0x%02x, \\_GPE.DPT1", slot);
         stmt("Store", "0x88, \\_GPE.DPT2");

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWl-0007gm-1L; Wed, 07 Mar 2012 23:44: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 1S5QWk-0007fl-BG
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:14 +0000
Received: from [85.158.139.83:41376] by server-7.bemta-5.messagelabs.com id
	93/51-16195-DC2F75F4; Wed, 07 Mar 2012 23:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1331163851!17695751!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27704 invoked from network); 7 Mar 2012 23:44:12 -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;
	7 Mar 2012 23: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 1S5QWh-0006i5-BR
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWh-00032m-9y
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:11 +0000
Message-Id: <E1S5QWh-00032m-9y@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] tools/firmware: remove "_PS0/3"
	Method
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Xudong Hao <xudong.hao@intel.com>
# Date 1331108150 0
# Node ID 95f48f40299f52cf52adfbc03b29ecbc66fda4d2
# Parent  a6bbda6dc322c4581d45fb98b005129a0acb9d62
tools/firmware: remove "_PS0/3" Method

Do not expose the ACPI power management "_PS0/3" Method to guest
firmware.  According to section 3.4 of the APCI specification 4.0, PCI
device control the device power through its own specification but not
through APCI.

Qemu pushes "_PS0/3" to guest will cause a mess between ACPI PM and
PCI PM as a result of incorrect ACPI table shipped with the guest
BIOS, it may cause a failure of PCI device PM state transition(from
PCI_UNKNOWN to PCI_D0).

Signed-off-by: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: Haitao Shan <haitao.shan@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24357:832fa3f35432
xen-unstable date:        Mon Dec 05 19:35:06 2011 +0000
---


diff -r a6bbda6dc322 -r 95f48f40299f tools/firmware/hvmloader/acpi/mk_dsdt.c
--- a/tools/firmware/hvmloader/acpi/mk_dsdt.c	Wed Mar 07 08:13:47 2012 +0000
+++ b/tools/firmware/hvmloader/acpi/mk_dsdt.c	Wed Mar 07 08:15:50 2012 +0000
@@ -251,8 +251,6 @@
      * the ACPI event:
      *  _EJ0: eject a device
      *  _STA: return a device's status, e.g. enabled or removed
-     * Other methods are optional: 
-     *  _PS0/3: put them here for debug purpose
      * 
      * Eject button would generate a general-purpose event, then the
      * control method for this event uses Notify() to inform OSPM which
@@ -271,14 +269,6 @@
         stmt("Name", "_ADR, 0x%08x", ((slot & ~7) << 13) | (slot & 7));
         /* _SUN == dev */
         stmt("Name", "_SUN, 0x%08x", slot >> 3);
-        push_block("Method", "_PS0, 0");
-        stmt("Store", "0x%02x, \\_GPE.DPT1", slot);
-        stmt("Store", "0x80, \\_GPE.DPT2");
-        pop_block();
-        push_block("Method", "_PS3, 0");
-        stmt("Store", "0x%02x, \\_GPE.DPT1", slot);
-        stmt("Store", "0x83, \\_GPE.DPT2");
-        pop_block();
         push_block("Method", "_EJ0, 1");
         stmt("Store", "0x%02x, \\_GPE.DPT1", slot);
         stmt("Store", "0x88, \\_GPE.DPT2");

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWo-0007jD-Bh; Wed, 07 Mar 2012 23:44: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 1S5QWm-0007hO-Od
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:17 +0000
Received: from [193.109.254.147:21800] by server-6.bemta-14.messagelabs.com id
	C7/DA-01457-0D2F75F4; Wed, 07 Mar 2012 23:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1331163810!55685592!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12269 invoked from network); 7 Mar 2012 23:43:31 -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;
	7 Mar 2012 23:43:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWj-0006iK-Tr
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWj-00034h-SH
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:13 +0000
Message-Id: <E1S5QWj-00034h-SH@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44: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/vMSI: miscellaneous fixes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331108785 0
# Node ID 871ed74bbefd969459294ce4f5e9df99eeae2400
# Parent  96db1984e87855b196c3b94c3cb7443c5c764f5f
x86/vMSI: miscellaneous fixes

This addresses a number of problems in msixtbl_{read,write}():
- address alignment was not checked, allowing for memory corruption in
  the hypervisor (write case) or returning of hypervisor private data
  to the guest (read case)
- the interrupt mask bit was permitted to be written by the guest
  (while Xen's interrupt flow control routines need to control it)
- MAX_MSIX_TABLE_{ENTRIES,PAGES} were pointlessly defined to plain
  numbers (making it unobvious why they have these values, and making
  the latter non-portable)
- MAX_MSIX_TABLE_PAGES was also off by one (failing to account for a
  non-zero table offset); this was also affecting host MSI-X code
- struct msixtbl_entry's table_flags[] was one element larger than
  necessary due to improper open-coding of BITS_TO_LONGS()
- msixtbl_read() unconditionally accessed the physical table, even
  though the data was only needed in a quarter of all cases
- various calculations were done unnecessarily for both of the rather
  distinct code paths in msixtbl_read()

Additionally it is unclear on what basis MAX_MSIX_ACC_ENTRIES was
chosen to be 3.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24535:fb81b807c154
xen-unstable date:        Mon Jan 23 09:35:17 2012 +0000
---


diff -r 96db1984e878 -r 871ed74bbefd xen/arch/x86/hvm/vmsi.c
--- a/xen/arch/x86/hvm/vmsi.c	Wed Mar 07 08:22:38 2012 +0000
+++ b/xen/arch/x86/hvm/vmsi.c	Wed Mar 07 08:26:25 2012 +0000
@@ -158,7 +158,7 @@
     struct pci_dev *pdev;
     unsigned long gtable;       /* gpa of msix table */
     unsigned long table_len;
-    unsigned long table_flags[MAX_MSIX_TABLE_ENTRIES / BITS_PER_LONG + 1];
+    unsigned long table_flags[BITS_TO_LONGS(MAX_MSIX_TABLE_ENTRIES)];
 #define MAX_MSIX_ACC_ENTRIES 3
     struct { 
         uint32_t msi_ad[3];	/* Shadow of address low, high and data */
@@ -185,17 +185,14 @@
 static void __iomem *msixtbl_addr_to_virt(
     struct msixtbl_entry *entry, unsigned long addr)
 {
-    int idx, nr_page;
+    unsigned int idx, nr_page;
 
-    if ( !entry )
+    if ( !entry || !entry->pdev )
         return NULL;
 
     nr_page = (addr >> PAGE_SHIFT) -
               (entry->gtable >> PAGE_SHIFT);
 
-    if ( !entry->pdev )
-        return NULL;
-
     idx = entry->pdev->msix_table_idx[nr_page];
     if ( !idx )
         return NULL;
@@ -208,37 +205,34 @@
     struct vcpu *v, unsigned long address,
     unsigned long len, unsigned long *pval)
 {
-    unsigned long offset, val;
+    unsigned long offset;
     struct msixtbl_entry *entry;
     void *virt;
-    int nr_entry, index;
+    unsigned int nr_entry, index;
     int r = X86EMUL_UNHANDLEABLE;
 
+    if ( len != 4 || (address & 3) )
+        return r;
+
     rcu_read_lock(&msixtbl_rcu_lock);
 
-    if ( len != 4 )
-        goto out;
+    entry = msixtbl_find_entry(v, address);
+    offset = address & (PCI_MSIX_ENTRY_SIZE - 1);
 
-    entry = msixtbl_find_entry(v, address);
-    virt = msixtbl_addr_to_virt(entry, address);
-    if ( !virt )
-        goto out;
-
-    nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE;
-    offset = address & (PCI_MSIX_ENTRY_SIZE - 1);
-    if ( nr_entry >= MAX_MSIX_ACC_ENTRIES && 
-         offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET )
-        goto out;
-
-    val = readl(virt);
     if ( offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET )
     {
+        nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE;
+        if ( nr_entry >= MAX_MSIX_ACC_ENTRIES )
+            goto out;
         index = offset / sizeof(uint32_t);
         *pval = entry->gentries[nr_entry].msi_ad[index];
     }
     else 
     {
-        *pval = val;
+        virt = msixtbl_addr_to_virt(entry, address);
+        if ( !virt )
+            goto out;
+        *pval = readl(virt);
     }
     
     r = X86EMUL_OKAY;
@@ -253,14 +247,14 @@
     unsigned long offset;
     struct msixtbl_entry *entry;
     void *virt;
-    int nr_entry, index;
+    unsigned int nr_entry, index;
     int r = X86EMUL_UNHANDLEABLE;
 
+    if ( len != 4 || (address & 3) )
+        return r;
+
     rcu_read_lock(&msixtbl_rcu_lock);
 
-    if ( len != 4 )
-        goto out;
-
     entry = msixtbl_find_entry(v, address);
     nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE;
 
@@ -284,9 +278,22 @@
     if ( !virt )
         goto out;
 
+    /* Do not allow the mask bit to be changed. */
+#if 0 /* XXX
+       * As the mask bit is the only defined bit in the word, and as the
+       * host MSI-X code doesn't preserve the other bits anyway, doing
+       * this is pointless. So for now just discard the write (also
+       * saving us from having to determine the matching irq_desc).
+       */
+    spin_lock_irqsave(&desc->lock, flags);
+    orig = readl(virt);
+    val &= ~PCI_MSIX_VECTOR_BITMASK;
+    val |= orig & PCI_MSIX_VECTOR_BITMASK;
     writel(val, virt);
+    spin_unlock_irqrestore(&desc->lock, flags);
+#endif
+
     r = X86EMUL_OKAY;
-
 out:
     rcu_read_unlock(&msixtbl_rcu_lock);
     return r;
diff -r 96db1984e878 -r 871ed74bbefd xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h	Wed Mar 07 08:22:38 2012 +0000
+++ b/xen/include/asm-x86/msi.h	Wed Mar 07 08:26:25 2012 +0000
@@ -119,12 +119,6 @@
 
 extern const struct hw_interrupt_type pci_msi_type;
 
-#define PCI_MSIX_ENTRY_SIZE			16
-#define  PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET	0
-#define  PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET	4
-#define  PCI_MSIX_ENTRY_DATA_OFFSET		8
-#define  PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET	12
-
 #define msi_control_reg(base)		(base + PCI_MSI_FLAGS)
 #define msi_lower_address_reg(base)	(base + PCI_MSI_ADDRESS_LO)
 #define msi_upper_address_reg(base)	(base + PCI_MSI_ADDRESS_HI)
diff -r 96db1984e878 -r 871ed74bbefd xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Wed Mar 07 08:22:38 2012 +0000
+++ b/xen/include/xen/pci.h	Wed Mar 07 08:26:25 2012 +0000
@@ -12,6 +12,7 @@
 #include <xen/list.h>
 #include <xen/spinlock.h>
 #include <xen/irq.h>
+#include <xen/pci_regs.h>
 
 /*
  * The PCI interface treats multi-function devices as independent
@@ -30,8 +31,10 @@
 #define PCI_BDF(b,d,f)  ((((b) & 0xff) << 8) | PCI_DEVFN(d,f))
 #define PCI_BDF2(b,df)  ((((b) & 0xff) << 8) | ((df) & 0xff))
 
-#define MAX_MSIX_TABLE_ENTRIES  2048
-#define MAX_MSIX_TABLE_PAGES    8
+#define MAX_MSIX_TABLE_ENTRIES  (PCI_MSIX_FLAGS_QSIZE + 1)
+#define MAX_MSIX_TABLE_PAGES    PFN_UP(MAX_MSIX_TABLE_ENTRIES * \
+                                       PCI_MSIX_ENTRY_SIZE + \
+                                       (~PCI_MSIX_BIRMASK & (PAGE_SIZE - 1)))
 struct pci_dev_info {
     unsigned is_extfn;
     unsigned is_virtfn;
diff -r 96db1984e878 -r 871ed74bbefd xen/include/xen/pci_regs.h
--- a/xen/include/xen/pci_regs.h	Wed Mar 07 08:22:38 2012 +0000
+++ b/xen/include/xen/pci_regs.h	Wed Mar 07 08:26:25 2012 +0000
@@ -305,6 +305,12 @@
 #define PCI_MSIX_PBA		8
 #define  PCI_MSIX_BIRMASK	(7 << 0)
 
+#define PCI_MSIX_ENTRY_SIZE			16
+#define  PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET	0
+#define  PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET	4
+#define  PCI_MSIX_ENTRY_DATA_OFFSET		8
+#define  PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET	12
+
 #define PCI_MSIX_VECTOR_BITMASK	(1 << 0)
 
 /* CompactPCI Hotswap Register */

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWo-0007jD-Bh; Wed, 07 Mar 2012 23:44: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 1S5QWm-0007hO-Od
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:17 +0000
Received: from [193.109.254.147:21800] by server-6.bemta-14.messagelabs.com id
	C7/DA-01457-0D2F75F4; Wed, 07 Mar 2012 23:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1331163810!55685592!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12269 invoked from network); 7 Mar 2012 23:43:31 -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;
	7 Mar 2012 23:43:31 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWj-0006iK-Tr
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWj-00034h-SH
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:13 +0000
Message-Id: <E1S5QWj-00034h-SH@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44: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/vMSI: miscellaneous fixes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331108785 0
# Node ID 871ed74bbefd969459294ce4f5e9df99eeae2400
# Parent  96db1984e87855b196c3b94c3cb7443c5c764f5f
x86/vMSI: miscellaneous fixes

This addresses a number of problems in msixtbl_{read,write}():
- address alignment was not checked, allowing for memory corruption in
  the hypervisor (write case) or returning of hypervisor private data
  to the guest (read case)
- the interrupt mask bit was permitted to be written by the guest
  (while Xen's interrupt flow control routines need to control it)
- MAX_MSIX_TABLE_{ENTRIES,PAGES} were pointlessly defined to plain
  numbers (making it unobvious why they have these values, and making
  the latter non-portable)
- MAX_MSIX_TABLE_PAGES was also off by one (failing to account for a
  non-zero table offset); this was also affecting host MSI-X code
- struct msixtbl_entry's table_flags[] was one element larger than
  necessary due to improper open-coding of BITS_TO_LONGS()
- msixtbl_read() unconditionally accessed the physical table, even
  though the data was only needed in a quarter of all cases
- various calculations were done unnecessarily for both of the rather
  distinct code paths in msixtbl_read()

Additionally it is unclear on what basis MAX_MSIX_ACC_ENTRIES was
chosen to be 3.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24535:fb81b807c154
xen-unstable date:        Mon Jan 23 09:35:17 2012 +0000
---


diff -r 96db1984e878 -r 871ed74bbefd xen/arch/x86/hvm/vmsi.c
--- a/xen/arch/x86/hvm/vmsi.c	Wed Mar 07 08:22:38 2012 +0000
+++ b/xen/arch/x86/hvm/vmsi.c	Wed Mar 07 08:26:25 2012 +0000
@@ -158,7 +158,7 @@
     struct pci_dev *pdev;
     unsigned long gtable;       /* gpa of msix table */
     unsigned long table_len;
-    unsigned long table_flags[MAX_MSIX_TABLE_ENTRIES / BITS_PER_LONG + 1];
+    unsigned long table_flags[BITS_TO_LONGS(MAX_MSIX_TABLE_ENTRIES)];
 #define MAX_MSIX_ACC_ENTRIES 3
     struct { 
         uint32_t msi_ad[3];	/* Shadow of address low, high and data */
@@ -185,17 +185,14 @@
 static void __iomem *msixtbl_addr_to_virt(
     struct msixtbl_entry *entry, unsigned long addr)
 {
-    int idx, nr_page;
+    unsigned int idx, nr_page;
 
-    if ( !entry )
+    if ( !entry || !entry->pdev )
         return NULL;
 
     nr_page = (addr >> PAGE_SHIFT) -
               (entry->gtable >> PAGE_SHIFT);
 
-    if ( !entry->pdev )
-        return NULL;
-
     idx = entry->pdev->msix_table_idx[nr_page];
     if ( !idx )
         return NULL;
@@ -208,37 +205,34 @@
     struct vcpu *v, unsigned long address,
     unsigned long len, unsigned long *pval)
 {
-    unsigned long offset, val;
+    unsigned long offset;
     struct msixtbl_entry *entry;
     void *virt;
-    int nr_entry, index;
+    unsigned int nr_entry, index;
     int r = X86EMUL_UNHANDLEABLE;
 
+    if ( len != 4 || (address & 3) )
+        return r;
+
     rcu_read_lock(&msixtbl_rcu_lock);
 
-    if ( len != 4 )
-        goto out;
+    entry = msixtbl_find_entry(v, address);
+    offset = address & (PCI_MSIX_ENTRY_SIZE - 1);
 
-    entry = msixtbl_find_entry(v, address);
-    virt = msixtbl_addr_to_virt(entry, address);
-    if ( !virt )
-        goto out;
-
-    nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE;
-    offset = address & (PCI_MSIX_ENTRY_SIZE - 1);
-    if ( nr_entry >= MAX_MSIX_ACC_ENTRIES && 
-         offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET )
-        goto out;
-
-    val = readl(virt);
     if ( offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET )
     {
+        nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE;
+        if ( nr_entry >= MAX_MSIX_ACC_ENTRIES )
+            goto out;
         index = offset / sizeof(uint32_t);
         *pval = entry->gentries[nr_entry].msi_ad[index];
     }
     else 
     {
-        *pval = val;
+        virt = msixtbl_addr_to_virt(entry, address);
+        if ( !virt )
+            goto out;
+        *pval = readl(virt);
     }
     
     r = X86EMUL_OKAY;
@@ -253,14 +247,14 @@
     unsigned long offset;
     struct msixtbl_entry *entry;
     void *virt;
-    int nr_entry, index;
+    unsigned int nr_entry, index;
     int r = X86EMUL_UNHANDLEABLE;
 
+    if ( len != 4 || (address & 3) )
+        return r;
+
     rcu_read_lock(&msixtbl_rcu_lock);
 
-    if ( len != 4 )
-        goto out;
-
     entry = msixtbl_find_entry(v, address);
     nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE;
 
@@ -284,9 +278,22 @@
     if ( !virt )
         goto out;
 
+    /* Do not allow the mask bit to be changed. */
+#if 0 /* XXX
+       * As the mask bit is the only defined bit in the word, and as the
+       * host MSI-X code doesn't preserve the other bits anyway, doing
+       * this is pointless. So for now just discard the write (also
+       * saving us from having to determine the matching irq_desc).
+       */
+    spin_lock_irqsave(&desc->lock, flags);
+    orig = readl(virt);
+    val &= ~PCI_MSIX_VECTOR_BITMASK;
+    val |= orig & PCI_MSIX_VECTOR_BITMASK;
     writel(val, virt);
+    spin_unlock_irqrestore(&desc->lock, flags);
+#endif
+
     r = X86EMUL_OKAY;
-
 out:
     rcu_read_unlock(&msixtbl_rcu_lock);
     return r;
diff -r 96db1984e878 -r 871ed74bbefd xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h	Wed Mar 07 08:22:38 2012 +0000
+++ b/xen/include/asm-x86/msi.h	Wed Mar 07 08:26:25 2012 +0000
@@ -119,12 +119,6 @@
 
 extern const struct hw_interrupt_type pci_msi_type;
 
-#define PCI_MSIX_ENTRY_SIZE			16
-#define  PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET	0
-#define  PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET	4
-#define  PCI_MSIX_ENTRY_DATA_OFFSET		8
-#define  PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET	12
-
 #define msi_control_reg(base)		(base + PCI_MSI_FLAGS)
 #define msi_lower_address_reg(base)	(base + PCI_MSI_ADDRESS_LO)
 #define msi_upper_address_reg(base)	(base + PCI_MSI_ADDRESS_HI)
diff -r 96db1984e878 -r 871ed74bbefd xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Wed Mar 07 08:22:38 2012 +0000
+++ b/xen/include/xen/pci.h	Wed Mar 07 08:26:25 2012 +0000
@@ -12,6 +12,7 @@
 #include <xen/list.h>
 #include <xen/spinlock.h>
 #include <xen/irq.h>
+#include <xen/pci_regs.h>
 
 /*
  * The PCI interface treats multi-function devices as independent
@@ -30,8 +31,10 @@
 #define PCI_BDF(b,d,f)  ((((b) & 0xff) << 8) | PCI_DEVFN(d,f))
 #define PCI_BDF2(b,df)  ((((b) & 0xff) << 8) | ((df) & 0xff))
 
-#define MAX_MSIX_TABLE_ENTRIES  2048
-#define MAX_MSIX_TABLE_PAGES    8
+#define MAX_MSIX_TABLE_ENTRIES  (PCI_MSIX_FLAGS_QSIZE + 1)
+#define MAX_MSIX_TABLE_PAGES    PFN_UP(MAX_MSIX_TABLE_ENTRIES * \
+                                       PCI_MSIX_ENTRY_SIZE + \
+                                       (~PCI_MSIX_BIRMASK & (PAGE_SIZE - 1)))
 struct pci_dev_info {
     unsigned is_extfn;
     unsigned is_virtfn;
diff -r 96db1984e878 -r 871ed74bbefd xen/include/xen/pci_regs.h
--- a/xen/include/xen/pci_regs.h	Wed Mar 07 08:22:38 2012 +0000
+++ b/xen/include/xen/pci_regs.h	Wed Mar 07 08:26:25 2012 +0000
@@ -305,6 +305,12 @@
 #define PCI_MSIX_PBA		8
 #define  PCI_MSIX_BIRMASK	(7 << 0)
 
+#define PCI_MSIX_ENTRY_SIZE			16
+#define  PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET	0
+#define  PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET	4
+#define  PCI_MSIX_ENTRY_DATA_OFFSET		8
+#define  PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET	12
+
 #define PCI_MSIX_VECTOR_BITMASK	(1 << 0)
 
 /* CompactPCI Hotswap Register */

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWo-0007jZ-GV; Wed, 07 Mar 2012 23:44: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 1S5QWm-0007fV-W8
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:17 +0000
Received: from [85.158.143.35:58491] by server-2.bemta-4.messagelabs.com id
	D6/8C-17550-0D2F75F4; Wed, 07 Mar 2012 23:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1331163854!3123114!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28426 invoked from network); 7 Mar 2012 23:44: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;
	7 Mar 2012 23:44: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 1S5QWk-0006iN-EK
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWk-000353-Cm
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:14 +0000
Message-Id: <E1S5QWk-000353-Cm@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Fix error recovery path in
	__gnttab_map_grant_ref
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Haoyu Zhang <haoyu.zhang@huawei.com>
# Date 1331108993 0
# Node ID d4ae43e71dcfd6142b1178e993a3ee3f3f550a9a
# Parent  871ed74bbefd969459294ce4f5e9df99eeae2400
Fix error recovery path in __gnttab_map_grant_ref

In file grant_table.c function __gnttab_map_grant_ref, if
__get_paged_frame failed, the effect of _set_status  previously
called should be rollback, so the flag GTF_reading and _GTF_writing
will be recovered.

Signed-off-by: Haoyu Zhang <haoyu.zhang@huawei.com>
Signed-off-by: Liang Wang <hzwangliang.wang@huawei.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24701:3574f4d67843
xen-unstable date:        Mon Feb 06 13:23:41 2012 -0800
---


diff -r 871ed74bbefd -r d4ae43e71dcf xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Mar 07 08:26:25 2012 +0000
+++ b/xen/common/grant_table.c	Wed Mar 07 08:29:53 2012 +0000
@@ -567,7 +567,7 @@
             gfn = sha1 ? sha1->frame : sha2->full_page.frame;
             rc = __get_paged_frame(gfn, &frame, !!(op->flags & GNTMAP_readonly), rd);
             if ( rc != GNTST_okay )
-                goto unlock_out;
+                goto unlock_out_clear;
             act->gfn = gfn;
             act->domid = ld->domain_id;
             act->frame = frame;
@@ -722,7 +722,8 @@
     if ( op->flags & GNTMAP_host_map )
         act->pin -= (op->flags & GNTMAP_readonly) ?
             GNTPIN_hstr_inc : GNTPIN_hstw_inc;
-
+ 
+ unlock_out_clear:
     if ( !(op->flags & GNTMAP_readonly) &&
          !(act->pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) )
         gnttab_clear_flag(_GTF_writing, status);

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWo-0007jZ-GV; Wed, 07 Mar 2012 23:44: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 1S5QWm-0007fV-W8
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:17 +0000
Received: from [85.158.143.35:58491] by server-2.bemta-4.messagelabs.com id
	D6/8C-17550-0D2F75F4; Wed, 07 Mar 2012 23:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1331163854!3123114!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28426 invoked from network); 7 Mar 2012 23:44: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;
	7 Mar 2012 23:44: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 1S5QWk-0006iN-EK
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWk-000353-Cm
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:14 +0000
Message-Id: <E1S5QWk-000353-Cm@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:13 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Fix error recovery path in
	__gnttab_map_grant_ref
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Haoyu Zhang <haoyu.zhang@huawei.com>
# Date 1331108993 0
# Node ID d4ae43e71dcfd6142b1178e993a3ee3f3f550a9a
# Parent  871ed74bbefd969459294ce4f5e9df99eeae2400
Fix error recovery path in __gnttab_map_grant_ref

In file grant_table.c function __gnttab_map_grant_ref, if
__get_paged_frame failed, the effect of _set_status  previously
called should be rollback, so the flag GTF_reading and _GTF_writing
will be recovered.

Signed-off-by: Haoyu Zhang <haoyu.zhang@huawei.com>
Signed-off-by: Liang Wang <hzwangliang.wang@huawei.com>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24701:3574f4d67843
xen-unstable date:        Mon Feb 06 13:23:41 2012 -0800
---


diff -r 871ed74bbefd -r d4ae43e71dcf xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Mar 07 08:26:25 2012 +0000
+++ b/xen/common/grant_table.c	Wed Mar 07 08:29:53 2012 +0000
@@ -567,7 +567,7 @@
             gfn = sha1 ? sha1->frame : sha2->full_page.frame;
             rc = __get_paged_frame(gfn, &frame, !!(op->flags & GNTMAP_readonly), rd);
             if ( rc != GNTST_okay )
-                goto unlock_out;
+                goto unlock_out_clear;
             act->gfn = gfn;
             act->domid = ld->domain_id;
             act->frame = frame;
@@ -722,7 +722,8 @@
     if ( op->flags & GNTMAP_host_map )
         act->pin -= (op->flags & GNTMAP_readonly) ?
             GNTPIN_hstr_inc : GNTPIN_hstw_inc;
-
+ 
+ unlock_out_clear:
     if ( !(op->flags & GNTMAP_readonly) &&
          !(act->pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask)) )
         gnttab_clear_flag(_GTF_writing, status);

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWq-0007mk-Cu; Wed, 07 Mar 2012 23:44:20 +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 1S5QWo-0007jT-V5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:19 +0000
Received: from [193.109.254.147:21816] by server-5.bemta-14.messagelabs.com id
	7D/9C-01689-2D2F75F4; Wed, 07 Mar 2012 23:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1331163823!59973399!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4071 invoked from network); 7 Mar 2012 23:43:44 -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;
	7 Mar 2012 23:43:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWm-0006iZ-FU
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWm-00036T-EE
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:16 +0000
Message-Id: <E1S5QWm-00036T-EE@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44: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/xsave: provide guests with
	finit-like environment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331109808 0
# Node ID b0bf2fc4eff937bf82f0fc16e9e0079990e0c27e
# Parent  e03aa3794cff3c5f6a5d87d9a282daf7baa1ddc7
x86/xsave: provide guests with finit-like environment

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

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

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

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Charles Arnold <carnold@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24157:7b5e1cb94bfa
xen-unstable date:        Fri Nov 18 09:22:45 2011 +0100
---


diff -r e03aa3794cff -r b0bf2fc4eff9 xen/arch/x86/i387.c
--- a/xen/arch/x86/i387.c	Wed Mar 07 08:39:21 2012 +0000
+++ b/xen/arch/x86/i387.c	Wed Mar 07 08:43:28 2012 +0000
@@ -287,7 +287,7 @@
 
 int xsave_alloc_save_area(struct vcpu *v)
 {
-    void *save_area;
+    struct xsave_struct *save_area;
 
     if ( !cpu_has_xsave || is_idle_vcpu(v) )
         return 0;
@@ -300,8 +300,9 @@
         return -ENOMEM;
 
     memset(save_area, 0, xsave_cntxt_size);
-    ((u32 *)save_area)[6] = 0x1f80;  /* MXCSR */
-    *(uint64_t *)(save_area + 512) = XSTATE_FP_SSE;  /* XSETBV */
+    save_area->fpu_sse.fcw = FCW_DEFAULT;
+    save_area->fpu_sse.mxcsr = MXCSR_DEFAULT;
+    save_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
 
     v->arch.xsave_area = save_area;
     v->arch.xcr0 = XSTATE_FP_SSE;
diff -r e03aa3794cff -r b0bf2fc4eff9 xen/include/asm-x86/i387.h
--- a/xen/include/asm-x86/i387.h	Wed Mar 07 08:39:21 2012 +0000
+++ b/xen/include/asm-x86/i387.h	Wed Mar 07 08:43:28 2012 +0000
@@ -35,9 +35,34 @@
 #define XSTATE_YMM_SIZE    256
 #define XSAVEOPT        (1 << 0)
 
+#define FCW_DEFAULT               0x037f
+#define MXCSR_DEFAULT             0x1f80
+
 struct xsave_struct
 {
-    struct { char x[512]; } fpu_sse;         /* FPU/MMX, SSE */
+    union {                                  /* FPU/MMX, SSE */
+        char x[512];
+        struct {
+            uint16_t fcw;
+            uint16_t fsw;
+            uint8_t ftw;
+            uint8_t rsvd1;
+            uint16_t fop;
+            union {
+#ifdef __x86_64__
+                uint64_t addr;
+#endif
+                struct {
+                    uint32_t offs;
+                    uint16_t sel;
+                    uint16_t rsvd;
+                };
+            } fip, fdp;
+            uint32_t mxcsr;
+            uint32_t mxcsr_mask;
+            /* data registers follow here */
+        };
+    } fpu_sse;
 
     struct {
         u64 xstate_bv;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWq-0007mk-Cu; Wed, 07 Mar 2012 23:44:20 +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 1S5QWo-0007jT-V5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:19 +0000
Received: from [193.109.254.147:21816] by server-5.bemta-14.messagelabs.com id
	7D/9C-01689-2D2F75F4; Wed, 07 Mar 2012 23:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1331163823!59973399!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4071 invoked from network); 7 Mar 2012 23:43:44 -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;
	7 Mar 2012 23:43:44 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWm-0006iZ-FU
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWm-00036T-EE
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:16 +0000
Message-Id: <E1S5QWm-00036T-EE@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44: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/xsave: provide guests with
	finit-like environment
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331109808 0
# Node ID b0bf2fc4eff937bf82f0fc16e9e0079990e0c27e
# Parent  e03aa3794cff3c5f6a5d87d9a282daf7baa1ddc7
x86/xsave: provide guests with finit-like environment

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

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

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

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Charles Arnold <carnold@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24157:7b5e1cb94bfa
xen-unstable date:        Fri Nov 18 09:22:45 2011 +0100
---


diff -r e03aa3794cff -r b0bf2fc4eff9 xen/arch/x86/i387.c
--- a/xen/arch/x86/i387.c	Wed Mar 07 08:39:21 2012 +0000
+++ b/xen/arch/x86/i387.c	Wed Mar 07 08:43:28 2012 +0000
@@ -287,7 +287,7 @@
 
 int xsave_alloc_save_area(struct vcpu *v)
 {
-    void *save_area;
+    struct xsave_struct *save_area;
 
     if ( !cpu_has_xsave || is_idle_vcpu(v) )
         return 0;
@@ -300,8 +300,9 @@
         return -ENOMEM;
 
     memset(save_area, 0, xsave_cntxt_size);
-    ((u32 *)save_area)[6] = 0x1f80;  /* MXCSR */
-    *(uint64_t *)(save_area + 512) = XSTATE_FP_SSE;  /* XSETBV */
+    save_area->fpu_sse.fcw = FCW_DEFAULT;
+    save_area->fpu_sse.mxcsr = MXCSR_DEFAULT;
+    save_area->xsave_hdr.xstate_bv = XSTATE_FP_SSE;
 
     v->arch.xsave_area = save_area;
     v->arch.xcr0 = XSTATE_FP_SSE;
diff -r e03aa3794cff -r b0bf2fc4eff9 xen/include/asm-x86/i387.h
--- a/xen/include/asm-x86/i387.h	Wed Mar 07 08:39:21 2012 +0000
+++ b/xen/include/asm-x86/i387.h	Wed Mar 07 08:43:28 2012 +0000
@@ -35,9 +35,34 @@
 #define XSTATE_YMM_SIZE    256
 #define XSAVEOPT        (1 << 0)
 
+#define FCW_DEFAULT               0x037f
+#define MXCSR_DEFAULT             0x1f80
+
 struct xsave_struct
 {
-    struct { char x[512]; } fpu_sse;         /* FPU/MMX, SSE */
+    union {                                  /* FPU/MMX, SSE */
+        char x[512];
+        struct {
+            uint16_t fcw;
+            uint16_t fsw;
+            uint8_t ftw;
+            uint8_t rsvd1;
+            uint16_t fop;
+            union {
+#ifdef __x86_64__
+                uint64_t addr;
+#endif
+                struct {
+                    uint32_t offs;
+                    uint16_t sel;
+                    uint16_t rsvd;
+                };
+            } fip, fdp;
+            uint32_t mxcsr;
+            uint32_t mxcsr_mask;
+            /* data registers follow here */
+        };
+    } fpu_sse;
 
     struct {
         u64 xstate_bv;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWq-0007mb-Ac; Wed, 07 Mar 2012 23:44: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 1S5QWo-0007fV-LV
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:18 +0000
Received: from [85.158.143.99:39024] by server-2.bemta-4.messagelabs.com id
	AB/8C-17550-2D2F75F4; Wed, 07 Mar 2012 23:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331163856!12864534!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5337 invoked from network); 7 Mar 2012 23:44:17 -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;
	7 Mar 2012 23:44: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 1S5QWl-0006iT-MX
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWl-00035m-Ed
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:15 +0000
Message-Id: <E1S5QWl-00035m-Ed@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:14 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] passthrough: release assigned PCI
	devices earlier during domain shutdown
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331109358 0
# Node ID 8f927378135a31fe363edd65df236a58cf2757ea
# Parent  b9e672d78cecfff31ef7d9478ca229997dddbec0
passthrough: release assigned PCI devices earlier during domain shutdown

At least with xend, where there's not even a tool stack side attempt
to de-assign devices during domain shutdown, this allows immediate re-
starts of a domain to work reliably. (There's no apparent reason why
c/s 18010:c1577f094ae4 chose to put this in the asynchronous part of
domain destruction).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24888:71159fb049f2
xen-unstable date:        Fri Feb 24 11:46:32 2012 +0100
---


diff -r b9e672d78cec -r 8f927378135a xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c	Wed Mar 07 08:32:29 2012 +0000
+++ b/xen/arch/ia64/xen/domain.c	Wed Mar 07 08:35:58 2012 +0000
@@ -671,10 +671,8 @@
 		free_xenheap_pages(d->shared_info,
 				   get_order_from_shift(XSI_SHIFT));
 
-	if ( iommu_enabled && need_iommu(d) )	{
-		pci_release_devices(d);
+	if ( iommu_enabled && need_iommu(d) )
 		iommu_domain_destroy(d);
-	}
 
 	tlb_track_destroy(d);
 
@@ -1719,6 +1717,8 @@
 
 	switch (d->arch.relres) {
 	case RELRES_not_started:
+		pci_release_devices(d);
+
 		/* Relinquish guest resources for VT-i domain. */
 		if (is_hvm_domain(d))
 			vmx_relinquish_guest_resources(d);
diff -r b9e672d78cec -r 8f927378135a xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Mar 07 08:32:29 2012 +0000
+++ b/xen/arch/x86/domain.c	Wed Mar 07 08:35:58 2012 +0000
@@ -605,7 +605,6 @@
         hvm_domain_destroy(d);
 
     vmce_destroy_msr(d);
-    pci_release_devices(d);
     free_domain_pirqs(d);
     if ( !is_idle_domain(d) )
         iommu_domain_destroy(d);
@@ -1954,6 +1953,8 @@
     switch ( d->arch.relmem )
     {
     case RELMEM_not_started:
+        pci_release_devices(d);
+
         /* Tear down paging-assistance stuff. */
         paging_teardown(d);
 
diff -r b9e672d78cec -r 8f927378135a xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Mar 07 08:32:29 2012 +0000
+++ b/xen/arch/x86/domctl.c	Wed Mar 07 08:35:58 2012 +0000
@@ -835,6 +835,9 @@
             break;
         }
 
+        if ( d->is_dying )
+            goto assign_device_out;
+
         ret = xsm_assign_device(d, domctl->u.assign_device.machine_bdf);
         if ( ret )
             goto assign_device_out;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWq-0007mb-Ac; Wed, 07 Mar 2012 23:44: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 1S5QWo-0007fV-LV
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:18 +0000
Received: from [85.158.143.99:39024] by server-2.bemta-4.messagelabs.com id
	AB/8C-17550-2D2F75F4; Wed, 07 Mar 2012 23:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331163856!12864534!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5337 invoked from network); 7 Mar 2012 23:44:17 -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;
	7 Mar 2012 23:44: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 1S5QWl-0006iT-MX
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWl-00035m-Ed
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:15 +0000
Message-Id: <E1S5QWl-00035m-Ed@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:14 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] passthrough: release assigned PCI
	devices earlier during domain shutdown
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331109358 0
# Node ID 8f927378135a31fe363edd65df236a58cf2757ea
# Parent  b9e672d78cecfff31ef7d9478ca229997dddbec0
passthrough: release assigned PCI devices earlier during domain shutdown

At least with xend, where there's not even a tool stack side attempt
to de-assign devices during domain shutdown, this allows immediate re-
starts of a domain to work reliably. (There's no apparent reason why
c/s 18010:c1577f094ae4 chose to put this in the asynchronous part of
domain destruction).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24888:71159fb049f2
xen-unstable date:        Fri Feb 24 11:46:32 2012 +0100
---


diff -r b9e672d78cec -r 8f927378135a xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c	Wed Mar 07 08:32:29 2012 +0000
+++ b/xen/arch/ia64/xen/domain.c	Wed Mar 07 08:35:58 2012 +0000
@@ -671,10 +671,8 @@
 		free_xenheap_pages(d->shared_info,
 				   get_order_from_shift(XSI_SHIFT));
 
-	if ( iommu_enabled && need_iommu(d) )	{
-		pci_release_devices(d);
+	if ( iommu_enabled && need_iommu(d) )
 		iommu_domain_destroy(d);
-	}
 
 	tlb_track_destroy(d);
 
@@ -1719,6 +1717,8 @@
 
 	switch (d->arch.relres) {
 	case RELRES_not_started:
+		pci_release_devices(d);
+
 		/* Relinquish guest resources for VT-i domain. */
 		if (is_hvm_domain(d))
 			vmx_relinquish_guest_resources(d);
diff -r b9e672d78cec -r 8f927378135a xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Mar 07 08:32:29 2012 +0000
+++ b/xen/arch/x86/domain.c	Wed Mar 07 08:35:58 2012 +0000
@@ -605,7 +605,6 @@
         hvm_domain_destroy(d);
 
     vmce_destroy_msr(d);
-    pci_release_devices(d);
     free_domain_pirqs(d);
     if ( !is_idle_domain(d) )
         iommu_domain_destroy(d);
@@ -1954,6 +1953,8 @@
     switch ( d->arch.relmem )
     {
     case RELMEM_not_started:
+        pci_release_devices(d);
+
         /* Tear down paging-assistance stuff. */
         paging_teardown(d);
 
diff -r b9e672d78cec -r 8f927378135a xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Mar 07 08:32:29 2012 +0000
+++ b/xen/arch/x86/domctl.c	Wed Mar 07 08:35:58 2012 +0000
@@ -835,6 +835,9 @@
             break;
         }
 
+        if ( d->is_dying )
+            goto assign_device_out;
+
         ret = xsm_assign_device(d, domctl->u.assign_device.machine_bdf);
         if ( ret )
             goto assign_device_out;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWq-0007mx-FL; Wed, 07 Mar 2012 23:44: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 1S5QWp-0007l0-HJ
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:19 +0000
Received: from [85.158.138.51:64855] by server-12.bemta-3.messagelabs.com id
	80/11-04338-2D2F75F4; Wed, 07 Mar 2012 23:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1331163856!16613688!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4027 invoked from network); 7 Mar 2012 23:44:17 -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;
	7 Mar 2012 23:44: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 1S5QWl-0006iW-Vm
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWl-000367-UI
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:15 +0000
Message-Id: <E1S5QWl-000367-UI@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:15 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Grant table: fix a bug when grant
	copying a previous grant mapped 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Liu <wei.liu2@citrix.com>
# Date 1331109561 0
# Node ID e03aa3794cff3c5f6a5d87d9a282daf7baa1ddc7
# Parent  8f927378135a31fe363edd65df236a58cf2757ea
Grant table: fix a bug when grant copying a previous grant mapped page.

In grant table version 2, when we create a non-transitive mapping from
DomU to Dom0, we need to set active entry's trans_domain and
trans_ref.  Otherwise when we grant copy from this previous mapped
ref, preemption count will get messed up.

See changeset 22994:299ed79acecf for more information.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24950:9ef985f5e6a5
xen-unstable date:        Thu Mar 01 16:37:18 2012 +0000
---


diff -r 8f927378135a -r e03aa3794cff xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Mar 07 08:35:58 2012 +0000
+++ b/xen/common/grant_table.c	Wed Mar 07 08:39:21 2012 +0000
@@ -574,6 +574,8 @@
             act->start = 0;
             act->length = PAGE_SIZE;
             act->is_sub_page = 0;
+            act->trans_dom = rd->domain_id;
+            act->trans_gref = op->ref;
         }
     }
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWq-0007mx-FL; Wed, 07 Mar 2012 23:44: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 1S5QWp-0007l0-HJ
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:19 +0000
Received: from [85.158.138.51:64855] by server-12.bemta-3.messagelabs.com id
	80/11-04338-2D2F75F4; Wed, 07 Mar 2012 23:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-174.messagelabs.com!1331163856!16613688!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4027 invoked from network); 7 Mar 2012 23:44:17 -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;
	7 Mar 2012 23:44: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 1S5QWl-0006iW-Vm
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWl-000367-UI
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:15 +0000
Message-Id: <E1S5QWl-000367-UI@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:15 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Grant table: fix a bug when grant
	copying a previous grant mapped 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Liu <wei.liu2@citrix.com>
# Date 1331109561 0
# Node ID e03aa3794cff3c5f6a5d87d9a282daf7baa1ddc7
# Parent  8f927378135a31fe363edd65df236a58cf2757ea
Grant table: fix a bug when grant copying a previous grant mapped page.

In grant table version 2, when we create a non-transitive mapping from
DomU to Dom0, we need to set active entry's trans_domain and
trans_ref.  Otherwise when we grant copy from this previous mapped
ref, preemption count will get messed up.

See changeset 22994:299ed79acecf for more information.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24950:9ef985f5e6a5
xen-unstable date:        Thu Mar 01 16:37:18 2012 +0000
---


diff -r 8f927378135a -r e03aa3794cff xen/common/grant_table.c
--- a/xen/common/grant_table.c	Wed Mar 07 08:35:58 2012 +0000
+++ b/xen/common/grant_table.c	Wed Mar 07 08:39:21 2012 +0000
@@ -574,6 +574,8 @@
             act->start = 0;
             act->length = PAGE_SIZE;
             act->is_sub_page = 0;
+            act->trans_dom = rd->domain_id;
+            act->trans_gref = op->ref;
         }
     }
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWq-0007n9-Hv; Wed, 07 Mar 2012 23:44: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 1S5QWp-0007fv-R4
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:19 +0000
Received: from [85.158.138.51:26224] by server-10.bemta-3.messagelabs.com id
	25/40-13338-3D2F75F4; Wed, 07 Mar 2012 23:44:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1331163857!16641847!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8749 invoked from network); 7 Mar 2012 23:44:18 -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;
	7 Mar 2012 23:44: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 1S5QWm-0006ic-Vq
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWm-00036p-UN
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:16 +0000
Message-Id: <E1S5QWm-00036p-UN@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:16 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/mm/shadow: adjust
	early-unshadow heuristic for PAE guests.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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.Deegan@citrix.com>
# Date 1331112178 0
# Node ID b5051d40e1cca83dac690dae85f637afd8dc745e
# Parent  b0bf2fc4eff937bf82f0fc16e9e0079990e0c27e
x86/mm/shadow: adjust early-unshadow heuristic for PAE guests.

PAE guests have 8-byte PTEs but tend to clear memory with 4-byte
writes.
This means that when zeroing a former pagetable every second 4-byte
write is unaligned and so the consecutive-zeroes --> unshadow
heuristic never kicks in.  Adjust the heuristic not to reset when
a write is >= 4 bytes and writing zero but not PTE-aligned.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset:   23554:c91255b2f0a0
xen-unstable date:        Mon Jun 20 13:16:14 2011 +0100
---


diff -r b0bf2fc4eff9 -r b5051d40e1cc xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Wed Mar 07 08:43:28 2012 +0000
+++ b/xen/arch/x86/mm/shadow/multi.c	Wed Mar 07 09:22:58 2012 +0000
@@ -4943,11 +4943,14 @@
     ASSERT(mfn_valid(sh_ctxt->mfn1));
 
     /* If we are writing lots of PTE-aligned zeros, might want to unshadow */
-    if ( likely(bytes >= 4)
-         && (*(u32 *)addr == 0)
-         && ((unsigned long) addr & ((sizeof (guest_intpte_t)) - 1)) == 0 )
-        check_for_early_unshadow(v, sh_ctxt->mfn1);
-    else
+    if ( likely(bytes >= 4) && (*(u32 *)addr == 0) )
+    {
+        if ( ((unsigned long) addr & ((sizeof (guest_intpte_t)) - 1)) == 0 )
+            check_for_early_unshadow(v, sh_ctxt->mfn1);
+        /* Don't reset the heuristic if we're writing zeros at non-aligned 
+         * addresses, otherwise it doesn't catch REP MOVSD on PAE guests */
+    }
+    else 
         reset_early_unshadow(v);
 
     /* We can avoid re-verifying the page contents after the write if:

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWq-0007n9-Hv; Wed, 07 Mar 2012 23:44: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 1S5QWp-0007fv-R4
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:19 +0000
Received: from [85.158.138.51:26224] by server-10.bemta-3.messagelabs.com id
	25/40-13338-3D2F75F4; Wed, 07 Mar 2012 23:44:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1331163857!16641847!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8749 invoked from network); 7 Mar 2012 23:44:18 -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;
	7 Mar 2012 23:44: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 1S5QWm-0006ic-Vq
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWm-00036p-UN
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:16 +0000
Message-Id: <E1S5QWm-00036p-UN@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:16 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/mm/shadow: adjust
	early-unshadow heuristic for PAE guests.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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.Deegan@citrix.com>
# Date 1331112178 0
# Node ID b5051d40e1cca83dac690dae85f637afd8dc745e
# Parent  b0bf2fc4eff937bf82f0fc16e9e0079990e0c27e
x86/mm/shadow: adjust early-unshadow heuristic for PAE guests.

PAE guests have 8-byte PTEs but tend to clear memory with 4-byte
writes.
This means that when zeroing a former pagetable every second 4-byte
write is unaligned and so the consecutive-zeroes --> unshadow
heuristic never kicks in.  Adjust the heuristic not to reset when
a write is >= 4 bytes and writing zero but not PTE-aligned.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
xen-unstable changeset:   23554:c91255b2f0a0
xen-unstable date:        Mon Jun 20 13:16:14 2011 +0100
---


diff -r b0bf2fc4eff9 -r b5051d40e1cc xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Wed Mar 07 08:43:28 2012 +0000
+++ b/xen/arch/x86/mm/shadow/multi.c	Wed Mar 07 09:22:58 2012 +0000
@@ -4943,11 +4943,14 @@
     ASSERT(mfn_valid(sh_ctxt->mfn1));
 
     /* If we are writing lots of PTE-aligned zeros, might want to unshadow */
-    if ( likely(bytes >= 4)
-         && (*(u32 *)addr == 0)
-         && ((unsigned long) addr & ((sizeof (guest_intpte_t)) - 1)) == 0 )
-        check_for_early_unshadow(v, sh_ctxt->mfn1);
-    else
+    if ( likely(bytes >= 4) && (*(u32 *)addr == 0) )
+    {
+        if ( ((unsigned long) addr & ((sizeof (guest_intpte_t)) - 1)) == 0 )
+            check_for_early_unshadow(v, sh_ctxt->mfn1);
+        /* Don't reset the heuristic if we're writing zeros at non-aligned 
+         * addresses, otherwise it doesn't catch REP MOVSD on PAE guests */
+    }
+    else 
         reset_early_unshadow(v);
 
     /* We can avoid re-verifying the page contents after the write if:

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWp-0007l8-3v; Wed, 07 Mar 2012 23:44: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 1S5QWn-0007fV-T5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:18 +0000
Received: from [85.158.143.99:39009] by server-2.bemta-4.messagelabs.com id
	89/8C-17550-1D2F75F4; Wed, 07 Mar 2012 23:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1331163855!17253406!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23750 invoked from network); 7 Mar 2012 23:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 23:44: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 1S5QWl-0006iQ-1L
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWk-00035P-Sx
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:14 +0000
Message-Id: <E1S5QWk-00035P-Sx@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44: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/mm: Don't check for invalid
	bits in non-present PTEs.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331109149 0
# Node ID b9e672d78cecfff31ef7d9478ca229997dddbec0
# Parent  d4ae43e71dcfd6142b1178e993a3ee3f3f550a9a
x86/mm: Don't check for invalid bits in non-present PTEs.

If _PAGE_PRESENT is clean in a pagetable entry, any pattern of bits
is valid in the rest of the entry.  OSes that special-case
PFEC_invalid_bits (since it should never happen) will be confused
by our setting it in this way.

Signed-off-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24883:adcd6ab160fa
xen-unstable date:        Thu Feb 23 10:29:27 2012 +0000
---


diff -r d4ae43e71dcf -r b9e672d78cec xen/arch/x86/mm/guest_walk.c
--- a/xen/arch/x86/mm/guest_walk.c	Wed Mar 07 08:29:53 2012 +0000
+++ b/xen/arch/x86/mm/guest_walk.c	Wed Mar 07 08:32:29 2012 +0000
@@ -162,8 +162,11 @@
     l4p = (guest_l4e_t *) top_map;
     gw->l4e = l4p[guest_l4_table_offset(va)];
     gflags = guest_l4e_get_flags(gw->l4e) ^ iflags;
+    if ( !(gflags & _PAGE_PRESENT) ) {
+        rc |= _PAGE_PRESENT;
+        goto out;
+    }
     rc |= ((gflags & mflags) ^ mflags);
-    if ( rc & _PAGE_PRESENT ) goto out;
 
     /* Map the l3 table */
     l3p = map_domain_gfn(p2m, 
@@ -176,9 +179,11 @@
     /* Get the l3e and check its flags*/
     gw->l3e = l3p[guest_l3_table_offset(va)];
     gflags = guest_l3e_get_flags(gw->l3e) ^ iflags;
+    if ( !(gflags & _PAGE_PRESENT) ) {
+        rc |= _PAGE_PRESENT;
+        goto out;
+    }
     rc |= ((gflags & mflags) ^ mflags);
-    if ( rc & _PAGE_PRESENT )
-        goto out;
 
 #else /* PAE only... */
 
@@ -213,9 +218,11 @@
 #endif /* All levels... */
 
     gflags = guest_l2e_get_flags(gw->l2e) ^ iflags;
+    if ( !(gflags & _PAGE_PRESENT) ) {
+        rc |= _PAGE_PRESENT;
+        goto out;
+    }
     rc |= ((gflags & mflags) ^ mflags);
-    if ( rc & _PAGE_PRESENT )
-        goto out;
 
     pse = (guest_supports_superpages(v) && 
            (guest_l2e_get_flags(gw->l2e) & _PAGE_PSE)); 
@@ -277,6 +284,10 @@
             goto out;
         gw->l1e = l1p[guest_l1_table_offset(va)];
         gflags = guest_l1e_get_flags(gw->l1e) ^ iflags;
+        if ( !(gflags & _PAGE_PRESENT) ) {
+            rc |= _PAGE_PRESENT;
+            goto out;
+        }
         rc |= ((gflags & mflags) ^ mflags);
     }
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23: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 1S5QWp-0007l8-3v; Wed, 07 Mar 2012 23:44: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 1S5QWn-0007fV-T5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:18 +0000
Received: from [85.158.143.99:39009] by server-2.bemta-4.messagelabs.com id
	89/8C-17550-1D2F75F4; Wed, 07 Mar 2012 23:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1331163855!17253406!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23750 invoked from network); 7 Mar 2012 23:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 23:44: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 1S5QWl-0006iQ-1L
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWk-00035P-Sx
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:14 +0000
Message-Id: <E1S5QWk-00035P-Sx@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44: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/mm: Don't check for invalid
	bits in non-present PTEs.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331109149 0
# Node ID b9e672d78cecfff31ef7d9478ca229997dddbec0
# Parent  d4ae43e71dcfd6142b1178e993a3ee3f3f550a9a
x86/mm: Don't check for invalid bits in non-present PTEs.

If _PAGE_PRESENT is clean in a pagetable entry, any pattern of bits
is valid in the rest of the entry.  OSes that special-case
PFEC_invalid_bits (since it should never happen) will be confused
by our setting it in this way.

Signed-off-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24883:adcd6ab160fa
xen-unstable date:        Thu Feb 23 10:29:27 2012 +0000
---


diff -r d4ae43e71dcf -r b9e672d78cec xen/arch/x86/mm/guest_walk.c
--- a/xen/arch/x86/mm/guest_walk.c	Wed Mar 07 08:29:53 2012 +0000
+++ b/xen/arch/x86/mm/guest_walk.c	Wed Mar 07 08:32:29 2012 +0000
@@ -162,8 +162,11 @@
     l4p = (guest_l4e_t *) top_map;
     gw->l4e = l4p[guest_l4_table_offset(va)];
     gflags = guest_l4e_get_flags(gw->l4e) ^ iflags;
+    if ( !(gflags & _PAGE_PRESENT) ) {
+        rc |= _PAGE_PRESENT;
+        goto out;
+    }
     rc |= ((gflags & mflags) ^ mflags);
-    if ( rc & _PAGE_PRESENT ) goto out;
 
     /* Map the l3 table */
     l3p = map_domain_gfn(p2m, 
@@ -176,9 +179,11 @@
     /* Get the l3e and check its flags*/
     gw->l3e = l3p[guest_l3_table_offset(va)];
     gflags = guest_l3e_get_flags(gw->l3e) ^ iflags;
+    if ( !(gflags & _PAGE_PRESENT) ) {
+        rc |= _PAGE_PRESENT;
+        goto out;
+    }
     rc |= ((gflags & mflags) ^ mflags);
-    if ( rc & _PAGE_PRESENT )
-        goto out;
 
 #else /* PAE only... */
 
@@ -213,9 +218,11 @@
 #endif /* All levels... */
 
     gflags = guest_l2e_get_flags(gw->l2e) ^ iflags;
+    if ( !(gflags & _PAGE_PRESENT) ) {
+        rc |= _PAGE_PRESENT;
+        goto out;
+    }
     rc |= ((gflags & mflags) ^ mflags);
-    if ( rc & _PAGE_PRESENT )
-        goto out;
 
     pse = (guest_supports_superpages(v) && 
            (guest_l2e_get_flags(gw->l2e) & _PAGE_PSE)); 
@@ -277,6 +284,10 @@
             goto out;
         gw->l1e = l1p[guest_l1_table_offset(va)];
         gflags = guest_l1e_get_flags(gw->l1e) ^ iflags;
+        if ( !(gflags & _PAGE_PRESENT) ) {
+            rc |= _PAGE_PRESENT;
+            goto out;
+        }
         rc |= ((gflags & mflags) ^ mflags);
     }
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWr-0007ow-Kx; Wed, 07 Mar 2012 23:44: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 1S5QWq-0007jT-9o
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:20 +0000
Received: from [193.109.254.147:21847] by server-5.bemta-14.messagelabs.com id
	E0/AC-01689-3D2F75F4; Wed, 07 Mar 2012 23:44:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1331163825!59973400!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4088 invoked from network); 7 Mar 2012 23:43:46 -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;
	7 Mar 2012 23:43:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWo-0006ii-1L
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWn-00037X-Vr
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:17 +0000
Message-Id: <E1S5QWn-00037X-Vr@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:17 +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 core-pair topology
	detection 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Huang <wei.huang2@amd.com>
# Date 1331112260 0
# Node ID f141db2fe4c1600cd40e1737560f5841150a30b2
# Parent  a168569a765915e0bb592b348359def4f6784ca6
x86: AMD core-pair topology detection code

This patch is to support core-pair topology introduced by AMD CPUs,
which introduces a new concept of [core, compute unit]. There is a new
feature bit for topology extension in CPUID:0x80000001. Also a new
CPUID 0x8000001E is introduced for CPU topology enumeration. This
patch collects the sibling information from the new CPUID and will be
stored in the sibling map in Xen hypervisor.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
xen-unstable changeset:   23611:c2c12b2dafb5
xen-unstable date:        Tue Jun 28 09:13:53 2011 +0100
---


diff -r a168569a7659 -r f141db2fe4c1 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Wed Mar 07 09:23:41 2012 +0000
+++ b/xen/arch/x86/cpu/amd.c	Wed Mar 07 09:24:20 2012 +0000
@@ -344,6 +344,49 @@
 	wrmsrl(MSR_K8_SYSCFG, syscfg);
 }
 
+static void __devinit amd_get_topology(struct cpuinfo_x86 *c)
+{
+#ifdef CONFIG_X86_HT
+        int cpu;
+        unsigned bits;
+
+        if (c->x86_max_cores <= 1)
+                return;
+        /*
+         * On a AMD multi core setup the lower bits of the APIC id
+         * distingush the cores.
+         */
+        cpu = smp_processor_id();
+        bits = (cpuid_ecx(0x80000008) >> 12) & 0xf;
+
+        if (bits == 0) {
+                while ((1 << bits) < c->x86_max_cores)
+                        bits++;
+        }
+
+        /* Low order bits define the core id */
+        c->cpu_core_id = c->phys_proc_id & ((1<<bits)-1);
+        /* Convert local APIC ID into the socket ID */
+        c->phys_proc_id >>= bits;
+        /* Collect compute unit ID if available */
+        if (cpu_has(c, X86_FEATURE_TOPOEXT)) {
+                u32 eax, ebx, ecx, edx;
+
+                cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
+                c->compute_unit_id = ebx & 0xFF;
+                c->x86_num_siblings = ((ebx >> 8) & 0x3) + 1;
+        }
+        
+        if (opt_cpu_info)
+                printk("CPU %d(%d) -> Processor %d, %s %d\n",
+                       cpu, c->x86_max_cores, c->phys_proc_id,
+                       cpu_has(c, X86_FEATURE_TOPOEXT) ? "Compute Unit" : 
+                                                         "Core",
+                       cpu_has(c, X86_FEATURE_TOPOEXT) ? c->compute_unit_id :
+                                                         c->cpu_core_id);
+#endif
+}
+
 static void __devinit init_amd(struct cpuinfo_x86 *c)
 {
 	u32 l, h;
@@ -566,26 +609,7 @@
 		}
 	}
 
-#ifdef CONFIG_X86_HT
-	/*
-	 * On a AMD multi core setup the lower bits of the APIC id
-	 * distingush the cores.
-	 */
-	if (c->x86_max_cores > 1) {
-		int cpu = smp_processor_id();
-		unsigned bits = (cpuid_ecx(0x80000008) >> 12) & 0xf;
-
-		if (bits == 0) {
-			while ((1 << bits) < c->x86_max_cores)
-				bits++;
-		}
-		c->cpu_core_id = c->phys_proc_id & ((1<<bits)-1);
-		c->phys_proc_id >>= bits;
-		if (opt_cpu_info)
-			printk("CPU %d(%d) -> Core %d\n",
-			       cpu, c->x86_max_cores, c->cpu_core_id);
-	}
-#endif
+        amd_get_topology(c);
 
 	/* Pointless to use MWAIT on Family10 as it does not deep sleep. */
 	if (c->x86 >= 0x10 && !force_mwait)
diff -r a168569a7659 -r f141db2fe4c1 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Wed Mar 07 09:23:41 2012 +0000
+++ b/xen/arch/x86/cpu/common.c	Wed Mar 07 09:24:20 2012 +0000
@@ -364,6 +364,7 @@
 	c->x86_clflush_size = 0;
 	c->phys_proc_id = BAD_APICID;
 	c->cpu_core_id = BAD_APICID;
+	c->compute_unit_id = BAD_APICID;
 	memset(&c->x86_capability, 0, sizeof c->x86_capability);
 
 	if (!have_cpuid_p()) {
diff -r a168569a7659 -r f141db2fe4c1 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Wed Mar 07 09:23:41 2012 +0000
+++ b/xen/arch/x86/smpboot.c	Wed Mar 07 09:24:20 2012 +0000
@@ -241,6 +241,14 @@
 /* CPUs for which sibling maps can be computed. */
 static cpumask_t cpu_sibling_setup_map;
 
+static void link_thread_siblings(int cpu1, int cpu2)
+{
+    cpu_set(cpu1, per_cpu(cpu_sibling_map, cpu2));
+    cpu_set(cpu2, per_cpu(cpu_sibling_map, cpu1));
+    cpu_set(cpu1, per_cpu(cpu_core_map, cpu2));
+    cpu_set(cpu2, per_cpu(cpu_core_map, cpu1));
+}
+
 static void set_cpu_sibling_map(int cpu)
 {
     int i;
@@ -252,13 +260,13 @@
     {
         for_each_cpu_mask ( i, cpu_sibling_setup_map )
         {
-            if ( (c[cpu].phys_proc_id == c[i].phys_proc_id) &&
-                 (c[cpu].cpu_core_id == c[i].cpu_core_id) )
-            {
-                cpu_set(i, per_cpu(cpu_sibling_map, cpu));
-                cpu_set(cpu, per_cpu(cpu_sibling_map, i));
-                cpu_set(i, per_cpu(cpu_core_map, cpu));
-                cpu_set(cpu, per_cpu(cpu_core_map, i));
+            if ( cpu_has(c, X86_FEATURE_TOPOEXT) ) {
+                if ( (c[cpu].phys_proc_id == c[i].phys_proc_id) &&
+                     (c[cpu].compute_unit_id == c[i].compute_unit_id) )
+                    link_thread_siblings(cpu, i);
+            } else if ( (c[cpu].phys_proc_id == c[i].phys_proc_id) &&
+                        (c[cpu].cpu_core_id == c[i].cpu_core_id) ) {
+                link_thread_siblings(cpu, i);
             }
         }
     }
@@ -854,6 +862,7 @@
     cpus_clear(per_cpu(cpu_core_map, cpu));
     c[cpu].phys_proc_id = BAD_APICID;
     c[cpu].cpu_core_id = BAD_APICID;
+    c[cpu].compute_unit_id = BAD_APICID;
     cpu_clear(cpu, cpu_sibling_setup_map);
 }
 
diff -r a168569a7659 -r f141db2fe4c1 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Wed Mar 07 09:23:41 2012 +0000
+++ b/xen/include/asm-x86/processor.h	Wed Mar 07 09:24:20 2012 +0000
@@ -175,9 +175,10 @@
     __u32 x86_max_cores; /* cpuid returned max cores value */
     __u32 booted_cores;  /* number of cores as seen by OS */
     __u32 x86_num_siblings; /* cpuid logical cpus per chip value */
+    __u32 apicid;
     int   phys_proc_id; /* package ID of each logical CPU */
     int   cpu_core_id; /* core ID of each logical CPU*/
-    __u32 apicid;
+    int   compute_unit_id; /* AMD compute unit ID of each logical CPU */
     unsigned short x86_clflush_size;
 } __cacheline_aligned;
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWo-0007jo-Mo; Wed, 07 Mar 2012 23:44: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 1S5QWn-0007fV-Co
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:17 +0000
Received: from [85.158.143.99:16045] by server-2.bemta-4.messagelabs.com id
	B6/8C-17550-0D2F75F4; Wed, 07 Mar 2012 23:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1331163853!17837991!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8087 invoked from network); 7 Mar 2012 23:44: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;
	7 Mar 2012 23: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 1S5QWj-0006iH-De
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWj-00034K-C5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:13 +0000
Message-Id: <E1S5QWj-00034K-C5@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:12 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Move IOMMU faults handling into
	softirq for VT-d.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331108558 0
# Node ID 96db1984e87855b196c3b94c3cb7443c5c764f5f
# Parent  d21100f1d00e57649b24c8781be2133a74503f4b
Move IOMMU faults handling into softirq for VT-d.

Dealing with interrupts from VT-d IOMMU(s) is deferred to a
softirq-tasklet, raised by the actual IRQ handler. Since a new
interrupt is not generated, even if further faults occur, until we
cleared all the pending ones, there's no need of disabling IRQs, as
the hardware does it by its own.  Notice that this may cause the log
to overflow, but none of the existing entry will be overwritten.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24517:a7ae457c327c
xen-unstable date:        Tue Jan 17 11:11:26 2012 +0000
---


diff -r d21100f1d00e -r 96db1984e878 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed Mar 07 08:19:48 2012 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Mar 07 08:22:38 2012 +0000
@@ -53,6 +53,8 @@
 
 int nr_iommus;
 
+static struct tasklet vtd_fault_tasklet;
+
 static void setup_dom0_devices(struct domain *d);
 static void setup_dom0_rmrr(struct domain *d);
 
@@ -872,10 +874,8 @@
 }
 
 #define PRIMARY_FAULT_REG_LEN (16)
-static void iommu_page_fault(int irq, void *dev_id,
-                             struct cpu_user_regs *regs)
+static void __do_iommu_page_fault(struct iommu *iommu)
 {
-    struct iommu *iommu = dev_id;
     int reg, fault_index;
     u32 fault_status;
     unsigned long flags;
@@ -949,6 +949,38 @@
     }
 }
 
+static void do_iommu_page_fault(unsigned long data)
+{
+    struct acpi_drhd_unit *drhd;
+
+    if ( list_empty(&acpi_drhd_units) )
+    {
+        dprintk(XENLOG_WARNING VTDPREFIX,
+                "no device found, something must be very wrong!\n");
+       return;
+    }
+
+    /*
+     * No matter from whom the interrupt came from, check all the
+     * IOMMUs present in the system. This allows for having just one
+     * tasklet (instead of one per each IOMMUs) and should be more than
+     * fine, considering how rare the event of a fault should be.
+     */
+    for_each_drhd_unit ( drhd )
+        __do_iommu_page_fault(drhd->iommu);
+}
+
+static void iommu_page_fault(int irq, void *dev_id,
+                             struct cpu_user_regs *regs)
+{
+    /*
+     * Just flag the tasklet as runnable. This is fine, according to VT-d
+     * specs since a new interrupt won't be generated until we clear all
+     * the faults that caused this one to happen.
+     */
+    tasklet_schedule(&vtd_fault_tasklet);
+}
+
 static void dma_msi_unmask(unsigned int irq)
 {
     struct iommu *iommu = irq_to_iommu[irq];
@@ -2089,6 +2121,8 @@
             iommu_hap_pt_share = FALSE;
     }
 
+    softirq_tasklet_init(&vtd_fault_tasklet, do_iommu_page_fault, 0);
+
     if ( !iommu_qinval && iommu_intremap )
     {
         iommu_intremap = 0;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWr-0007ow-Kx; Wed, 07 Mar 2012 23:44: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 1S5QWq-0007jT-9o
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:20 +0000
Received: from [193.109.254.147:21847] by server-5.bemta-14.messagelabs.com id
	E0/AC-01689-3D2F75F4; Wed, 07 Mar 2012 23:44:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1331163825!59973400!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4088 invoked from network); 7 Mar 2012 23:43:46 -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;
	7 Mar 2012 23:43:46 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWo-0006ii-1L
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWn-00037X-Vr
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:17 +0000
Message-Id: <E1S5QWn-00037X-Vr@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:17 +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 core-pair topology
	detection 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Huang <wei.huang2@amd.com>
# Date 1331112260 0
# Node ID f141db2fe4c1600cd40e1737560f5841150a30b2
# Parent  a168569a765915e0bb592b348359def4f6784ca6
x86: AMD core-pair topology detection code

This patch is to support core-pair topology introduced by AMD CPUs,
which introduces a new concept of [core, compute unit]. There is a new
feature bit for topology extension in CPUID:0x80000001. Also a new
CPUID 0x8000001E is introduced for CPU topology enumeration. This
patch collects the sibling information from the new CPUID and will be
stored in the sibling map in Xen hypervisor.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
xen-unstable changeset:   23611:c2c12b2dafb5
xen-unstable date:        Tue Jun 28 09:13:53 2011 +0100
---


diff -r a168569a7659 -r f141db2fe4c1 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Wed Mar 07 09:23:41 2012 +0000
+++ b/xen/arch/x86/cpu/amd.c	Wed Mar 07 09:24:20 2012 +0000
@@ -344,6 +344,49 @@
 	wrmsrl(MSR_K8_SYSCFG, syscfg);
 }
 
+static void __devinit amd_get_topology(struct cpuinfo_x86 *c)
+{
+#ifdef CONFIG_X86_HT
+        int cpu;
+        unsigned bits;
+
+        if (c->x86_max_cores <= 1)
+                return;
+        /*
+         * On a AMD multi core setup the lower bits of the APIC id
+         * distingush the cores.
+         */
+        cpu = smp_processor_id();
+        bits = (cpuid_ecx(0x80000008) >> 12) & 0xf;
+
+        if (bits == 0) {
+                while ((1 << bits) < c->x86_max_cores)
+                        bits++;
+        }
+
+        /* Low order bits define the core id */
+        c->cpu_core_id = c->phys_proc_id & ((1<<bits)-1);
+        /* Convert local APIC ID into the socket ID */
+        c->phys_proc_id >>= bits;
+        /* Collect compute unit ID if available */
+        if (cpu_has(c, X86_FEATURE_TOPOEXT)) {
+                u32 eax, ebx, ecx, edx;
+
+                cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
+                c->compute_unit_id = ebx & 0xFF;
+                c->x86_num_siblings = ((ebx >> 8) & 0x3) + 1;
+        }
+        
+        if (opt_cpu_info)
+                printk("CPU %d(%d) -> Processor %d, %s %d\n",
+                       cpu, c->x86_max_cores, c->phys_proc_id,
+                       cpu_has(c, X86_FEATURE_TOPOEXT) ? "Compute Unit" : 
+                                                         "Core",
+                       cpu_has(c, X86_FEATURE_TOPOEXT) ? c->compute_unit_id :
+                                                         c->cpu_core_id);
+#endif
+}
+
 static void __devinit init_amd(struct cpuinfo_x86 *c)
 {
 	u32 l, h;
@@ -566,26 +609,7 @@
 		}
 	}
 
-#ifdef CONFIG_X86_HT
-	/*
-	 * On a AMD multi core setup the lower bits of the APIC id
-	 * distingush the cores.
-	 */
-	if (c->x86_max_cores > 1) {
-		int cpu = smp_processor_id();
-		unsigned bits = (cpuid_ecx(0x80000008) >> 12) & 0xf;
-
-		if (bits == 0) {
-			while ((1 << bits) < c->x86_max_cores)
-				bits++;
-		}
-		c->cpu_core_id = c->phys_proc_id & ((1<<bits)-1);
-		c->phys_proc_id >>= bits;
-		if (opt_cpu_info)
-			printk("CPU %d(%d) -> Core %d\n",
-			       cpu, c->x86_max_cores, c->cpu_core_id);
-	}
-#endif
+        amd_get_topology(c);
 
 	/* Pointless to use MWAIT on Family10 as it does not deep sleep. */
 	if (c->x86 >= 0x10 && !force_mwait)
diff -r a168569a7659 -r f141db2fe4c1 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Wed Mar 07 09:23:41 2012 +0000
+++ b/xen/arch/x86/cpu/common.c	Wed Mar 07 09:24:20 2012 +0000
@@ -364,6 +364,7 @@
 	c->x86_clflush_size = 0;
 	c->phys_proc_id = BAD_APICID;
 	c->cpu_core_id = BAD_APICID;
+	c->compute_unit_id = BAD_APICID;
 	memset(&c->x86_capability, 0, sizeof c->x86_capability);
 
 	if (!have_cpuid_p()) {
diff -r a168569a7659 -r f141db2fe4c1 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Wed Mar 07 09:23:41 2012 +0000
+++ b/xen/arch/x86/smpboot.c	Wed Mar 07 09:24:20 2012 +0000
@@ -241,6 +241,14 @@
 /* CPUs for which sibling maps can be computed. */
 static cpumask_t cpu_sibling_setup_map;
 
+static void link_thread_siblings(int cpu1, int cpu2)
+{
+    cpu_set(cpu1, per_cpu(cpu_sibling_map, cpu2));
+    cpu_set(cpu2, per_cpu(cpu_sibling_map, cpu1));
+    cpu_set(cpu1, per_cpu(cpu_core_map, cpu2));
+    cpu_set(cpu2, per_cpu(cpu_core_map, cpu1));
+}
+
 static void set_cpu_sibling_map(int cpu)
 {
     int i;
@@ -252,13 +260,13 @@
     {
         for_each_cpu_mask ( i, cpu_sibling_setup_map )
         {
-            if ( (c[cpu].phys_proc_id == c[i].phys_proc_id) &&
-                 (c[cpu].cpu_core_id == c[i].cpu_core_id) )
-            {
-                cpu_set(i, per_cpu(cpu_sibling_map, cpu));
-                cpu_set(cpu, per_cpu(cpu_sibling_map, i));
-                cpu_set(i, per_cpu(cpu_core_map, cpu));
-                cpu_set(cpu, per_cpu(cpu_core_map, i));
+            if ( cpu_has(c, X86_FEATURE_TOPOEXT) ) {
+                if ( (c[cpu].phys_proc_id == c[i].phys_proc_id) &&
+                     (c[cpu].compute_unit_id == c[i].compute_unit_id) )
+                    link_thread_siblings(cpu, i);
+            } else if ( (c[cpu].phys_proc_id == c[i].phys_proc_id) &&
+                        (c[cpu].cpu_core_id == c[i].cpu_core_id) ) {
+                link_thread_siblings(cpu, i);
             }
         }
     }
@@ -854,6 +862,7 @@
     cpus_clear(per_cpu(cpu_core_map, cpu));
     c[cpu].phys_proc_id = BAD_APICID;
     c[cpu].cpu_core_id = BAD_APICID;
+    c[cpu].compute_unit_id = BAD_APICID;
     cpu_clear(cpu, cpu_sibling_setup_map);
 }
 
diff -r a168569a7659 -r f141db2fe4c1 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Wed Mar 07 09:23:41 2012 +0000
+++ b/xen/include/asm-x86/processor.h	Wed Mar 07 09:24:20 2012 +0000
@@ -175,9 +175,10 @@
     __u32 x86_max_cores; /* cpuid returned max cores value */
     __u32 booted_cores;  /* number of cores as seen by OS */
     __u32 x86_num_siblings; /* cpuid logical cpus per chip value */
+    __u32 apicid;
     int   phys_proc_id; /* package ID of each logical CPU */
     int   cpu_core_id; /* core ID of each logical CPU*/
-    __u32 apicid;
+    int   compute_unit_id; /* AMD compute unit ID of each logical CPU */
     unsigned short x86_clflush_size;
 } __cacheline_aligned;
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWo-0007jo-Mo; Wed, 07 Mar 2012 23:44: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 1S5QWn-0007fV-Co
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:17 +0000
Received: from [85.158.143.99:16045] by server-2.bemta-4.messagelabs.com id
	B6/8C-17550-0D2F75F4; Wed, 07 Mar 2012 23:44:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1331163853!17837991!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8087 invoked from network); 7 Mar 2012 23:44: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;
	7 Mar 2012 23: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 1S5QWj-0006iH-De
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWj-00034K-C5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:13 +0000
Message-Id: <E1S5QWj-00034K-C5@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:12 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Move IOMMU faults handling into
	softirq for VT-d.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331108558 0
# Node ID 96db1984e87855b196c3b94c3cb7443c5c764f5f
# Parent  d21100f1d00e57649b24c8781be2133a74503f4b
Move IOMMU faults handling into softirq for VT-d.

Dealing with interrupts from VT-d IOMMU(s) is deferred to a
softirq-tasklet, raised by the actual IRQ handler. Since a new
interrupt is not generated, even if further faults occur, until we
cleared all the pending ones, there's no need of disabling IRQs, as
the hardware does it by its own.  Notice that this may cause the log
to overflow, but none of the existing entry will be overwritten.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24517:a7ae457c327c
xen-unstable date:        Tue Jan 17 11:11:26 2012 +0000
---


diff -r d21100f1d00e -r 96db1984e878 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c	Wed Mar 07 08:19:48 2012 +0000
+++ b/xen/drivers/passthrough/vtd/iommu.c	Wed Mar 07 08:22:38 2012 +0000
@@ -53,6 +53,8 @@
 
 int nr_iommus;
 
+static struct tasklet vtd_fault_tasklet;
+
 static void setup_dom0_devices(struct domain *d);
 static void setup_dom0_rmrr(struct domain *d);
 
@@ -872,10 +874,8 @@
 }
 
 #define PRIMARY_FAULT_REG_LEN (16)
-static void iommu_page_fault(int irq, void *dev_id,
-                             struct cpu_user_regs *regs)
+static void __do_iommu_page_fault(struct iommu *iommu)
 {
-    struct iommu *iommu = dev_id;
     int reg, fault_index;
     u32 fault_status;
     unsigned long flags;
@@ -949,6 +949,38 @@
     }
 }
 
+static void do_iommu_page_fault(unsigned long data)
+{
+    struct acpi_drhd_unit *drhd;
+
+    if ( list_empty(&acpi_drhd_units) )
+    {
+        dprintk(XENLOG_WARNING VTDPREFIX,
+                "no device found, something must be very wrong!\n");
+       return;
+    }
+
+    /*
+     * No matter from whom the interrupt came from, check all the
+     * IOMMUs present in the system. This allows for having just one
+     * tasklet (instead of one per each IOMMUs) and should be more than
+     * fine, considering how rare the event of a fault should be.
+     */
+    for_each_drhd_unit ( drhd )
+        __do_iommu_page_fault(drhd->iommu);
+}
+
+static void iommu_page_fault(int irq, void *dev_id,
+                             struct cpu_user_regs *regs)
+{
+    /*
+     * Just flag the tasklet as runnable. This is fine, according to VT-d
+     * specs since a new interrupt won't be generated until we clear all
+     * the faults that caused this one to happen.
+     */
+    tasklet_schedule(&vtd_fault_tasklet);
+}
+
 static void dma_msi_unmask(unsigned int irq)
 {
     struct iommu *iommu = irq_to_iommu[irq];
@@ -2089,6 +2121,8 @@
             iommu_hap_pt_share = FALSE;
     }
 
+    softirq_tasklet_init(&vtd_fault_tasklet, do_iommu_page_fault, 0);
+
     if ( !iommu_qinval && iommu_intremap )
     {
         iommu_intremap = 0;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWs-0007qw-QF; Wed, 07 Mar 2012 23:44: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 1S5QWr-0007n1-1t
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:21 +0000
Received: from [85.158.139.83:41510] by server-5.bemta-5.messagelabs.com id
	22/56-13566-4D2F75F4; Wed, 07 Mar 2012 23:44:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1331163857!17695757!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27789 invoked from network); 7 Mar 2012 23:44:18 -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;
	7 Mar 2012 23:44: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 1S5QWn-0006if-Go
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWn-00037B-FP
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:17 +0000
Message-Id: <E1S5QWn-00037B-FP@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:16 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: consolidate cpu_core_id and
	phys_proc_id into cpuinfo_x86 struct
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Huang <wei.huang2@amd.com>
# Date 1331112221 0
# Node ID a168569a765915e0bb592b348359def4f6784ca6
# Parent  b5051d40e1cca83dac690dae85f637afd8dc745e
x86: consolidate cpu_core_id and phys_proc_id into cpuinfo_x86 struct

This patch moves cpu_core_id and phys_proc_id into cpuinfo_x86
structure. This is similar to upstream Linux kernel's approach.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
xen-unstable changeset:   23610:87c2013c2aa2
xen-unstable date:        Tue Jun 28 09:13:31 2011 +0100
---


diff -r b5051d40e1cc -r a168569a7659 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Wed Mar 07 09:22:58 2012 +0000
+++ b/xen/arch/x86/cpu/amd.c	Wed Mar 07 09:23:41 2012 +0000
@@ -579,11 +579,11 @@
 			while ((1 << bits) < c->x86_max_cores)
 				bits++;
 		}
-		cpu_core_id[cpu] = phys_proc_id[cpu] & ((1<<bits)-1);
-		phys_proc_id[cpu] >>= bits;
+		c->cpu_core_id = c->phys_proc_id & ((1<<bits)-1);
+		c->phys_proc_id >>= bits;
 		if (opt_cpu_info)
 			printk("CPU %d(%d) -> Core %d\n",
-			       cpu, c->x86_max_cores, cpu_core_id[cpu]);
+			       cpu, c->x86_max_cores, c->cpu_core_id);
 	}
 #endif
 
diff -r b5051d40e1cc -r a168569a7659 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Wed Mar 07 09:22:58 2012 +0000
+++ b/xen/arch/x86/cpu/common.c	Wed Mar 07 09:23:41 2012 +0000
@@ -326,7 +326,7 @@
 	early_intel_workaround(c);
 
 #ifdef CONFIG_X86_HT
-	phys_proc_id[smp_processor_id()] = (cpuid_ebx(1) >> 24) & 0xff;
+	c->phys_proc_id = (cpuid_ebx(1) >> 24) & 0xff;
 #endif
 }
 
@@ -362,6 +362,8 @@
 	c->x86_max_cores = 1;
 	c->x86_num_siblings = 1;
 	c->x86_clflush_size = 0;
+	c->phys_proc_id = BAD_APICID;
+	c->cpu_core_id = BAD_APICID;
 	memset(&c->x86_capability, 0, sizeof c->x86_capability);
 
 	if (!have_cpuid_p()) {
@@ -510,7 +512,6 @@
 	unsigned int ht_mask_width, core_plus_mask_width;
 	unsigned int core_select_mask, core_level_siblings;
 	unsigned int initial_apicid;
-	int cpu = smp_processor_id();
 
 	if ( c->cpuid_level < 0xb )
 		return;
@@ -545,9 +546,9 @@
 
 	core_select_mask = (~(-1 << core_plus_mask_width)) >> ht_mask_width;
 
-	cpu_core_id[cpu] = phys_pkg_id(initial_apicid, ht_mask_width)
+	c->cpu_core_id = phys_pkg_id(initial_apicid, ht_mask_width)
 		& core_select_mask;
-	phys_proc_id[cpu] = phys_pkg_id(initial_apicid, core_plus_mask_width);
+	c->phys_proc_id = phys_pkg_id(initial_apicid, core_plus_mask_width);
 
 	c->apicid = phys_pkg_id(initial_apicid, 0);
 	c->x86_max_cores = (core_level_siblings / c->x86_num_siblings);
@@ -555,10 +556,10 @@
 	if ( opt_cpu_info )
 	{
 		printk("CPU: Physical Processor ID: %d\n",
-		       phys_proc_id[cpu]);
+		       c->phys_proc_id);
 		if ( c->x86_max_cores > 1 )
 			printk("CPU: Processor Core ID: %d\n",
-			       cpu_core_id[cpu]);
+			       c->cpu_core_id);
 	}
 }
 
@@ -567,7 +568,6 @@
 {
 	u32 	eax, ebx, ecx, edx;
 	int 	index_msb, core_bits;
-	int 	cpu = smp_processor_id();
 
 	cpuid(1, &eax, &ebx, &ecx, &edx);
 
@@ -590,11 +590,11 @@
 		}
 
 		index_msb = get_count_order(c->x86_num_siblings);
-		phys_proc_id[cpu] = phys_pkg_id((ebx >> 24) & 0xFF, index_msb);
+		c->phys_proc_id = phys_pkg_id((ebx >> 24) & 0xFF, index_msb);
 
 		if (opt_cpu_info)
 			printk("CPU: Physical Processor ID: %d\n",
-			       phys_proc_id[cpu]);
+			       c->phys_proc_id);
 
 		c->x86_num_siblings = c->x86_num_siblings / c->x86_max_cores;
 
@@ -602,12 +602,12 @@
 
 		core_bits = get_count_order(c->x86_max_cores);
 
-		cpu_core_id[cpu] = phys_pkg_id((ebx >> 24) & 0xFF, index_msb) &
+		c->cpu_core_id = phys_pkg_id((ebx >> 24) & 0xFF, index_msb) &
 					       ((1 << core_bits) - 1);
 
 		if (opt_cpu_info && c->x86_max_cores > 1)
 			printk("CPU: Processor Core ID: %d\n",
-			       cpu_core_id[cpu]);
+			       c->cpu_core_id);
 	}
 }
 #endif
diff -r b5051d40e1cc -r a168569a7659 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Wed Mar 07 09:22:58 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Wed Mar 07 09:23:41 2012 +0000
@@ -1041,9 +1041,9 @@
         if (nthreads != NULL)
             *nthreads = 1;
     } else {
-        *chipid = phys_proc_id[cpu];
+        *chipid = c->phys_proc_id;
         if (c->x86_max_cores > 1)
-            *coreid = cpu_core_id[cpu];
+            *coreid = c->cpu_core_id;
         else
             *coreid = 0;
         *threadid = c->apicid & ((1 << (c->x86_num_siblings - 1)) - 1);
diff -r b5051d40e1cc -r a168569a7659 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Wed Mar 07 09:22:58 2012 +0000
+++ b/xen/arch/x86/smpboot.c	Wed Mar 07 09:23:41 2012 +0000
@@ -52,12 +52,6 @@
 /* Set if we find a B stepping CPU */
 static int smp_b_stepping;
 
-/* Package ID of each logical CPU */
-int phys_proc_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID};
-
-/* Core ID of each logical CPU */
-int cpu_core_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID};
-
 /* representing HT siblings of each logical CPU */
 DEFINE_PER_CPU_READ_MOSTLY(cpumask_t, cpu_sibling_map);
 /* representing HT and core siblings of each logical CPU */
@@ -258,8 +252,8 @@
     {
         for_each_cpu_mask ( i, cpu_sibling_setup_map )
         {
-            if ( (phys_proc_id[cpu] == phys_proc_id[i]) &&
-                 (cpu_core_id[cpu] == cpu_core_id[i]) )
+            if ( (c[cpu].phys_proc_id == c[i].phys_proc_id) &&
+                 (c[cpu].cpu_core_id == c[i].cpu_core_id) )
             {
                 cpu_set(i, per_cpu(cpu_sibling_map, cpu));
                 cpu_set(cpu, per_cpu(cpu_sibling_map, i));
@@ -282,7 +276,7 @@
 
     for_each_cpu_mask ( i, cpu_sibling_setup_map )
     {
-        if ( phys_proc_id[cpu] == phys_proc_id[i] )
+        if ( c[cpu].phys_proc_id == c[i].phys_proc_id )
         {
             cpu_set(i, per_cpu(cpu_core_map, cpu));
             cpu_set(cpu, per_cpu(cpu_core_map, i));
@@ -858,8 +852,8 @@
         cpu_clear(cpu, per_cpu(cpu_sibling_map, sibling));
     cpus_clear(per_cpu(cpu_sibling_map, cpu));
     cpus_clear(per_cpu(cpu_core_map, cpu));
-    phys_proc_id[cpu] = BAD_APICID;
-    cpu_core_id[cpu] = BAD_APICID;
+    c[cpu].phys_proc_id = BAD_APICID;
+    c[cpu].cpu_core_id = BAD_APICID;
     cpu_clear(cpu, cpu_sibling_setup_map);
 }
 
diff -r b5051d40e1cc -r a168569a7659 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Wed Mar 07 09:22:58 2012 +0000
+++ b/xen/include/asm-x86/processor.h	Wed Mar 07 09:23:41 2012 +0000
@@ -175,6 +175,8 @@
     __u32 x86_max_cores; /* cpuid returned max cores value */
     __u32 booted_cores;  /* number of cores as seen by OS */
     __u32 x86_num_siblings; /* cpuid logical cpus per chip value */
+    int   phys_proc_id; /* package ID of each logical CPU */
+    int   cpu_core_id; /* core ID of each logical CPU*/
     __u32 apicid;
     unsigned short x86_clflush_size;
 } __cacheline_aligned;
@@ -196,8 +198,6 @@
 extern void set_cpuid_faulting(bool_t enable);
 
 extern u64 host_pat;
-extern int phys_proc_id[NR_CPUS];
-extern int cpu_core_id[NR_CPUS];
 extern bool_t opt_cpu_info;
 
 /* Maximum width of physical addresses supported by the hardware */
@@ -217,8 +217,8 @@
 static always_inline void detect_ht(struct cpuinfo_x86 *c) {}
 #endif
 
-#define cpu_to_core(_cpu)   (cpu_core_id[_cpu])
-#define cpu_to_socket(_cpu) (phys_proc_id[_cpu])
+#define cpu_to_core(_cpu)   (cpu_data[_cpu].cpu_core_id)
+#define cpu_to_socket(_cpu) (cpu_data[_cpu].phys_proc_id)
 
 /*
  * Generic CPUID function

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWs-0007qw-QF; Wed, 07 Mar 2012 23:44: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 1S5QWr-0007n1-1t
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:21 +0000
Received: from [85.158.139.83:41510] by server-5.bemta-5.messagelabs.com id
	22/56-13566-4D2F75F4; Wed, 07 Mar 2012 23:44:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1331163857!17695757!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27789 invoked from network); 7 Mar 2012 23:44:18 -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;
	7 Mar 2012 23:44: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 1S5QWn-0006if-Go
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWn-00037B-FP
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:17 +0000
Message-Id: <E1S5QWn-00037B-FP@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:16 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: consolidate cpu_core_id and
	phys_proc_id into cpuinfo_x86 struct
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Huang <wei.huang2@amd.com>
# Date 1331112221 0
# Node ID a168569a765915e0bb592b348359def4f6784ca6
# Parent  b5051d40e1cca83dac690dae85f637afd8dc745e
x86: consolidate cpu_core_id and phys_proc_id into cpuinfo_x86 struct

This patch moves cpu_core_id and phys_proc_id into cpuinfo_x86
structure. This is similar to upstream Linux kernel's approach.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
xen-unstable changeset:   23610:87c2013c2aa2
xen-unstable date:        Tue Jun 28 09:13:31 2011 +0100
---


diff -r b5051d40e1cc -r a168569a7659 xen/arch/x86/cpu/amd.c
--- a/xen/arch/x86/cpu/amd.c	Wed Mar 07 09:22:58 2012 +0000
+++ b/xen/arch/x86/cpu/amd.c	Wed Mar 07 09:23:41 2012 +0000
@@ -579,11 +579,11 @@
 			while ((1 << bits) < c->x86_max_cores)
 				bits++;
 		}
-		cpu_core_id[cpu] = phys_proc_id[cpu] & ((1<<bits)-1);
-		phys_proc_id[cpu] >>= bits;
+		c->cpu_core_id = c->phys_proc_id & ((1<<bits)-1);
+		c->phys_proc_id >>= bits;
 		if (opt_cpu_info)
 			printk("CPU %d(%d) -> Core %d\n",
-			       cpu, c->x86_max_cores, cpu_core_id[cpu]);
+			       cpu, c->x86_max_cores, c->cpu_core_id);
 	}
 #endif
 
diff -r b5051d40e1cc -r a168569a7659 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c	Wed Mar 07 09:22:58 2012 +0000
+++ b/xen/arch/x86/cpu/common.c	Wed Mar 07 09:23:41 2012 +0000
@@ -326,7 +326,7 @@
 	early_intel_workaround(c);
 
 #ifdef CONFIG_X86_HT
-	phys_proc_id[smp_processor_id()] = (cpuid_ebx(1) >> 24) & 0xff;
+	c->phys_proc_id = (cpuid_ebx(1) >> 24) & 0xff;
 #endif
 }
 
@@ -362,6 +362,8 @@
 	c->x86_max_cores = 1;
 	c->x86_num_siblings = 1;
 	c->x86_clflush_size = 0;
+	c->phys_proc_id = BAD_APICID;
+	c->cpu_core_id = BAD_APICID;
 	memset(&c->x86_capability, 0, sizeof c->x86_capability);
 
 	if (!have_cpuid_p()) {
@@ -510,7 +512,6 @@
 	unsigned int ht_mask_width, core_plus_mask_width;
 	unsigned int core_select_mask, core_level_siblings;
 	unsigned int initial_apicid;
-	int cpu = smp_processor_id();
 
 	if ( c->cpuid_level < 0xb )
 		return;
@@ -545,9 +546,9 @@
 
 	core_select_mask = (~(-1 << core_plus_mask_width)) >> ht_mask_width;
 
-	cpu_core_id[cpu] = phys_pkg_id(initial_apicid, ht_mask_width)
+	c->cpu_core_id = phys_pkg_id(initial_apicid, ht_mask_width)
 		& core_select_mask;
-	phys_proc_id[cpu] = phys_pkg_id(initial_apicid, core_plus_mask_width);
+	c->phys_proc_id = phys_pkg_id(initial_apicid, core_plus_mask_width);
 
 	c->apicid = phys_pkg_id(initial_apicid, 0);
 	c->x86_max_cores = (core_level_siblings / c->x86_num_siblings);
@@ -555,10 +556,10 @@
 	if ( opt_cpu_info )
 	{
 		printk("CPU: Physical Processor ID: %d\n",
-		       phys_proc_id[cpu]);
+		       c->phys_proc_id);
 		if ( c->x86_max_cores > 1 )
 			printk("CPU: Processor Core ID: %d\n",
-			       cpu_core_id[cpu]);
+			       c->cpu_core_id);
 	}
 }
 
@@ -567,7 +568,6 @@
 {
 	u32 	eax, ebx, ecx, edx;
 	int 	index_msb, core_bits;
-	int 	cpu = smp_processor_id();
 
 	cpuid(1, &eax, &ebx, &ecx, &edx);
 
@@ -590,11 +590,11 @@
 		}
 
 		index_msb = get_count_order(c->x86_num_siblings);
-		phys_proc_id[cpu] = phys_pkg_id((ebx >> 24) & 0xFF, index_msb);
+		c->phys_proc_id = phys_pkg_id((ebx >> 24) & 0xFF, index_msb);
 
 		if (opt_cpu_info)
 			printk("CPU: Physical Processor ID: %d\n",
-			       phys_proc_id[cpu]);
+			       c->phys_proc_id);
 
 		c->x86_num_siblings = c->x86_num_siblings / c->x86_max_cores;
 
@@ -602,12 +602,12 @@
 
 		core_bits = get_count_order(c->x86_max_cores);
 
-		cpu_core_id[cpu] = phys_pkg_id((ebx >> 24) & 0xFF, index_msb) &
+		c->cpu_core_id = phys_pkg_id((ebx >> 24) & 0xFF, index_msb) &
 					       ((1 << core_bits) - 1);
 
 		if (opt_cpu_info && c->x86_max_cores > 1)
 			printk("CPU: Processor Core ID: %d\n",
-			       cpu_core_id[cpu]);
+			       c->cpu_core_id);
 	}
 }
 #endif
diff -r b5051d40e1cc -r a168569a7659 xen/arch/x86/cpu/mcheck/mce.c
--- a/xen/arch/x86/cpu/mcheck/mce.c	Wed Mar 07 09:22:58 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce.c	Wed Mar 07 09:23:41 2012 +0000
@@ -1041,9 +1041,9 @@
         if (nthreads != NULL)
             *nthreads = 1;
     } else {
-        *chipid = phys_proc_id[cpu];
+        *chipid = c->phys_proc_id;
         if (c->x86_max_cores > 1)
-            *coreid = cpu_core_id[cpu];
+            *coreid = c->cpu_core_id;
         else
             *coreid = 0;
         *threadid = c->apicid & ((1 << (c->x86_num_siblings - 1)) - 1);
diff -r b5051d40e1cc -r a168569a7659 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Wed Mar 07 09:22:58 2012 +0000
+++ b/xen/arch/x86/smpboot.c	Wed Mar 07 09:23:41 2012 +0000
@@ -52,12 +52,6 @@
 /* Set if we find a B stepping CPU */
 static int smp_b_stepping;
 
-/* Package ID of each logical CPU */
-int phys_proc_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID};
-
-/* Core ID of each logical CPU */
-int cpu_core_id[NR_CPUS] __read_mostly = {[0 ... NR_CPUS-1] = BAD_APICID};
-
 /* representing HT siblings of each logical CPU */
 DEFINE_PER_CPU_READ_MOSTLY(cpumask_t, cpu_sibling_map);
 /* representing HT and core siblings of each logical CPU */
@@ -258,8 +252,8 @@
     {
         for_each_cpu_mask ( i, cpu_sibling_setup_map )
         {
-            if ( (phys_proc_id[cpu] == phys_proc_id[i]) &&
-                 (cpu_core_id[cpu] == cpu_core_id[i]) )
+            if ( (c[cpu].phys_proc_id == c[i].phys_proc_id) &&
+                 (c[cpu].cpu_core_id == c[i].cpu_core_id) )
             {
                 cpu_set(i, per_cpu(cpu_sibling_map, cpu));
                 cpu_set(cpu, per_cpu(cpu_sibling_map, i));
@@ -282,7 +276,7 @@
 
     for_each_cpu_mask ( i, cpu_sibling_setup_map )
     {
-        if ( phys_proc_id[cpu] == phys_proc_id[i] )
+        if ( c[cpu].phys_proc_id == c[i].phys_proc_id )
         {
             cpu_set(i, per_cpu(cpu_core_map, cpu));
             cpu_set(cpu, per_cpu(cpu_core_map, i));
@@ -858,8 +852,8 @@
         cpu_clear(cpu, per_cpu(cpu_sibling_map, sibling));
     cpus_clear(per_cpu(cpu_sibling_map, cpu));
     cpus_clear(per_cpu(cpu_core_map, cpu));
-    phys_proc_id[cpu] = BAD_APICID;
-    cpu_core_id[cpu] = BAD_APICID;
+    c[cpu].phys_proc_id = BAD_APICID;
+    c[cpu].cpu_core_id = BAD_APICID;
     cpu_clear(cpu, cpu_sibling_setup_map);
 }
 
diff -r b5051d40e1cc -r a168569a7659 xen/include/asm-x86/processor.h
--- a/xen/include/asm-x86/processor.h	Wed Mar 07 09:22:58 2012 +0000
+++ b/xen/include/asm-x86/processor.h	Wed Mar 07 09:23:41 2012 +0000
@@ -175,6 +175,8 @@
     __u32 x86_max_cores; /* cpuid returned max cores value */
     __u32 booted_cores;  /* number of cores as seen by OS */
     __u32 x86_num_siblings; /* cpuid logical cpus per chip value */
+    int   phys_proc_id; /* package ID of each logical CPU */
+    int   cpu_core_id; /* core ID of each logical CPU*/
     __u32 apicid;
     unsigned short x86_clflush_size;
 } __cacheline_aligned;
@@ -196,8 +198,6 @@
 extern void set_cpuid_faulting(bool_t enable);
 
 extern u64 host_pat;
-extern int phys_proc_id[NR_CPUS];
-extern int cpu_core_id[NR_CPUS];
 extern bool_t opt_cpu_info;
 
 /* Maximum width of physical addresses supported by the hardware */
@@ -217,8 +217,8 @@
 static always_inline void detect_ht(struct cpuinfo_x86 *c) {}
 #endif
 
-#define cpu_to_core(_cpu)   (cpu_core_id[_cpu])
-#define cpu_to_socket(_cpu) (phys_proc_id[_cpu])
+#define cpu_to_core(_cpu)   (cpu_data[_cpu].cpu_core_id)
+#define cpu_to_socket(_cpu) (cpu_data[_cpu].phys_proc_id)
 
 /*
  * Generic CPUID function

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWt-0007t1-W2; Wed, 07 Mar 2012 23:44: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 1S5QWs-0007fV-1M
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:22 +0000
Received: from [85.158.143.99:16165] by server-2.bemta-4.messagelabs.com id
	91/9C-17550-5D2F75F4; Wed, 07 Mar 2012 23:44:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1331163859!17550414!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30521 invoked from network); 7 Mar 2012 23:44:20 -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;
	7 Mar 2012 23:44: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 1S5QWp-0006io-1H
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWo-00038F-W5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:19 +0000
Message-Id: <E1S5QWo-00038F-W5@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:18 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] ns16550: Simplify UART and
	UART-interrupt probing logic.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331112642 0
# Node ID f1b85192dbd8eb2da389648077bfd25b8a00a481
# Parent  6c3a6fb7013da78ccddc2e6fd0467cd30bf334fe
ns16550: Simplify UART and UART-interrupt probing logic.

1. No need to check for UART existence in the polling routine. We
already check for UART existence during boot-time initialisation (see
check_existence() function).

2. No obvious need to send a dummy character. The poll routine will
run until a character is eventually sent, but for the most common use
of serial ports (console logging) that will happen almost immediately.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23811:f1349a968a5a
xen-unstable date:        Fri Sep 02 14:56:26 2011 +0100

Revert part of 23811:f1349a968a5a "ns16550: Simplify UART..."

The change to poll LSR.THRE in a loop from __ns16550_poll is a bug.
We can loop indefinitely if there are no chars to transmit.

Thanks to Jan for spotting it.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23948:dcb2bd283dca
xen-unstable date:        Wed Oct 12 17:11:28 2011 +0100
---


diff -r 6c3a6fb7013d -r f1b85192dbd8 xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Wed Mar 07 09:25:34 2012 +0000
+++ b/xen/drivers/char/ns16550.c	Wed Mar 07 09:30:42 2012 +0000
@@ -39,7 +39,7 @@
     /* UART with no IRQ line: periodically-polled I/O. */
     struct timer timer;
     unsigned int timeout_ms;
-    bool_t probing, intr_works;
+    bool_t intr_works;
     /* PCI card parameters. */
     unsigned int pb_bdf[3]; /* pci bridge BDF */
     unsigned int ps_bdf[3]; /* pci serial port BDF */
@@ -133,12 +133,7 @@
     struct serial_port *port = dev_id;
     struct ns16550 *uart = port->uart;
 
-    if (uart->intr_works == 0)
-    {
-        uart->probing = 0;
-        uart->intr_works = 1;
-        stop_timer(&uart->timer);
-    }
+    uart->intr_works = 1;
 
     while ( !(ns_read_reg(uart, IIR) & IIR_NOINT) )
     {
@@ -150,7 +145,7 @@
     }
 }
 
-/* Safe: ns16550_poll() runs in softirq context so not reentrant on a given CPU. */
+/* Safe: ns16550_poll() runs as softirq so not reentrant on a given CPU. */
 static DEFINE_PER_CPU(struct serial_port *, poll_port);
 
 static void __ns16550_poll(struct cpu_user_regs *regs)
@@ -161,12 +156,6 @@
     if ( uart->intr_works )
         return;     /* Interrupts work - no more polling */
 
-    if ( uart->probing ) {
-        uart->probing = 0;
-        if ( (ns_read_reg(uart, LSR) & 0xff) == 0xff )
-            return;     /* All bits set - probably no UART present */
-    }
-
     while ( ns_read_reg(uart, LSR) & LSR_DR )
         serial_rx_interrupt(port, regs);
 
@@ -230,6 +219,8 @@
     unsigned char lcr;
     unsigned int  divisor;
 
+    uart->intr_works = 0;
+
     pci_serial_early_init(uart);
 
     /* I/O ports are distinguished by their size (16 bits). */
@@ -304,12 +295,6 @@
 
         /* Enable receive and transmit interrupts. */
         ns_write_reg(uart, IER, IER_ERDAI | IER_ETHREI);
-
-        /* Do a timed write to make sure we are getting interrupts. */
-        uart->probing = 1;
-        uart->intr_works = 0;
-        ns_write_reg(uart, THR, 0xff);
-        set_timer(&uart->timer, NOW() + MILLISECS(uart->timeout_ms));
     }
 }
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWt-0007t1-W2; Wed, 07 Mar 2012 23:44: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 1S5QWs-0007fV-1M
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:22 +0000
Received: from [85.158.143.99:16165] by server-2.bemta-4.messagelabs.com id
	91/9C-17550-5D2F75F4; Wed, 07 Mar 2012 23:44:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1331163859!17550414!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30521 invoked from network); 7 Mar 2012 23:44:20 -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;
	7 Mar 2012 23:44: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 1S5QWp-0006io-1H
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWo-00038F-W5
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:19 +0000
Message-Id: <E1S5QWo-00038F-W5@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:18 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] ns16550: Simplify UART and
	UART-interrupt probing logic.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331112642 0
# Node ID f1b85192dbd8eb2da389648077bfd25b8a00a481
# Parent  6c3a6fb7013da78ccddc2e6fd0467cd30bf334fe
ns16550: Simplify UART and UART-interrupt probing logic.

1. No need to check for UART existence in the polling routine. We
already check for UART existence during boot-time initialisation (see
check_existence() function).

2. No obvious need to send a dummy character. The poll routine will
run until a character is eventually sent, but for the most common use
of serial ports (console logging) that will happen almost immediately.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23811:f1349a968a5a
xen-unstable date:        Fri Sep 02 14:56:26 2011 +0100

Revert part of 23811:f1349a968a5a "ns16550: Simplify UART..."

The change to poll LSR.THRE in a loop from __ns16550_poll is a bug.
We can loop indefinitely if there are no chars to transmit.

Thanks to Jan for spotting it.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23948:dcb2bd283dca
xen-unstable date:        Wed Oct 12 17:11:28 2011 +0100
---


diff -r 6c3a6fb7013d -r f1b85192dbd8 xen/drivers/char/ns16550.c
--- a/xen/drivers/char/ns16550.c	Wed Mar 07 09:25:34 2012 +0000
+++ b/xen/drivers/char/ns16550.c	Wed Mar 07 09:30:42 2012 +0000
@@ -39,7 +39,7 @@
     /* UART with no IRQ line: periodically-polled I/O. */
     struct timer timer;
     unsigned int timeout_ms;
-    bool_t probing, intr_works;
+    bool_t intr_works;
     /* PCI card parameters. */
     unsigned int pb_bdf[3]; /* pci bridge BDF */
     unsigned int ps_bdf[3]; /* pci serial port BDF */
@@ -133,12 +133,7 @@
     struct serial_port *port = dev_id;
     struct ns16550 *uart = port->uart;
 
-    if (uart->intr_works == 0)
-    {
-        uart->probing = 0;
-        uart->intr_works = 1;
-        stop_timer(&uart->timer);
-    }
+    uart->intr_works = 1;
 
     while ( !(ns_read_reg(uart, IIR) & IIR_NOINT) )
     {
@@ -150,7 +145,7 @@
     }
 }
 
-/* Safe: ns16550_poll() runs in softirq context so not reentrant on a given CPU. */
+/* Safe: ns16550_poll() runs as softirq so not reentrant on a given CPU. */
 static DEFINE_PER_CPU(struct serial_port *, poll_port);
 
 static void __ns16550_poll(struct cpu_user_regs *regs)
@@ -161,12 +156,6 @@
     if ( uart->intr_works )
         return;     /* Interrupts work - no more polling */
 
-    if ( uart->probing ) {
-        uart->probing = 0;
-        if ( (ns_read_reg(uart, LSR) & 0xff) == 0xff )
-            return;     /* All bits set - probably no UART present */
-    }
-
     while ( ns_read_reg(uart, LSR) & LSR_DR )
         serial_rx_interrupt(port, regs);
 
@@ -230,6 +219,8 @@
     unsigned char lcr;
     unsigned int  divisor;
 
+    uart->intr_works = 0;
+
     pci_serial_early_init(uart);
 
     /* I/O ports are distinguished by their size (16 bits). */
@@ -304,12 +295,6 @@
 
         /* Enable receive and transmit interrupts. */
         ns_write_reg(uart, IER, IER_ERDAI | IER_ETHREI);
-
-        /* Do a timed write to make sure we are getting interrupts. */
-        uart->probing = 1;
-        uart->intr_works = 0;
-        ns_write_reg(uart, THR, 0xff);
-        set_timer(&uart->timer, NOW() + MILLISECS(uart->timeout_ms));
     }
 }
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWu-0007t9-2Y; Wed, 07 Mar 2012 23:44: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 1S5QWs-0007fV-HU
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:22 +0000
Received: from [85.158.143.35:20331] by server-2.bemta-4.messagelabs.com id
	62/9C-17550-6D2F75F4; Wed, 07 Mar 2012 23:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1331163860!4021888!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4881 invoked from network); 7 Mar 2012 23:44:21 -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;
	7 Mar 2012 23:44: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 1S5QWq-0006iu-2h
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWq-000390-1P
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:20 +0000
Message-Id: <E1S5QWq-000390-1P@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:19 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] sched_credit: Use delay to
	control scheduling frequency
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Hui Lv <hui.lv@intel.com>
# Date 1331112866 0
# Node ID 1f95b55ef427144fc32759445791037f6b2c358d
# Parent  1c0f76eea67d61fe6346e2fed879b6b80fc09beb
sched_credit: Use delay to control scheduling frequency

This patch can improve Xen performance:
1. Basically, the "delay method" can achieve 11% overall performance
boost for SPECvirt than original credit scheduler.
2. We have tried 1ms delay and 10ms delay, there is no big difference
between these two configurations. (1ms is enough to achieve a good
performance)
3. We have compared different load level response time/latency (low,
high, peak), "delay method" didn't bring very much response time
increase.
4. 1ms delay can reduce 30% context switch at peak performance, where
produces the benefits. (int sched_ratelimit_us = 1000 is the
recommended setting)

Signed-off-by: Hui Lv <hui.lv@intel.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24518:44c2856b1952
xen-unstable date:        Tue Jan 17 11:18:48 2012 +0000
---


diff -r 1c0f76eea67d -r 1f95b55ef427 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Wed Mar 07 09:33:45 2012 +0000
+++ b/xen/common/sched_credit.c	Wed Mar 07 09:34:26 2012 +0000
@@ -172,6 +172,7 @@
     uint32_t credit;
     int credit_balance;
     uint32_t runq_sort;
+    unsigned ratelimit_us;
     /* Period of master and tick in milliseconds */
     unsigned tslice_ms, tick_period_us, ticks_per_tslice;
     unsigned credits_per_tslice;
@@ -1298,10 +1299,15 @@
     struct csched_private *prv = CSCHED_PRIV(ops);
     struct csched_vcpu *snext;
     struct task_slice ret;
+    s_time_t runtime, tslice;
 
     CSCHED_STAT_CRANK(schedule);
     CSCHED_VCPU_CHECK(current);
 
+    runtime = now - current->runstate.state_entry_time;
+    if ( runtime < 0 ) /* Does this ever happen? */
+        runtime = 0;
+
     if ( !is_idle_vcpu(scurr->vcpu) )
     {
         /* Update credits of a non-idle VCPU. */
@@ -1314,6 +1320,35 @@
         scurr->pri = CSCHED_PRI_IDLE;
     }
 
+    /* Choices, choices:
+     * - If we have a tasklet, we need to run the idle vcpu no matter what.
+     * - If sched rate limiting is in effect, and the current vcpu has
+     *   run for less than that amount of time, continue the current one,
+     *   but with a shorter timeslice and return it immediately
+     * - Otherwise, chose the one with the highest priority (which may
+     *   be the one currently running)
+     * - If the currently running one is TS_OVER, see if there
+     *   is a higher priority one waiting on the runqueue of another
+     *   cpu and steal it.
+     */
+
+    /* If we have schedule rate limiting enabled, check to see
+     * how long we've run for. */
+    if ( !tasklet_work_scheduled
+         && prv->ratelimit_us
+         && vcpu_runnable(current)
+         && !is_idle_vcpu(current)
+         && runtime < MICROSECS(prv->ratelimit_us) )
+    {
+        snext = scurr;
+        snext->start_time += now;
+        perfc_incr(delay_ms);
+        tslice = MICROSECS(prv->ratelimit_us);
+        ret.migrated = 0;
+        goto out;
+    }
+    tslice = MILLISECS(prv->tslice_ms);
+
     /*
      * Select next runnable local VCPU (ie top of local runq)
      */
@@ -1368,11 +1403,12 @@
     if ( !is_idle_vcpu(snext->vcpu) )
         snext->start_time += now;
 
+out:
     /*
      * Return task to run next...
      */
     ret.time = (is_idle_vcpu(snext->vcpu) ?
-                -1 : MILLISECS(prv->tslice_ms));
+                -1 : tslice);
     ret.task = snext->vcpu;
 
     CSCHED_VCPU_CHECK(ret.task);
@@ -1522,6 +1558,15 @@
     prv->tick_period_us = prv->tslice_ms * 1000 / prv->ticks_per_tslice;
     prv->credits_per_tslice = CSCHED_CREDITS_PER_MSEC * prv->tslice_ms;
 
+    if ( MICROSECS(sched_ratelimit_us) > MILLISECS(sched_credit_tslice_ms) )
+    {
+        printk("WARNING: sched_ratelimit_us >" 
+               "sched_credit_tslice_ms is undefined\n"
+               "Setting ratelimit_us to 1000 * tslice_ms\n");
+        prv->ratelimit_us = 1000 * prv->tslice_ms;
+    }
+    else
+        prv->ratelimit_us = sched_ratelimit_us;
     return 0;
 }
 
diff -r 1c0f76eea67d -r 1f95b55ef427 xen/common/schedule.c
--- a/xen/common/schedule.c	Wed Mar 07 09:33:45 2012 +0000
+++ b/xen/common/schedule.c	Wed Mar 07 09:34:26 2012 +0000
@@ -47,6 +47,11 @@
 bool_t sched_smt_power_savings = 0;
 boolean_param("sched_smt_power_savings", sched_smt_power_savings);
 
+/* Default scheduling rate limit: 1ms 
+ * The behavior when sched_ratelimit_us is greater than sched_credit_tslice_ms is undefined
+ * */
+int sched_ratelimit_us = 1000;
+integer_param("sched_ratelimit_us", sched_ratelimit_us);
 /* Various timer handlers. */
 static void s_timer_fn(void *unused);
 static void vcpu_periodic_timer_fn(void *data);
diff -r 1c0f76eea67d -r 1f95b55ef427 xen/include/xen/perfc_defn.h
--- a/xen/include/xen/perfc_defn.h	Wed Mar 07 09:33:45 2012 +0000
+++ b/xen/include/xen/perfc_defn.h	Wed Mar 07 09:34:26 2012 +0000
@@ -16,6 +16,7 @@
 PERFCOUNTER(sched_run,              "sched: runs through scheduler")
 PERFCOUNTER(sched_ctx,              "sched: context switches")
 
+PERFCOUNTER(delay_ms,               "csched: delay")
 PERFCOUNTER(vcpu_check,             "csched: vcpu_check")
 PERFCOUNTER(schedule,               "csched: schedule")
 PERFCOUNTER(acct_run,               "csched: acct_run")
diff -r 1c0f76eea67d -r 1f95b55ef427 xen/include/xen/sched-if.h
--- a/xen/include/xen/sched-if.h	Wed Mar 07 09:33:45 2012 +0000
+++ b/xen/include/xen/sched-if.h	Wed Mar 07 09:34:26 2012 +0000
@@ -16,6 +16,11 @@
 /* cpus currently in no cpupool */
 extern cpumask_t cpupool_free_cpus;
 
+/* Scheduler generic parameters
+ * */
+extern int sched_ratelimit_us;
+
+
 /*
  * In order to allow a scheduler to remap the lock->cpu mapping,
  * we have a per-cpu pointer, along with a pre-allocated set of

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWu-0007t9-2Y; Wed, 07 Mar 2012 23:44: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 1S5QWs-0007fV-HU
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:22 +0000
Received: from [85.158.143.35:20331] by server-2.bemta-4.messagelabs.com id
	62/9C-17550-6D2F75F4; Wed, 07 Mar 2012 23:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1331163860!4021888!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4881 invoked from network); 7 Mar 2012 23:44:21 -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;
	7 Mar 2012 23:44: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 1S5QWq-0006iu-2h
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWq-000390-1P
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:20 +0000
Message-Id: <E1S5QWq-000390-1P@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:19 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] sched_credit: Use delay to
	control scheduling frequency
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Hui Lv <hui.lv@intel.com>
# Date 1331112866 0
# Node ID 1f95b55ef427144fc32759445791037f6b2c358d
# Parent  1c0f76eea67d61fe6346e2fed879b6b80fc09beb
sched_credit: Use delay to control scheduling frequency

This patch can improve Xen performance:
1. Basically, the "delay method" can achieve 11% overall performance
boost for SPECvirt than original credit scheduler.
2. We have tried 1ms delay and 10ms delay, there is no big difference
between these two configurations. (1ms is enough to achieve a good
performance)
3. We have compared different load level response time/latency (low,
high, peak), "delay method" didn't bring very much response time
increase.
4. 1ms delay can reduce 30% context switch at peak performance, where
produces the benefits. (int sched_ratelimit_us = 1000 is the
recommended setting)

Signed-off-by: Hui Lv <hui.lv@intel.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24518:44c2856b1952
xen-unstable date:        Tue Jan 17 11:18:48 2012 +0000
---


diff -r 1c0f76eea67d -r 1f95b55ef427 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Wed Mar 07 09:33:45 2012 +0000
+++ b/xen/common/sched_credit.c	Wed Mar 07 09:34:26 2012 +0000
@@ -172,6 +172,7 @@
     uint32_t credit;
     int credit_balance;
     uint32_t runq_sort;
+    unsigned ratelimit_us;
     /* Period of master and tick in milliseconds */
     unsigned tslice_ms, tick_period_us, ticks_per_tslice;
     unsigned credits_per_tslice;
@@ -1298,10 +1299,15 @@
     struct csched_private *prv = CSCHED_PRIV(ops);
     struct csched_vcpu *snext;
     struct task_slice ret;
+    s_time_t runtime, tslice;
 
     CSCHED_STAT_CRANK(schedule);
     CSCHED_VCPU_CHECK(current);
 
+    runtime = now - current->runstate.state_entry_time;
+    if ( runtime < 0 ) /* Does this ever happen? */
+        runtime = 0;
+
     if ( !is_idle_vcpu(scurr->vcpu) )
     {
         /* Update credits of a non-idle VCPU. */
@@ -1314,6 +1320,35 @@
         scurr->pri = CSCHED_PRI_IDLE;
     }
 
+    /* Choices, choices:
+     * - If we have a tasklet, we need to run the idle vcpu no matter what.
+     * - If sched rate limiting is in effect, and the current vcpu has
+     *   run for less than that amount of time, continue the current one,
+     *   but with a shorter timeslice and return it immediately
+     * - Otherwise, chose the one with the highest priority (which may
+     *   be the one currently running)
+     * - If the currently running one is TS_OVER, see if there
+     *   is a higher priority one waiting on the runqueue of another
+     *   cpu and steal it.
+     */
+
+    /* If we have schedule rate limiting enabled, check to see
+     * how long we've run for. */
+    if ( !tasklet_work_scheduled
+         && prv->ratelimit_us
+         && vcpu_runnable(current)
+         && !is_idle_vcpu(current)
+         && runtime < MICROSECS(prv->ratelimit_us) )
+    {
+        snext = scurr;
+        snext->start_time += now;
+        perfc_incr(delay_ms);
+        tslice = MICROSECS(prv->ratelimit_us);
+        ret.migrated = 0;
+        goto out;
+    }
+    tslice = MILLISECS(prv->tslice_ms);
+
     /*
      * Select next runnable local VCPU (ie top of local runq)
      */
@@ -1368,11 +1403,12 @@
     if ( !is_idle_vcpu(snext->vcpu) )
         snext->start_time += now;
 
+out:
     /*
      * Return task to run next...
      */
     ret.time = (is_idle_vcpu(snext->vcpu) ?
-                -1 : MILLISECS(prv->tslice_ms));
+                -1 : tslice);
     ret.task = snext->vcpu;
 
     CSCHED_VCPU_CHECK(ret.task);
@@ -1522,6 +1558,15 @@
     prv->tick_period_us = prv->tslice_ms * 1000 / prv->ticks_per_tslice;
     prv->credits_per_tslice = CSCHED_CREDITS_PER_MSEC * prv->tslice_ms;
 
+    if ( MICROSECS(sched_ratelimit_us) > MILLISECS(sched_credit_tslice_ms) )
+    {
+        printk("WARNING: sched_ratelimit_us >" 
+               "sched_credit_tslice_ms is undefined\n"
+               "Setting ratelimit_us to 1000 * tslice_ms\n");
+        prv->ratelimit_us = 1000 * prv->tslice_ms;
+    }
+    else
+        prv->ratelimit_us = sched_ratelimit_us;
     return 0;
 }
 
diff -r 1c0f76eea67d -r 1f95b55ef427 xen/common/schedule.c
--- a/xen/common/schedule.c	Wed Mar 07 09:33:45 2012 +0000
+++ b/xen/common/schedule.c	Wed Mar 07 09:34:26 2012 +0000
@@ -47,6 +47,11 @@
 bool_t sched_smt_power_savings = 0;
 boolean_param("sched_smt_power_savings", sched_smt_power_savings);
 
+/* Default scheduling rate limit: 1ms 
+ * The behavior when sched_ratelimit_us is greater than sched_credit_tslice_ms is undefined
+ * */
+int sched_ratelimit_us = 1000;
+integer_param("sched_ratelimit_us", sched_ratelimit_us);
 /* Various timer handlers. */
 static void s_timer_fn(void *unused);
 static void vcpu_periodic_timer_fn(void *data);
diff -r 1c0f76eea67d -r 1f95b55ef427 xen/include/xen/perfc_defn.h
--- a/xen/include/xen/perfc_defn.h	Wed Mar 07 09:33:45 2012 +0000
+++ b/xen/include/xen/perfc_defn.h	Wed Mar 07 09:34:26 2012 +0000
@@ -16,6 +16,7 @@
 PERFCOUNTER(sched_run,              "sched: runs through scheduler")
 PERFCOUNTER(sched_ctx,              "sched: context switches")
 
+PERFCOUNTER(delay_ms,               "csched: delay")
 PERFCOUNTER(vcpu_check,             "csched: vcpu_check")
 PERFCOUNTER(schedule,               "csched: schedule")
 PERFCOUNTER(acct_run,               "csched: acct_run")
diff -r 1c0f76eea67d -r 1f95b55ef427 xen/include/xen/sched-if.h
--- a/xen/include/xen/sched-if.h	Wed Mar 07 09:33:45 2012 +0000
+++ b/xen/include/xen/sched-if.h	Wed Mar 07 09:34:26 2012 +0000
@@ -16,6 +16,11 @@
 /* cpus currently in no cpupool */
 extern cpumask_t cpupool_free_cpus;
 
+/* Scheduler generic parameters
+ * */
+extern int sched_ratelimit_us;
+
+
 /*
  * In order to allow a scheduler to remap the lock->cpu mapping,
  * we have a per-cpu pointer, along with a pre-allocated set of

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWv-0007uu-6u; Wed, 07 Mar 2012 23:44:25 +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 1S5QWt-0007qf-7f
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:23 +0000
Received: from [85.158.138.51:64931] by server-4.bemta-3.messagelabs.com id
	42/A5-06141-6D2F75F4; Wed, 07 Mar 2012 23:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1331163859!16641851!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8797 invoked from network); 7 Mar 2012 23:44:21 -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;
	7 Mar 2012 23:44: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 1S5QWp-0006ir-Hu
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWp-00038b-GU
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:19 +0000
Message-Id: <E1S5QWp-00038b-GU@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:19 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen,
	credit1: Add variable timeslice
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331112825 0
# Node ID 1c0f76eea67d61fe6346e2fed879b6b80fc09beb
# Parent  f1b85192dbd8eb2da389648077bfd25b8a00a481
xen,credit1: Add variable timeslice

Add a xen command-line parameter, sched_credit_tslice_ms,
to set the timeslice of the credit1 scheduler.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
xen-unstable changeset:   23834:1d40b2793723
xen-unstable date:        Tue Sep 13 10:43:43 2011 +0100
---


diff -r f1b85192dbd8 -r 1c0f76eea67d xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Wed Mar 07 09:30:42 2012 +0000
+++ b/xen/common/sched_credit.c	Wed Mar 07 09:33:45 2012 +0000
@@ -41,15 +41,9 @@
  */
 #define CSCHED_DEFAULT_WEIGHT       256
 #define CSCHED_TICKS_PER_TSLICE     3
-#define CSCHED_TICKS_PER_ACCT       3
-#define CSCHED_MSECS_PER_TICK       10
-#define CSCHED_MSECS_PER_TSLICE     \
-    (CSCHED_MSECS_PER_TICK * CSCHED_TICKS_PER_TSLICE)
+/* Default timeslice: 30ms */
+#define CSCHED_DEFAULT_TSLICE_MS    30
 #define CSCHED_CREDITS_PER_MSEC     10
-#define CSCHED_CREDITS_PER_TSLICE   \
-    (CSCHED_CREDITS_PER_MSEC * CSCHED_MSECS_PER_TSLICE)
-#define CSCHED_CREDITS_PER_ACCT     \
-    (CSCHED_CREDITS_PER_MSEC * CSCHED_MSECS_PER_TICK * CSCHED_TICKS_PER_ACCT)
 
 
 /*
@@ -113,6 +107,8 @@
  */
 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);
 
 /*
  * Physical CPU
@@ -176,6 +172,9 @@
     uint32_t credit;
     int credit_balance;
     uint32_t runq_sort;
+    /* Period of master and tick in milliseconds */
+    unsigned tslice_ms, tick_period_us, ticks_per_tslice;
+    unsigned credits_per_tslice;
 };
 
 static void csched_tick(void *_cpu);
@@ -326,7 +325,7 @@
 
     spin_lock_irqsave(&prv->lock, flags);
 
-    prv->credit -= CSCHED_CREDITS_PER_ACCT;
+    prv->credit -= prv->credits_per_tslice;
     prv->ncpus--;
     cpu_clear(cpu, prv->idlers);
     cpu_clear(cpu, prv->cpus);
@@ -360,19 +359,19 @@
     spin_lock_irqsave(&prv->lock, flags);
 
     /* Initialize/update system-wide config */
-    prv->credit += CSCHED_CREDITS_PER_ACCT;
+    prv->credit += prv->credits_per_tslice;
     prv->ncpus++;
     cpu_set(cpu, prv->cpus);
     if ( prv->ncpus == 1 )
     {
         prv->master = cpu;
         init_timer(&prv->master_ticker, csched_acct, prv, cpu);
-        set_timer(&prv->master_ticker, NOW() +
-                  MILLISECS(CSCHED_MSECS_PER_TICK) * CSCHED_TICKS_PER_ACCT);
+        set_timer(&prv->master_ticker,
+                  NOW() + MILLISECS(prv->tslice_ms));
     }
 
     init_timer(&spc->ticker, csched_tick, (void *)(unsigned long)cpu, cpu);
-    set_timer(&spc->ticker, NOW() + MILLISECS(CSCHED_MSECS_PER_TICK));
+    set_timer(&spc->ticker, NOW() + MICROSECS(prv->tick_period_us) );
 
     INIT_LIST_HEAD(&spc->runq);
     spc->runq_sort_last = prv->runq_sort;
@@ -1000,7 +999,7 @@
          * for one full accounting period. We allow a domain to earn more
          * only when the system-wide credit balance is negative.
          */
-        credit_peak = sdom->active_vcpu_count * CSCHED_CREDITS_PER_ACCT;
+        credit_peak = sdom->active_vcpu_count * prv->credits_per_tslice;
         if ( prv->credit_balance < 0 )
         {
             credit_peak += ( ( -prv->credit_balance
@@ -1012,7 +1011,7 @@
 
         if ( sdom->cap != 0U )
         {
-            credit_cap = ((sdom->cap * CSCHED_CREDITS_PER_ACCT) + 99) / 100;
+            credit_cap = ((sdom->cap * prv->credits_per_tslice) + 99) / 100;
             if ( credit_cap < credit_peak )
                 credit_peak = credit_cap;
 
@@ -1090,10 +1089,10 @@
                 }
 
                 /* Lower bound on credits */
-                if ( credit < -CSCHED_CREDITS_PER_TSLICE )
+                if ( credit < -prv->credits_per_tslice )
                 {
                     CSCHED_STAT_CRANK(acct_min_credit);
-                    credit = -CSCHED_CREDITS_PER_TSLICE;
+                    credit = -prv->credits_per_tslice;
                     atomic_set(&svc->credit, credit);
                 }
             }
@@ -1115,7 +1114,7 @@
                 }
 
                 /* Upper bound on credits means VCPU stops earning */
-                if ( credit > CSCHED_CREDITS_PER_TSLICE )
+                if ( credit > prv->credits_per_tslice )
                 {
                     __csched_vcpu_acct_stop_locked(prv, svc);
                     /* Divide credits in half, so that when it starts
@@ -1139,8 +1138,8 @@
     prv->runq_sort++;
 
 out:
-    set_timer( &prv->master_ticker, NOW() +
-            MILLISECS(CSCHED_MSECS_PER_TICK) * CSCHED_TICKS_PER_ACCT );
+    set_timer( &prv->master_ticker,
+               NOW() + MILLISECS(prv->tslice_ms));
 }
 
 static void
@@ -1167,7 +1166,7 @@
      */
     csched_runq_sort(prv, cpu);
 
-    set_timer(&spc->ticker, NOW() + MILLISECS(CSCHED_MSECS_PER_TICK));
+    set_timer(&spc->ticker, NOW() + MICROSECS(prv->tick_period_us) );
 }
 
 static struct csched_vcpu *
@@ -1373,7 +1372,7 @@
      * Return task to run next...
      */
     ret.time = (is_idle_vcpu(snext->vcpu) ?
-                -1 : MILLISECS(CSCHED_MSECS_PER_TSLICE));
+                -1 : MILLISECS(prv->tslice_ms));
     ret.task = snext->vcpu;
 
     CSCHED_VCPU_CHECK(ret.task);
@@ -1463,10 +1462,9 @@
            "\tweight             = %u\n"
            "\trunq_sort          = %u\n"
            "\tdefault-weight     = %d\n"
-           "\tmsecs per tick     = %dms\n"
+           "\ttslice             = %dms\n"
            "\tcredits per msec   = %d\n"
            "\tticks per tslice   = %d\n"
-           "\tticks per acct     = %d\n"
            "\tmigration delay    = %uus\n",
            prv->ncpus,
            prv->master,
@@ -1475,10 +1473,9 @@
            prv->weight,
            prv->runq_sort,
            CSCHED_DEFAULT_WEIGHT,
-           CSCHED_MSECS_PER_TICK,
+           prv->tslice_ms,
            CSCHED_CREDITS_PER_MSEC,
-           CSCHED_TICKS_PER_TSLICE,
-           CSCHED_TICKS_PER_ACCT,
+           prv->ticks_per_tslice,
            vcpu_migration_delay);
 
     cpumask_scnprintf(idlers_buf, sizeof(idlers_buf), prv->idlers);
@@ -1518,6 +1515,13 @@
     INIT_LIST_HEAD(&prv->active_sdom);
     prv->master = UINT_MAX;
 
+    prv->tslice_ms = sched_credit_tslice_ms;
+    prv->ticks_per_tslice = CSCHED_TICKS_PER_TSLICE;
+    if ( prv->tslice_ms < prv->ticks_per_tslice )
+        prv->ticks_per_tslice = 1;
+    prv->tick_period_us = prv->tslice_ms * 1000 / prv->ticks_per_tslice;
+    prv->credits_per_tslice = CSCHED_CREDITS_PER_MSEC * prv->tslice_ms;
+
     return 0;
 }
 
@@ -1542,13 +1546,16 @@
 
 static void csched_tick_resume(const struct scheduler *ops, unsigned int cpu)
 {
+    struct csched_private *prv;
     struct csched_pcpu *spc;
     uint64_t now = NOW();
 
     spc = CSCHED_PCPU(cpu);
 
-    set_timer(&spc->ticker, now + MILLISECS(CSCHED_MSECS_PER_TICK)
-            - now % MILLISECS(CSCHED_MSECS_PER_TICK) );
+    prv = CSCHED_PRIV(ops);
+
+    set_timer(&spc->ticker, now + MICROSECS(prv->tick_period_us)
+            - now % MICROSECS(prv->tick_period_us) );
 }
 
 static struct csched_private _csched_priv;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWv-0007uu-6u; Wed, 07 Mar 2012 23:44:25 +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 1S5QWt-0007qf-7f
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:23 +0000
Received: from [85.158.138.51:64931] by server-4.bemta-3.messagelabs.com id
	42/A5-06141-6D2F75F4; Wed, 07 Mar 2012 23:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1331163859!16641851!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8797 invoked from network); 7 Mar 2012 23:44:21 -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;
	7 Mar 2012 23:44: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 1S5QWp-0006ir-Hu
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWp-00038b-GU
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:19 +0000
Message-Id: <E1S5QWp-00038b-GU@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:19 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen,
	credit1: Add variable timeslice
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331112825 0
# Node ID 1c0f76eea67d61fe6346e2fed879b6b80fc09beb
# Parent  f1b85192dbd8eb2da389648077bfd25b8a00a481
xen,credit1: Add variable timeslice

Add a xen command-line parameter, sched_credit_tslice_ms,
to set the timeslice of the credit1 scheduler.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
xen-unstable changeset:   23834:1d40b2793723
xen-unstable date:        Tue Sep 13 10:43:43 2011 +0100
---


diff -r f1b85192dbd8 -r 1c0f76eea67d xen/common/sched_credit.c
--- a/xen/common/sched_credit.c	Wed Mar 07 09:30:42 2012 +0000
+++ b/xen/common/sched_credit.c	Wed Mar 07 09:33:45 2012 +0000
@@ -41,15 +41,9 @@
  */
 #define CSCHED_DEFAULT_WEIGHT       256
 #define CSCHED_TICKS_PER_TSLICE     3
-#define CSCHED_TICKS_PER_ACCT       3
-#define CSCHED_MSECS_PER_TICK       10
-#define CSCHED_MSECS_PER_TSLICE     \
-    (CSCHED_MSECS_PER_TICK * CSCHED_TICKS_PER_TSLICE)
+/* Default timeslice: 30ms */
+#define CSCHED_DEFAULT_TSLICE_MS    30
 #define CSCHED_CREDITS_PER_MSEC     10
-#define CSCHED_CREDITS_PER_TSLICE   \
-    (CSCHED_CREDITS_PER_MSEC * CSCHED_MSECS_PER_TSLICE)
-#define CSCHED_CREDITS_PER_ACCT     \
-    (CSCHED_CREDITS_PER_MSEC * CSCHED_MSECS_PER_TICK * CSCHED_TICKS_PER_ACCT)
 
 
 /*
@@ -113,6 +107,8 @@
  */
 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);
 
 /*
  * Physical CPU
@@ -176,6 +172,9 @@
     uint32_t credit;
     int credit_balance;
     uint32_t runq_sort;
+    /* Period of master and tick in milliseconds */
+    unsigned tslice_ms, tick_period_us, ticks_per_tslice;
+    unsigned credits_per_tslice;
 };
 
 static void csched_tick(void *_cpu);
@@ -326,7 +325,7 @@
 
     spin_lock_irqsave(&prv->lock, flags);
 
-    prv->credit -= CSCHED_CREDITS_PER_ACCT;
+    prv->credit -= prv->credits_per_tslice;
     prv->ncpus--;
     cpu_clear(cpu, prv->idlers);
     cpu_clear(cpu, prv->cpus);
@@ -360,19 +359,19 @@
     spin_lock_irqsave(&prv->lock, flags);
 
     /* Initialize/update system-wide config */
-    prv->credit += CSCHED_CREDITS_PER_ACCT;
+    prv->credit += prv->credits_per_tslice;
     prv->ncpus++;
     cpu_set(cpu, prv->cpus);
     if ( prv->ncpus == 1 )
     {
         prv->master = cpu;
         init_timer(&prv->master_ticker, csched_acct, prv, cpu);
-        set_timer(&prv->master_ticker, NOW() +
-                  MILLISECS(CSCHED_MSECS_PER_TICK) * CSCHED_TICKS_PER_ACCT);
+        set_timer(&prv->master_ticker,
+                  NOW() + MILLISECS(prv->tslice_ms));
     }
 
     init_timer(&spc->ticker, csched_tick, (void *)(unsigned long)cpu, cpu);
-    set_timer(&spc->ticker, NOW() + MILLISECS(CSCHED_MSECS_PER_TICK));
+    set_timer(&spc->ticker, NOW() + MICROSECS(prv->tick_period_us) );
 
     INIT_LIST_HEAD(&spc->runq);
     spc->runq_sort_last = prv->runq_sort;
@@ -1000,7 +999,7 @@
          * for one full accounting period. We allow a domain to earn more
          * only when the system-wide credit balance is negative.
          */
-        credit_peak = sdom->active_vcpu_count * CSCHED_CREDITS_PER_ACCT;
+        credit_peak = sdom->active_vcpu_count * prv->credits_per_tslice;
         if ( prv->credit_balance < 0 )
         {
             credit_peak += ( ( -prv->credit_balance
@@ -1012,7 +1011,7 @@
 
         if ( sdom->cap != 0U )
         {
-            credit_cap = ((sdom->cap * CSCHED_CREDITS_PER_ACCT) + 99) / 100;
+            credit_cap = ((sdom->cap * prv->credits_per_tslice) + 99) / 100;
             if ( credit_cap < credit_peak )
                 credit_peak = credit_cap;
 
@@ -1090,10 +1089,10 @@
                 }
 
                 /* Lower bound on credits */
-                if ( credit < -CSCHED_CREDITS_PER_TSLICE )
+                if ( credit < -prv->credits_per_tslice )
                 {
                     CSCHED_STAT_CRANK(acct_min_credit);
-                    credit = -CSCHED_CREDITS_PER_TSLICE;
+                    credit = -prv->credits_per_tslice;
                     atomic_set(&svc->credit, credit);
                 }
             }
@@ -1115,7 +1114,7 @@
                 }
 
                 /* Upper bound on credits means VCPU stops earning */
-                if ( credit > CSCHED_CREDITS_PER_TSLICE )
+                if ( credit > prv->credits_per_tslice )
                 {
                     __csched_vcpu_acct_stop_locked(prv, svc);
                     /* Divide credits in half, so that when it starts
@@ -1139,8 +1138,8 @@
     prv->runq_sort++;
 
 out:
-    set_timer( &prv->master_ticker, NOW() +
-            MILLISECS(CSCHED_MSECS_PER_TICK) * CSCHED_TICKS_PER_ACCT );
+    set_timer( &prv->master_ticker,
+               NOW() + MILLISECS(prv->tslice_ms));
 }
 
 static void
@@ -1167,7 +1166,7 @@
      */
     csched_runq_sort(prv, cpu);
 
-    set_timer(&spc->ticker, NOW() + MILLISECS(CSCHED_MSECS_PER_TICK));
+    set_timer(&spc->ticker, NOW() + MICROSECS(prv->tick_period_us) );
 }
 
 static struct csched_vcpu *
@@ -1373,7 +1372,7 @@
      * Return task to run next...
      */
     ret.time = (is_idle_vcpu(snext->vcpu) ?
-                -1 : MILLISECS(CSCHED_MSECS_PER_TSLICE));
+                -1 : MILLISECS(prv->tslice_ms));
     ret.task = snext->vcpu;
 
     CSCHED_VCPU_CHECK(ret.task);
@@ -1463,10 +1462,9 @@
            "\tweight             = %u\n"
            "\trunq_sort          = %u\n"
            "\tdefault-weight     = %d\n"
-           "\tmsecs per tick     = %dms\n"
+           "\ttslice             = %dms\n"
            "\tcredits per msec   = %d\n"
            "\tticks per tslice   = %d\n"
-           "\tticks per acct     = %d\n"
            "\tmigration delay    = %uus\n",
            prv->ncpus,
            prv->master,
@@ -1475,10 +1473,9 @@
            prv->weight,
            prv->runq_sort,
            CSCHED_DEFAULT_WEIGHT,
-           CSCHED_MSECS_PER_TICK,
+           prv->tslice_ms,
            CSCHED_CREDITS_PER_MSEC,
-           CSCHED_TICKS_PER_TSLICE,
-           CSCHED_TICKS_PER_ACCT,
+           prv->ticks_per_tslice,
            vcpu_migration_delay);
 
     cpumask_scnprintf(idlers_buf, sizeof(idlers_buf), prv->idlers);
@@ -1518,6 +1515,13 @@
     INIT_LIST_HEAD(&prv->active_sdom);
     prv->master = UINT_MAX;
 
+    prv->tslice_ms = sched_credit_tslice_ms;
+    prv->ticks_per_tslice = CSCHED_TICKS_PER_TSLICE;
+    if ( prv->tslice_ms < prv->ticks_per_tslice )
+        prv->ticks_per_tslice = 1;
+    prv->tick_period_us = prv->tslice_ms * 1000 / prv->ticks_per_tslice;
+    prv->credits_per_tslice = CSCHED_CREDITS_PER_MSEC * prv->tslice_ms;
+
     return 0;
 }
 
@@ -1542,13 +1546,16 @@
 
 static void csched_tick_resume(const struct scheduler *ops, unsigned int cpu)
 {
+    struct csched_private *prv;
     struct csched_pcpu *spc;
     uint64_t now = NOW();
 
     spc = CSCHED_PCPU(cpu);
 
-    set_timer(&spc->ticker, now + MILLISECS(CSCHED_MSECS_PER_TICK)
-            - now % MILLISECS(CSCHED_MSECS_PER_TICK) );
+    prv = CSCHED_PRIV(ops);
+
+    set_timer(&spc->ticker, now + MICROSECS(prv->tick_period_us)
+            - now % MICROSECS(prv->tick_period_us) );
 }
 
 static struct csched_private _csched_priv;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWs-0007r7-T0; Wed, 07 Mar 2012 23:44: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 1S5QWr-0007l0-Dr
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:21 +0000
Received: from [85.158.138.51:26288] by server-12.bemta-3.messagelabs.com id
	A5/11-04338-5D2F75F4; Wed, 07 Mar 2012 23:44:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1331163859!14774734!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10164 invoked from network); 7 Mar 2012 23:44:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 23:44: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 1S5QWo-0006il-KE
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWo-00037t-G0
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:18 +0000
Message-Id: <E1S5QWo-00037t-G0@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:18 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: work around certain Intel
	BIOSes causing (transient) hangs during
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@novell.com>
# Date 1331112334 0
# Node ID 6c3a6fb7013da78ccddc2e6fd0467cd30bf334fe
# Parent  f141db2fe4c1600cd40e1737560f5841150a30b2
x86: work around certain Intel BIOSes causing (transient) hangs during
boot

They apparently leave the USB legacy emulation bits set in ICH10's
SMI Control and Enable register, but fail to handle the resulting SMIs
gracefully. The hangs can apparently extend indefinitely, but are
commonly observed to last between a few seconds and a minute.

This assumes that only ICH10-based systems on Intel main boards with
Intel BIOS may be affected. Until Intel comes up with a more precise
identification of affected BIOSes, all Intel ones on Intel boards
will get this workaround applied.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   23795:e17f70940d1f
xen-unstable date:        Sat Aug 27 12:14:38 2011 +0100
---


diff -r f141db2fe4c1 -r 6c3a6fb7013d xen/arch/x86/dmi_scan.c
--- a/xen/arch/x86/dmi_scan.c	Wed Mar 07 09:24:20 2012 +0000
+++ b/xen/arch/x86/dmi_scan.c	Wed Mar 07 09:25:34 2012 +0000
@@ -9,6 +9,8 @@
 #include <asm/io.h>
 #include <asm/system.h>
 #include <xen/dmi.h>
+#include <xen/pci.h>
+#include <xen/pci_regs.h>
 
 #define bt_ioremap(b,l)  ((u8 *)__acpi_map_table(b,l))
 #define bt_iounmap(b,l)  ((void)0)
@@ -188,6 +190,28 @@
 	return 0;
 }
 
+static int __init ich10_bios_quirk(struct dmi_system_id *d)
+{
+    u32 port, smictl;
+
+    if ( pci_conf_read16(0, 0x1f, 0, PCI_VENDOR_ID) != 0x8086 )
+        return 0;
+
+    switch ( pci_conf_read16(0, 0x1f, 0, PCI_DEVICE_ID) ) {
+    case 0x3a14:
+    case 0x3a16:
+    case 0x3a18:
+    case 0x3a1a:
+        port = (pci_conf_read16(0, 0x1f, 0, 0x40) & 0xff80) + 0x30;
+        smictl = inl(port);
+        /* turn off LEGACY_USB{,2}_EN if enabled */
+        if ( smictl & 0x20008 )
+            outl(smictl & ~0x20008, port);
+        break;
+    }
+
+    return 0;
+}
 
 #ifdef CONFIG_ACPI_SLEEP
 static __init int reset_videomode_after_s3(struct dmi_blacklist *d)
@@ -273,6 +297,18 @@
 			} },
 #endif
 
+	{ ich10_bios_quirk, "Intel board & BIOS",
+		/*
+		 * BIOS leaves legacy USB emulation enabled while
+		 * SMM can't properly handle it.
+		 */
+		{
+			MATCH(DMI_BOARD_VENDOR, "Intel Corp"),
+			MATCH(DMI_BIOS_VENDOR, "Intel Corp"),
+			NO_MATCH, NO_MATCH
+		}
+	},
+
 #ifdef	CONFIG_ACPI_BOOT
 	/*
 	 * If your system is blacklisted here, but you find that acpi=force

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWs-0007r7-T0; Wed, 07 Mar 2012 23:44: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 1S5QWr-0007l0-Dr
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:21 +0000
Received: from [85.158.138.51:26288] by server-12.bemta-3.messagelabs.com id
	A5/11-04338-5D2F75F4; Wed, 07 Mar 2012 23:44:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1331163859!14774734!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10164 invoked from network); 7 Mar 2012 23:44:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 23:44: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 1S5QWo-0006il-KE
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWo-00037t-G0
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:18 +0000
Message-Id: <E1S5QWo-00037t-G0@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:18 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: work around certain Intel
	BIOSes causing (transient) hangs during
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@novell.com>
# Date 1331112334 0
# Node ID 6c3a6fb7013da78ccddc2e6fd0467cd30bf334fe
# Parent  f141db2fe4c1600cd40e1737560f5841150a30b2
x86: work around certain Intel BIOSes causing (transient) hangs during
boot

They apparently leave the USB legacy emulation bits set in ICH10's
SMI Control and Enable register, but fail to handle the resulting SMIs
gracefully. The hangs can apparently extend indefinitely, but are
commonly observed to last between a few seconds and a minute.

This assumes that only ICH10-based systems on Intel main boards with
Intel BIOS may be affected. Until Intel comes up with a more precise
identification of affected BIOSes, all Intel ones on Intel boards
will get this workaround applied.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen-unstable changeset:   23795:e17f70940d1f
xen-unstable date:        Sat Aug 27 12:14:38 2011 +0100
---


diff -r f141db2fe4c1 -r 6c3a6fb7013d xen/arch/x86/dmi_scan.c
--- a/xen/arch/x86/dmi_scan.c	Wed Mar 07 09:24:20 2012 +0000
+++ b/xen/arch/x86/dmi_scan.c	Wed Mar 07 09:25:34 2012 +0000
@@ -9,6 +9,8 @@
 #include <asm/io.h>
 #include <asm/system.h>
 #include <xen/dmi.h>
+#include <xen/pci.h>
+#include <xen/pci_regs.h>
 
 #define bt_ioremap(b,l)  ((u8 *)__acpi_map_table(b,l))
 #define bt_iounmap(b,l)  ((void)0)
@@ -188,6 +190,28 @@
 	return 0;
 }
 
+static int __init ich10_bios_quirk(struct dmi_system_id *d)
+{
+    u32 port, smictl;
+
+    if ( pci_conf_read16(0, 0x1f, 0, PCI_VENDOR_ID) != 0x8086 )
+        return 0;
+
+    switch ( pci_conf_read16(0, 0x1f, 0, PCI_DEVICE_ID) ) {
+    case 0x3a14:
+    case 0x3a16:
+    case 0x3a18:
+    case 0x3a1a:
+        port = (pci_conf_read16(0, 0x1f, 0, 0x40) & 0xff80) + 0x30;
+        smictl = inl(port);
+        /* turn off LEGACY_USB{,2}_EN if enabled */
+        if ( smictl & 0x20008 )
+            outl(smictl & ~0x20008, port);
+        break;
+    }
+
+    return 0;
+}
 
 #ifdef CONFIG_ACPI_SLEEP
 static __init int reset_videomode_after_s3(struct dmi_blacklist *d)
@@ -273,6 +297,18 @@
 			} },
 #endif
 
+	{ ich10_bios_quirk, "Intel board & BIOS",
+		/*
+		 * BIOS leaves legacy USB emulation enabled while
+		 * SMM can't properly handle it.
+		 */
+		{
+			MATCH(DMI_BOARD_VENDOR, "Intel Corp"),
+			MATCH(DMI_BIOS_VENDOR, "Intel Corp"),
+			NO_MATCH, NO_MATCH
+		}
+	},
+
 #ifdef	CONFIG_ACPI_BOOT
 	/*
 	 * If your system is blacklisted here, but you find that acpi=force

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWv-0007w0-IN; Wed, 07 Mar 2012 23:44: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 1S5QWt-0007sR-Vk
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:24 +0000
Received: from [85.158.139.83:41549] by server-1.bemta-5.messagelabs.com id
	A2/72-28458-7D2F75F4; Wed, 07 Mar 2012 23:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1331163861!18355537!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3364 invoked from network); 7 Mar 2012 23:44:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 23:44: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 1S5QWq-0006iz-Ig
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWq-00039M-HM
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:20 +0000
Message-Id: <E1S5QWq-00039M-HM@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:20 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] libxc: Replace malloc with alloca
	in hot path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Santosh Jodh <santosh.jodh@citrix.com>
# Date 1331113150 0
# Node ID b7efb9e1a041f46baa9816025d8bf33dd1976db8
# Parent  1f95b55ef427144fc32759445791037f6b2c358d
libxc: Replace malloc with alloca in hot path

Replace malloc with alloc in hot paths for improved performance.

Signed-off-by: Santosh Jodh <santosh.jodh@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset:   24709:8ba7ae0b070b
xen-unstable date:        Tue Feb 07 18:46:50 2012 +0000
---


diff -r 1f95b55ef427 -r b7efb9e1a041 tools/libxc/xc_linux_osdep.c
--- a/tools/libxc/xc_linux_osdep.c	Wed Mar 07 09:34:26 2012 +0000
+++ b/tools/libxc/xc_linux_osdep.c	Wed Mar 07 09:39:10 2012 +0000
@@ -218,7 +218,7 @@
          * IOCTL_PRIVCMD_MMAPBATCH_V2 is not supported - fall back to
          * IOCTL_PRIVCMD_MMAPBATCH.
          */
-        xen_pfn_t *pfn = malloc(num * sizeof(*pfn));
+        xen_pfn_t *pfn = alloca(num * sizeof(*pfn));
 
         if ( pfn )
         {
@@ -264,8 +264,6 @@
                 break;
             }
 
-            free(pfn);
-
             if ( rc == -ENOENT && i == num )
                 rc = 0;
             else if ( rc )
@@ -532,7 +530,7 @@
     void *addr = NULL;
     int i;
 
-    map = malloc(sizeof(*map) +
+    map = alloca(sizeof(*map) +
                  (count - 1) * sizeof(struct ioctl_gntdev_map_grant_ref));
     if ( map == NULL )
         return NULL;
@@ -567,7 +565,6 @@
     }
 
  out:
-    free(map);
 
     return addr;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWv-0007w0-IN; Wed, 07 Mar 2012 23:44: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 1S5QWt-0007sR-Vk
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:24 +0000
Received: from [85.158.139.83:41549] by server-1.bemta-5.messagelabs.com id
	A2/72-28458-7D2F75F4; Wed, 07 Mar 2012 23:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-182.messagelabs.com!1331163861!18355537!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3364 invoked from network); 7 Mar 2012 23:44:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 23:44: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 1S5QWq-0006iz-Ig
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWq-00039M-HM
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:20 +0000
Message-Id: <E1S5QWq-00039M-HM@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:20 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] libxc: Replace malloc with alloca
	in hot path
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Santosh Jodh <santosh.jodh@citrix.com>
# Date 1331113150 0
# Node ID b7efb9e1a041f46baa9816025d8bf33dd1976db8
# Parent  1f95b55ef427144fc32759445791037f6b2c358d
libxc: Replace malloc with alloca in hot path

Replace malloc with alloc in hot paths for improved performance.

Signed-off-by: Santosh Jodh <santosh.jodh@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset:   24709:8ba7ae0b070b
xen-unstable date:        Tue Feb 07 18:46:50 2012 +0000
---


diff -r 1f95b55ef427 -r b7efb9e1a041 tools/libxc/xc_linux_osdep.c
--- a/tools/libxc/xc_linux_osdep.c	Wed Mar 07 09:34:26 2012 +0000
+++ b/tools/libxc/xc_linux_osdep.c	Wed Mar 07 09:39:10 2012 +0000
@@ -218,7 +218,7 @@
          * IOCTL_PRIVCMD_MMAPBATCH_V2 is not supported - fall back to
          * IOCTL_PRIVCMD_MMAPBATCH.
          */
-        xen_pfn_t *pfn = malloc(num * sizeof(*pfn));
+        xen_pfn_t *pfn = alloca(num * sizeof(*pfn));
 
         if ( pfn )
         {
@@ -264,8 +264,6 @@
                 break;
             }
 
-            free(pfn);
-
             if ( rc == -ENOENT && i == num )
                 rc = 0;
             else if ( rc )
@@ -532,7 +530,7 @@
     void *addr = NULL;
     int i;
 
-    map = malloc(sizeof(*map) +
+    map = alloca(sizeof(*map) +
                  (count - 1) * sizeof(struct ioctl_gntdev_map_grant_ref));
     if ( map == NULL )
         return NULL;
@@ -567,7 +565,6 @@
     }
 
  out:
-    free(map);
 
     return addr;
 }

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWv-0007vE-A4; Wed, 07 Mar 2012 23:44: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 1S5QWt-0007fV-HX
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:23 +0000
Received: from [85.158.143.35:58596] by server-2.bemta-4.messagelabs.com id
	55/9C-17550-7D2F75F4; Wed, 07 Mar 2012 23:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1331163861!9435881!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14371 invoked from network); 7 Mar 2012 23:44:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 23:44: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 1S5QWr-0006jH-JJ
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWr-0003A4-He
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:21 +0000
Message-Id: <E1S5QWr-0003A4-He@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:21 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] IO-APIC: Prevent using EOI
	broadcast suppression if user specified
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331117651 0
# Node ID dc7fc50b35948d3727ff11887041410948ab3629
# Parent  bcf1250a14e8b5f7a63d7b9311687ee8d98b7853
IO-APIC: Prevent using EOI broadcast suppression if user specified
ioapic_ack=new on the command line.

Currently, if EOI broadcast suppression is advertised on the BSP
LAPIC, Xen will discard any user specified option regarding IO-APIC
ack mode.

This patch introduces a check which prevents EOI Broadcast suppression
from forcing the IO-APIC ack mode to old if the user has explicitly
asked for the new ack mode on the command line.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24870:9bf3ec036bef
xen-unstable date:        Thu Feb 23 09:58:47 2012 +0000
---


diff -r bcf1250a14e8 -r dc7fc50b3594 xen/arch/x86/apic.c
--- a/xen/arch/x86/apic.c	Wed Mar 07 09:39:45 2012 +0000
+++ b/xen/arch/x86/apic.c	Wed Mar 07 10:54:11 2012 +0000
@@ -437,9 +437,15 @@
      */
     if ( reg0 & APIC_LVR_DIRECTED_EOI )
     {
-        ioapic_ack_new = 0;
-        directed_eoi_enabled = 1;
-        printk("Enabled directed EOI with ioapic_ack_old on!\n");
+        if ( ioapic_ack_new == 1 && ioapic_ack_forced == 1 )
+            printk("Not enabling directed EOI because ioapic_ack_new has been "
+                   "forced on the command line\n");
+        else
+        {
+            ioapic_ack_new = 0;
+            directed_eoi_enabled = 1;
+            printk("Enabled directed EOI with ioapic_ack_old on!\n");
+        }
     }
 
     /*
diff -r bcf1250a14e8 -r dc7fc50b3594 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Wed Mar 07 09:39:45 2012 +0000
+++ b/xen/arch/x86/io_apic.c	Wed Mar 07 10:54:11 2012 +0000
@@ -44,6 +44,7 @@
 static DEFINE_SPINLOCK(ioapic_lock);
 
 bool_t __read_mostly skip_ioapic_setup;
+bool_t __read_mostly ioapic_ack_forced = 0;
 
 #ifndef sis_apic_bug
 /*
@@ -1610,9 +1611,15 @@
 static void setup_ioapic_ack(char *s)
 {
     if ( !strcmp(s, "old") )
+    {
         ioapic_ack_new = 0;
+        ioapic_ack_forced = 1;
+    }
     else if ( !strcmp(s, "new") )
+    {
         ioapic_ack_new = 1;
+        ioapic_ack_forced = 1;
+    }
     else
         printk("Unknown ioapic_ack value specified: '%s'\n", s);
 }
diff -r bcf1250a14e8 -r dc7fc50b3594 xen/include/asm-x86/io_apic.h
--- a/xen/include/asm-x86/io_apic.h	Wed Mar 07 09:39:45 2012 +0000
+++ b/xen/include/asm-x86/io_apic.h	Wed Mar 07 10:54:11 2012 +0000
@@ -179,6 +179,7 @@
 
 /* 1 if "noapic" boot option passed */
 extern bool_t skip_ioapic_setup;
+extern bool_t ioapic_ack_forced;
 
 #ifdef CONFIG_ACPI_BOOT
 extern int io_apic_get_unique_id (int ioapic, int apic_id);

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWv-0007vU-DS; Wed, 07 Mar 2012 23:44: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 1S5QWt-0007rA-HJ
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:23 +0000
Received: from [85.158.143.35:20341] by server-1.bemta-4.messagelabs.com id
	CE/A8-20925-6D2F75F4; Wed, 07 Mar 2012 23:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1331163861!12840558!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15494 invoked from network); 7 Mar 2012 23:44:22 -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;
	7 Mar 2012 23:44: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 1S5QWr-0006j4-2V
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWr-00039i-18
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:21 +0000
Message-Id: <E1S5QWr-00039i-18@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:20 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] libxc: remove tests of alloca()
	return value
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331113185 0
# Node ID bcf1250a14e8b5f7a63d7b9311687ee8d98b7853
# Parent  b7efb9e1a041f46baa9816025d8bf33dd1976db8
libxc: remove tests of alloca() return value

alloca() does not return NULL on an allocation failure on Linux so
remove the unneccessary tests from this Linux-specific code.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: Santosh Jodh <santosh.jodh@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset:   24832:9cc7961d8f5c
xen-unstable date:        Mon Feb 20 17:31:49 2012 +0000
---


diff -r b7efb9e1a041 -r bcf1250a14e8 tools/libxc/xc_linux_osdep.c
--- a/tools/libxc/xc_linux_osdep.c	Wed Mar 07 09:39:10 2012 +0000
+++ b/tools/libxc/xc_linux_osdep.c	Wed Mar 07 09:39:45 2012 +0000
@@ -218,63 +218,54 @@
          * IOCTL_PRIVCMD_MMAPBATCH_V2 is not supported - fall back to
          * IOCTL_PRIVCMD_MMAPBATCH.
          */
+        privcmd_mmapbatch_t ioctlx;
         xen_pfn_t *pfn = alloca(num * sizeof(*pfn));
 
-        if ( pfn )
+        memcpy(pfn, arr, num * sizeof(*arr));
+
+        ioctlx.num = num;
+        ioctlx.dom = dom;
+        ioctlx.addr = (unsigned long)addr;
+        ioctlx.arr = pfn;
+
+        rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
+
+        rc = rc < 0 ? -errno : 0;
+
+        for ( i = 0; i < num; ++i )
         {
-            privcmd_mmapbatch_t ioctlx;
+            switch ( pfn[i] ^ arr[i] )
+            {
+            case 0:
+                err[i] = rc != -ENOENT ? rc : 0;
+                continue;
+            default:
+                err[i] = -EINVAL;
+                continue;
+            case XEN_DOMCTL_PFINFO_PAGEDTAB:
+                if ( rc != -ENOENT )
+                {
+                    err[i] = rc ?: -EINVAL;
+                    continue;
+                 }
+                rc = xc_map_foreign_batch_single(fd, dom, pfn + i,
+                        (unsigned long)addr + ((unsigned long)i<<XC_PAGE_SHIFT));
+                if ( rc < 0 )
+                {
+                    rc = -errno;
+                    break;
+                }
+                rc = -ENOENT;
+                continue;
+            }
+            break;
+        }
 
-            memcpy(pfn, arr, num * sizeof(*arr));
-
-            ioctlx.num = num;
-            ioctlx.dom = dom;
-            ioctlx.addr = (unsigned long)addr;
-            ioctlx.arr = pfn;
-
-            rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
-
-            rc = rc < 0 ? -errno : 0;
-
-            for ( i = 0; i < num; ++i )
-            {
-                switch ( pfn[i] ^ arr[i] )
-                {
-                case 0:
-                    err[i] = rc != -ENOENT ? rc : 0;
-                    continue;
-                default:
-                    err[i] = -EINVAL;
-                    continue;
-                case XEN_DOMCTL_PFINFO_PAGEDTAB:
-                    if ( rc != -ENOENT )
-                    {
-                        err[i] = rc ?: -EINVAL;
-                        continue;
-                    }
-                    rc = xc_map_foreign_batch_single(fd, dom, pfn + i,
-                        (unsigned long)addr + ((unsigned long)i<<XC_PAGE_SHIFT));
-                    if ( rc < 0 )
-                    {
-                        rc = -errno;
-                        break;
-                    }
-                    rc = -ENOENT;
-                    continue;
-                }
-                break;
-            }
-
-            if ( rc == -ENOENT && i == num )
-                rc = 0;
-            else if ( rc )
-            {
-                errno = -rc;
-                rc = -1;
-            }
-        }
-        else
+        if ( rc == -ENOENT && i == num )
+            rc = 0;
+        else if ( rc )
         {
-            errno = -ENOMEM;
+            errno = -rc;
             rc = -1;
         }
     }
@@ -532,8 +523,6 @@
 
     map = alloca(sizeof(*map) +
                  (count - 1) * sizeof(struct ioctl_gntdev_map_grant_ref));
-    if ( map == NULL )
-        return NULL;
 
     for ( i = 0; i < count; i++ )
     {

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWv-0007vU-DS; Wed, 07 Mar 2012 23:44: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 1S5QWt-0007rA-HJ
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:23 +0000
Received: from [85.158.143.35:20341] by server-1.bemta-4.messagelabs.com id
	CE/A8-20925-6D2F75F4; Wed, 07 Mar 2012 23:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1331163861!12840558!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15494 invoked from network); 7 Mar 2012 23:44:22 -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;
	7 Mar 2012 23:44: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 1S5QWr-0006j4-2V
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWr-00039i-18
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:21 +0000
Message-Id: <E1S5QWr-00039i-18@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:20 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] libxc: remove tests of alloca()
	return value
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331113185 0
# Node ID bcf1250a14e8b5f7a63d7b9311687ee8d98b7853
# Parent  b7efb9e1a041f46baa9816025d8bf33dd1976db8
libxc: remove tests of alloca() return value

alloca() does not return NULL on an allocation failure on Linux so
remove the unneccessary tests from this Linux-specific code.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Cc: Santosh Jodh <santosh.jodh@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
xen-unstable changeset:   24832:9cc7961d8f5c
xen-unstable date:        Mon Feb 20 17:31:49 2012 +0000
---


diff -r b7efb9e1a041 -r bcf1250a14e8 tools/libxc/xc_linux_osdep.c
--- a/tools/libxc/xc_linux_osdep.c	Wed Mar 07 09:39:10 2012 +0000
+++ b/tools/libxc/xc_linux_osdep.c	Wed Mar 07 09:39:45 2012 +0000
@@ -218,63 +218,54 @@
          * IOCTL_PRIVCMD_MMAPBATCH_V2 is not supported - fall back to
          * IOCTL_PRIVCMD_MMAPBATCH.
          */
+        privcmd_mmapbatch_t ioctlx;
         xen_pfn_t *pfn = alloca(num * sizeof(*pfn));
 
-        if ( pfn )
+        memcpy(pfn, arr, num * sizeof(*arr));
+
+        ioctlx.num = num;
+        ioctlx.dom = dom;
+        ioctlx.addr = (unsigned long)addr;
+        ioctlx.arr = pfn;
+
+        rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
+
+        rc = rc < 0 ? -errno : 0;
+
+        for ( i = 0; i < num; ++i )
         {
-            privcmd_mmapbatch_t ioctlx;
+            switch ( pfn[i] ^ arr[i] )
+            {
+            case 0:
+                err[i] = rc != -ENOENT ? rc : 0;
+                continue;
+            default:
+                err[i] = -EINVAL;
+                continue;
+            case XEN_DOMCTL_PFINFO_PAGEDTAB:
+                if ( rc != -ENOENT )
+                {
+                    err[i] = rc ?: -EINVAL;
+                    continue;
+                 }
+                rc = xc_map_foreign_batch_single(fd, dom, pfn + i,
+                        (unsigned long)addr + ((unsigned long)i<<XC_PAGE_SHIFT));
+                if ( rc < 0 )
+                {
+                    rc = -errno;
+                    break;
+                }
+                rc = -ENOENT;
+                continue;
+            }
+            break;
+        }
 
-            memcpy(pfn, arr, num * sizeof(*arr));
-
-            ioctlx.num = num;
-            ioctlx.dom = dom;
-            ioctlx.addr = (unsigned long)addr;
-            ioctlx.arr = pfn;
-
-            rc = ioctl(fd, IOCTL_PRIVCMD_MMAPBATCH, &ioctlx);
-
-            rc = rc < 0 ? -errno : 0;
-
-            for ( i = 0; i < num; ++i )
-            {
-                switch ( pfn[i] ^ arr[i] )
-                {
-                case 0:
-                    err[i] = rc != -ENOENT ? rc : 0;
-                    continue;
-                default:
-                    err[i] = -EINVAL;
-                    continue;
-                case XEN_DOMCTL_PFINFO_PAGEDTAB:
-                    if ( rc != -ENOENT )
-                    {
-                        err[i] = rc ?: -EINVAL;
-                        continue;
-                    }
-                    rc = xc_map_foreign_batch_single(fd, dom, pfn + i,
-                        (unsigned long)addr + ((unsigned long)i<<XC_PAGE_SHIFT));
-                    if ( rc < 0 )
-                    {
-                        rc = -errno;
-                        break;
-                    }
-                    rc = -ENOENT;
-                    continue;
-                }
-                break;
-            }
-
-            if ( rc == -ENOENT && i == num )
-                rc = 0;
-            else if ( rc )
-            {
-                errno = -rc;
-                rc = -1;
-            }
-        }
-        else
+        if ( rc == -ENOENT && i == num )
+            rc = 0;
+        else if ( rc )
         {
-            errno = -ENOMEM;
+            errno = -rc;
             rc = -1;
         }
     }
@@ -532,8 +523,6 @@
 
     map = alloca(sizeof(*map) +
                  (count - 1) * sizeof(struct ioctl_gntdev_map_grant_ref));
-    if ( map == NULL )
-        return NULL;
 
     for ( i = 0; i < count; i++ )
     {

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWv-0007vE-A4; Wed, 07 Mar 2012 23:44: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 1S5QWt-0007fV-HX
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:23 +0000
Received: from [85.158.143.35:58596] by server-2.bemta-4.messagelabs.com id
	55/9C-17550-7D2F75F4; Wed, 07 Mar 2012 23:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1331163861!9435881!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14371 invoked from network); 7 Mar 2012 23:44:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	7 Mar 2012 23:44: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 1S5QWr-0006jH-JJ
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWr-0003A4-He
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:21 +0000
Message-Id: <E1S5QWr-0003A4-He@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:21 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] IO-APIC: Prevent using EOI
	broadcast suppression if user specified
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331117651 0
# Node ID dc7fc50b35948d3727ff11887041410948ab3629
# Parent  bcf1250a14e8b5f7a63d7b9311687ee8d98b7853
IO-APIC: Prevent using EOI broadcast suppression if user specified
ioapic_ack=new on the command line.

Currently, if EOI broadcast suppression is advertised on the BSP
LAPIC, Xen will discard any user specified option regarding IO-APIC
ack mode.

This patch introduces a check which prevents EOI Broadcast suppression
from forcing the IO-APIC ack mode to old if the user has explicitly
asked for the new ack mode on the command line.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24870:9bf3ec036bef
xen-unstable date:        Thu Feb 23 09:58:47 2012 +0000
---


diff -r bcf1250a14e8 -r dc7fc50b3594 xen/arch/x86/apic.c
--- a/xen/arch/x86/apic.c	Wed Mar 07 09:39:45 2012 +0000
+++ b/xen/arch/x86/apic.c	Wed Mar 07 10:54:11 2012 +0000
@@ -437,9 +437,15 @@
      */
     if ( reg0 & APIC_LVR_DIRECTED_EOI )
     {
-        ioapic_ack_new = 0;
-        directed_eoi_enabled = 1;
-        printk("Enabled directed EOI with ioapic_ack_old on!\n");
+        if ( ioapic_ack_new == 1 && ioapic_ack_forced == 1 )
+            printk("Not enabling directed EOI because ioapic_ack_new has been "
+                   "forced on the command line\n");
+        else
+        {
+            ioapic_ack_new = 0;
+            directed_eoi_enabled = 1;
+            printk("Enabled directed EOI with ioapic_ack_old on!\n");
+        }
     }
 
     /*
diff -r bcf1250a14e8 -r dc7fc50b3594 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Wed Mar 07 09:39:45 2012 +0000
+++ b/xen/arch/x86/io_apic.c	Wed Mar 07 10:54:11 2012 +0000
@@ -44,6 +44,7 @@
 static DEFINE_SPINLOCK(ioapic_lock);
 
 bool_t __read_mostly skip_ioapic_setup;
+bool_t __read_mostly ioapic_ack_forced = 0;
 
 #ifndef sis_apic_bug
 /*
@@ -1610,9 +1611,15 @@
 static void setup_ioapic_ack(char *s)
 {
     if ( !strcmp(s, "old") )
+    {
         ioapic_ack_new = 0;
+        ioapic_ack_forced = 1;
+    }
     else if ( !strcmp(s, "new") )
+    {
         ioapic_ack_new = 1;
+        ioapic_ack_forced = 1;
+    }
     else
         printk("Unknown ioapic_ack value specified: '%s'\n", s);
 }
diff -r bcf1250a14e8 -r dc7fc50b3594 xen/include/asm-x86/io_apic.h
--- a/xen/include/asm-x86/io_apic.h	Wed Mar 07 09:39:45 2012 +0000
+++ b/xen/include/asm-x86/io_apic.h	Wed Mar 07 10:54:11 2012 +0000
@@ -179,6 +179,7 @@
 
 /* 1 if "noapic" boot option passed */
 extern bool_t skip_ioapic_setup;
+extern bool_t ioapic_ack_forced;
 
 #ifdef CONFIG_ACPI_BOOT
 extern int io_apic_get_unique_id (int ioapic, int apic_id);

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWx-00080f-Rt; Wed, 07 Mar 2012 23:44: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 1S5QWv-0007sR-Ls
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:25 +0000
Received: from [85.158.139.83:41614] by server-1.bemta-5.messagelabs.com id
	A7/72-28458-9D2F75F4; Wed, 07 Mar 2012 23:44:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1331163862!18356564!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29605 invoked from network); 7 Mar 2012 23:44:23 -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;
	7 Mar 2012 23:44: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 1S5QWs-0006jS-2T
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWs-0003AQ-19
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:22 +0000
Message-Id: <E1S5QWs-0003AQ-19@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:21 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xenoprof: Adjust indentation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331117905 0
# Node ID ed5c1ad51a236ee3b10c5dc1a86ae2217fa2a0f7
# Parent  dc7fc50b35948d3727ff11887041410948ab3629
xenoprof: Adjust indentation

Bring indentation into Xen hypervisor standard coding style.

No functional changes.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24536:212cf37d50e1
xen-unstable date:        Mon Jan 23 09:36:01 2012 +0000

xenoprof: Handle 32-bit guest stacks properly in a 64-bit hypervisor

The dump_guest_backtrace() function attempted to walk the stack
based on the assumption that the guest and hypervisor pointer sizes
were the same; thus any 32-bit guest running under 64-bit hypervisor
would have unreliable results.

In 64-bit mode, read the 32-bit stack frame properly.

Signed-off-by: Marcus Granado <marcus.granado@eu.citrix.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24537:3c0a533d3af0
xen-unstable date:        Mon Jan 23 09:36:29 2012 +0000

xenoprof: Use uint64_t explicitly for internal calls

A recent changeset to make XENOPROF_ESCAPE_CODE consistent across
32- and 64-bit builds caused a build failure, because values were
passed through functions as "unsigned long".  Replace these with
uint64_t explicitly.

Also remove redundant function prototype from perfmon.c, now that
it's in a header file.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24564:768c932ea8da
xen-unstable date:        Thu Jan 26 11:03:23 2012 +0000

xenoprof: Make the escape code consistent across 32 and  64-bit xen

At the moment, the xenoprof escape code is defined as "~0UL".
Unfortunately, this expands to 0xffffffff on 32-bit systems
and 0xffffffffffffffff on 64-bit systems; with the result that
while 32-on-32 and 64-in-64 work fine, 32-on-64 (also known as
"compat mode") is broken.

This patch makes the definition consistent across architectures.
In so doing, it will break old-32-bit-on-new-Xen, and vice versa;
but this was seen as an acceptable thing to do.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24565:1e27e827e6a8
xen-unstable date:        Thu Jan 26 11:03:50 2012 +0000
---


diff -r dc7fc50b3594 -r ed5c1ad51a23 xen/arch/ia64/xen/oprofile/perfmon.c
--- a/xen/arch/ia64/xen/oprofile/perfmon.c	Wed Mar 07 10:54:11 2012 +0000
+++ b/xen/arch/ia64/xen/oprofile/perfmon.c	Wed Mar 07 10:58:25 2012 +0000
@@ -38,8 +38,6 @@
 #include <asm/vmx.h>    /* for vmx_user_mode() */
 
 // XXX move them to an appropriate header file
-extern void xenoprof_log_event(struct vcpu *vcpu, struct pt_regs * regs,
-                               unsigned long eip, int mode, int event);
 extern int is_active(struct domain *d);
 
 static int allow_virq;
diff -r dc7fc50b3594 -r ed5c1ad51a23 xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Wed Mar 07 10:54:11 2012 +0000
+++ b/xen/arch/x86/oprofile/backtrace.c	Wed Mar 07 10:58:25 2012 +0000
@@ -16,48 +16,82 @@
 #include<asm/guest_access.h>
 
 struct frame_head {
-	struct frame_head * ebp;
-	unsigned long ret;
+    struct frame_head * ebp;
+    unsigned long ret;
 } __attribute__((packed));
 
+#ifdef CONFIG_X86_64
+struct frame_head_32bit {
+    uint32_t ebp;
+    unsigned long ret;
+} __attribute__((packed));
+#endif
+
 static struct frame_head *
 dump_hypervisor_backtrace(struct domain *d, struct vcpu *vcpu, 
 			  struct frame_head * head, int mode)
 {
-	if (!xenoprof_add_trace(d, vcpu, head->ret, mode))
-		return 0;
+    if (!xenoprof_add_trace(d, vcpu, head->ret, mode))
+        return 0;
+    
+    /* frame pointers should strictly progress back up the stack
+     * (towards higher addresses) */
+    if (head >= head->ebp)
+        return NULL;
+    
+    return head->ebp;
+}
 
-	/* frame pointers should strictly progress back up the stack
-	 * (towards higher addresses) */
-	if (head >= head->ebp)
-		return NULL;
-
-	return head->ebp;
+#ifdef CONFIG_X86_64
+static inline int is_32bit_vcpu(struct vcpu *vcpu)
+{
+    if (is_hvm_vcpu(vcpu))
+        return !hvm_long_mode_enabled(vcpu);
+    else
+        return is_pv_32bit_vcpu(vcpu);
 }
+#endif
 
 static struct frame_head *
 dump_guest_backtrace(struct domain *d, struct vcpu *vcpu, 
 		     struct frame_head * head, int mode)
 {
-	struct frame_head bufhead[2];
-	XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char);
-	
-	/* Also check accessibility of one struct frame_head beyond */
-	if (!guest_handle_okay(guest_head, sizeof(bufhead)))
-		return 0;
-	if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
-	    sizeof(bufhead)))
-		return 0;
+    struct frame_head bufhead[2];
+    XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char);
 
-	if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode))
-	    return 0;
-
-	/* frame pointers should strictly progress back up the stack
-	 * (towards higher addresses) */
-	if (head >= bufhead[0].ebp)
-		return NULL;
-
-	return bufhead[0].ebp;
+#ifdef CONFIG_X86_64
+    if ( is_32bit_vcpu(vcpu) )
+    {
+        struct frame_head_32bit bufhead32[2];
+        /* Also check accessibility of one struct frame_head beyond */
+        if (!guest_handle_okay(guest_head, sizeof(bufhead32)))
+            return 0;
+        if (__copy_from_guest_offset((char *)bufhead32, guest_head, 0, 
+                                     sizeof(bufhead32)))
+            return 0;
+        bufhead[0].ebp=(struct frame_head *)(unsigned long)bufhead32[0].ebp;
+        bufhead[0].ret=bufhead32[0].ret;
+    }
+    else
+#endif
+    {
+        /* Also check accessibility of one struct frame_head beyond */
+        if (!guest_handle_okay(guest_head, sizeof(bufhead)))
+            return 0;
+        if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
+                                     sizeof(bufhead)))
+            return 0;
+    }
+    
+    if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode))
+        return 0;
+    
+    /* frame pointers should strictly progress back up the stack
+     * (towards higher addresses) */
+    if (head >= bufhead[0].ebp)
+        return NULL;
+    
+    return bufhead[0].ebp;
 }
 
 /*
@@ -94,22 +128,22 @@
 static int valid_hypervisor_stack(struct frame_head * head, 
 				  struct cpu_user_regs * regs)
 {
-	unsigned long headaddr = (unsigned long)head;
+    unsigned long headaddr = (unsigned long)head;
 #ifdef CONFIG_X86_64
-	unsigned long stack = (unsigned long)regs->rsp;
+    unsigned long stack = (unsigned long)regs->rsp;
 #else
-	unsigned long stack = (unsigned long)regs;
+    unsigned long stack = (unsigned long)regs;
 #endif
-	unsigned long stack_base = (stack & ~(STACK_SIZE - 1)) + STACK_SIZE;
+    unsigned long stack_base = (stack & ~(STACK_SIZE - 1)) + STACK_SIZE;
 
-	return headaddr > stack && headaddr < stack_base;
+    return headaddr > stack && headaddr < stack_base;
 }
 #else
 /* without fp, it's just junk */
 static int valid_hypervisor_stack(struct frame_head * head, 
 				  struct cpu_user_regs * regs)
 {
-	return 0;
+    return 0;
 }
 #endif
 
@@ -117,16 +151,16 @@
 			struct cpu_user_regs * const regs,
 			unsigned long depth, int mode)
 {
-	struct frame_head *head;
+    struct frame_head *head;
 
-	head = (struct frame_head *)regs->ebp;
+    head = (struct frame_head *)regs->ebp;
 
-	if (mode > 1) {
-		while (depth-- && valid_hypervisor_stack(head, regs))
-		    head = dump_hypervisor_backtrace(d, vcpu, head, mode);
-		return;
-	}
+    if (mode > 1) {
+        while (depth-- && valid_hypervisor_stack(head, regs))
+            head = dump_hypervisor_backtrace(d, vcpu, head, mode);
+        return;
+    }
 
-	while (depth-- && head)
-	    head = dump_guest_backtrace(d, vcpu, head, mode);
+    while (depth-- && head)
+        head = dump_guest_backtrace(d, vcpu, head, mode);
 }
diff -r dc7fc50b3594 -r ed5c1ad51a23 xen/common/xenoprof.c
--- a/xen/common/xenoprof.c	Wed Mar 07 10:54:11 2012 +0000
+++ b/xen/common/xenoprof.c	Wed Mar 07 10:58:25 2012 +0000
@@ -479,7 +479,7 @@
 
 /* Check for space and add a sample. Return 1 if successful, 0 otherwise. */
 static int xenoprof_add_sample(struct domain *d, xenoprof_buf_t *buf,
-                               unsigned long eip, int mode, int event)
+                               uint64_t eip, int mode, int event)
 {
     int head, tail, size;
 
@@ -516,7 +516,7 @@
 }
 
 int xenoprof_add_trace(struct domain *d, struct vcpu *vcpu,
-                       unsigned long eip, int mode)
+                       uint64_t eip, int mode)
 {
     xenoprof_buf_t *buf = d->xenoprof->vcpu[vcpu->vcpu_id].buffer;
 
@@ -531,7 +531,7 @@
 }
 
 void xenoprof_log_event(struct vcpu *vcpu, 
-                        struct cpu_user_regs * regs, unsigned long eip, 
+                        struct cpu_user_regs * regs, uint64_t eip, 
                         int mode, int event)
 {
     struct domain *d = vcpu->domain;
diff -r dc7fc50b3594 -r ed5c1ad51a23 xen/include/public/xenoprof.h
--- a/xen/include/public/xenoprof.h	Wed Mar 07 10:54:11 2012 +0000
+++ b/xen/include/public/xenoprof.h	Wed Mar 07 10:58:25 2012 +0000
@@ -68,7 +68,7 @@
 };
 
 /* PC value that indicates a special code */
-#define XENOPROF_ESCAPE_CODE ~0UL
+#define XENOPROF_ESCAPE_CODE (~0ULL)
 /* Transient events for the xenoprof->oprofile cpu buf */
 #define XENOPROF_TRACE_BEGIN 1
 
diff -r dc7fc50b3594 -r ed5c1ad51a23 xen/include/xen/xenoprof.h
--- a/xen/include/xen/xenoprof.h	Wed Mar 07 10:54:11 2012 +0000
+++ b/xen/include/xen/xenoprof.h	Wed Mar 07 10:58:25 2012 +0000
@@ -69,7 +69,7 @@
 void free_xenoprof_pages(struct domain *d);
 
 int xenoprof_add_trace(struct domain *d, struct vcpu *v, 
-                       unsigned long eip, int mode);
+                       uint64_t eip, int mode);
 
 #define PMU_OWNER_NONE          0
 #define PMU_OWNER_XENOPROF      1
@@ -78,7 +78,7 @@
 void release_pmu_ownship(int pmu_ownership);
 
 void xenoprof_log_event(struct vcpu *vcpu,
-                        struct cpu_user_regs * regs, unsigned long eip,
+                        struct cpu_user_regs * regs, uint64_t eip,
                         int mode, int event);
 
 #endif  /* __XEN__XENOPROF_H__ */

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

From xen-changelog-bounces@lists.xen.org Wed Mar 07 23:44:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 07 Mar 2012 23:44:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S5QWx-00080f-Rt; Wed, 07 Mar 2012 23:44: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 1S5QWv-0007sR-Ls
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:25 +0000
Received: from [85.158.139.83:41614] by server-1.bemta-5.messagelabs.com id
	A7/72-28458-9D2F75F4; Wed, 07 Mar 2012 23:44:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1331163862!18356564!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29605 invoked from network); 7 Mar 2012 23:44:23 -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;
	7 Mar 2012 23:44: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 1S5QWs-0006jS-2T
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5QWs-0003AQ-19
	for xen-changelog@lists.xensource.com; Wed, 07 Mar 2012 23:44:22 +0000
Message-Id: <E1S5QWs-0003AQ-19@xenbits.xen.org>
Date: Wed, 07 Mar 2012 23:44:21 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xenoprof: Adjust indentation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331117905 0
# Node ID ed5c1ad51a236ee3b10c5dc1a86ae2217fa2a0f7
# Parent  dc7fc50b35948d3727ff11887041410948ab3629
xenoprof: Adjust indentation

Bring indentation into Xen hypervisor standard coding style.

No functional changes.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24536:212cf37d50e1
xen-unstable date:        Mon Jan 23 09:36:01 2012 +0000

xenoprof: Handle 32-bit guest stacks properly in a 64-bit hypervisor

The dump_guest_backtrace() function attempted to walk the stack
based on the assumption that the guest and hypervisor pointer sizes
were the same; thus any 32-bit guest running under 64-bit hypervisor
would have unreliable results.

In 64-bit mode, read the 32-bit stack frame properly.

Signed-off-by: Marcus Granado <marcus.granado@eu.citrix.com>
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24537:3c0a533d3af0
xen-unstable date:        Mon Jan 23 09:36:29 2012 +0000

xenoprof: Use uint64_t explicitly for internal calls

A recent changeset to make XENOPROF_ESCAPE_CODE consistent across
32- and 64-bit builds caused a build failure, because values were
passed through functions as "unsigned long".  Replace these with
uint64_t explicitly.

Also remove redundant function prototype from perfmon.c, now that
it's in a header file.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24564:768c932ea8da
xen-unstable date:        Thu Jan 26 11:03:23 2012 +0000

xenoprof: Make the escape code consistent across 32 and  64-bit xen

At the moment, the xenoprof escape code is defined as "~0UL".
Unfortunately, this expands to 0xffffffff on 32-bit systems
and 0xffffffffffffffff on 64-bit systems; with the result that
while 32-on-32 and 64-in-64 work fine, 32-on-64 (also known as
"compat mode") is broken.

This patch makes the definition consistent across architectures.
In so doing, it will break old-32-bit-on-new-Xen, and vice versa;
but this was seen as an acceptable thing to do.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24565:1e27e827e6a8
xen-unstable date:        Thu Jan 26 11:03:50 2012 +0000
---


diff -r dc7fc50b3594 -r ed5c1ad51a23 xen/arch/ia64/xen/oprofile/perfmon.c
--- a/xen/arch/ia64/xen/oprofile/perfmon.c	Wed Mar 07 10:54:11 2012 +0000
+++ b/xen/arch/ia64/xen/oprofile/perfmon.c	Wed Mar 07 10:58:25 2012 +0000
@@ -38,8 +38,6 @@
 #include <asm/vmx.h>    /* for vmx_user_mode() */
 
 // XXX move them to an appropriate header file
-extern void xenoprof_log_event(struct vcpu *vcpu, struct pt_regs * regs,
-                               unsigned long eip, int mode, int event);
 extern int is_active(struct domain *d);
 
 static int allow_virq;
diff -r dc7fc50b3594 -r ed5c1ad51a23 xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Wed Mar 07 10:54:11 2012 +0000
+++ b/xen/arch/x86/oprofile/backtrace.c	Wed Mar 07 10:58:25 2012 +0000
@@ -16,48 +16,82 @@
 #include<asm/guest_access.h>
 
 struct frame_head {
-	struct frame_head * ebp;
-	unsigned long ret;
+    struct frame_head * ebp;
+    unsigned long ret;
 } __attribute__((packed));
 
+#ifdef CONFIG_X86_64
+struct frame_head_32bit {
+    uint32_t ebp;
+    unsigned long ret;
+} __attribute__((packed));
+#endif
+
 static struct frame_head *
 dump_hypervisor_backtrace(struct domain *d, struct vcpu *vcpu, 
 			  struct frame_head * head, int mode)
 {
-	if (!xenoprof_add_trace(d, vcpu, head->ret, mode))
-		return 0;
+    if (!xenoprof_add_trace(d, vcpu, head->ret, mode))
+        return 0;
+    
+    /* frame pointers should strictly progress back up the stack
+     * (towards higher addresses) */
+    if (head >= head->ebp)
+        return NULL;
+    
+    return head->ebp;
+}
 
-	/* frame pointers should strictly progress back up the stack
-	 * (towards higher addresses) */
-	if (head >= head->ebp)
-		return NULL;
-
-	return head->ebp;
+#ifdef CONFIG_X86_64
+static inline int is_32bit_vcpu(struct vcpu *vcpu)
+{
+    if (is_hvm_vcpu(vcpu))
+        return !hvm_long_mode_enabled(vcpu);
+    else
+        return is_pv_32bit_vcpu(vcpu);
 }
+#endif
 
 static struct frame_head *
 dump_guest_backtrace(struct domain *d, struct vcpu *vcpu, 
 		     struct frame_head * head, int mode)
 {
-	struct frame_head bufhead[2];
-	XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char);
-	
-	/* Also check accessibility of one struct frame_head beyond */
-	if (!guest_handle_okay(guest_head, sizeof(bufhead)))
-		return 0;
-	if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
-	    sizeof(bufhead)))
-		return 0;
+    struct frame_head bufhead[2];
+    XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char);
 
-	if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode))
-	    return 0;
-
-	/* frame pointers should strictly progress back up the stack
-	 * (towards higher addresses) */
-	if (head >= bufhead[0].ebp)
-		return NULL;
-
-	return bufhead[0].ebp;
+#ifdef CONFIG_X86_64
+    if ( is_32bit_vcpu(vcpu) )
+    {
+        struct frame_head_32bit bufhead32[2];
+        /* Also check accessibility of one struct frame_head beyond */
+        if (!guest_handle_okay(guest_head, sizeof(bufhead32)))
+            return 0;
+        if (__copy_from_guest_offset((char *)bufhead32, guest_head, 0, 
+                                     sizeof(bufhead32)))
+            return 0;
+        bufhead[0].ebp=(struct frame_head *)(unsigned long)bufhead32[0].ebp;
+        bufhead[0].ret=bufhead32[0].ret;
+    }
+    else
+#endif
+    {
+        /* Also check accessibility of one struct frame_head beyond */
+        if (!guest_handle_okay(guest_head, sizeof(bufhead)))
+            return 0;
+        if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
+                                     sizeof(bufhead)))
+            return 0;
+    }
+    
+    if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode))
+        return 0;
+    
+    /* frame pointers should strictly progress back up the stack
+     * (towards higher addresses) */
+    if (head >= bufhead[0].ebp)
+        return NULL;
+    
+    return bufhead[0].ebp;
 }
 
 /*
@@ -94,22 +128,22 @@
 static int valid_hypervisor_stack(struct frame_head * head, 
 				  struct cpu_user_regs * regs)
 {
-	unsigned long headaddr = (unsigned long)head;
+    unsigned long headaddr = (unsigned long)head;
 #ifdef CONFIG_X86_64
-	unsigned long stack = (unsigned long)regs->rsp;
+    unsigned long stack = (unsigned long)regs->rsp;
 #else
-	unsigned long stack = (unsigned long)regs;
+    unsigned long stack = (unsigned long)regs;
 #endif
-	unsigned long stack_base = (stack & ~(STACK_SIZE - 1)) + STACK_SIZE;
+    unsigned long stack_base = (stack & ~(STACK_SIZE - 1)) + STACK_SIZE;
 
-	return headaddr > stack && headaddr < stack_base;
+    return headaddr > stack && headaddr < stack_base;
 }
 #else
 /* without fp, it's just junk */
 static int valid_hypervisor_stack(struct frame_head * head, 
 				  struct cpu_user_regs * regs)
 {
-	return 0;
+    return 0;
 }
 #endif
 
@@ -117,16 +151,16 @@
 			struct cpu_user_regs * const regs,
 			unsigned long depth, int mode)
 {
-	struct frame_head *head;
+    struct frame_head *head;
 
-	head = (struct frame_head *)regs->ebp;
+    head = (struct frame_head *)regs->ebp;
 
-	if (mode > 1) {
-		while (depth-- && valid_hypervisor_stack(head, regs))
-		    head = dump_hypervisor_backtrace(d, vcpu, head, mode);
-		return;
-	}
+    if (mode > 1) {
+        while (depth-- && valid_hypervisor_stack(head, regs))
+            head = dump_hypervisor_backtrace(d, vcpu, head, mode);
+        return;
+    }
 
-	while (depth-- && head)
-	    head = dump_guest_backtrace(d, vcpu, head, mode);
+    while (depth-- && head)
+        head = dump_guest_backtrace(d, vcpu, head, mode);
 }
diff -r dc7fc50b3594 -r ed5c1ad51a23 xen/common/xenoprof.c
--- a/xen/common/xenoprof.c	Wed Mar 07 10:54:11 2012 +0000
+++ b/xen/common/xenoprof.c	Wed Mar 07 10:58:25 2012 +0000
@@ -479,7 +479,7 @@
 
 /* Check for space and add a sample. Return 1 if successful, 0 otherwise. */
 static int xenoprof_add_sample(struct domain *d, xenoprof_buf_t *buf,
-                               unsigned long eip, int mode, int event)
+                               uint64_t eip, int mode, int event)
 {
     int head, tail, size;
 
@@ -516,7 +516,7 @@
 }
 
 int xenoprof_add_trace(struct domain *d, struct vcpu *vcpu,
-                       unsigned long eip, int mode)
+                       uint64_t eip, int mode)
 {
     xenoprof_buf_t *buf = d->xenoprof->vcpu[vcpu->vcpu_id].buffer;
 
@@ -531,7 +531,7 @@
 }
 
 void xenoprof_log_event(struct vcpu *vcpu, 
-                        struct cpu_user_regs * regs, unsigned long eip, 
+                        struct cpu_user_regs * regs, uint64_t eip, 
                         int mode, int event)
 {
     struct domain *d = vcpu->domain;
diff -r dc7fc50b3594 -r ed5c1ad51a23 xen/include/public/xenoprof.h
--- a/xen/include/public/xenoprof.h	Wed Mar 07 10:54:11 2012 +0000
+++ b/xen/include/public/xenoprof.h	Wed Mar 07 10:58:25 2012 +0000
@@ -68,7 +68,7 @@
 };
 
 /* PC value that indicates a special code */
-#define XENOPROF_ESCAPE_CODE ~0UL
+#define XENOPROF_ESCAPE_CODE (~0ULL)
 /* Transient events for the xenoprof->oprofile cpu buf */
 #define XENOPROF_TRACE_BEGIN 1
 
diff -r dc7fc50b3594 -r ed5c1ad51a23 xen/include/xen/xenoprof.h
--- a/xen/include/xen/xenoprof.h	Wed Mar 07 10:54:11 2012 +0000
+++ b/xen/include/xen/xenoprof.h	Wed Mar 07 10:58:25 2012 +0000
@@ -69,7 +69,7 @@
 void free_xenoprof_pages(struct domain *d);
 
 int xenoprof_add_trace(struct domain *d, struct vcpu *v, 
-                       unsigned long eip, int mode);
+                       uint64_t eip, int mode);
 
 #define PMU_OWNER_NONE          0
 #define PMU_OWNER_XENOPROF      1
@@ -78,7 +78,7 @@
 void release_pmu_ownship(int pmu_ownership);
 
 void xenoprof_log_event(struct vcpu *vcpu,
-                        struct cpu_user_regs * regs, unsigned long eip,
+                        struct cpu_user_regs * regs, uint64_t eip,
                         int mode, int event);
 
 #endif  /* __XEN__XENOPROF_H__ */

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 08:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 08: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 1S5YRO-0002sk-Dv; Thu, 08 Mar 2012 08:11:14 +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 1S5YRM-0002sf-Kt
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 08:11:12 +0000
Received: from [193.109.254.147:13228] by server-4.bemta-14.messagelabs.com id
	10/1E-08205-F99685F4; Thu, 08 Mar 2012 08:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1331194216!63841638!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26600 invoked from network); 8 Mar 2012 08:10:17 -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;
	8 Mar 2012 08:10: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 1S5YRJ-0005GJ-Oj
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 08:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5YRJ-0001ww-9J
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 08:11:09 +0000
Message-Id: <E1S5YRJ-0001ww-9J@xenbits.xen.org>
Date: Thu, 08 Mar 2012 08:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] provide a single,
	common implementation for get_order_from_{bytes, 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331117431 -3600
# Node ID f611200469159a960c3f0b975aa0f91ec768e29f
# Parent  f234e34ea28f753bba92980f367cf545666d69a1
provide a single, common implementation for get_order_from_{bytes,pages}()

All three per-architecture implementations were identical, and I cannot
see how future architectures would need any sort of customization here
(the only per-architecture aspect here is the actual PAGE_SHIFT value).

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


diff -r f234e34ea28f -r f61120046915 xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Wed Mar 07 10:59:18 2012 +0100
+++ b/xen/include/asm-arm/mm.h	Wed Mar 07 11:50:31 2012 +0100
@@ -202,25 +202,6 @@
 #define mfn_to_virt(mfn)  (maddr_to_virt((paddr_t)(mfn) << PAGE_SHIFT))
 
 
-static inline int get_order_from_bytes(paddr_t size)
-{
-    int order;
-    size = (size-1) >> PAGE_SHIFT;
-    for ( order = 0; size; order++ )
-        size >>= 1;
-    return order;
-}
-
-static inline int get_order_from_pages(unsigned long nr_pages)
-{
-    int order;
-    nr_pages--;
-    for ( order = 0; nr_pages; order++ )
-        nr_pages >>= 1;
-    return order;
-}
-
-
 /* Convert between Xen-heap virtual addresses and page-info structures. */
 static inline struct page_info *virt_to_page(const void *v)
 {
diff -r f234e34ea28f -r f61120046915 xen/include/asm-ia64/xenpage.h
--- a/xen/include/asm-ia64/xenpage.h	Wed Mar 07 10:59:18 2012 +0100
+++ b/xen/include/asm-ia64/xenpage.h	Wed Mar 07 11:50:31 2012 +0100
@@ -60,24 +60,6 @@
 	void *p;
 } xen_va;
 
-static inline int get_order_from_bytes(paddr_t size)
-{
-    int order;
-    size = (size-1) >> PAGE_SHIFT;
-    for ( order = 0; size; order++ )
-        size >>= 1;
-    return order;
-}
-
-static inline int get_order_from_pages(unsigned long nr_pages)
-{
-    int order;
-    nr_pages--;
-    for ( order = 0; nr_pages; order++ )
-        nr_pages >>= 1;
-    return order;
-}
-
 static inline int get_order_from_shift(unsigned long shift)
 {
     if (shift <= PAGE_SHIFT)
diff -r f234e34ea28f -r f61120046915 xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h	Wed Mar 07 10:59:18 2012 +0100
+++ b/xen/include/asm-x86/page.h	Wed Mar 07 11:50:31 2012 +0100
@@ -354,24 +354,6 @@
 
 #ifndef __ASSEMBLY__
 
-static inline int get_order_from_bytes(paddr_t size)
-{
-    int order;
-    size = (size-1) >> PAGE_SHIFT;
-    for ( order = 0; size; order++ )
-        size >>= 1;
-    return order;
-}
-
-static inline int get_order_from_pages(unsigned long nr_pages)
-{
-    int order;
-    nr_pages--;
-    for ( order = 0; nr_pages; order++ )
-        nr_pages >>= 1;
-    return order;
-}
-
 /* Allocator functions for Xen pagetables. */
 void *alloc_xen_pagetable(void);
 void free_xen_pagetable(void *v);
diff -r f234e34ea28f -r f61120046915 xen/include/xen/mm.h
--- a/xen/include/xen/mm.h	Wed Mar 07 10:59:18 2012 +0100
+++ b/xen/include/xen/mm.h	Wed Mar 07 11:50:31 2012 +0100
@@ -318,6 +318,28 @@
 # define page_list_splice(list, hd)        list_splice(list, hd)
 #endif
 
+static inline unsigned int get_order_from_bytes(paddr_t size)
+{
+    unsigned int order;
+
+    size = (size - 1) >> PAGE_SHIFT;
+    for ( order = 0; size; order++ )
+        size >>= 1;
+
+    return order;
+}
+
+static inline unsigned int get_order_from_pages(unsigned long nr_pages)
+{
+    unsigned int order;
+
+    nr_pages--;
+    for ( order = 0; nr_pages; order++ )
+        nr_pages >>= 1;
+
+    return order;
+}
+
 void scrub_one_page(struct page_info *);
 
 /* Returns 1 on success, 0 on error, negative if the ring

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 08:11:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 08: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 1S5YRO-0002sk-Dv; Thu, 08 Mar 2012 08:11:14 +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 1S5YRM-0002sf-Kt
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 08:11:12 +0000
Received: from [193.109.254.147:13228] by server-4.bemta-14.messagelabs.com id
	10/1E-08205-F99685F4; Thu, 08 Mar 2012 08:11:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1331194216!63841638!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26600 invoked from network); 8 Mar 2012 08:10:17 -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;
	8 Mar 2012 08:10: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 1S5YRJ-0005GJ-Oj
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 08:11:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5YRJ-0001ww-9J
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 08:11:09 +0000
Message-Id: <E1S5YRJ-0001ww-9J@xenbits.xen.org>
Date: Thu, 08 Mar 2012 08:11:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] provide a single,
	common implementation for get_order_from_{bytes, 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331117431 -3600
# Node ID f611200469159a960c3f0b975aa0f91ec768e29f
# Parent  f234e34ea28f753bba92980f367cf545666d69a1
provide a single, common implementation for get_order_from_{bytes,pages}()

All three per-architecture implementations were identical, and I cannot
see how future architectures would need any sort of customization here
(the only per-architecture aspect here is the actual PAGE_SHIFT value).

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


diff -r f234e34ea28f -r f61120046915 xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Wed Mar 07 10:59:18 2012 +0100
+++ b/xen/include/asm-arm/mm.h	Wed Mar 07 11:50:31 2012 +0100
@@ -202,25 +202,6 @@
 #define mfn_to_virt(mfn)  (maddr_to_virt((paddr_t)(mfn) << PAGE_SHIFT))
 
 
-static inline int get_order_from_bytes(paddr_t size)
-{
-    int order;
-    size = (size-1) >> PAGE_SHIFT;
-    for ( order = 0; size; order++ )
-        size >>= 1;
-    return order;
-}
-
-static inline int get_order_from_pages(unsigned long nr_pages)
-{
-    int order;
-    nr_pages--;
-    for ( order = 0; nr_pages; order++ )
-        nr_pages >>= 1;
-    return order;
-}
-
-
 /* Convert between Xen-heap virtual addresses and page-info structures. */
 static inline struct page_info *virt_to_page(const void *v)
 {
diff -r f234e34ea28f -r f61120046915 xen/include/asm-ia64/xenpage.h
--- a/xen/include/asm-ia64/xenpage.h	Wed Mar 07 10:59:18 2012 +0100
+++ b/xen/include/asm-ia64/xenpage.h	Wed Mar 07 11:50:31 2012 +0100
@@ -60,24 +60,6 @@
 	void *p;
 } xen_va;
 
-static inline int get_order_from_bytes(paddr_t size)
-{
-    int order;
-    size = (size-1) >> PAGE_SHIFT;
-    for ( order = 0; size; order++ )
-        size >>= 1;
-    return order;
-}
-
-static inline int get_order_from_pages(unsigned long nr_pages)
-{
-    int order;
-    nr_pages--;
-    for ( order = 0; nr_pages; order++ )
-        nr_pages >>= 1;
-    return order;
-}
-
 static inline int get_order_from_shift(unsigned long shift)
 {
     if (shift <= PAGE_SHIFT)
diff -r f234e34ea28f -r f61120046915 xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h	Wed Mar 07 10:59:18 2012 +0100
+++ b/xen/include/asm-x86/page.h	Wed Mar 07 11:50:31 2012 +0100
@@ -354,24 +354,6 @@
 
 #ifndef __ASSEMBLY__
 
-static inline int get_order_from_bytes(paddr_t size)
-{
-    int order;
-    size = (size-1) >> PAGE_SHIFT;
-    for ( order = 0; size; order++ )
-        size >>= 1;
-    return order;
-}
-
-static inline int get_order_from_pages(unsigned long nr_pages)
-{
-    int order;
-    nr_pages--;
-    for ( order = 0; nr_pages; order++ )
-        nr_pages >>= 1;
-    return order;
-}
-
 /* Allocator functions for Xen pagetables. */
 void *alloc_xen_pagetable(void);
 void free_xen_pagetable(void *v);
diff -r f234e34ea28f -r f61120046915 xen/include/xen/mm.h
--- a/xen/include/xen/mm.h	Wed Mar 07 10:59:18 2012 +0100
+++ b/xen/include/xen/mm.h	Wed Mar 07 11:50:31 2012 +0100
@@ -318,6 +318,28 @@
 # define page_list_splice(list, hd)        list_splice(list, hd)
 #endif
 
+static inline unsigned int get_order_from_bytes(paddr_t size)
+{
+    unsigned int order;
+
+    size = (size - 1) >> PAGE_SHIFT;
+    for ( order = 0; size; order++ )
+        size >>= 1;
+
+    return order;
+}
+
+static inline unsigned int get_order_from_pages(unsigned long nr_pages)
+{
+    unsigned int order;
+
+    nr_pages--;
+    for ( order = 0; nr_pages; order++ )
+        nr_pages >>= 1;
+
+    return order;
+}
+
 void scrub_one_page(struct page_info *);
 
 /* Returns 1 on success, 0 on error, negative if the ring

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUA-00062y-55; Thu, 08 Mar 2012 10:22: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 1S5aU8-00062L-Tz
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:13 +0000
Received: from [85.158.139.83:39458] by server-10.bemta-5.messagelabs.com id
	4C/E2-08260-458885F4; Thu, 08 Mar 2012 10:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1331202130!17512620!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26094 invoked from network); 8 Mar 2012 10:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Mar 2012 10: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 1S5aU6-0006nQ-Bo
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU6-0007lL-Ae
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:10 +0000
Message-Id: <E1S5aU6-0007lL-Ae@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:09 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86: small fixes to pcpu platform
	op handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110436 0
# Node ID e4c5791fb484274274af54b1fb5f58cd807d6ce0
# Parent  0cfc22ad014b709f614fecea0d5cd2bf78bd9ef9
x86: small fixes to pcpu platform op handling

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

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

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

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24201:9c6bea25f712
xen-unstable date:        Thu Nov 24 17:56:26 2011 +0100
---


diff -r 0cfc22ad014b -r e4c5791fb484 xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Wed Mar 07 08:51:51 2012 +0000
+++ b/xen/arch/x86/platform_hypercall.c	Wed Mar 07 08:53:56 2012 +0000
@@ -418,13 +418,14 @@
         if ( (g_info->xen_cpuid >= NR_CPUS) ||
              !cpu_present(g_info->xen_cpuid) )
         {
-            g_info->flags |= XEN_PCPU_FLAGS_INVALID;
+            g_info->flags = XEN_PCPU_FLAGS_INVALID;
         }
         else
         {
             g_info->apic_id = x86_cpu_to_apicid[g_info->xen_cpuid];
             g_info->acpi_id = acpi_get_processor_id(g_info->xen_cpuid);
             ASSERT(g_info->apic_id != BAD_APICID);
+            g_info->flags = 0;
             if (cpu_online(g_info->xen_cpuid))
                 g_info->flags |= XEN_PCPU_FLAGS_ONLINE;
         }
@@ -442,7 +443,7 @@
         int cpu;
 
         cpu = op->u.cpu_ol.cpuid;
-        if (!cpu_present(cpu))
+        if (cpu >= NR_CPUS || !cpu_present(cpu))
         {
             ret = -EINVAL;
             break;
@@ -462,15 +463,25 @@
         int cpu;
 
         cpu = op->u.cpu_ol.cpuid;
-        if (!cpu_present(cpu))
+
+        if ( cpu == 0 )
+        {
+            ret = -EOPNOTSUPP;
+            break;
+        }
+
+        if ( cpu >= NR_CPUS || !cpu_present(cpu) )
         {
             ret = -EINVAL;
             break;
-        } else if (!cpu_online(cpu))
+        }
+        
+        if (!cpu_online(cpu))
         {
             ret = 0;
             break;
         }
+
         ret = continue_hypercall_on_cpu(
           0, cpu_down_helper, (void *)(unsigned long)cpu);
         break;

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUA-00062y-55; Thu, 08 Mar 2012 10:22: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 1S5aU8-00062L-Tz
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:13 +0000
Received: from [85.158.139.83:39458] by server-10.bemta-5.messagelabs.com id
	4C/E2-08260-458885F4; Thu, 08 Mar 2012 10:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1331202130!17512620!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26094 invoked from network); 8 Mar 2012 10:22:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Mar 2012 10: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 1S5aU6-0006nQ-Bo
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU6-0007lL-Ae
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:10 +0000
Message-Id: <E1S5aU6-0007lL-Ae@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:09 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86: small fixes to pcpu platform
	op handling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110436 0
# Node ID e4c5791fb484274274af54b1fb5f58cd807d6ce0
# Parent  0cfc22ad014b709f614fecea0d5cd2bf78bd9ef9
x86: small fixes to pcpu platform op handling

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

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

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

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24201:9c6bea25f712
xen-unstable date:        Thu Nov 24 17:56:26 2011 +0100
---


diff -r 0cfc22ad014b -r e4c5791fb484 xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Wed Mar 07 08:51:51 2012 +0000
+++ b/xen/arch/x86/platform_hypercall.c	Wed Mar 07 08:53:56 2012 +0000
@@ -418,13 +418,14 @@
         if ( (g_info->xen_cpuid >= NR_CPUS) ||
              !cpu_present(g_info->xen_cpuid) )
         {
-            g_info->flags |= XEN_PCPU_FLAGS_INVALID;
+            g_info->flags = XEN_PCPU_FLAGS_INVALID;
         }
         else
         {
             g_info->apic_id = x86_cpu_to_apicid[g_info->xen_cpuid];
             g_info->acpi_id = acpi_get_processor_id(g_info->xen_cpuid);
             ASSERT(g_info->apic_id != BAD_APICID);
+            g_info->flags = 0;
             if (cpu_online(g_info->xen_cpuid))
                 g_info->flags |= XEN_PCPU_FLAGS_ONLINE;
         }
@@ -442,7 +443,7 @@
         int cpu;
 
         cpu = op->u.cpu_ol.cpuid;
-        if (!cpu_present(cpu))
+        if (cpu >= NR_CPUS || !cpu_present(cpu))
         {
             ret = -EINVAL;
             break;
@@ -462,15 +463,25 @@
         int cpu;
 
         cpu = op->u.cpu_ol.cpuid;
-        if (!cpu_present(cpu))
+
+        if ( cpu == 0 )
+        {
+            ret = -EOPNOTSUPP;
+            break;
+        }
+
+        if ( cpu >= NR_CPUS || !cpu_present(cpu) )
         {
             ret = -EINVAL;
             break;
-        } else if (!cpu_online(cpu))
+        }
+        
+        if (!cpu_online(cpu))
         {
             ret = 0;
             break;
         }
+
         ret = continue_hypercall_on_cpu(
           0, cpu_down_helper, (void *)(unsigned long)cpu);
         break;

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUA-00062t-2a; Thu, 08 Mar 2012 10:22: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 1S5aU8-00062G-6h
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:12 +0000
Received: from [85.158.139.83:42659] by server-12.bemta-5.messagelabs.com id
	BD/F0-05587-358885F4; Thu, 08 Mar 2012 10:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1331202129!18338950!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1116 invoked from network); 8 Mar 2012 10:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Mar 2012 10: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 1S5aU5-0006nK-Iq
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU5-0007kQ-CM
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:09 +0000
Message-Id: <E1S5aU5-0007kQ-CM@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:08 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/mm: change return code for
	log-dirty disabling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110287 0
# Node ID d4c7fac37dcf47d4ed8db9ab261d3fad229806a6
# Parent  b5575d7e462ee6ff0abb601b24a18978d4dd63f6
x86/mm: change return code for log-dirty disabling

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

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24190:6b3d8250ee2c
xen-unstable date:        Thu Nov 24 15:20:57 2011 +0000
---


diff -r b5575d7e462e -r d4c7fac37dcf xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Wed Mar 07 08:50:55 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Mar 07 08:51:27 2012 +0000
@@ -678,6 +678,8 @@
         return rc;
     case XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION:
         sc->mb = hap_get_allocation(d);
+        /* Fall through... */
+    case XEN_DOMCTL_SHADOW_OP_OFF:
         return 0;
     default:
         HAP_ERROR("Bad hap domctl op %u\n", sc->op);

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUA-00062t-2a; Thu, 08 Mar 2012 10:22: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 1S5aU8-00062G-6h
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:12 +0000
Received: from [85.158.139.83:42659] by server-12.bemta-5.messagelabs.com id
	BD/F0-05587-358885F4; Thu, 08 Mar 2012 10:22:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1331202129!18338950!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1116 invoked from network); 8 Mar 2012 10:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Mar 2012 10: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 1S5aU5-0006nK-Iq
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU5-0007kQ-CM
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:09 +0000
Message-Id: <E1S5aU5-0007kQ-CM@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:08 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/mm: change return code for
	log-dirty disabling
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110287 0
# Node ID d4c7fac37dcf47d4ed8db9ab261d3fad229806a6
# Parent  b5575d7e462ee6ff0abb601b24a18978d4dd63f6
x86/mm: change return code for log-dirty disabling

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

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24190:6b3d8250ee2c
xen-unstable date:        Thu Nov 24 15:20:57 2011 +0000
---


diff -r b5575d7e462e -r d4c7fac37dcf xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Wed Mar 07 08:50:55 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Mar 07 08:51:27 2012 +0000
@@ -678,6 +678,8 @@
         return rc;
     case XEN_DOMCTL_SHADOW_OP_GET_ALLOCATION:
         sc->mb = hap_get_allocation(d);
+        /* Fall through... */
+    case XEN_DOMCTL_SHADOW_OP_OFF:
         return 0;
     default:
         HAP_ERROR("Bad hap domctl op %u\n", sc->op);

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUB-00063W-Cg; Thu, 08 Mar 2012 10:22: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 1S5aU9-00062W-NF
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:13 +0000
Received: from [85.158.143.35:5131] by server-1.bemta-4.messagelabs.com id
	05/6E-20925-558885F4; Thu, 08 Mar 2012 10:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1331202131!12275331!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22894 invoked from network); 8 Mar 2012 10:22:12 -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;
	8 Mar 2012 10: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 1S5aU7-0006nT-3O
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU6-0007ln-Q6
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:10 +0000
Message-Id: <E1S5aU6-0007ln-Q6@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:10 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/mm: Don't lose track of the
	log dirty bitmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110464 0
# Node ID 32dbcf7567eae5cd6dc927bcce6b00cfcd5e9b18
# Parent  e4c5791fb484274274af54b1fb5f58cd807d6ce0
x86/mm: Don't lose track of the log dirty bitmap

hap_log_dirty_init unconditionally sets the top of the log dirty
bitmap to INVALID_MFN. If there had been a bitmap allocated, it is
then leaked, and the host crashes on an ASSERT when the domain is
cleaned up.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24282:a06cda9fb25f
xen-unstable date:        Thu Dec 01 14:17:16 2011 +0000
---


diff -r e4c5791fb484 -r 32dbcf7567ea xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Wed Mar 07 08:53:56 2012 +0000
+++ b/xen/arch/x86/mm/paging.c	Wed Mar 07 08:54:24 2012 +0000
@@ -621,7 +621,6 @@
     d->arch.paging.log_dirty.enable_log_dirty = enable_log_dirty;
     d->arch.paging.log_dirty.disable_log_dirty = disable_log_dirty;
     d->arch.paging.log_dirty.clean_dirty_bitmap = clean_dirty_bitmap;
-    d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
 }
 
 /* This function fress log dirty bitmap resources. */
@@ -642,6 +641,11 @@
     if ( (rc = p2m_init(d)) != 0 )
         return rc;
 
+    /* This must be initialized separately from the rest of the
+     * log-dirty init code as that can be called more than once and we
+     * don't want to leak any active log-dirty bitmaps */
+    d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
+
     /* The order of the *_init calls below is important, as the later
      * ones may rewrite some common fields.  Shadow pagetables are the
      * default... */

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUB-00063W-Cg; Thu, 08 Mar 2012 10:22: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 1S5aU9-00062W-NF
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:13 +0000
Received: from [85.158.143.35:5131] by server-1.bemta-4.messagelabs.com id
	05/6E-20925-558885F4; Thu, 08 Mar 2012 10:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-21.messagelabs.com!1331202131!12275331!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22894 invoked from network); 8 Mar 2012 10:22:12 -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;
	8 Mar 2012 10: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 1S5aU7-0006nT-3O
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU6-0007ln-Q6
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:10 +0000
Message-Id: <E1S5aU6-0007ln-Q6@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:10 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/mm: Don't lose track of the
	log dirty bitmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110464 0
# Node ID 32dbcf7567eae5cd6dc927bcce6b00cfcd5e9b18
# Parent  e4c5791fb484274274af54b1fb5f58cd807d6ce0
x86/mm: Don't lose track of the log dirty bitmap

hap_log_dirty_init unconditionally sets the top of the log dirty
bitmap to INVALID_MFN. If there had been a bitmap allocated, it is
then leaked, and the host crashes on an ASSERT when the domain is
cleaned up.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Tim Deegan <tim@xen.org>
xen-unstable changeset:   24282:a06cda9fb25f
xen-unstable date:        Thu Dec 01 14:17:16 2011 +0000
---


diff -r e4c5791fb484 -r 32dbcf7567ea xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Wed Mar 07 08:53:56 2012 +0000
+++ b/xen/arch/x86/mm/paging.c	Wed Mar 07 08:54:24 2012 +0000
@@ -621,7 +621,6 @@
     d->arch.paging.log_dirty.enable_log_dirty = enable_log_dirty;
     d->arch.paging.log_dirty.disable_log_dirty = disable_log_dirty;
     d->arch.paging.log_dirty.clean_dirty_bitmap = clean_dirty_bitmap;
-    d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
 }
 
 /* This function fress log dirty bitmap resources. */
@@ -642,6 +641,11 @@
     if ( (rc = p2m_init(d)) != 0 )
         return rc;
 
+    /* This must be initialized separately from the rest of the
+     * log-dirty init code as that can be called more than once and we
+     * don't want to leak any active log-dirty bitmaps */
+    d->arch.paging.log_dirty.top = _mfn(INVALID_MFN);
+
     /* The order of the *_init calls below is important, as the later
      * ones may rewrite some common fields.  Shadow pagetables are the
      * default... */

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUA-000633-85; Thu, 08 Mar 2012 10:22: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 1S5aU9-00062Q-49
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:13 +0000
Received: from [85.158.139.83:39467] by server-1.bemta-5.messagelabs.com id
	77/80-28458-458885F4; Thu, 08 Mar 2012 10:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1331202130!17757787!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3304 invoked from network); 8 Mar 2012 10:22:11 -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;
	8 Mar 2012 10: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 1S5aU6-0006nN-6h
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU5-0007ku-Rv
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:09 +0000
Message-Id: <E1S5aU5-0007ku-Rv@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:09 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] Trivial fix for rc val in hap
	track dirty vram
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110311 0
# Node ID 0cfc22ad014b709f614fecea0d5cd2bf78bd9ef9
# Parent  d4c7fac37dcf47d4ed8db9ab261d3fad229806a6
Trivial fix for rc val in hap track dirty vram

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24193:67d2ac426def
xen-unstable date:        Thu Nov 24 15:44:51 2011 +0000
---


diff -r d4c7fac37dcf -r 0cfc22ad014b xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Wed Mar 07 08:51:27 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Mar 07 08:51:51 2012 +0000
@@ -143,7 +143,7 @@
         }
         else if ( !paging_mode_log_dirty(d) && !dirty_vram )
         {
-            rc -ENOMEM;
+            rc = -ENOMEM;
             if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
                 goto param_fail;
 

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUA-000633-85; Thu, 08 Mar 2012 10:22: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 1S5aU9-00062Q-49
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:13 +0000
Received: from [85.158.139.83:39467] by server-1.bemta-5.messagelabs.com id
	77/80-28458-458885F4; Thu, 08 Mar 2012 10:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1331202130!17757787!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3304 invoked from network); 8 Mar 2012 10:22:11 -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;
	8 Mar 2012 10: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 1S5aU6-0006nN-6h
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU5-0007ku-Rv
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:09 +0000
Message-Id: <E1S5aU5-0007ku-Rv@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:09 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] Trivial fix for rc val in hap
	track dirty vram
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110311 0
# Node ID 0cfc22ad014b709f614fecea0d5cd2bf78bd9ef9
# Parent  d4c7fac37dcf47d4ed8db9ab261d3fad229806a6
Trivial fix for rc val in hap track dirty vram

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24193:67d2ac426def
xen-unstable date:        Thu Nov 24 15:44:51 2011 +0000
---


diff -r d4c7fac37dcf -r 0cfc22ad014b xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Wed Mar 07 08:51:27 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Wed Mar 07 08:51:51 2012 +0000
@@ -143,7 +143,7 @@
         }
         else if ( !paging_mode_log_dirty(d) && !dirty_vram )
         {
-            rc -ENOMEM;
+            rc = -ENOMEM;
             if ( (dirty_vram = xmalloc(struct sh_dirty_vram)) == NULL )
                 goto param_fail;
 

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUA-000638-AE; Thu, 08 Mar 2012 10:22:14 +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 1S5aU9-00062C-9e
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:13 +0000
Received: from [193.109.254.147:60888] by server-4.bemta-14.messagelabs.com id
	2E/C6-08205-458885F4; Thu, 08 Mar 2012 10:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1331202098!60036772!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24469 invoked from network); 8 Mar 2012 10:21:39 -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;
	8 Mar 2012 10:21:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU7-0006nW-B6
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU7-0007mG-9V
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:11 +0000
Message-Id: <E1S5aU7-0007mG-9V@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:10 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] KEXEC: fix kexec_get_range_compat
	to fail vocally.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110557 0
# Node ID fef96d88043052964759a2c00d042af071588b59
# Parent  32dbcf7567eae5cd6dc927bcce6b00cfcd5e9b18
KEXEC: fix kexec_get_range_compat to fail vocally.

Fail with -ERANGE rather than silently truncating 64bit values (a
physical address and size) into 32bit integers for dom0 to consume.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Simplify the bitwise arithmetic a bit.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24358:9961a6d5356a
xen-unstable date:        Mon Dec 05 19:42:46 2011 +0000
---


diff -r 32dbcf7567ea -r fef96d880430 xen/common/kexec.c
--- a/xen/common/kexec.c	Wed Mar 07 08:54:24 2012 +0000
+++ b/xen/common/kexec.c	Wed Mar 07 08:55:57 2012 +0000
@@ -295,6 +295,10 @@
 
     ret = kexec_get_range_internal(&range);
 
+    /* Dont silently truncate physical addresses or sizes. */
+    if ( (range.start | range.size) & ~(unsigned long)(~0u) )
+        return -ERANGE;
+
     if ( ret == 0 ) {
         XLAT_kexec_range(&compat_range, &range);
         if ( unlikely(copy_to_guest(uarg, &compat_range, 1)) )

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUA-000638-AE; Thu, 08 Mar 2012 10:22:14 +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 1S5aU9-00062C-9e
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:13 +0000
Received: from [193.109.254.147:60888] by server-4.bemta-14.messagelabs.com id
	2E/C6-08205-458885F4; Thu, 08 Mar 2012 10:22:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-27.messagelabs.com!1331202098!60036772!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24469 invoked from network); 8 Mar 2012 10:21:39 -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;
	8 Mar 2012 10:21:39 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU7-0006nW-B6
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU7-0007mG-9V
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:11 +0000
Message-Id: <E1S5aU7-0007mG-9V@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:10 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] KEXEC: fix kexec_get_range_compat
	to fail vocally.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110557 0
# Node ID fef96d88043052964759a2c00d042af071588b59
# Parent  32dbcf7567eae5cd6dc927bcce6b00cfcd5e9b18
KEXEC: fix kexec_get_range_compat to fail vocally.

Fail with -ERANGE rather than silently truncating 64bit values (a
physical address and size) into 32bit integers for dom0 to consume.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Simplify the bitwise arithmetic a bit.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24358:9961a6d5356a
xen-unstable date:        Mon Dec 05 19:42:46 2011 +0000
---


diff -r 32dbcf7567ea -r fef96d880430 xen/common/kexec.c
--- a/xen/common/kexec.c	Wed Mar 07 08:54:24 2012 +0000
+++ b/xen/common/kexec.c	Wed Mar 07 08:55:57 2012 +0000
@@ -295,6 +295,10 @@
 
     ret = kexec_get_range_internal(&range);
 
+    /* Dont silently truncate physical addresses or sizes. */
+    if ( (range.start | range.size) & ~(unsigned long)(~0u) )
+        return -ERANGE;
+
     if ( ret == 0 ) {
         XLAT_kexec_range(&compat_range, &range);
         if ( unlikely(copy_to_guest(uarg, &compat_range, 1)) )

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUB-00063b-FA; Thu, 08 Mar 2012 10: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 1S5aUA-00062L-JI
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:14 +0000
Received: from [85.158.139.83:42929] by server-10.bemta-5.messagelabs.com id
	2E/03-08260-658885F4; Thu, 08 Mar 2012 10:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1331202132!15705782!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29194 invoked from network); 8 Mar 2012 10:22: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 Mar 2012 10: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 1S5aU8-0006nc-DE
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU8-0007nD-8T
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:12 +0000
Message-Id: <E1S5aU8-0007nD-8T@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:11 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] Fix build after previous
	changeset.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331111051 0
# Node ID 35ee60fe531f5a8e10b5ad314dfa287a3c09265d
# Parent  cf5751788c49ee25db5c9280d6dc9ea3e6b8f97a
Fix build after previous changeset.

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


diff -r cf5751788c49 -r 35ee60fe531f xen/arch/x86/cpu/mcheck/mce_amd_quirks.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Wed Mar 07 08:56:28 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Wed Mar 07 09:04:11 2012 +0000
@@ -19,6 +19,7 @@
 
 #include <asm-x86/msr.h>
 #include <asm-x86/processor.h>
+#include <xen/errno.h>
 
 #include "mce_quirks.h"
 
@@ -56,7 +57,7 @@
 
 int mcequirk_amd_apply(enum mcequirk_amd_flags flags)
 {
-	u64 val;
+    u32 lo, hi;
 
 	switch (flags) {
 	case MCEQUIRK_K7_BANK0:
@@ -72,8 +73,8 @@
 		wrmsrl(MSR_IA32_MC4_STATUS, 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));
+            if (rdmsr_safe(MSR_AMD64_MCx_MASK(4), lo, hi) == 0)
+                    wrmsr_safe(MSR_AMD64_MCx_MASK(4), lo | (1 << 10), hi);
 		break;
 	}
 

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUB-00063b-FA; Thu, 08 Mar 2012 10: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 1S5aUA-00062L-JI
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:14 +0000
Received: from [85.158.139.83:42929] by server-10.bemta-5.messagelabs.com id
	2E/03-08260-658885F4; Thu, 08 Mar 2012 10:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1331202132!15705782!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29194 invoked from network); 8 Mar 2012 10:22: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 Mar 2012 10: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 1S5aU8-0006nc-DE
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU8-0007nD-8T
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:12 +0000
Message-Id: <E1S5aU8-0007nD-8T@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:11 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] Fix build after previous
	changeset.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331111051 0
# Node ID 35ee60fe531f5a8e10b5ad314dfa287a3c09265d
# Parent  cf5751788c49ee25db5c9280d6dc9ea3e6b8f97a
Fix build after previous changeset.

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


diff -r cf5751788c49 -r 35ee60fe531f xen/arch/x86/cpu/mcheck/mce_amd_quirks.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Wed Mar 07 08:56:28 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Wed Mar 07 09:04:11 2012 +0000
@@ -19,6 +19,7 @@
 
 #include <asm-x86/msr.h>
 #include <asm-x86/processor.h>
+#include <xen/errno.h>
 
 #include "mce_quirks.h"
 
@@ -56,7 +57,7 @@
 
 int mcequirk_amd_apply(enum mcequirk_amd_flags flags)
 {
-	u64 val;
+    u32 lo, hi;
 
 	switch (flags) {
 	case MCEQUIRK_K7_BANK0:
@@ -72,8 +73,8 @@
 		wrmsrl(MSR_IA32_MC4_STATUS, 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));
+            if (rdmsr_safe(MSR_AMD64_MCx_MASK(4), lo, hi) == 0)
+                    wrmsr_safe(MSR_AMD64_MCx_MASK(4), lo | (1 << 10), hi);
 		break;
 	}
 

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUD-000657-Hi; Thu, 08 Mar 2012 10:22: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 1S5aUC-00062W-1U
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:16 +0000
Received: from [85.158.143.99:27519] by server-1.bemta-4.messagelabs.com id
	44/9E-20925-758885F4; Thu, 08 Mar 2012 10:22:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1331202133!11916868!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3080 invoked from network); 8 Mar 2012 10:22:14 -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;
	8 Mar 2012 10:22: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 1S5aU8-0006nf-QO
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU8-0007nj-Oi
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:12 +0000
Message-Id: <E1S5aU8-0007nj-Oi@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:12 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/emulator: workaround for AMD
	erratum 573
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331111120 0
# Node ID 26bf0e10596e0058529aa525d8e154aa67afe7d2
# Parent  35ee60fe531f5a8e10b5ad314dfa287a3c09265d
x86/emulator: workaround for AMD erratum 573

The only cases where we might end up emulating fsincos (as any other
x87 operations without memory operands) are
- when a HVM guest is in real mode (not applicable on AMD)
- between two half page table updates in PAE mode (unlikely, and not
  doing the emulation here does affect only performance, not
  correctness)
- when a guest maliciously (or erroneously) modifies an (MMIO or page
  table update) instruction under emulation (unspecified behavior)

Hence, in order to avoid the erratum to cause harm to the entire host,
don't emulate fsincos on the affected AMD CPU families.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24417:1452fb248cd5
xen-unstable date:        Fri Dec 16 15:45:40 2011 +0100
---


diff -r 35ee60fe531f -r 26bf0e10596e tools/tests/x86_emulate.c
--- a/tools/tests/x86_emulate.c	Wed Mar 07 09:04:11 2012 +0000
+++ b/tools/tests/x86_emulate.c	Wed Mar 07 09:05:20 2012 +0000
@@ -3,5 +3,7 @@
 #include <string.h>
 #include <public/xen.h>
 
+#define cpu_has_amd_erratum(nr) 0
+
 #include "x86_emulate/x86_emulate.h"
 #include "x86_emulate/x86_emulate.c"
diff -r 35ee60fe531f -r 26bf0e10596e xen/arch/x86/x86_emulate.c
--- a/xen/arch/x86/x86_emulate.c	Wed Mar 07 09:04:11 2012 +0000
+++ b/xen/arch/x86/x86_emulate.c	Wed Mar 07 09:05:20 2012 +0000
@@ -10,8 +10,15 @@
  */
 
 #include <asm/x86_emulate.h>
+#include <asm/processor.h> /* current_cpu_info */
+#include <asm/amd.h> /* cpu_has_amd_erratum() */
 
 /* Avoid namespace pollution. */
 #undef cmpxchg
+#undef cpuid
+#undef wbinvd
+
+#define cpu_has_amd_erratum(nr) \
+        cpu_has_amd_erratum(&current_cpu_data, AMD_ERRATUM_##nr)
 
 #include "x86_emulate/x86_emulate.c"
diff -r 35ee60fe531f -r 26bf0e10596e xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Wed Mar 07 09:04:11 2012 +0000
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Wed Mar 07 09:05:20 2012 +0000
@@ -2578,6 +2578,9 @@
     case 0xd9: /* FPU 0xd9 */
         switch ( modrm )
         {
+        case 0xfb: /* fsincos */
+            fail_if(cpu_has_amd_erratum(573));
+            /* fall through */
         case 0xc0 ... 0xc7: /* fld %stN */
         case 0xc8 ... 0xcf: /* fxch %stN */
         case 0xd0: /* fnop */
@@ -2603,7 +2606,6 @@
         case 0xf8: /* fprem */
         case 0xf9: /* fyl2xp1 */
         case 0xfa: /* fsqrt */
-        case 0xfb: /* fsincos */
         case 0xfc: /* frndint */
         case 0xfd: /* fscale */
         case 0xfe: /* fsin */
diff -r 35ee60fe531f -r 26bf0e10596e xen/include/asm-x86/amd.h
--- a/xen/include/asm-x86/amd.h	Wed Mar 07 09:04:11 2012 +0000
+++ b/xen/include/asm-x86/amd.h	Wed Mar 07 09:05:20 2012 +0000
@@ -134,5 +134,11 @@
     AMD_OSVW_ERRATUM(3, AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf),	\
 		        AMD_MODEL_RANGE(0x12, 0x0, 0x0, 0x1, 0x0))
 
+#define AMD_ERRATUM_573							\
+    AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0xff, 0xf),	\
+                       AMD_MODEL_RANGE(0x10, 0x0, 0x0, 0xff, 0xf),	\
+                       AMD_MODEL_RANGE(0x11, 0x0, 0x0, 0xff, 0xf),	\
+                       AMD_MODEL_RANGE(0x12, 0x0, 0x0, 0xff, 0xf))
+
 int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);
 #endif /* __AMD_H__ */

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUD-000657-Hi; Thu, 08 Mar 2012 10:22: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 1S5aUC-00062W-1U
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:16 +0000
Received: from [85.158.143.99:27519] by server-1.bemta-4.messagelabs.com id
	44/9E-20925-758885F4; Thu, 08 Mar 2012 10:22:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1331202133!11916868!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3080 invoked from network); 8 Mar 2012 10:22:14 -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;
	8 Mar 2012 10:22: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 1S5aU8-0006nf-QO
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU8-0007nj-Oi
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:12 +0000
Message-Id: <E1S5aU8-0007nj-Oi@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:12 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/emulator: workaround for AMD
	erratum 573
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331111120 0
# Node ID 26bf0e10596e0058529aa525d8e154aa67afe7d2
# Parent  35ee60fe531f5a8e10b5ad314dfa287a3c09265d
x86/emulator: workaround for AMD erratum 573

The only cases where we might end up emulating fsincos (as any other
x87 operations without memory operands) are
- when a HVM guest is in real mode (not applicable on AMD)
- between two half page table updates in PAE mode (unlikely, and not
  doing the emulation here does affect only performance, not
  correctness)
- when a guest maliciously (or erroneously) modifies an (MMIO or page
  table update) instruction under emulation (unspecified behavior)

Hence, in order to avoid the erratum to cause harm to the entire host,
don't emulate fsincos on the affected AMD CPU families.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24417:1452fb248cd5
xen-unstable date:        Fri Dec 16 15:45:40 2011 +0100
---


diff -r 35ee60fe531f -r 26bf0e10596e tools/tests/x86_emulate.c
--- a/tools/tests/x86_emulate.c	Wed Mar 07 09:04:11 2012 +0000
+++ b/tools/tests/x86_emulate.c	Wed Mar 07 09:05:20 2012 +0000
@@ -3,5 +3,7 @@
 #include <string.h>
 #include <public/xen.h>
 
+#define cpu_has_amd_erratum(nr) 0
+
 #include "x86_emulate/x86_emulate.h"
 #include "x86_emulate/x86_emulate.c"
diff -r 35ee60fe531f -r 26bf0e10596e xen/arch/x86/x86_emulate.c
--- a/xen/arch/x86/x86_emulate.c	Wed Mar 07 09:04:11 2012 +0000
+++ b/xen/arch/x86/x86_emulate.c	Wed Mar 07 09:05:20 2012 +0000
@@ -10,8 +10,15 @@
  */
 
 #include <asm/x86_emulate.h>
+#include <asm/processor.h> /* current_cpu_info */
+#include <asm/amd.h> /* cpu_has_amd_erratum() */
 
 /* Avoid namespace pollution. */
 #undef cmpxchg
+#undef cpuid
+#undef wbinvd
+
+#define cpu_has_amd_erratum(nr) \
+        cpu_has_amd_erratum(&current_cpu_data, AMD_ERRATUM_##nr)
 
 #include "x86_emulate/x86_emulate.c"
diff -r 35ee60fe531f -r 26bf0e10596e xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Wed Mar 07 09:04:11 2012 +0000
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Wed Mar 07 09:05:20 2012 +0000
@@ -2578,6 +2578,9 @@
     case 0xd9: /* FPU 0xd9 */
         switch ( modrm )
         {
+        case 0xfb: /* fsincos */
+            fail_if(cpu_has_amd_erratum(573));
+            /* fall through */
         case 0xc0 ... 0xc7: /* fld %stN */
         case 0xc8 ... 0xcf: /* fxch %stN */
         case 0xd0: /* fnop */
@@ -2603,7 +2606,6 @@
         case 0xf8: /* fprem */
         case 0xf9: /* fyl2xp1 */
         case 0xfa: /* fsqrt */
-        case 0xfb: /* fsincos */
         case 0xfc: /* frndint */
         case 0xfd: /* fscale */
         case 0xfe: /* fsin */
diff -r 35ee60fe531f -r 26bf0e10596e xen/include/asm-x86/amd.h
--- a/xen/include/asm-x86/amd.h	Wed Mar 07 09:04:11 2012 +0000
+++ b/xen/include/asm-x86/amd.h	Wed Mar 07 09:05:20 2012 +0000
@@ -134,5 +134,11 @@
     AMD_OSVW_ERRATUM(3, AMD_MODEL_RANGE(0x10, 0x2, 0x1, 0xff, 0xf),	\
 		        AMD_MODEL_RANGE(0x12, 0x0, 0x0, 0x1, 0x0))
 
+#define AMD_ERRATUM_573							\
+    AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x0f, 0x0, 0x0, 0xff, 0xf),	\
+                       AMD_MODEL_RANGE(0x10, 0x0, 0x0, 0xff, 0xf),	\
+                       AMD_MODEL_RANGE(0x11, 0x0, 0x0, 0xff, 0xf),	\
+                       AMD_MODEL_RANGE(0x12, 0x0, 0x0, 0xff, 0xf))
+
 int cpu_has_amd_erratum(const struct cpuinfo_x86 *, int, ...);
 #endif /* __AMD_H__ */

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUF-000672-2u; Thu, 08 Mar 2012 10:22: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 1S5aUD-00062s-QH
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:17 +0000
Received: from [85.158.143.35:33992] by server-2.bemta-4.messagelabs.com id
	96/14-17550-958885F4; Thu, 08 Mar 2012 10:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1331202129!9512673!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1637 invoked from network); 8 Mar 2012 10:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Mar 2012 10: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 1S5aU5-0006nH-0Q
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU4-0007jx-SE
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:08 +0000
Message-Id: <E1S5aU4-0007jx-SE@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:08 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/vioapic: clear remote IRR
	when switching RTE to edge triggered
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110255 0
# Node ID b5575d7e462ee6ff0abb601b24a18978d4dd63f6
# Parent  17992e40806abbc796f1d11722a63e682200d63e
x86/vioapic: clear remote IRR when switching RTE to edge triggered
mode

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

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


diff -r 17992e40806a -r b5575d7e462e xen/arch/x86/hvm/vioapic.c
--- a/xen/arch/x86/hvm/vioapic.c	Wed Mar 07 08:50:32 2012 +0000
+++ b/xen/arch/x86/hvm/vioapic.c	Wed Mar 07 08:50:55 2012 +0000
@@ -153,8 +153,9 @@
     {
         vlapic_adjust_i8259_target(d);
     }
-    else if ( (ent.fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
-              !ent.fields.mask &&
+    else if ( ent.fields.trig_mode == VIOAPIC_EDGE_TRIG )
+        pent->fields.remote_irr = 0;
+    else if ( !ent.fields.mask &&
               !ent.fields.remote_irr &&
               hvm_irq->gsi_assert_count[idx] )
     {

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUF-000672-2u; Thu, 08 Mar 2012 10:22: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 1S5aUD-00062s-QH
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:17 +0000
Received: from [85.158.143.35:33992] by server-2.bemta-4.messagelabs.com id
	96/14-17550-958885F4; Thu, 08 Mar 2012 10:22:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1331202129!9512673!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1637 invoked from network); 8 Mar 2012 10:22:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Mar 2012 10: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 1S5aU5-0006nH-0Q
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU4-0007jx-SE
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:08 +0000
Message-Id: <E1S5aU4-0007jx-SE@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:08 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/vioapic: clear remote IRR
	when switching RTE to edge triggered
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110255 0
# Node ID b5575d7e462ee6ff0abb601b24a18978d4dd63f6
# Parent  17992e40806abbc796f1d11722a63e682200d63e
x86/vioapic: clear remote IRR when switching RTE to edge triggered
mode

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

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


diff -r 17992e40806a -r b5575d7e462e xen/arch/x86/hvm/vioapic.c
--- a/xen/arch/x86/hvm/vioapic.c	Wed Mar 07 08:50:32 2012 +0000
+++ b/xen/arch/x86/hvm/vioapic.c	Wed Mar 07 08:50:55 2012 +0000
@@ -153,8 +153,9 @@
     {
         vlapic_adjust_i8259_target(d);
     }
-    else if ( (ent.fields.trig_mode == VIOAPIC_LEVEL_TRIG) &&
-              !ent.fields.mask &&
+    else if ( ent.fields.trig_mode == VIOAPIC_EDGE_TRIG )
+        pent->fields.remote_irr = 0;
+    else if ( !ent.fields.mask &&
               !ent.fields.remote_irr &&
               hvm_irq->gsi_assert_count[idx] )
     {

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUD-00065I-M7; Thu, 08 Mar 2012 10:22: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 1S5aUC-00062W-HU
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:16 +0000
Received: from [85.158.143.99:60915] by server-1.bemta-4.messagelabs.com id
	BB/9E-20925-858885F4; Thu, 08 Mar 2012 10:22:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1331202133!11916870!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3134 invoked from network); 8 Mar 2012 10:22:14 -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;
	8 Mar 2012 10:22: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 1S5aU9-0006ni-Aa
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU9-0007oD-9C
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:13 +0000
Message-Id: <E1S5aU9-0007oD-9C@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:12 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] passthrough: release assigned PCI
	devices earlier during domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331111345 0
# Node ID c62e9965b3950a423b5e5dc2fb9b9495d535dc35
# Parent  26bf0e10596e0058529aa525d8e154aa67afe7d2
passthrough: release assigned PCI devices earlier during domain
shutdown

At least with xend, where there's not even a tool stack side attempt
to de-assign devices during domain shutdown, this allows immediate re-
starts of a domain to work reliably. (There's no apparent reason why
c/s 18010:c1577f094ae4 chose to put this in the asynchronous part of
domain destruction).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24888:71159fb049f2
xen-unstable date:        Fri Feb 24 11:46:32 2012 +0100
---


diff -r 26bf0e10596e -r c62e9965b395 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c	Wed Mar 07 09:05:20 2012 +0000
+++ b/xen/arch/ia64/xen/domain.c	Wed Mar 07 09:09:05 2012 +0000
@@ -669,10 +669,8 @@
 		free_xenheap_pages(d->shared_info,
 				   get_order_from_shift(XSI_SHIFT));
 
-	if ( iommu_enabled && need_iommu(d) )	{
-		pci_release_devices(d);
+	if ( iommu_enabled && need_iommu(d) )
 		iommu_domain_destroy(d);
-	}
 
 	tlb_track_destroy(d);
 
@@ -1717,6 +1715,8 @@
 
 	switch (d->arch.relres) {
 	case RELRES_not_started:
+		pci_release_devices(d);
+
 		/* Relinquish guest resources for VT-i domain. */
 		if (is_hvm_domain(d))
 			vmx_relinquish_guest_resources(d);
diff -r 26bf0e10596e -r c62e9965b395 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Mar 07 09:05:20 2012 +0000
+++ b/xen/arch/x86/domain.c	Wed Mar 07 09:09:05 2012 +0000
@@ -565,7 +565,6 @@
     if ( is_hvm_domain(d) )
         hvm_domain_destroy(d);
 
-    pci_release_devices(d);
     free_domain_pirqs(d);
     if ( !is_idle_domain(d) )
         iommu_domain_destroy(d);
@@ -1967,6 +1966,8 @@
     switch ( d->arch.relmem )
     {
     case RELMEM_not_started:
+        pci_release_devices(d);
+
         /* Tear down paging-assistance stuff. */
         paging_teardown(d);
 
diff -r 26bf0e10596e -r c62e9965b395 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Mar 07 09:05:20 2012 +0000
+++ b/xen/arch/x86/domctl.c	Wed Mar 07 09:09:05 2012 +0000
@@ -832,6 +832,9 @@
             break;
         }
 
+        if ( d->is_dying )
+            goto assign_device_out;
+
         ret = xsm_assign_device(d, domctl->u.assign_device.machine_bdf);
         if ( ret )
             goto assign_device_out;

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUD-00065I-M7; Thu, 08 Mar 2012 10:22: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 1S5aUC-00062W-HU
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:16 +0000
Received: from [85.158.143.99:60915] by server-1.bemta-4.messagelabs.com id
	BB/9E-20925-858885F4; Thu, 08 Mar 2012 10:22:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1331202133!11916870!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3134 invoked from network); 8 Mar 2012 10:22:14 -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;
	8 Mar 2012 10:22: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 1S5aU9-0006ni-Aa
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU9-0007oD-9C
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:13 +0000
Message-Id: <E1S5aU9-0007oD-9C@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:12 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] passthrough: release assigned PCI
	devices earlier during domain
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331111345 0
# Node ID c62e9965b3950a423b5e5dc2fb9b9495d535dc35
# Parent  26bf0e10596e0058529aa525d8e154aa67afe7d2
passthrough: release assigned PCI devices earlier during domain
shutdown

At least with xend, where there's not even a tool stack side attempt
to de-assign devices during domain shutdown, this allows immediate re-
starts of a domain to work reliably. (There's no apparent reason why
c/s 18010:c1577f094ae4 chose to put this in the asynchronous part of
domain destruction).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24888:71159fb049f2
xen-unstable date:        Fri Feb 24 11:46:32 2012 +0100
---


diff -r 26bf0e10596e -r c62e9965b395 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c	Wed Mar 07 09:05:20 2012 +0000
+++ b/xen/arch/ia64/xen/domain.c	Wed Mar 07 09:09:05 2012 +0000
@@ -669,10 +669,8 @@
 		free_xenheap_pages(d->shared_info,
 				   get_order_from_shift(XSI_SHIFT));
 
-	if ( iommu_enabled && need_iommu(d) )	{
-		pci_release_devices(d);
+	if ( iommu_enabled && need_iommu(d) )
 		iommu_domain_destroy(d);
-	}
 
 	tlb_track_destroy(d);
 
@@ -1717,6 +1715,8 @@
 
 	switch (d->arch.relres) {
 	case RELRES_not_started:
+		pci_release_devices(d);
+
 		/* Relinquish guest resources for VT-i domain. */
 		if (is_hvm_domain(d))
 			vmx_relinquish_guest_resources(d);
diff -r 26bf0e10596e -r c62e9965b395 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Wed Mar 07 09:05:20 2012 +0000
+++ b/xen/arch/x86/domain.c	Wed Mar 07 09:09:05 2012 +0000
@@ -565,7 +565,6 @@
     if ( is_hvm_domain(d) )
         hvm_domain_destroy(d);
 
-    pci_release_devices(d);
     free_domain_pirqs(d);
     if ( !is_idle_domain(d) )
         iommu_domain_destroy(d);
@@ -1967,6 +1966,8 @@
     switch ( d->arch.relmem )
     {
     case RELMEM_not_started:
+        pci_release_devices(d);
+
         /* Tear down paging-assistance stuff. */
         paging_teardown(d);
 
diff -r 26bf0e10596e -r c62e9965b395 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Wed Mar 07 09:05:20 2012 +0000
+++ b/xen/arch/x86/domctl.c	Wed Mar 07 09:09:05 2012 +0000
@@ -832,6 +832,9 @@
             break;
         }
 
+        if ( d->is_dying )
+            goto assign_device_out;
+
         ret = xsm_assign_device(d, domctl->u.assign_device.machine_bdf);
         if ( ret )
             goto assign_device_out;

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUF-00066t-0I; Thu, 08 Mar 2012 10:22: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 1S5aUD-00062s-9N
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:17 +0000
Received: from [85.158.143.35:33981] by server-2.bemta-4.messagelabs.com id
	A1/14-17550-558885F4; Thu, 08 Mar 2012 10:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1331202128!9512672!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1512 invoked from network); 8 Mar 2012 10:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Mar 2012 10: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 1S5aU4-0006nE-K5
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU4-0007jU-C8
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:08 +0000
Message-Id: <E1S5aU4-0007jU-C8@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:07 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/IO-APIC: refine EOI-ing of
	migrating level interrupts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110232 0
# Node ID 17992e40806abbc796f1d11722a63e682200d63e
# Parent  bf902d6661e36a7bd779d7e2501fa54cd698bfd4
x86/IO-APIC: refine EOI-ing of migrating level interrupts

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

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

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen-unstable changeset:   24155:0d50e704834f
xen-unstable date:        Fri Nov 18 09:18:41 2011 +0100
---


diff -r bf902d6661e3 -r 17992e40806a xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Thu Feb 23 10:41:33 2012 +0000
+++ b/xen/arch/x86/io_apic.c	Wed Mar 07 08:50:32 2012 +0000
@@ -73,10 +73,6 @@
 
 #define ioapic_has_eoi_reg(apic) (mp_ioapics[(apic)].mpc_apicver >= 0x20)
 
-#define io_apic_eoi_vector(apic, vector) io_apic_eoi((apic), (vector), -1)
-#define io_apic_eoi_pin(apic, pin) io_apic_eoi((apic), -1, (pin))
-
-
 /*
  * This is performance-critical, we want to do it O(1)
  *
@@ -212,16 +208,13 @@
     spin_unlock_irqrestore(&ioapic_lock, flags);
 }
 
-/* EOI an IO-APIC entry.  One of vector or pin may be -1, indicating that
- * it should be worked out using the other.  This function expect that the
- * ioapic_lock is taken, and interrupts are disabled (or there is a good reason
- * not to), and that if both pin and vector are passed, that they refer to the
+/* EOI an IO-APIC entry.  Vector may be -1, indicating that it should be
+ * worked out using the pin.  This function expects that the ioapic_lock is
+ * being held, and interrupts are disabled (or there is a good reason not
+ * to), and that if both pin and vector are passed, that they refer to the
  * same redirection entry in the IO-APIC. */
 static void __io_apic_eoi(unsigned int apic, unsigned int vector, unsigned int pin)
 {
-    /* Ensure some useful information is passed in */
-    BUG_ON( (vector == -1 && pin == -1) );
-    
     /* Prefer the use of the EOI register if available */
     if ( ioapic_has_eoi_reg(apic) )
     {
@@ -238,42 +231,6 @@
         struct IO_APIC_route_entry entry;
         bool_t need_to_unmask = 0;
 
-        /* If pin is unknown, search for it */
-        if ( pin == -1 )
-        {
-            unsigned int p;
-            for ( p = 0; p < nr_ioapic_registers[apic]; ++p )
-            {
-                entry = __ioapic_read_entry(apic, p, TRUE);
-                if ( entry.vector == vector )
-                {
-                    pin = p;
-                    /* break; */
-
-                    /* Here should be a break out of the loop, but at the 
-                     * Xen code doesn't actually prevent multiple IO-APIC
-                     * entries being assigned the same vector, so EOI all
-                     * pins which have the correct vector.
-                     *
-                     * Remove the following code when the above assertion
-                     * is fulfilled. */
-                    __io_apic_eoi(apic, vector, p);
-                }
-            }
-            
-            /* If search fails, nothing to do */
-
-            /* if ( pin == -1 ) */
-
-            /* Because the loop wasn't broken out of (see comment above),
-             * all relevant pins have been EOI, so we can always return.
-             * 
-             * Re-instate the if statement above when the Xen logic has been
-             * fixed.*/
-
-            return;
-        }
-
         entry = __ioapic_read_entry(apic, pin, TRUE);
 
         if ( ! entry.mask )
@@ -300,17 +257,6 @@
     }
 }
 
-/* EOI an IO-APIC entry.  One of vector or pin may be -1, indicating that
- * it should be worked out using the other.  This function disables interrupts
- * and takes the ioapic_lock */
-static void io_apic_eoi(unsigned int apic, unsigned int vector, unsigned int pin)
-{
-    unsigned int flags;
-    spin_lock_irqsave(&ioapic_lock, flags);
-    __io_apic_eoi(apic, vector, pin);
-    spin_unlock_irqrestore(&ioapic_lock, flags);
-}
-
 /*
  * Saves all the IO-APIC RTE's
  */
@@ -1808,11 +1754,7 @@
 
     /* Manually EOI the old vector if we are moving to the new */
     if ( vector && i != vector )
-    {
-        int ioapic;
-        for (ioapic = 0; ioapic < nr_ioapics; ioapic++)
-            io_apic_eoi_vector(ioapic, i);
-    }
+        eoi_IO_APIC_irq(irq);
 
     v = apic_read(APIC_TMR + ((i & ~0x1f) >> 1));
 

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUF-00066t-0I; Thu, 08 Mar 2012 10:22: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 1S5aUD-00062s-9N
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:17 +0000
Received: from [85.158.143.35:33981] by server-2.bemta-4.messagelabs.com id
	A1/14-17550-558885F4; Thu, 08 Mar 2012 10:22:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1331202128!9512672!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1512 invoked from network); 8 Mar 2012 10:22:09 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Mar 2012 10: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 1S5aU4-0006nE-K5
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU4-0007jU-C8
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:08 +0000
Message-Id: <E1S5aU4-0007jU-C8@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:07 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/IO-APIC: refine EOI-ing of
	migrating level interrupts
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110232 0
# Node ID 17992e40806abbc796f1d11722a63e682200d63e
# Parent  bf902d6661e36a7bd779d7e2501fa54cd698bfd4
x86/IO-APIC: refine EOI-ing of migrating level interrupts

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

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

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen-unstable changeset:   24155:0d50e704834f
xen-unstable date:        Fri Nov 18 09:18:41 2011 +0100
---


diff -r bf902d6661e3 -r 17992e40806a xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Thu Feb 23 10:41:33 2012 +0000
+++ b/xen/arch/x86/io_apic.c	Wed Mar 07 08:50:32 2012 +0000
@@ -73,10 +73,6 @@
 
 #define ioapic_has_eoi_reg(apic) (mp_ioapics[(apic)].mpc_apicver >= 0x20)
 
-#define io_apic_eoi_vector(apic, vector) io_apic_eoi((apic), (vector), -1)
-#define io_apic_eoi_pin(apic, pin) io_apic_eoi((apic), -1, (pin))
-
-
 /*
  * This is performance-critical, we want to do it O(1)
  *
@@ -212,16 +208,13 @@
     spin_unlock_irqrestore(&ioapic_lock, flags);
 }
 
-/* EOI an IO-APIC entry.  One of vector or pin may be -1, indicating that
- * it should be worked out using the other.  This function expect that the
- * ioapic_lock is taken, and interrupts are disabled (or there is a good reason
- * not to), and that if both pin and vector are passed, that they refer to the
+/* EOI an IO-APIC entry.  Vector may be -1, indicating that it should be
+ * worked out using the pin.  This function expects that the ioapic_lock is
+ * being held, and interrupts are disabled (or there is a good reason not
+ * to), and that if both pin and vector are passed, that they refer to the
  * same redirection entry in the IO-APIC. */
 static void __io_apic_eoi(unsigned int apic, unsigned int vector, unsigned int pin)
 {
-    /* Ensure some useful information is passed in */
-    BUG_ON( (vector == -1 && pin == -1) );
-    
     /* Prefer the use of the EOI register if available */
     if ( ioapic_has_eoi_reg(apic) )
     {
@@ -238,42 +231,6 @@
         struct IO_APIC_route_entry entry;
         bool_t need_to_unmask = 0;
 
-        /* If pin is unknown, search for it */
-        if ( pin == -1 )
-        {
-            unsigned int p;
-            for ( p = 0; p < nr_ioapic_registers[apic]; ++p )
-            {
-                entry = __ioapic_read_entry(apic, p, TRUE);
-                if ( entry.vector == vector )
-                {
-                    pin = p;
-                    /* break; */
-
-                    /* Here should be a break out of the loop, but at the 
-                     * Xen code doesn't actually prevent multiple IO-APIC
-                     * entries being assigned the same vector, so EOI all
-                     * pins which have the correct vector.
-                     *
-                     * Remove the following code when the above assertion
-                     * is fulfilled. */
-                    __io_apic_eoi(apic, vector, p);
-                }
-            }
-            
-            /* If search fails, nothing to do */
-
-            /* if ( pin == -1 ) */
-
-            /* Because the loop wasn't broken out of (see comment above),
-             * all relevant pins have been EOI, so we can always return.
-             * 
-             * Re-instate the if statement above when the Xen logic has been
-             * fixed.*/
-
-            return;
-        }
-
         entry = __ioapic_read_entry(apic, pin, TRUE);
 
         if ( ! entry.mask )
@@ -300,17 +257,6 @@
     }
 }
 
-/* EOI an IO-APIC entry.  One of vector or pin may be -1, indicating that
- * it should be worked out using the other.  This function disables interrupts
- * and takes the ioapic_lock */
-static void io_apic_eoi(unsigned int apic, unsigned int vector, unsigned int pin)
-{
-    unsigned int flags;
-    spin_lock_irqsave(&ioapic_lock, flags);
-    __io_apic_eoi(apic, vector, pin);
-    spin_unlock_irqrestore(&ioapic_lock, flags);
-}
-
 /*
  * Saves all the IO-APIC RTE's
  */
@@ -1808,11 +1754,7 @@
 
     /* Manually EOI the old vector if we are moving to the new */
     if ( vector && i != vector )
-    {
-        int ioapic;
-        for (ioapic = 0; ioapic < nr_ioapics; ioapic++)
-            io_apic_eoi_vector(ioapic, i);
-    }
+        eoi_IO_APIC_irq(irq);
 
     v = apic_read(APIC_TMR + ((i & ~0x1f) >> 1));
 

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUE-00066m-Tq; Thu, 08 Mar 2012 10:22: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 1S5aUD-00063F-0s
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:17 +0000
Received: from [85.158.139.83:42941] by server-6.bemta-5.messagelabs.com id
	40/89-13222-658885F4; Thu, 08 Mar 2012 10:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1331202132!18407017!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32580 invoked from network); 8 Mar 2012 10:22:13 -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;
	8 Mar 2012 10: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 1S5aU7-0006nZ-Qk
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU7-0007ml-PI
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:11 +0000
Message-Id: <E1S5aU7-0007ml-PI@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:11 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86,
	amd: Disable GartTlbWlkErr when BIOS forgets it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110588 0
# Node ID cf5751788c49ee25db5c9280d6dc9ea3e6b8f97a
# Parent  fef96d88043052964759a2c00d042af071588b59
x86, amd: Disable GartTlbWlkErr when BIOS forgets it

This patch disables GartTlbWlk errors on AMD Fam10h CPUs if the BIOS
forgets to do is (or is just too old). Letting these errors enabled
can cause a sync-flood on the CPU causing a reboot.

The AMD BKDG recommends disabling GART TLB Wlk Error completely.

Based on a Linux patch from Joerg Roedel <joerg.roedel@amd.com>; see
e.g.
https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=patch;h=5bbc097d890409d8eff4e3f1d26f11a9d6b7c07e

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24389:868d82faf651
xen-unstable date:        Tue Dec 13 09:45:11 2011 +0100
---


diff -r fef96d880430 -r cf5751788c49 xen/arch/x86/cpu/mcheck/amd_f10.c
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c	Wed Mar 07 08:55:57 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c	Wed Mar 07 08:56:28 2012 +0000
@@ -46,6 +46,7 @@
 #include <asm/msr.h>
 
 #include "mce.h"
+#include "mce_quirks.h"
 #include "x86_mca.h"
 
 
@@ -85,9 +86,14 @@
 /* AMD Family10 machine check */
 enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c)
 { 
+	enum mcequirk_amd_flags quirkflag = mcequirk_lookup_amd_quirkdata(c);
+
 	if (amd_k8_mcheck_init(c) == mcheck_none)
 		return mcheck_none;
 
+	if (quirkflag == MCEQUIRK_F10_GART)
+		mcequirk_amd_apply(quirkflag);
+
 	x86_mce_callback_register(amd_f10_handler);
 
 	return mcheck_amd_famXX;
diff -r fef96d880430 -r cf5751788c49 xen/arch/x86/cpu/mcheck/mce_amd_quirks.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Wed Mar 07 08:55:57 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Wed Mar 07 08:56:28 2012 +0000
@@ -29,6 +29,8 @@
 	  MCEQUIRK_K7_BANK0 },
 	{ 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
@@ -54,6 +56,8 @@
 
 int mcequirk_amd_apply(enum mcequirk_amd_flags flags)
 {
+	u64 val;
+
 	switch (flags) {
 	case MCEQUIRK_K7_BANK0:
 		return 1; /* first bank */
@@ -67,6 +71,10 @@
 		wrmsrl(MSR_IA32_MC4_CTL, ~(1ULL << 10));
 		wrmsrl(MSR_IA32_MC4_STATUS, 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;
diff -r fef96d880430 -r cf5751788c49 xen/arch/x86/cpu/mcheck/mce_quirks.h
--- a/xen/arch/x86/cpu/mcheck/mce_quirks.h	Wed Mar 07 08:55:57 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce_quirks.h	Wed Mar 07 08:56:28 2012 +0000
@@ -33,8 +33,9 @@
  */
 
 enum mcequirk_amd_flags {
-	MCEQUIRK_K7_BANK0 = 0x1,
-	MCEQUIRK_K8_GART = 0x2,
+	MCEQUIRK_K7_BANK0 = 1,
+	MCEQUIRK_K8_GART,
+	MCEQUIRK_F10_GART
 };
 
 enum mcequirk_intel_flags {
diff -r fef96d880430 -r cf5751788c49 xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Wed Mar 07 08:55:57 2012 +0000
+++ b/xen/include/asm-x86/msr-index.h	Wed Mar 07 08:56:28 2012 +0000
@@ -98,6 +98,8 @@
 #define CMCI_EN 			(1UL<<30)
 #define CMCI_THRESHOLD_MASK		0x7FFF
 
+#define MSR_AMD64_MC0_MASK		0xc0010044
+
 #define MSR_IA32_MC1_CTL		0x00000404
 #define MSR_IA32_MC1_CTL2		0x00000281
 #define MSR_IA32_MC1_STATUS		0x00000405
@@ -151,6 +153,8 @@
 #define MSR_IA32_MCx_ADDR(x)		(MSR_IA32_MC0_ADDR + 4*(x))
 #define MSR_IA32_MCx_MISC(x)		(MSR_IA32_MC0_MISC + 4*(x)) 
 
+#define MSR_AMD64_MCx_MASK(x)		(MSR_AMD64_MC0_MASK + (x))
+
 #define MSR_P6_PERFCTR0			0x000000c1
 #define MSR_P6_PERFCTR1			0x000000c2
 #define MSR_P6_EVNTSEL0			0x00000186

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 10:22:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 10: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 1S5aUE-00066m-Tq; Thu, 08 Mar 2012 10:22: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 1S5aUD-00063F-0s
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:17 +0000
Received: from [85.158.139.83:42941] by server-6.bemta-5.messagelabs.com id
	40/89-13222-658885F4; Thu, 08 Mar 2012 10:22:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1331202132!18407017!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32580 invoked from network); 8 Mar 2012 10:22:13 -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;
	8 Mar 2012 10: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 1S5aU7-0006nZ-Qk
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5aU7-0007ml-PI
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 10:22:11 +0000
Message-Id: <E1S5aU7-0007ml-PI@xenbits.xen.org>
Date: Thu, 08 Mar 2012 10:22:11 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86,
	amd: Disable GartTlbWlkErr when BIOS forgets it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331110588 0
# Node ID cf5751788c49ee25db5c9280d6dc9ea3e6b8f97a
# Parent  fef96d88043052964759a2c00d042af071588b59
x86, amd: Disable GartTlbWlkErr when BIOS forgets it

This patch disables GartTlbWlk errors on AMD Fam10h CPUs if the BIOS
forgets to do is (or is just too old). Letting these errors enabled
can cause a sync-flood on the CPU causing a reboot.

The AMD BKDG recommends disabling GART TLB Wlk Error completely.

Based on a Linux patch from Joerg Roedel <joerg.roedel@amd.com>; see
e.g.
https://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=patch;h=5bbc097d890409d8eff4e3f1d26f11a9d6b7c07e

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24389:868d82faf651
xen-unstable date:        Tue Dec 13 09:45:11 2011 +0100
---


diff -r fef96d880430 -r cf5751788c49 xen/arch/x86/cpu/mcheck/amd_f10.c
--- a/xen/arch/x86/cpu/mcheck/amd_f10.c	Wed Mar 07 08:55:57 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/amd_f10.c	Wed Mar 07 08:56:28 2012 +0000
@@ -46,6 +46,7 @@
 #include <asm/msr.h>
 
 #include "mce.h"
+#include "mce_quirks.h"
 #include "x86_mca.h"
 
 
@@ -85,9 +86,14 @@
 /* AMD Family10 machine check */
 enum mcheck_type amd_f10_mcheck_init(struct cpuinfo_x86 *c)
 { 
+	enum mcequirk_amd_flags quirkflag = mcequirk_lookup_amd_quirkdata(c);
+
 	if (amd_k8_mcheck_init(c) == mcheck_none)
 		return mcheck_none;
 
+	if (quirkflag == MCEQUIRK_F10_GART)
+		mcequirk_amd_apply(quirkflag);
+
 	x86_mce_callback_register(amd_f10_handler);
 
 	return mcheck_amd_famXX;
diff -r fef96d880430 -r cf5751788c49 xen/arch/x86/cpu/mcheck/mce_amd_quirks.c
--- a/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Wed Mar 07 08:55:57 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce_amd_quirks.c	Wed Mar 07 08:56:28 2012 +0000
@@ -29,6 +29,8 @@
 	  MCEQUIRK_K7_BANK0 },
 	{ 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
@@ -54,6 +56,8 @@
 
 int mcequirk_amd_apply(enum mcequirk_amd_flags flags)
 {
+	u64 val;
+
 	switch (flags) {
 	case MCEQUIRK_K7_BANK0:
 		return 1; /* first bank */
@@ -67,6 +71,10 @@
 		wrmsrl(MSR_IA32_MC4_CTL, ~(1ULL << 10));
 		wrmsrl(MSR_IA32_MC4_STATUS, 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;
diff -r fef96d880430 -r cf5751788c49 xen/arch/x86/cpu/mcheck/mce_quirks.h
--- a/xen/arch/x86/cpu/mcheck/mce_quirks.h	Wed Mar 07 08:55:57 2012 +0000
+++ b/xen/arch/x86/cpu/mcheck/mce_quirks.h	Wed Mar 07 08:56:28 2012 +0000
@@ -33,8 +33,9 @@
  */
 
 enum mcequirk_amd_flags {
-	MCEQUIRK_K7_BANK0 = 0x1,
-	MCEQUIRK_K8_GART = 0x2,
+	MCEQUIRK_K7_BANK0 = 1,
+	MCEQUIRK_K8_GART,
+	MCEQUIRK_F10_GART
 };
 
 enum mcequirk_intel_flags {
diff -r fef96d880430 -r cf5751788c49 xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Wed Mar 07 08:55:57 2012 +0000
+++ b/xen/include/asm-x86/msr-index.h	Wed Mar 07 08:56:28 2012 +0000
@@ -98,6 +98,8 @@
 #define CMCI_EN 			(1UL<<30)
 #define CMCI_THRESHOLD_MASK		0x7FFF
 
+#define MSR_AMD64_MC0_MASK		0xc0010044
+
 #define MSR_IA32_MC1_CTL		0x00000404
 #define MSR_IA32_MC1_CTL2		0x00000281
 #define MSR_IA32_MC1_STATUS		0x00000405
@@ -151,6 +153,8 @@
 #define MSR_IA32_MCx_ADDR(x)		(MSR_IA32_MC0_ADDR + 4*(x))
 #define MSR_IA32_MCx_MISC(x)		(MSR_IA32_MC0_MISC + 4*(x)) 
 
+#define MSR_AMD64_MCx_MASK(x)		(MSR_AMD64_MC0_MASK + (x))
+
 #define MSR_P6_PERFCTR0			0x000000c1
 #define MSR_P6_PERFCTR1			0x000000c2
 #define MSR_P6_EVNTSEL0			0x00000186

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 17:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 17: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 1S5hYc-0004tv-0i; Thu, 08 Mar 2012 17: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 1S5hYa-0004tq-2X
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 17:55:16 +0000
Received: from [85.158.143.99:18149] by server-1.bemta-4.messagelabs.com id
	7C/A7-20925-382F85F4; Thu, 08 Mar 2012 17:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1331229312!17402610!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20569 invoked from network); 8 Mar 2012 17:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Mar 2012 17: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 1S5hYV-0004F9-VL
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 17:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5hYV-000615-Hl
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 17:55:11 +0000
Message-Id: <E1S5hYV-000615-Hl@xenbits.xen.org>
Date: Thu, 08 Mar 2012 17:55:10 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/vMSI: miscellaneous fixes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331204417 0
# Node ID c41ab909f08eef8ecf9cfa975e991a767695aed8
# Parent  c62e9965b3950a423b5e5dc2fb9b9495d535dc35
x86/vMSI: miscellaneous fixes

This addresses a number of problems in msixtbl_{read,write}():
- address alignment was not checked, allowing for memory corruption in
  the hypervisor (write case) or returning of hypervisor private data
  to the guest (read case)
- the interrupt mask bit was permitted to be written by the guest
  (while Xen's interrupt flow control routines need to control it)
- MAX_MSIX_TABLE_{ENTRIES,PAGES} were pointlessly defined to plain
  numbers (making it unobvious why they have these values, and making
  the latter non-portable)
- MAX_MSIX_TABLE_PAGES was also off by one (failing to account for a
  non-zero table offset); this was also affecting host MSI-X code
- struct msixtbl_entry's table_flags[] was one element larger than
  necessary due to improper open-coding of BITS_TO_LONGS()
- msixtbl_read() unconditionally accessed the physical table, even
  though the data was only needed in a quarter of all cases
- various calculations were done unnecessarily for both of the rather
  distinct code paths in msixtbl_read()

Additionally it is unclear on what basis MAX_MSIX_ACC_ENTRIES was
chosen to be 3.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24535:fb81b807c154
xen-unstable date:        Mon Jan 23 09:35:17 2012 +0000
---


diff -r c62e9965b395 -r c41ab909f08e xen/arch/x86/hvm/vmsi.c
--- a/xen/arch/x86/hvm/vmsi.c	Wed Mar 07 09:09:05 2012 +0000
+++ b/xen/arch/x86/hvm/vmsi.c	Thu Mar 08 11:00:17 2012 +0000
@@ -157,7 +157,7 @@
     struct pci_dev *pdev;
     unsigned long gtable;       /* gpa of msix table */
     unsigned long table_len;
-    unsigned long table_flags[MAX_MSIX_TABLE_ENTRIES / BITS_PER_LONG + 1];
+    unsigned long table_flags[BITS_TO_LONGS(MAX_MSIX_TABLE_ENTRIES)];
 
     struct rcu_head rcu;
 };
@@ -179,17 +179,14 @@
 static void __iomem *msixtbl_addr_to_virt(
     struct msixtbl_entry *entry, unsigned long addr)
 {
-    int idx, nr_page;
+    unsigned int idx, nr_page;
 
-    if ( !entry )
+    if ( !entry || !entry->pdev )
         return NULL;
 
     nr_page = (addr >> PAGE_SHIFT) -
               (entry->gtable >> PAGE_SHIFT);
 
-    if ( !entry->pdev )
-        return NULL;
-
     idx = entry->pdev->msix_table_idx[nr_page];
     if ( !idx )
         return NULL;
@@ -207,11 +204,11 @@
     void *virt;
     int r = X86EMUL_UNHANDLEABLE;
 
+    if ( len != 4 || (address & 3) )
+        return r;
+
     rcu_read_lock();
 
-    if ( len != 4 )
-        goto out;
-
     offset = address & (PCI_MSIX_ENTRY_SIZE - 1);
     if ( offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET)
         goto out;
@@ -235,14 +232,14 @@
     unsigned long offset;
     struct msixtbl_entry *entry;
     void *virt;
-    int nr_entry;
+    unsigned int nr_entry;
     int r = X86EMUL_UNHANDLEABLE;
 
+    if ( len != 4 || (address & 3) )
+        return r;
+
     rcu_read_lock();
 
-    if ( len != 4 )
-        goto out;
-
     entry = msixtbl_find_entry(v, address);
     nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE;
 
@@ -261,9 +258,22 @@
     if ( !virt )
         goto out;
 
+    /* Do not allow the mask bit to be changed. */
+#if 0 /* XXX
+       * As the mask bit is the only defined bit in the word, and as the
+       * host MSI-X code doesn't preserve the other bits anyway, doing
+       * this is pointless. So for now just discard the write (also
+       * saving us from having to determine the matching irq_desc).
+       */
+    spin_lock_irqsave(&desc->lock, flags);
+    orig = readl(virt);
+    val &= ~PCI_MSIX_VECTOR_BITMASK;
+    val |= orig & PCI_MSIX_VECTOR_BITMASK;
     writel(val, virt);
+    spin_unlock_irqrestore(&desc->lock, flags);
+#endif
+
     r = X86EMUL_OKAY;
-
 out:
     rcu_read_unlock();
     return r;
diff -r c62e9965b395 -r c41ab909f08e xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h	Wed Mar 07 09:09:05 2012 +0000
+++ b/xen/include/asm-x86/msi.h	Thu Mar 08 11:00:17 2012 +0000
@@ -127,12 +127,6 @@
 #define PCI_MSIX_FLAGS_BIRMASK		(7 << 0)
 #define PCI_MSIX_FLAGS_BITMASK		(1 << 0)
 
-#define PCI_MSIX_ENTRY_SIZE			16
-#define  PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET	0
-#define  PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET	4
-#define  PCI_MSIX_ENTRY_DATA_OFFSET		8
-#define  PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET	12
-
 #define msi_control_reg(base)		(base + PCI_MSI_FLAGS)
 #define msi_lower_address_reg(base)	(base + PCI_MSI_ADDRESS_LO)
 #define msi_upper_address_reg(base)	(base + PCI_MSI_ADDRESS_HI)
diff -r c62e9965b395 -r c41ab909f08e xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Wed Mar 07 09:09:05 2012 +0000
+++ b/xen/include/xen/pci.h	Thu Mar 08 11:00:17 2012 +0000
@@ -11,6 +11,8 @@
 #include <xen/types.h>
 #include <xen/list.h>
 #include <xen/spinlock.h>
+#include <xen/pci_regs.h>
+#include <asm/page.h>
 
 /*
  * The PCI interface treats multi-function devices as independent
@@ -29,8 +31,10 @@
 #define PCI_BDF(b,d,f)  ((((b) & 0xff) << 8) | PCI_DEVFN(d,f))
 #define PCI_BDF2(b,df)  ((((b) & 0xff) << 8) | ((df) & 0xff))
 
-#define MAX_MSIX_TABLE_ENTRIES  2048
-#define MAX_MSIX_TABLE_PAGES    8
+#define MAX_MSIX_TABLE_ENTRIES  (PCI_MSIX_FLAGS_QSIZE + 1)
+#define MAX_MSIX_TABLE_PAGES    PFN_UP(MAX_MSIX_TABLE_ENTRIES * \
+                                       PCI_MSIX_ENTRY_SIZE + \
+                                       (~PCI_MSIX_FLAGS_BIRMASK & (PAGE_SIZE - 1)))
 struct pci_dev_info {
     unsigned is_extfn;
     unsigned is_virtfn;
diff -r c62e9965b395 -r c41ab909f08e xen/include/xen/pci_regs.h
--- a/xen/include/xen/pci_regs.h	Wed Mar 07 09:09:05 2012 +0000
+++ b/xen/include/xen/pci_regs.h	Thu Mar 08 11:00:17 2012 +0000
@@ -302,6 +302,13 @@
 #define  PCI_MSIX_FLAGS_ENABLE	(1 << 15)
 #define  PCI_MSIX_FLAGS_MASKALL	(1 << 14)
 #define PCI_MSIX_FLAGS_BIRMASK	(7 << 0)
+
+#define PCI_MSIX_ENTRY_SIZE			16
+#define  PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET	0
+#define  PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET	4
+#define  PCI_MSIX_ENTRY_DATA_OFFSET		8
+#define  PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET	12
+
 #define PCI_MSIX_FLAGS_BITMASK	(1 << 0)
 
 /* CompactPCI Hotswap Register */

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 17:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 17: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 1S5hYc-0004tv-0i; Thu, 08 Mar 2012 17: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 1S5hYa-0004tq-2X
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 17:55:16 +0000
Received: from [85.158.143.99:18149] by server-1.bemta-4.messagelabs.com id
	7C/A7-20925-382F85F4; Thu, 08 Mar 2012 17:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1331229312!17402610!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20569 invoked from network); 8 Mar 2012 17:55:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	8 Mar 2012 17: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 1S5hYV-0004F9-VL
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 17:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5hYV-000615-Hl
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 17:55:11 +0000
Message-Id: <E1S5hYV-000615-Hl@xenbits.xen.org>
Date: Thu, 08 Mar 2012 17:55:10 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/vMSI: miscellaneous fixes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331204417 0
# Node ID c41ab909f08eef8ecf9cfa975e991a767695aed8
# Parent  c62e9965b3950a423b5e5dc2fb9b9495d535dc35
x86/vMSI: miscellaneous fixes

This addresses a number of problems in msixtbl_{read,write}():
- address alignment was not checked, allowing for memory corruption in
  the hypervisor (write case) or returning of hypervisor private data
  to the guest (read case)
- the interrupt mask bit was permitted to be written by the guest
  (while Xen's interrupt flow control routines need to control it)
- MAX_MSIX_TABLE_{ENTRIES,PAGES} were pointlessly defined to plain
  numbers (making it unobvious why they have these values, and making
  the latter non-portable)
- MAX_MSIX_TABLE_PAGES was also off by one (failing to account for a
  non-zero table offset); this was also affecting host MSI-X code
- struct msixtbl_entry's table_flags[] was one element larger than
  necessary due to improper open-coding of BITS_TO_LONGS()
- msixtbl_read() unconditionally accessed the physical table, even
  though the data was only needed in a quarter of all cases
- various calculations were done unnecessarily for both of the rather
  distinct code paths in msixtbl_read()

Additionally it is unclear on what basis MAX_MSIX_ACC_ENTRIES was
chosen to be 3.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24535:fb81b807c154
xen-unstable date:        Mon Jan 23 09:35:17 2012 +0000
---


diff -r c62e9965b395 -r c41ab909f08e xen/arch/x86/hvm/vmsi.c
--- a/xen/arch/x86/hvm/vmsi.c	Wed Mar 07 09:09:05 2012 +0000
+++ b/xen/arch/x86/hvm/vmsi.c	Thu Mar 08 11:00:17 2012 +0000
@@ -157,7 +157,7 @@
     struct pci_dev *pdev;
     unsigned long gtable;       /* gpa of msix table */
     unsigned long table_len;
-    unsigned long table_flags[MAX_MSIX_TABLE_ENTRIES / BITS_PER_LONG + 1];
+    unsigned long table_flags[BITS_TO_LONGS(MAX_MSIX_TABLE_ENTRIES)];
 
     struct rcu_head rcu;
 };
@@ -179,17 +179,14 @@
 static void __iomem *msixtbl_addr_to_virt(
     struct msixtbl_entry *entry, unsigned long addr)
 {
-    int idx, nr_page;
+    unsigned int idx, nr_page;
 
-    if ( !entry )
+    if ( !entry || !entry->pdev )
         return NULL;
 
     nr_page = (addr >> PAGE_SHIFT) -
               (entry->gtable >> PAGE_SHIFT);
 
-    if ( !entry->pdev )
-        return NULL;
-
     idx = entry->pdev->msix_table_idx[nr_page];
     if ( !idx )
         return NULL;
@@ -207,11 +204,11 @@
     void *virt;
     int r = X86EMUL_UNHANDLEABLE;
 
+    if ( len != 4 || (address & 3) )
+        return r;
+
     rcu_read_lock();
 
-    if ( len != 4 )
-        goto out;
-
     offset = address & (PCI_MSIX_ENTRY_SIZE - 1);
     if ( offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET)
         goto out;
@@ -235,14 +232,14 @@
     unsigned long offset;
     struct msixtbl_entry *entry;
     void *virt;
-    int nr_entry;
+    unsigned int nr_entry;
     int r = X86EMUL_UNHANDLEABLE;
 
+    if ( len != 4 || (address & 3) )
+        return r;
+
     rcu_read_lock();
 
-    if ( len != 4 )
-        goto out;
-
     entry = msixtbl_find_entry(v, address);
     nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE;
 
@@ -261,9 +258,22 @@
     if ( !virt )
         goto out;
 
+    /* Do not allow the mask bit to be changed. */
+#if 0 /* XXX
+       * As the mask bit is the only defined bit in the word, and as the
+       * host MSI-X code doesn't preserve the other bits anyway, doing
+       * this is pointless. So for now just discard the write (also
+       * saving us from having to determine the matching irq_desc).
+       */
+    spin_lock_irqsave(&desc->lock, flags);
+    orig = readl(virt);
+    val &= ~PCI_MSIX_VECTOR_BITMASK;
+    val |= orig & PCI_MSIX_VECTOR_BITMASK;
     writel(val, virt);
+    spin_unlock_irqrestore(&desc->lock, flags);
+#endif
+
     r = X86EMUL_OKAY;
-
 out:
     rcu_read_unlock();
     return r;
diff -r c62e9965b395 -r c41ab909f08e xen/include/asm-x86/msi.h
--- a/xen/include/asm-x86/msi.h	Wed Mar 07 09:09:05 2012 +0000
+++ b/xen/include/asm-x86/msi.h	Thu Mar 08 11:00:17 2012 +0000
@@ -127,12 +127,6 @@
 #define PCI_MSIX_FLAGS_BIRMASK		(7 << 0)
 #define PCI_MSIX_FLAGS_BITMASK		(1 << 0)
 
-#define PCI_MSIX_ENTRY_SIZE			16
-#define  PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET	0
-#define  PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET	4
-#define  PCI_MSIX_ENTRY_DATA_OFFSET		8
-#define  PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET	12
-
 #define msi_control_reg(base)		(base + PCI_MSI_FLAGS)
 #define msi_lower_address_reg(base)	(base + PCI_MSI_ADDRESS_LO)
 #define msi_upper_address_reg(base)	(base + PCI_MSI_ADDRESS_HI)
diff -r c62e9965b395 -r c41ab909f08e xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Wed Mar 07 09:09:05 2012 +0000
+++ b/xen/include/xen/pci.h	Thu Mar 08 11:00:17 2012 +0000
@@ -11,6 +11,8 @@
 #include <xen/types.h>
 #include <xen/list.h>
 #include <xen/spinlock.h>
+#include <xen/pci_regs.h>
+#include <asm/page.h>
 
 /*
  * The PCI interface treats multi-function devices as independent
@@ -29,8 +31,10 @@
 #define PCI_BDF(b,d,f)  ((((b) & 0xff) << 8) | PCI_DEVFN(d,f))
 #define PCI_BDF2(b,df)  ((((b) & 0xff) << 8) | ((df) & 0xff))
 
-#define MAX_MSIX_TABLE_ENTRIES  2048
-#define MAX_MSIX_TABLE_PAGES    8
+#define MAX_MSIX_TABLE_ENTRIES  (PCI_MSIX_FLAGS_QSIZE + 1)
+#define MAX_MSIX_TABLE_PAGES    PFN_UP(MAX_MSIX_TABLE_ENTRIES * \
+                                       PCI_MSIX_ENTRY_SIZE + \
+                                       (~PCI_MSIX_FLAGS_BIRMASK & (PAGE_SIZE - 1)))
 struct pci_dev_info {
     unsigned is_extfn;
     unsigned is_virtfn;
diff -r c62e9965b395 -r c41ab909f08e xen/include/xen/pci_regs.h
--- a/xen/include/xen/pci_regs.h	Wed Mar 07 09:09:05 2012 +0000
+++ b/xen/include/xen/pci_regs.h	Thu Mar 08 11:00:17 2012 +0000
@@ -302,6 +302,13 @@
 #define  PCI_MSIX_FLAGS_ENABLE	(1 << 15)
 #define  PCI_MSIX_FLAGS_MASKALL	(1 << 14)
 #define PCI_MSIX_FLAGS_BIRMASK	(7 << 0)
+
+#define PCI_MSIX_ENTRY_SIZE			16
+#define  PCI_MSIX_ENTRY_LOWER_ADDR_OFFSET	0
+#define  PCI_MSIX_ENTRY_UPPER_ADDR_OFFSET	4
+#define  PCI_MSIX_ENTRY_DATA_OFFSET		8
+#define  PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET	12
+
 #define PCI_MSIX_FLAGS_BITMASK	(1 << 0)
 
 /* CompactPCI Hotswap Register */

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 20:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 20: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 1S5kMp-0007nR-Uf; Thu, 08 Mar 2012 20: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 1S5kMo-0007n5-FH
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:18 +0000
Received: from [85.158.139.83:24663] by server-11.bemta-5.messagelabs.com id
	82/74-12959-5BC195F4; Thu, 08 Mar 2012 20:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1331240115!18521805!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10042 invoked from network); 8 Mar 2012 20:55:16 -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;
	8 Mar 2012 20: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 1S5kMl-0006TS-5d
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5kMk-0007z1-VK
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:14 +0000
Message-Id: <E1S5kMk-0007z1-VK@xenbits.xen.org>
Date: Thu, 08 Mar 2012 20: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/IRQ: prevent vector sharing
	within IO-APICs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331201062 0
# Node ID 7c0d02aa4742e45507bef41fbc2fc03129a33a7b
# Parent  0bbaff574126e8fb417abe6d94b42f7bf460ad26
x86/IRQ: prevent vector sharing within IO-APICs

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

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

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

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen-unstable changeset:   24156:f29b5bd6e25f
xen-unstable date:        Fri Nov 18 09:21:24 2011 +0100
---


diff -r 0bbaff574126 -r 7c0d02aa4742 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Thu Mar 08 10:03:35 2012 +0000
+++ b/xen/arch/x86/io_apic.c	Thu Mar 08 10:04:22 2012 +0000
@@ -70,6 +70,34 @@
 
 #define ioapic_has_eoi_reg(apic) (mp_ioapics[(apic)].mpc_apicver >= 0x20)
 
+static int apic_pin_2_gsi_irq(int apic, int pin);
+
+static vmask_t *__read_mostly vector_map[MAX_IO_APICS];
+
+static void share_vector_maps(unsigned int src, unsigned int dst)
+{
+    unsigned int pin;
+
+    if (vector_map[src] == vector_map[dst])
+        return;
+
+    bitmap_or(vector_map[src]->_bits, vector_map[src]->_bits,
+              vector_map[dst]->_bits, NR_VECTORS);
+
+    for (pin = 0; pin < nr_ioapic_registers[dst]; ++pin) {
+        int irq = apic_pin_2_gsi_irq(dst, pin);
+        struct irq_cfg *cfg;
+
+        if (irq < 0)
+            continue;
+        cfg = irq_cfg(irq);
+        if (cfg->used_vectors == vector_map[dst])
+            cfg->used_vectors = vector_map[src];
+    }
+
+    vector_map[dst] = vector_map[src];
+}
+
 /*
  * This is performance-critical, we want to do it O(1)
  *
@@ -110,6 +138,7 @@
     }
     entry->apic = apic;
     entry->pin = pin;
+    share_vector_maps(irq_2_pin[irq].apic, apic);
 }
 
 /*
@@ -125,6 +154,7 @@
         if (entry->apic == oldapic && entry->pin == oldpin) {
             entry->apic = newapic;
             entry->pin = newpin;
+            share_vector_maps(oldapic, newapic);
         }
         if (!entry->next)
             break;
@@ -132,6 +162,16 @@
     }
 }
 
+vmask_t *io_apic_get_used_vector_map(unsigned int irq)
+{
+    struct irq_pin_list *entry = irq_2_pin + irq;
+
+    if (entry->pin == -1)
+        return NULL;
+
+    return vector_map[entry->apic];
+}
+
 struct IO_APIC_route_entry **alloc_ioapic_entries(void)
 {
     int apic;
@@ -1294,6 +1334,18 @@
     for (i = irq_2_pin_free_entry = nr_irqs_gsi; i < PIN_MAP_SIZE; i++)
         irq_2_pin[i].next = i + 1;
 
+    if (directed_eoi_enabled) {
+        for (apic = 0; apic < nr_ioapics; apic++) {
+            vector_map[apic] = xzalloc(vmask_t);
+            BUG_ON(!vector_map[apic]);
+        }
+    } else {
+        vector_map[0] = xzalloc(vmask_t);
+        BUG_ON(!vector_map[0]);
+        for (apic = 1; apic < nr_ioapics; apic++)
+            vector_map[apic] = vector_map[0];
+    }
+
     for(apic = 0; apic < nr_ioapics; apic++) {
         int pin;
         /* See if any of the pins is in ExtINT mode */
@@ -2465,13 +2517,12 @@
     }
 
     if ( cfg->vector <= 0 || cfg->vector > LAST_DYNAMIC_VECTOR ) {
+        add_pin_to_irq(irq, apic, pin);
         vector = assign_irq_vector(irq);
         if ( vector < 0 )
             return vector;
 
         printk(XENLOG_INFO "allocated vector %02x for irq %d\n", vector, irq);
-
-        add_pin_to_irq(irq, apic, pin);
     }
     spin_lock(&pcidevs_lock);
     spin_lock(&dom0->event_lock);
diff -r 0bbaff574126 -r 7c0d02aa4742 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Thu Mar 08 10:03:35 2012 +0000
+++ b/xen/arch/x86/irq.c	Thu Mar 08 10:04:22 2012 +0000
@@ -403,6 +403,11 @@
             }
         }
     }
+    else if ( IO_APIC_IRQ(irq) &&
+              opt_irq_vector_map != OPT_IRQ_VECTOR_MAP_NONE )
+    {
+        ret = io_apic_get_used_vector_map(irq);
+    }
 
     return ret;
 }
diff -r 0bbaff574126 -r 7c0d02aa4742 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Thu Mar 08 10:03:35 2012 +0000
+++ b/xen/include/asm-x86/irq.h	Thu Mar 08 10:04:22 2012 +0000
@@ -113,6 +113,7 @@
 void disable_IO_APIC(void);
 void print_IO_APIC(void);
 void setup_ioapic_dest(void);
+vmask_t *io_apic_get_used_vector_map(unsigned int irq);
 
 extern unsigned long io_apic_irqs;
 

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 20:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 20: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 1S5kMp-0007nR-Uf; Thu, 08 Mar 2012 20: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 1S5kMo-0007n5-FH
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:18 +0000
Received: from [85.158.139.83:24663] by server-11.bemta-5.messagelabs.com id
	82/74-12959-5BC195F4; Thu, 08 Mar 2012 20:55:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1331240115!18521805!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10042 invoked from network); 8 Mar 2012 20:55:16 -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;
	8 Mar 2012 20: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 1S5kMl-0006TS-5d
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5kMk-0007z1-VK
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:14 +0000
Message-Id: <E1S5kMk-0007z1-VK@xenbits.xen.org>
Date: Thu, 08 Mar 2012 20: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/IRQ: prevent vector sharing
	within IO-APICs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331201062 0
# Node ID 7c0d02aa4742e45507bef41fbc2fc03129a33a7b
# Parent  0bbaff574126e8fb417abe6d94b42f7bf460ad26
x86/IRQ: prevent vector sharing within IO-APICs

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

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

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

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen-unstable changeset:   24156:f29b5bd6e25f
xen-unstable date:        Fri Nov 18 09:21:24 2011 +0100
---


diff -r 0bbaff574126 -r 7c0d02aa4742 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Thu Mar 08 10:03:35 2012 +0000
+++ b/xen/arch/x86/io_apic.c	Thu Mar 08 10:04:22 2012 +0000
@@ -70,6 +70,34 @@
 
 #define ioapic_has_eoi_reg(apic) (mp_ioapics[(apic)].mpc_apicver >= 0x20)
 
+static int apic_pin_2_gsi_irq(int apic, int pin);
+
+static vmask_t *__read_mostly vector_map[MAX_IO_APICS];
+
+static void share_vector_maps(unsigned int src, unsigned int dst)
+{
+    unsigned int pin;
+
+    if (vector_map[src] == vector_map[dst])
+        return;
+
+    bitmap_or(vector_map[src]->_bits, vector_map[src]->_bits,
+              vector_map[dst]->_bits, NR_VECTORS);
+
+    for (pin = 0; pin < nr_ioapic_registers[dst]; ++pin) {
+        int irq = apic_pin_2_gsi_irq(dst, pin);
+        struct irq_cfg *cfg;
+
+        if (irq < 0)
+            continue;
+        cfg = irq_cfg(irq);
+        if (cfg->used_vectors == vector_map[dst])
+            cfg->used_vectors = vector_map[src];
+    }
+
+    vector_map[dst] = vector_map[src];
+}
+
 /*
  * This is performance-critical, we want to do it O(1)
  *
@@ -110,6 +138,7 @@
     }
     entry->apic = apic;
     entry->pin = pin;
+    share_vector_maps(irq_2_pin[irq].apic, apic);
 }
 
 /*
@@ -125,6 +154,7 @@
         if (entry->apic == oldapic && entry->pin == oldpin) {
             entry->apic = newapic;
             entry->pin = newpin;
+            share_vector_maps(oldapic, newapic);
         }
         if (!entry->next)
             break;
@@ -132,6 +162,16 @@
     }
 }
 
+vmask_t *io_apic_get_used_vector_map(unsigned int irq)
+{
+    struct irq_pin_list *entry = irq_2_pin + irq;
+
+    if (entry->pin == -1)
+        return NULL;
+
+    return vector_map[entry->apic];
+}
+
 struct IO_APIC_route_entry **alloc_ioapic_entries(void)
 {
     int apic;
@@ -1294,6 +1334,18 @@
     for (i = irq_2_pin_free_entry = nr_irqs_gsi; i < PIN_MAP_SIZE; i++)
         irq_2_pin[i].next = i + 1;
 
+    if (directed_eoi_enabled) {
+        for (apic = 0; apic < nr_ioapics; apic++) {
+            vector_map[apic] = xzalloc(vmask_t);
+            BUG_ON(!vector_map[apic]);
+        }
+    } else {
+        vector_map[0] = xzalloc(vmask_t);
+        BUG_ON(!vector_map[0]);
+        for (apic = 1; apic < nr_ioapics; apic++)
+            vector_map[apic] = vector_map[0];
+    }
+
     for(apic = 0; apic < nr_ioapics; apic++) {
         int pin;
         /* See if any of the pins is in ExtINT mode */
@@ -2465,13 +2517,12 @@
     }
 
     if ( cfg->vector <= 0 || cfg->vector > LAST_DYNAMIC_VECTOR ) {
+        add_pin_to_irq(irq, apic, pin);
         vector = assign_irq_vector(irq);
         if ( vector < 0 )
             return vector;
 
         printk(XENLOG_INFO "allocated vector %02x for irq %d\n", vector, irq);
-
-        add_pin_to_irq(irq, apic, pin);
     }
     spin_lock(&pcidevs_lock);
     spin_lock(&dom0->event_lock);
diff -r 0bbaff574126 -r 7c0d02aa4742 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Thu Mar 08 10:03:35 2012 +0000
+++ b/xen/arch/x86/irq.c	Thu Mar 08 10:04:22 2012 +0000
@@ -403,6 +403,11 @@
             }
         }
     }
+    else if ( IO_APIC_IRQ(irq) &&
+              opt_irq_vector_map != OPT_IRQ_VECTOR_MAP_NONE )
+    {
+        ret = io_apic_get_used_vector_map(irq);
+    }
 
     return ret;
 }
diff -r 0bbaff574126 -r 7c0d02aa4742 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Thu Mar 08 10:03:35 2012 +0000
+++ b/xen/include/asm-x86/irq.h	Thu Mar 08 10:04:22 2012 +0000
@@ -113,6 +113,7 @@
 void disable_IO_APIC(void);
 void print_IO_APIC(void);
 void setup_ioapic_dest(void);
+vmask_t *io_apic_get_used_vector_map(unsigned int irq);
 
 extern unsigned long io_apic_irqs;
 

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 20:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 20: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 1S5kMo-0007nE-Rx; Thu, 08 Mar 2012 20: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 1S5kMn-0007mx-9c
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:17 +0000
Received: from [85.158.139.83:24593] by server-9.bemta-5.messagelabs.com id
	08/C1-09826-4BC195F4; Thu, 08 Mar 2012 20:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1331240114!14575556!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7078 invoked from network); 8 Mar 2012 20:55:15 -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;
	8 Mar 2012 20: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 1S5kMj-0006TM-NT
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5kMj-0007y1-6J
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:13 +0000
Message-Id: <E1S5kMj-0007y1-6J@xenbits.xen.org>
Date: Thu, 08 Mar 2012 20: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 32-bit guest
	stack handling after c/s 24537:3c0a533d3af0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331197106 0
# Node ID 8a2e167905d3d0447d3ab1a5e58a37187c9b9046
# Parent  ed5c1ad51a236ee3b10c5dc1a86ae2217fa2a0f7
x86/xenoprof: fix 32-bit guest stack handling after c/s 24537:3c0a533d3af0

32-bit guests don't have 64-bit precudrure return addresses - both
elements of struct frame_head_32bit should be 32 bits wide, not just
the frame link pointer.

Further, consolidate the whole handling here (also in the native size
guest case) to properly use guest handles and guest memory accessors.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24971:e88a49951212
xen-unstable date:        Tue Mar 06 16:43:01 2012 +0100
---


diff -r ed5c1ad51a23 -r 8a2e167905d3 xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Wed Mar 07 10:58:25 2012 +0000
+++ b/xen/arch/x86/oprofile/backtrace.c	Thu Mar 08 08:58:26 2012 +0000
@@ -13,18 +13,22 @@
 #include<xen/types.h>
 #include<asm/page.h>
 #include<xen/xenoprof.h>
-#include<asm/guest_access.h>
+#include<xen/guest_access.h>
 
 struct frame_head {
     struct frame_head * ebp;
     unsigned long ret;
 } __attribute__((packed));
+typedef struct frame_head frame_head_t;
+DEFINE_XEN_GUEST_HANDLE(frame_head_t);
 
 #ifdef CONFIG_X86_64
 struct frame_head_32bit {
     uint32_t ebp;
-    unsigned long ret;
+    uint32_t ret;
 } __attribute__((packed));
+typedef struct frame_head_32bit frame_head32_t;
+DEFINE_COMPAT_HANDLE(frame_head32_t);
 #endif
 
 static struct frame_head *
@@ -54,44 +58,47 @@
 
 static struct frame_head *
 dump_guest_backtrace(struct domain *d, struct vcpu *vcpu, 
-		     struct frame_head * head, int mode)
+		     const struct frame_head *head, int mode)
 {
-    struct frame_head bufhead[2];
-    XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char);
+    frame_head_t bufhead;
 
 #ifdef CONFIG_X86_64
     if ( is_32bit_vcpu(vcpu) )
     {
-        struct frame_head_32bit bufhead32[2];
+        __compat_handle_const_frame_head32_t guest_head =
+            { .c = (unsigned long)head };
+        frame_head32_t bufhead32;
+
         /* Also check accessibility of one struct frame_head beyond */
-        if (!guest_handle_okay(guest_head, sizeof(bufhead32)))
+        if (!compat_handle_okay(guest_head, 2))
             return 0;
-        if (__copy_from_guest_offset((char *)bufhead32, guest_head, 0, 
-                                     sizeof(bufhead32)))
+        if (__copy_from_compat(&bufhead32, guest_head, 1))
             return 0;
-        bufhead[0].ebp=(struct frame_head *)(unsigned long)bufhead32[0].ebp;
-        bufhead[0].ret=bufhead32[0].ret;
+        bufhead.ebp = (struct frame_head *)(unsigned long)bufhead32.ebp;
+        bufhead.ret = bufhead32.ret;
     }
     else
 #endif
     {
+        XEN_GUEST_HANDLE(const_frame_head_t) guest_head =
+            const_guest_handle_from_ptr(head, frame_head_t);
+
         /* Also check accessibility of one struct frame_head beyond */
-        if (!guest_handle_okay(guest_head, sizeof(bufhead)))
+        if (!guest_handle_okay(guest_head, 2))
             return 0;
-        if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
-                                     sizeof(bufhead)))
+        if (__copy_from_guest(&bufhead, guest_head, 1))
             return 0;
     }
     
-    if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode))
+    if (!xenoprof_add_trace(d, vcpu, bufhead.ret, mode))
         return 0;
     
     /* frame pointers should strictly progress back up the stack
      * (towards higher addresses) */
-    if (head >= bufhead[0].ebp)
+    if (head >= bufhead.ebp)
         return NULL;
     
-    return bufhead[0].ebp;
+    return bufhead.ebp;
 }
 
 /*

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 20:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 20: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 1S5kMo-0007nE-Rx; Thu, 08 Mar 2012 20: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 1S5kMn-0007mx-9c
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:17 +0000
Received: from [85.158.139.83:24593] by server-9.bemta-5.messagelabs.com id
	08/C1-09826-4BC195F4; Thu, 08 Mar 2012 20:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1331240114!14575556!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7078 invoked from network); 8 Mar 2012 20:55:15 -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;
	8 Mar 2012 20: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 1S5kMj-0006TM-NT
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5kMj-0007y1-6J
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:13 +0000
Message-Id: <E1S5kMj-0007y1-6J@xenbits.xen.org>
Date: Thu, 08 Mar 2012 20: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 32-bit guest
	stack handling after c/s 24537:3c0a533d3af0
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331197106 0
# Node ID 8a2e167905d3d0447d3ab1a5e58a37187c9b9046
# Parent  ed5c1ad51a236ee3b10c5dc1a86ae2217fa2a0f7
x86/xenoprof: fix 32-bit guest stack handling after c/s 24537:3c0a533d3af0

32-bit guests don't have 64-bit precudrure return addresses - both
elements of struct frame_head_32bit should be 32 bits wide, not just
the frame link pointer.

Further, consolidate the whole handling here (also in the native size
guest case) to properly use guest handles and guest memory accessors.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24971:e88a49951212
xen-unstable date:        Tue Mar 06 16:43:01 2012 +0100
---


diff -r ed5c1ad51a23 -r 8a2e167905d3 xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Wed Mar 07 10:58:25 2012 +0000
+++ b/xen/arch/x86/oprofile/backtrace.c	Thu Mar 08 08:58:26 2012 +0000
@@ -13,18 +13,22 @@
 #include<xen/types.h>
 #include<asm/page.h>
 #include<xen/xenoprof.h>
-#include<asm/guest_access.h>
+#include<xen/guest_access.h>
 
 struct frame_head {
     struct frame_head * ebp;
     unsigned long ret;
 } __attribute__((packed));
+typedef struct frame_head frame_head_t;
+DEFINE_XEN_GUEST_HANDLE(frame_head_t);
 
 #ifdef CONFIG_X86_64
 struct frame_head_32bit {
     uint32_t ebp;
-    unsigned long ret;
+    uint32_t ret;
 } __attribute__((packed));
+typedef struct frame_head_32bit frame_head32_t;
+DEFINE_COMPAT_HANDLE(frame_head32_t);
 #endif
 
 static struct frame_head *
@@ -54,44 +58,47 @@
 
 static struct frame_head *
 dump_guest_backtrace(struct domain *d, struct vcpu *vcpu, 
-		     struct frame_head * head, int mode)
+		     const struct frame_head *head, int mode)
 {
-    struct frame_head bufhead[2];
-    XEN_GUEST_HANDLE(char) guest_head = guest_handle_from_ptr(head, char);
+    frame_head_t bufhead;
 
 #ifdef CONFIG_X86_64
     if ( is_32bit_vcpu(vcpu) )
     {
-        struct frame_head_32bit bufhead32[2];
+        __compat_handle_const_frame_head32_t guest_head =
+            { .c = (unsigned long)head };
+        frame_head32_t bufhead32;
+
         /* Also check accessibility of one struct frame_head beyond */
-        if (!guest_handle_okay(guest_head, sizeof(bufhead32)))
+        if (!compat_handle_okay(guest_head, 2))
             return 0;
-        if (__copy_from_guest_offset((char *)bufhead32, guest_head, 0, 
-                                     sizeof(bufhead32)))
+        if (__copy_from_compat(&bufhead32, guest_head, 1))
             return 0;
-        bufhead[0].ebp=(struct frame_head *)(unsigned long)bufhead32[0].ebp;
-        bufhead[0].ret=bufhead32[0].ret;
+        bufhead.ebp = (struct frame_head *)(unsigned long)bufhead32.ebp;
+        bufhead.ret = bufhead32.ret;
     }
     else
 #endif
     {
+        XEN_GUEST_HANDLE(const_frame_head_t) guest_head =
+            const_guest_handle_from_ptr(head, frame_head_t);
+
         /* Also check accessibility of one struct frame_head beyond */
-        if (!guest_handle_okay(guest_head, sizeof(bufhead)))
+        if (!guest_handle_okay(guest_head, 2))
             return 0;
-        if (__copy_from_guest_offset((char *)bufhead, guest_head, 0, 
-                                     sizeof(bufhead)))
+        if (__copy_from_guest(&bufhead, guest_head, 1))
             return 0;
     }
     
-    if (!xenoprof_add_trace(d, vcpu, bufhead[0].ret, mode))
+    if (!xenoprof_add_trace(d, vcpu, bufhead.ret, mode))
         return 0;
     
     /* frame pointers should strictly progress back up the stack
      * (towards higher addresses) */
-    if (head >= bufhead[0].ebp)
+    if (head >= bufhead.ebp)
         return NULL;
     
-    return bufhead[0].ebp;
+    return bufhead.ebp;
 }
 
 /*

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 20:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 20: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 1S5kMq-0007nX-0u; Thu, 08 Mar 2012 20: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 1S5kMp-0007nD-91
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:19 +0000
Received: from [85.158.143.99:47936] by server-1.bemta-4.messagelabs.com id
	4E/51-20925-6BC195F4; Thu, 08 Mar 2012 20:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1331240116!19956824!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9941 invoked from network); 8 Mar 2012 20:55:17 -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;
	8 Mar 2012 20: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 1S5kMm-0006TV-0V
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5kMl-0007zV-NF
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:15 +0000
Message-Id: <E1S5kMl-0007zV-NF@xenbits.xen.org>
Date: Thu, 08 Mar 2012 20: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] iommu: Move IOMMU faults handling
	into softirq for AMD-Vi.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331201104 0
# Node ID b01091775dd9bfe2ea3ebad478a1668703c19434
# Parent  7c0d02aa4742e45507bef41fbc2fc03129a33a7b
iommu: Move IOMMU faults handling into softirq for AMD-Vi.

Dealing with interrupts from AMD-Vi IOMMU(s) is deferred to a
softirq-tasklet, raised by the actual IRQ handler. To avoid more
interrupts being generated (because of further faults), they must be
masked in the IOMMU within the low level IRQ handler and enabled back
in the tasklet body. Notice that this may cause the log to overflow,
but none of the existing entry will be overwritten.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24527:028230eb2359
xen-unstable date:        Fri Jan 20 10:20:32 2012 +0000
---


diff -r 7c0d02aa4742 -r b01091775dd9 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Mar 08 10:04:22 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Mar 08 10:05:04 2012 +0000
@@ -33,6 +33,8 @@
 static long amd_iommu_cmd_buffer_entries = IOMMU_CMD_BUFFER_DEFAULT_ENTRIES;
 static long amd_iommu_event_log_entries = IOMMU_EVENT_LOG_DEFAULT_ENTRIES;
 
+static struct tasklet amd_iommu_irq_tasklet;
+
 unsigned short ivrs_bdf_entries;
 struct ivrs_mappings *ivrs_mappings;
 struct list_head amd_iommu_head;
@@ -517,34 +519,70 @@
     }
 }
 
+static void do_amd_iommu_irq(unsigned long data)
+{
+    struct amd_iommu *iommu;
+
+    if ( !iommu_found() )
+    {
+        AMD_IOMMU_DEBUG("no device found, something must be very wrong!\n");
+        return;
+   }
+
+    /*
+     * No matter from where the interrupt came from, check all the
+     * IOMMUs present in the system. This allows for having just one
+     * tasklet (instead of one per each IOMMUs).
+     */
+    for_each_amd_iommu ( iommu )
+    {
+        u32 entry;
+        unsigned long flags;
+        int of;
+
+        spin_lock_irqsave(&iommu->lock, flags);
+        amd_iommu_read_event_log(iommu);
+
+        /* check event overflow */
+        entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+        of = get_field_from_reg_u32(entry,
+                                   IOMMU_STATUS_EVENT_OVERFLOW_MASK,
+                                   IOMMU_STATUS_EVENT_OVERFLOW_SHIFT);
+
+        /* reset event log if event overflow */
+        if ( of )
+            amd_iommu_reset_event_log(iommu);
+
+        /* reset interrupt status bit */
+        entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+        set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
+                             IOMMU_STATUS_EVENT_LOG_INT_MASK,
+                             IOMMU_STATUS_EVENT_LOG_INT_SHIFT, &entry);
+        writel(entry, iommu->mmio_base+IOMMU_STATUS_MMIO_OFFSET);
+        spin_unlock_irqrestore(&iommu->lock, flags);
+    }
+}
+
 static void amd_iommu_page_fault(int irq, void *dev_id,
                              struct cpu_user_regs *regs)
 {
     u32 entry;
     unsigned long flags;
-    int of;
     struct amd_iommu *iommu = dev_id;
 
     spin_lock_irqsave(&iommu->lock, flags);
-    amd_iommu_read_event_log(iommu);
 
-    /*check event overflow */
+    /* Silence interrupts from both event logging */
     entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
-    of = get_field_from_reg_u32(entry,
-                               IOMMU_STATUS_EVENT_OVERFLOW_MASK,
-                               IOMMU_STATUS_EVENT_OVERFLOW_SHIFT);
-
-    /* reset event log if event overflow */
-    if ( of )
-        amd_iommu_reset_event_log(iommu);
-
-    /* reset interrupt status bit */
-    entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
-    set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
+    set_field_in_reg_u32(IOMMU_CONTROL_DISABLED, entry,
                          IOMMU_STATUS_EVENT_LOG_INT_MASK,
                          IOMMU_STATUS_EVENT_LOG_INT_SHIFT, &entry);
     writel(entry, iommu->mmio_base+IOMMU_STATUS_MMIO_OFFSET);
+
     spin_unlock_irqrestore(&iommu->lock, flags);
+
+    /* It is the tasklet that will clear the logs and re-enable interrupts */
+    tasklet_schedule(&amd_iommu_irq_tasklet);
 }
 
 static int set_iommu_interrupt_handler(struct amd_iommu *iommu)
@@ -689,6 +727,8 @@
     printk("AMD-Vi: IOMMU %d Enabled.\n", nr_amd_iommus );
     nr_amd_iommus++;
 
+    softirq_tasklet_init(&amd_iommu_irq_tasklet, do_amd_iommu_irq, 0);
+
     return 0;
 
 error_out:

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 20:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 20: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 1S5kMq-0007nX-0u; Thu, 08 Mar 2012 20: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 1S5kMp-0007nD-91
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:19 +0000
Received: from [85.158.143.99:47936] by server-1.bemta-4.messagelabs.com id
	4E/51-20925-6BC195F4; Thu, 08 Mar 2012 20:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-216.messagelabs.com!1331240116!19956824!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9941 invoked from network); 8 Mar 2012 20:55:17 -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;
	8 Mar 2012 20: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 1S5kMm-0006TV-0V
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5kMl-0007zV-NF
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:15 +0000
Message-Id: <E1S5kMl-0007zV-NF@xenbits.xen.org>
Date: Thu, 08 Mar 2012 20: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] iommu: Move IOMMU faults handling
	into softirq for AMD-Vi.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331201104 0
# Node ID b01091775dd9bfe2ea3ebad478a1668703c19434
# Parent  7c0d02aa4742e45507bef41fbc2fc03129a33a7b
iommu: Move IOMMU faults handling into softirq for AMD-Vi.

Dealing with interrupts from AMD-Vi IOMMU(s) is deferred to a
softirq-tasklet, raised by the actual IRQ handler. To avoid more
interrupts being generated (because of further faults), they must be
masked in the IOMMU within the low level IRQ handler and enabled back
in the tasklet body. Notice that this may cause the log to overflow,
but none of the existing entry will be overwritten.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24527:028230eb2359
xen-unstable date:        Fri Jan 20 10:20:32 2012 +0000
---


diff -r 7c0d02aa4742 -r b01091775dd9 xen/drivers/passthrough/amd/iommu_init.c
--- a/xen/drivers/passthrough/amd/iommu_init.c	Thu Mar 08 10:04:22 2012 +0000
+++ b/xen/drivers/passthrough/amd/iommu_init.c	Thu Mar 08 10:05:04 2012 +0000
@@ -33,6 +33,8 @@
 static long amd_iommu_cmd_buffer_entries = IOMMU_CMD_BUFFER_DEFAULT_ENTRIES;
 static long amd_iommu_event_log_entries = IOMMU_EVENT_LOG_DEFAULT_ENTRIES;
 
+static struct tasklet amd_iommu_irq_tasklet;
+
 unsigned short ivrs_bdf_entries;
 struct ivrs_mappings *ivrs_mappings;
 struct list_head amd_iommu_head;
@@ -517,34 +519,70 @@
     }
 }
 
+static void do_amd_iommu_irq(unsigned long data)
+{
+    struct amd_iommu *iommu;
+
+    if ( !iommu_found() )
+    {
+        AMD_IOMMU_DEBUG("no device found, something must be very wrong!\n");
+        return;
+   }
+
+    /*
+     * No matter from where the interrupt came from, check all the
+     * IOMMUs present in the system. This allows for having just one
+     * tasklet (instead of one per each IOMMUs).
+     */
+    for_each_amd_iommu ( iommu )
+    {
+        u32 entry;
+        unsigned long flags;
+        int of;
+
+        spin_lock_irqsave(&iommu->lock, flags);
+        amd_iommu_read_event_log(iommu);
+
+        /* check event overflow */
+        entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+        of = get_field_from_reg_u32(entry,
+                                   IOMMU_STATUS_EVENT_OVERFLOW_MASK,
+                                   IOMMU_STATUS_EVENT_OVERFLOW_SHIFT);
+
+        /* reset event log if event overflow */
+        if ( of )
+            amd_iommu_reset_event_log(iommu);
+
+        /* reset interrupt status bit */
+        entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
+        set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
+                             IOMMU_STATUS_EVENT_LOG_INT_MASK,
+                             IOMMU_STATUS_EVENT_LOG_INT_SHIFT, &entry);
+        writel(entry, iommu->mmio_base+IOMMU_STATUS_MMIO_OFFSET);
+        spin_unlock_irqrestore(&iommu->lock, flags);
+    }
+}
+
 static void amd_iommu_page_fault(int irq, void *dev_id,
                              struct cpu_user_regs *regs)
 {
     u32 entry;
     unsigned long flags;
-    int of;
     struct amd_iommu *iommu = dev_id;
 
     spin_lock_irqsave(&iommu->lock, flags);
-    amd_iommu_read_event_log(iommu);
 
-    /*check event overflow */
+    /* Silence interrupts from both event logging */
     entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
-    of = get_field_from_reg_u32(entry,
-                               IOMMU_STATUS_EVENT_OVERFLOW_MASK,
-                               IOMMU_STATUS_EVENT_OVERFLOW_SHIFT);
-
-    /* reset event log if event overflow */
-    if ( of )
-        amd_iommu_reset_event_log(iommu);
-
-    /* reset interrupt status bit */
-    entry = readl(iommu->mmio_base + IOMMU_STATUS_MMIO_OFFSET);
-    set_field_in_reg_u32(IOMMU_CONTROL_ENABLED, entry,
+    set_field_in_reg_u32(IOMMU_CONTROL_DISABLED, entry,
                          IOMMU_STATUS_EVENT_LOG_INT_MASK,
                          IOMMU_STATUS_EVENT_LOG_INT_SHIFT, &entry);
     writel(entry, iommu->mmio_base+IOMMU_STATUS_MMIO_OFFSET);
+
     spin_unlock_irqrestore(&iommu->lock, flags);
+
+    /* It is the tasklet that will clear the logs and re-enable interrupts */
+    tasklet_schedule(&amd_iommu_irq_tasklet);
 }
 
 static int set_iommu_interrupt_handler(struct amd_iommu *iommu)
@@ -689,6 +727,8 @@
     printk("AMD-Vi: IOMMU %d Enabled.\n", nr_amd_iommus );
     nr_amd_iommus++;
 
+    softirq_tasklet_init(&amd_iommu_irq_tasklet, do_amd_iommu_irq, 0);
+
     return 0;
 
 error_out:

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 20:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 20: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 1S5kMs-0007nu-3L; Thu, 08 Mar 2012 20: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 1S5kMq-0007nS-IG
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:20 +0000
Received: from [85.158.138.51:29809] by server-5.bemta-3.messagelabs.com id
	E0/4D-09139-7BC195F4; Thu, 08 Mar 2012 20:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1331240116!16762863!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20645 invoked from network); 8 Mar 2012 20:55:17 -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 Mar 2012 20: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 1S5kMk-0006TP-Gr
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5kMk-0007yU-2t
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:14 +0000
Message-Id: <E1S5kMk-0007yU-2t@xenbits.xen.org>
Date: Thu, 08 Mar 2012 20: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] introduce xzalloc() & Co
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331201015 0
# Node ID 0bbaff574126e8fb417abe6d94b42f7bf460ad26
# Parent  8a2e167905d3d0447d3ab1a5e58a37187c9b9046
introduce xzalloc() & Co

Rather than having to match a call to one of the xmalloc() flavors
with a subsequent memset(), introduce a zeroing variant of each of
those flavors.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23900:e09ebf7a31f5
xen-unstable date:        Tue Oct 04 14:15:26 2011 +0200
---


diff -r 8a2e167905d3 -r 0bbaff574126 xen/common/xmalloc_tlsf.c
--- a/xen/common/xmalloc_tlsf.c	Thu Mar 08 08:58:26 2012 +0000
+++ b/xen/common/xmalloc_tlsf.c	Thu Mar 08 10:03:35 2012 +0000
@@ -585,6 +585,13 @@
     return p;
 }
 
+void *_xzalloc(unsigned long size, unsigned long align)
+{
+    void *p = _xmalloc(size, align);
+
+    return p ? memset(p, 0, size) : p;
+}
+
 void xfree(void *p)
 {
     struct bhdr *b;
diff -r 8a2e167905d3 -r 0bbaff574126 xen/include/acpi/platform/aclinux.h
--- a/xen/include/acpi/platform/aclinux.h	Thu Mar 08 08:58:26 2012 +0000
+++ b/xen/include/acpi/platform/aclinux.h	Thu Mar 08 10:03:35 2012 +0000
@@ -77,10 +77,7 @@
 #define acpi_thread_id struct vcpu *
 
 #define ACPI_ALLOCATE(a)	xmalloc_bytes(a)
-#define ACPI_ALLOCATE_ZEROED(a)	({              \
-    void *p = xmalloc_bytes(a);                 \
-    if ( p ) memset(p, 0, a);                   \
-    p; })
+#define ACPI_ALLOCATE_ZEROED(a)	xzalloc_bytes(a)
 #define ACPI_FREE(a)		xfree(a)
 
 #endif				/* __ACLINUX_H__ */
diff -r 8a2e167905d3 -r 0bbaff574126 xen/include/xen/xmalloc.h
--- a/xen/include/xen/xmalloc.h	Thu Mar 08 08:58:26 2012 +0000
+++ b/xen/include/xen/xmalloc.h	Thu Mar 08 10:03:35 2012 +0000
@@ -8,19 +8,25 @@
 
 /* Allocate space for typed object. */
 #define xmalloc(_type) ((_type *)_xmalloc(sizeof(_type), __alignof__(_type)))
+#define xzalloc(_type) ((_type *)_xzalloc(sizeof(_type), __alignof__(_type)))
 
 /* Allocate space for array of typed objects. */
 #define xmalloc_array(_type, _num) \
     ((_type *)_xmalloc_array(sizeof(_type), __alignof__(_type), _num))
+#define xzalloc_array(_type, _num) \
+    ((_type *)_xzalloc_array(sizeof(_type), __alignof__(_type), _num))
 
 /* Allocate untyped storage. */
-#define xmalloc_bytes(_bytes) (_xmalloc(_bytes, SMP_CACHE_BYTES))
+#define xmalloc_bytes(_bytes) _xmalloc(_bytes, SMP_CACHE_BYTES)
+#define xzalloc_bytes(_bytes) _xzalloc(_bytes, SMP_CACHE_BYTES)
 
 /* Free any of the above. */
 extern void xfree(void *);
 
 /* Underlying functions */
 extern void *_xmalloc(unsigned long size, unsigned long align);
+extern void *_xzalloc(unsigned long size, unsigned long align);
+
 static inline void *_xmalloc_array(
     unsigned long size, unsigned long align, unsigned long num)
 {
@@ -30,6 +36,15 @@
  	return _xmalloc(size * num, align);
 }
 
+static inline void *_xzalloc_array(
+    unsigned long size, unsigned long align, unsigned long num)
+{
+    /* Check for overflow. */
+    if (size && num > UINT_MAX / size)
+        return NULL;
+    return _xzalloc(size * num, align);
+}
+
 /*
  * Pooled allocator interface.
  */

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

From xen-changelog-bounces@lists.xen.org Thu Mar 08 20:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 08 Mar 2012 20: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 1S5kMs-0007nu-3L; Thu, 08 Mar 2012 20: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 1S5kMq-0007nS-IG
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:20 +0000
Received: from [85.158.138.51:29809] by server-5.bemta-3.messagelabs.com id
	E0/4D-09139-7BC195F4; Thu, 08 Mar 2012 20:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1331240116!16762863!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20645 invoked from network); 8 Mar 2012 20:55:17 -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 Mar 2012 20: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 1S5kMk-0006TP-Gr
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S5kMk-0007yU-2t
	for xen-changelog@lists.xensource.com; Thu, 08 Mar 2012 20:55:14 +0000
Message-Id: <E1S5kMk-0007yU-2t@xenbits.xen.org>
Date: Thu, 08 Mar 2012 20: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] introduce xzalloc() & Co
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331201015 0
# Node ID 0bbaff574126e8fb417abe6d94b42f7bf460ad26
# Parent  8a2e167905d3d0447d3ab1a5e58a37187c9b9046
introduce xzalloc() & Co

Rather than having to match a call to one of the xmalloc() flavors
with a subsequent memset(), introduce a zeroing variant of each of
those flavors.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23900:e09ebf7a31f5
xen-unstable date:        Tue Oct 04 14:15:26 2011 +0200
---


diff -r 8a2e167905d3 -r 0bbaff574126 xen/common/xmalloc_tlsf.c
--- a/xen/common/xmalloc_tlsf.c	Thu Mar 08 08:58:26 2012 +0000
+++ b/xen/common/xmalloc_tlsf.c	Thu Mar 08 10:03:35 2012 +0000
@@ -585,6 +585,13 @@
     return p;
 }
 
+void *_xzalloc(unsigned long size, unsigned long align)
+{
+    void *p = _xmalloc(size, align);
+
+    return p ? memset(p, 0, size) : p;
+}
+
 void xfree(void *p)
 {
     struct bhdr *b;
diff -r 8a2e167905d3 -r 0bbaff574126 xen/include/acpi/platform/aclinux.h
--- a/xen/include/acpi/platform/aclinux.h	Thu Mar 08 08:58:26 2012 +0000
+++ b/xen/include/acpi/platform/aclinux.h	Thu Mar 08 10:03:35 2012 +0000
@@ -77,10 +77,7 @@
 #define acpi_thread_id struct vcpu *
 
 #define ACPI_ALLOCATE(a)	xmalloc_bytes(a)
-#define ACPI_ALLOCATE_ZEROED(a)	({              \
-    void *p = xmalloc_bytes(a);                 \
-    if ( p ) memset(p, 0, a);                   \
-    p; })
+#define ACPI_ALLOCATE_ZEROED(a)	xzalloc_bytes(a)
 #define ACPI_FREE(a)		xfree(a)
 
 #endif				/* __ACLINUX_H__ */
diff -r 8a2e167905d3 -r 0bbaff574126 xen/include/xen/xmalloc.h
--- a/xen/include/xen/xmalloc.h	Thu Mar 08 08:58:26 2012 +0000
+++ b/xen/include/xen/xmalloc.h	Thu Mar 08 10:03:35 2012 +0000
@@ -8,19 +8,25 @@
 
 /* Allocate space for typed object. */
 #define xmalloc(_type) ((_type *)_xmalloc(sizeof(_type), __alignof__(_type)))
+#define xzalloc(_type) ((_type *)_xzalloc(sizeof(_type), __alignof__(_type)))
 
 /* Allocate space for array of typed objects. */
 #define xmalloc_array(_type, _num) \
     ((_type *)_xmalloc_array(sizeof(_type), __alignof__(_type), _num))
+#define xzalloc_array(_type, _num) \
+    ((_type *)_xzalloc_array(sizeof(_type), __alignof__(_type), _num))
 
 /* Allocate untyped storage. */
-#define xmalloc_bytes(_bytes) (_xmalloc(_bytes, SMP_CACHE_BYTES))
+#define xmalloc_bytes(_bytes) _xmalloc(_bytes, SMP_CACHE_BYTES)
+#define xzalloc_bytes(_bytes) _xzalloc(_bytes, SMP_CACHE_BYTES)
 
 /* Free any of the above. */
 extern void xfree(void *);
 
 /* Underlying functions */
 extern void *_xmalloc(unsigned long size, unsigned long align);
+extern void *_xzalloc(unsigned long size, unsigned long align);
+
 static inline void *_xmalloc_array(
     unsigned long size, unsigned long align, unsigned long num)
 {
@@ -30,6 +36,15 @@
  	return _xmalloc(size * num, align);
 }
 
+static inline void *_xzalloc_array(
+    unsigned long size, unsigned long align, unsigned long num)
+{
+    /* Check for overflow. */
+    if (size && num > UINT_MAX / size)
+        return NULL;
+    return _xzalloc(size * num, align);
+}
+
 /*
  * Pooled allocator interface.
  */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2H-0007ng-Bf; Sat, 10 Mar 2012 06:44: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 1S6G2F-0007nR-Cc
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:11 +0000
Received: from [85.158.138.51:17169] by server-10.bemta-3.messagelabs.com id
	0C/70-13338-A38FA5F4; Sat, 10 Mar 2012 06:44:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1331361848!16998079!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21283 invoked from network); 10 Mar 2012 06:44:09 -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 Mar 2012 06:44: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 1S6G2C-0006aU-Fd
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2C-0004YN-9u
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:08 +0000
Message-Id: <E1S6G2C-0004YN-9u@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Low mem virq incremental 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331197522 0
# Node ID 56ca2b874928af0352e445ee31aefe5d7fda2f49
# Parent  f611200469159a960c3f0b975aa0f91ec768e29f
Low mem virq incremental adjustments

Consider tmem before firing the virq.

Add .gitignore rune.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r f61120046915 -r 56ca2b874928 .gitignore
--- a/.gitignore	Wed Mar 07 11:50:31 2012 +0100
+++ b/.gitignore	Thu Mar 08 09:05:22 2012 +0000
@@ -203,6 +203,7 @@
 tools/misc/gtraceview
 tools/misc/gtracestat
 tools/misc/xenlockprof
+tools/misc/lowmemd
 tools/pygrub/build/*
 tools/python/build/*
 tools/python/xen/util/path.py
diff -r f61120046915 -r 56ca2b874928 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Wed Mar 07 11:50:31 2012 +0100
+++ b/xen/common/page_alloc.c	Thu Mar 08 09:05:22 2012 +0000
@@ -373,7 +373,10 @@
 
 static void check_low_mem_virq(void)
 {
-    if ( unlikely(total_avail_pages <= low_mem_virq_th) )
+    unsigned long avail_pages = total_avail_pages +
+        opt_tmem ? tmem_freeable_pages() : 0;
+
+    if ( unlikely(avail_pages <= low_mem_virq_th) )
     {
         send_global_virq(VIRQ_ENOMEM);
 
@@ -387,7 +390,7 @@
         return;
     }
 
-    if ( unlikely(total_avail_pages >= low_mem_virq_high) )
+    if ( unlikely(avail_pages >= low_mem_virq_high) )
     {
         /* Reset hysteresis. Bring threshold up one order.
          * If we are back where originally set, set high

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2J-0007oe-Ou; Sat, 10 Mar 2012 06: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 1S6G2I-0007nW-0B
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:14 +0000
Received: from [85.158.143.99:46496] by server-2.bemta-4.messagelabs.com id
	5F/32-17550-D38FA5F4; Sat, 10 Mar 2012 06:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1331361851!18493650!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14286 invoked from network); 10 Mar 2012 06:44: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 Mar 2012 06: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 1S6G2F-0006aj-4f
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2F-0004al-0F
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:11 +0000
Message-Id: <E1S6G2F-0004al-0F@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] svm: Fake out the Bus Unit Config
	MSR on revF AMD 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331198241 0
# Node ID 322300fd2ebd7857b536531ccb79ceed5f799a36
# Parent  02216ba702b0a8f58871e1d9292b243f9b645b0b
svm: Fake out the Bus Unit Config MSR on revF AMD CPUs

Win2k8 x64 reads this MSR on revF chips, where it wasn't publically
available; it uses a magic constant in %rdi as a password, which we
don't have in rdmsr_safe().  Since we'll ignore the later writes, just
use a plausible value here (the reset value from rev10h chips) if the
real CPU didn't provide one.

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


diff -r 02216ba702b0 -r 322300fd2ebd xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Thu Mar 08 09:16:09 2012 +0000
+++ b/xen/arch/x86/hvm/svm/svm.c	Thu Mar 08 09:17:21 2012 +0000
@@ -1505,6 +1505,18 @@
         if ( rdmsr_safe(msr, *msr_content) == 0 )
             break;
 
+        if ( msr == MSR_F10_BU_CFG )
+        {
+            /* Win2k8 x64 reads this MSR on revF chips, where it
+             * wasn't publically available; it uses a magic constant
+             * in %rdi as a password, which we don't have in
+             * rdmsr_safe().  Since we'll ignore the later writes,
+             * just use a plausible value here (the reset value from
+             * rev10h chips) if the real CPU didn't provide one. */
+            *msr_content = 0x0000000010200020ull;
+            break;
+        }
+
         goto gpf;
     }
 
diff -r 02216ba702b0 -r 322300fd2ebd xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Thu Mar 08 09:16:09 2012 +0000
+++ b/xen/include/asm-x86/msr-index.h	Thu Mar 08 09:17:21 2012 +0000
@@ -209,6 +209,9 @@
 #define MSR_F10_MC4_MISC2		0xc0000409
 #define MSR_F10_MC4_MISC3		0xc000040A
 
+/* AMD Family10h MMU control MSRs */
+#define MSR_F10_BU_CFG                  0xc0011023
+
 /* Other AMD Fam10h MSRs */
 #define MSR_FAM10H_MMIO_CONF_BASE	0xc0010058
 #define FAM10H_MMIO_CONF_ENABLE         (1<<0)

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2H-0007ng-Bf; Sat, 10 Mar 2012 06:44: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 1S6G2F-0007nR-Cc
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:11 +0000
Received: from [85.158.138.51:17169] by server-10.bemta-3.messagelabs.com id
	0C/70-13338-A38FA5F4; Sat, 10 Mar 2012 06:44:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1331361848!16998079!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21283 invoked from network); 10 Mar 2012 06:44:09 -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 Mar 2012 06:44: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 1S6G2C-0006aU-Fd
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2C-0004YN-9u
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:08 +0000
Message-Id: <E1S6G2C-0004YN-9u@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Low mem virq incremental 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331197522 0
# Node ID 56ca2b874928af0352e445ee31aefe5d7fda2f49
# Parent  f611200469159a960c3f0b975aa0f91ec768e29f
Low mem virq incremental adjustments

Consider tmem before firing the virq.

Add .gitignore rune.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r f61120046915 -r 56ca2b874928 .gitignore
--- a/.gitignore	Wed Mar 07 11:50:31 2012 +0100
+++ b/.gitignore	Thu Mar 08 09:05:22 2012 +0000
@@ -203,6 +203,7 @@
 tools/misc/gtraceview
 tools/misc/gtracestat
 tools/misc/xenlockprof
+tools/misc/lowmemd
 tools/pygrub/build/*
 tools/python/build/*
 tools/python/xen/util/path.py
diff -r f61120046915 -r 56ca2b874928 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Wed Mar 07 11:50:31 2012 +0100
+++ b/xen/common/page_alloc.c	Thu Mar 08 09:05:22 2012 +0000
@@ -373,7 +373,10 @@
 
 static void check_low_mem_virq(void)
 {
-    if ( unlikely(total_avail_pages <= low_mem_virq_th) )
+    unsigned long avail_pages = total_avail_pages +
+        opt_tmem ? tmem_freeable_pages() : 0;
+
+    if ( unlikely(avail_pages <= low_mem_virq_th) )
     {
         send_global_virq(VIRQ_ENOMEM);
 
@@ -387,7 +390,7 @@
         return;
     }
 
-    if ( unlikely(total_avail_pages >= low_mem_virq_high) )
+    if ( unlikely(avail_pages >= low_mem_virq_high) )
     {
         /* Reset hysteresis. Bring threshold up one order.
          * If we are back where originally set, set high

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2I-0007oE-Jo; Sat, 10 Mar 2012 06:44: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 1S6G2H-0007nW-H7
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:13 +0000
Received: from [85.158.143.35:55059] by server-2.bemta-4.messagelabs.com id
	AE/32-17550-D38FA5F4; Sat, 10 Mar 2012 06:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1331361851!10934547!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13555 invoked from network); 10 Mar 2012 06:44:12 -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;
	10 Mar 2012 06: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 1S6G2E-0006ag-KM
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2E-0004aI-Fn
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:10 +0000
Message-Id: <E1S6G2E-0004aI-Fn@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Add more specific logging for
	get_page_from_l1e failures
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331198169 0
# Node ID 02216ba702b0a8f58871e1d9292b243f9b645b0b
# Parent  569ce192e3dd3beb45e311783cca1c633c28a7cc
x86: Add more specific logging for get_page_from_l1e failures

This patch should clarify which of the two possible reasons cause the
messages
of the form "(XEN) mm.c:908:d1 Error getting mfn 29b2b (pfn
5555555555555555)
from L1 entry 0000000029b2b067 for l1e_owner=1, pg_owner=1".

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


diff -r 569ce192e3dd -r 02216ba702b0 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Mar 08 09:15:26 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Mar 08 09:16:09 2012 +0000
@@ -889,7 +889,12 @@
          */
         if ( (real_pg_owner == NULL) || (pg_owner == l1e_owner) ||
              !IS_PRIV_FOR(pg_owner, real_pg_owner) )
+        {
+            MEM_LOG("pg_owner %d l1e_owner %d, but real_pg_owner %d",
+                    pg_owner->domain_id, l1e_owner->domain_id,
+                    real_pg_owner?real_pg_owner->domain_id:-1);
             goto could_not_pin;
+        }
         pg_owner = real_pg_owner;
     }
 
@@ -905,7 +910,10 @@
     write = (l1f & _PAGE_RW) &&
             ((l1e_owner == pg_owner) || !paging_mode_external(pg_owner));
     if ( write && !get_page_type(page, PGT_writable_page) )
+    {
+        MEM_LOG("Could not get page type PGT_writable_page");
         goto could_not_pin;
+    }
 
     if ( pte_flags_to_cacheattr(l1f) !=
          ((page->count_info & PGC_cacheattr_mask) >> PGC_cacheattr_base) )

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2J-0007oo-Rz; Sat, 10 Mar 2012 06: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 1S6G2I-0007nW-QD
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:15 +0000
Received: from [85.158.143.99:46509] by server-2.bemta-4.messagelabs.com id
	D0/42-17550-E38FA5F4; Sat, 10 Mar 2012 06:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1331361852!18568193!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26608 invoked from network); 10 Mar 2012 06:44:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Mar 2012 06: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 1S6G2F-0006am-JX
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2F-0004bF-I8
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:11 +0000
Message-Id: <E1S6G2F-0004bF-I8@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] NMI: Command line parameter for
	watchdog timeout
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331198607 0
# Node ID 2487f63339c00a91cf80c1a4598c10fdcaac0464
# Parent  322300fd2ebd7857b536531ccb79ceed5f799a36
NMI: Command line parameter for watchdog timeout

Introduce a command parameter to set the watchtog timeout.  Manually
specifying "watchdog_timeout=<seconds>" on the command line will also
turn the watchdog on.  For consistency, move opt_watchdog into nmi.c
along with opt_watchdog_timeout.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 322300fd2ebd -r 2487f63339c0 docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Thu Mar 08 09:17:21 2012 +0000
+++ b/docs/misc/xen-command-line.markdown	Thu Mar 08 09:23:27 2012 +0000
@@ -391,7 +391,17 @@
 ### watchdog
 > `= <boolean>`
 
-Run an NMI watchdog on each processor.  Defaults to disabled.
+> Default: `false`
+
+Run an NMI watchdog on each processor.  If a processor is stuck for longer than the watchdog\_timeout, a panic occurs.
+
+### watchdog\_timeout
+> `= <integer>`
+
+> Default: `5`
+
+Set the NMI watchdog timeout in seconds.  Specifying `0` will turn off the watchdog.
+
 ### x2apic
 ### x2apic\_phys
 ### xencons
diff -r 322300fd2ebd -r 2487f63339c0 xen/arch/x86/nmi.c
--- a/xen/arch/x86/nmi.c	Thu Mar 08 09:17:21 2012 +0000
+++ b/xen/arch/x86/nmi.c	Thu Mar 08 09:23:27 2012 +0000
@@ -40,6 +40,19 @@
 static DEFINE_PER_CPU(struct timer, nmi_timer);
 static DEFINE_PER_CPU(unsigned int, nmi_timer_ticks);
 
+/* opt_watchdog: If true, run a watchdog NMI on each processor. */
+bool_t __initdata opt_watchdog = 0;
+boolean_param("watchdog", opt_watchdog);
+
+/* opt_watchdog_timeout: Number of seconds to wait before panic. */
+static unsigned int opt_watchdog_timeout = 5;
+static void parse_watchdog_timeout(char * s)
+{
+    opt_watchdog_timeout = simple_strtoull(s, NULL, 0);
+    opt_watchdog = !!opt_watchdog_timeout;
+}
+custom_param("watchdog_timeout", parse_watchdog_timeout);
+
 /*
  * lapic_nmi_owner tracks the ownership of the lapic NMI hardware:
  * - it may be reserved by some other driver, or not
@@ -425,11 +438,11 @@
          !atomic_read(&watchdog_disable_count) )
     {
         /*
-         * Ayiee, looks like this CPU is stuck ... wait a few IRQs (5 seconds) 
+         * Ayiee, looks like this CPU is stuck ... wait for the timeout
          * before doing the oops ...
          */
         this_cpu(alert_counter)++;
-        if ( this_cpu(alert_counter) == 5*nmi_hz )
+        if ( this_cpu(alert_counter) == opt_watchdog_timeout*nmi_hz )
         {
             console_force_unlock();
             printk("Watchdog timer detects that CPU%d is stuck!\n",
diff -r 322300fd2ebd -r 2487f63339c0 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Thu Mar 08 09:17:21 2012 +0000
+++ b/xen/arch/x86/setup.c	Thu Mar 08 09:23:27 2012 +0000
@@ -45,6 +45,7 @@
 #include <asm/mach-generic/mach_apic.h> /* for generic_apic_probe */
 #include <asm/setup.h>
 #include <xen/cpu.h>
+#include <asm/nmi.h>
 
 /* opt_nosmp: If true, secondary processors are ignored. */
 static bool_t __initdata opt_nosmp;
@@ -54,10 +55,6 @@
 static unsigned int __initdata max_cpus;
 integer_param("maxcpus", max_cpus);
 
-/* opt_watchdog: If true, run a watchdog NMI on each processor. */
-static bool_t __initdata opt_watchdog;
-boolean_param("watchdog", opt_watchdog);
-
 /* smep: Enable/disable Supervisor Mode Execution Protection (default on). */
 static bool_t __initdata disable_smep;
 invbool_param("smep", disable_smep);
diff -r 322300fd2ebd -r 2487f63339c0 xen/include/asm-x86/nmi.h
--- a/xen/include/asm-x86/nmi.h	Thu Mar 08 09:17:21 2012 +0000
+++ b/xen/include/asm-x86/nmi.h	Thu Mar 08 09:23:27 2012 +0000
@@ -5,6 +5,9 @@
 #include <public/nmi.h>
 
 struct cpu_user_regs;
+
+/* Watchdog boolean from the command line */
+extern bool_t opt_watchdog;
  
 typedef int (*nmi_callback_t)(struct cpu_user_regs *regs, int cpu);
  

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2J-0007ot-V4; Sat, 10 Mar 2012 06: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 1S6G2J-0007nd-5D
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:15 +0000
Received: from [85.158.143.99:46526] by server-1.bemta-4.messagelabs.com id
	54/D7-20925-E38FA5F4; Sat, 10 Mar 2012 06:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1331361852!17995279!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7054 invoked from network); 10 Mar 2012 06:44:13 -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;
	10 Mar 2012 06: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 1S6G2G-0006ap-8c
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2G-0004bl-42
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:12 +0000
Message-Id: <E1S6G2G-0004bl-42@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvm: Print support/enable status of
	HAP superpage mappings.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331199829 0
# Node ID 0384f791e5383cb91e44f1be021f335e9d92de33
# Parent  2487f63339c00a91cf80c1a4598c10fdcaac0464
hvm: Print support/enable status of HAP superpage mappings.

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


diff -r 2487f63339c0 -r 0384f791e538 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 08 09:23:27 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Mar 08 09:43:49 2012 +0000
@@ -131,7 +131,15 @@
 
     printk("HVM: %s enabled\n", hvm_funcs.name);
     if ( hvm_funcs.hap_supported )
-        printk("HVM: Hardware Assisted Paging detected.\n");
+    {
+        printk("HVM: Hardware Assisted Paging (HAP) detected\n");
+        printk("HVM: HAP page sizes: 4kB");
+        if ( hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_2MB )
+            printk(", 2MB%s", opt_hap_2mb ? "" : " [disabled]");
+        if ( hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_1GB )
+            printk(", 1GB%s", opt_hap_1gb ? "" : " [disabled]");
+        printk("\n");
+    }
 
     /*
      * Allow direct access to the PC debug ports 0x80 and 0xed (they are
diff -r 2487f63339c0 -r 0384f791e538 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Thu Mar 08 09:23:27 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Thu Mar 08 09:43:49 2012 +0000
@@ -93,11 +93,6 @@
 
     if ( !printed )
         printk(" - none\n");
-
-    if ( cpu_has_vmx_ept_1gb )
-        printk("EPT supports 1GB super page.\n");
-    if ( cpu_has_vmx_ept_2mb )
-        printk("EPT supports 2MB super page.\n");
 }
 
 static u32 adjust_vmx_controls(
diff -r 2487f63339c0 -r 0384f791e538 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Mar 08 09:23:27 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Mar 08 09:43:49 2012 +0000
@@ -40,10 +40,10 @@
 #include "mm-locks.h"
 
 /* turn on/off 1GB host page table support for hap, default on */
-static bool_t __read_mostly opt_hap_1gb = 1;
+bool_t __read_mostly opt_hap_1gb = 1;
 boolean_param("hap_1gb", opt_hap_1gb);
 
-static bool_t __read_mostly opt_hap_2mb = 1;
+bool_t __read_mostly opt_hap_2mb = 1;
 boolean_param("hap_2mb", opt_hap_2mb);
 
 /* Printouts */
diff -r 2487f63339c0 -r 0384f791e538 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Mar 08 09:23:27 2012 +0000
+++ b/xen/include/asm-x86/p2m.h	Thu Mar 08 09:43:49 2012 +0000
@@ -32,6 +32,8 @@
 #include <asm/mem_sharing.h>
 #include <asm/page.h>    /* for pagetable_t */
 
+extern bool_t opt_hap_1gb, opt_hap_2mb;
+
 /*
  * The phys_to_machine_mapping maps guest physical frame numbers 
  * to machine frame numbers.  It only exists for paging_mode_translate 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2I-0007o9-GZ; Sat, 10 Mar 2012 06:44: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 1S6G2H-0007nd-75
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:13 +0000
Received: from [85.158.143.35:55035] by server-1.bemta-4.messagelabs.com id
	AF/C7-20925-C38FA5F4; Sat, 10 Mar 2012 06:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1331361850!3698968!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22341 invoked from network); 10 Mar 2012 06:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Mar 2012 06: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 1S6G2D-0006aa-HW
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2D-0004ZL-CX
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:09 +0000
Message-Id: <E1S6G2D-0004ZL-CX@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Make sure log-dirty is turned
	off before trying to dismantle it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331198005 0
# Node ID 42afd4d1669b6cdd5635ac0bf2d87f8f3917309b
# Parent  12c795ed5bec1f5f1c288b5326b9ab991b4f333c
x86: Make sure log-dirty is turned off before trying to dismantle it

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


diff -r 12c795ed5bec -r 42afd4d1669b xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Thu Mar 08 09:10:32 2012 +0000
+++ b/xen/arch/x86/mm/paging.c	Thu Mar 08 09:13:25 2012 +0000
@@ -722,6 +722,10 @@
 /* Call when destroying a domain */
 void paging_teardown(struct domain *d)
 {
+    /* Make sure log-dirty is turned off before trying to dismantle it. 
+     * Needs to be done here becuse it's covered by the hap/shadow lock */
+    d->arch.paging.log_dirty.disable_log_dirty(d);
+
     if ( hap_enabled(d) )
         hap_teardown(d);
     else

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2J-0007oZ-MX; Sat, 10 Mar 2012 06:44: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 1S6G2H-0007ne-Ln
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:13 +0000
Received: from [85.158.139.83:19624] by server-2.bemta-5.messagelabs.com id
	8B/D9-17016-C38FA5F4; Sat, 10 Mar 2012 06:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1331361850!7471339!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29666 invoked from network); 10 Mar 2012 06:44:11 -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 Mar 2012 06: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 1S6G2E-0006ad-Bi
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2D-0004Zo-UD
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:09 +0000
Message-Id: <E1S6G2D-0004Zo-UD@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Reduce severity of hvm_op
	warnings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331198126 0
# Node ID 569ce192e3dd3beb45e311783cca1c633c28a7cc
# Parent  42afd4d1669b6cdd5635ac0bf2d87f8f3917309b
x86: Reduce severity of hvm_op warnings

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


diff -r 42afd4d1669b -r 569ce192e3dd xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 08 09:13:25 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Mar 08 09:15:26 2012 +0000
@@ -4257,7 +4257,7 @@
 
     default:
     {
-        gdprintk(XENLOG_WARNING, "Bad HVM op %ld.\n", op);
+        gdprintk(XENLOG_DEBUG, "Bad HVM op %ld.\n", op);
         rc = -ENOSYS;
         break;
     }
diff -r 42afd4d1669b -r 569ce192e3dd xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Mar 08 09:13:25 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Mar 08 09:15:26 2012 +0000
@@ -713,7 +713,7 @@
     case XEN_DOMCTL_SHADOW_OP_OFF:
         return 0;
     default:
-        HAP_ERROR("Bad hap domctl op %u\n", sc->op);
+        HAP_PRINTK("Bad hap domctl op %u\n", sc->op);
         return -EINVAL;
     }
 }

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2J-0007oZ-MX; Sat, 10 Mar 2012 06:44: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 1S6G2H-0007ne-Ln
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:13 +0000
Received: from [85.158.139.83:19624] by server-2.bemta-5.messagelabs.com id
	8B/D9-17016-C38FA5F4; Sat, 10 Mar 2012 06:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1331361850!7471339!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29666 invoked from network); 10 Mar 2012 06:44:11 -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 Mar 2012 06: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 1S6G2E-0006ad-Bi
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2D-0004Zo-UD
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:09 +0000
Message-Id: <E1S6G2D-0004Zo-UD@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Reduce severity of hvm_op
	warnings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331198126 0
# Node ID 569ce192e3dd3beb45e311783cca1c633c28a7cc
# Parent  42afd4d1669b6cdd5635ac0bf2d87f8f3917309b
x86: Reduce severity of hvm_op warnings

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


diff -r 42afd4d1669b -r 569ce192e3dd xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 08 09:13:25 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Mar 08 09:15:26 2012 +0000
@@ -4257,7 +4257,7 @@
 
     default:
     {
-        gdprintk(XENLOG_WARNING, "Bad HVM op %ld.\n", op);
+        gdprintk(XENLOG_DEBUG, "Bad HVM op %ld.\n", op);
         rc = -ENOSYS;
         break;
     }
diff -r 42afd4d1669b -r 569ce192e3dd xen/arch/x86/mm/hap/hap.c
--- a/xen/arch/x86/mm/hap/hap.c	Thu Mar 08 09:13:25 2012 +0000
+++ b/xen/arch/x86/mm/hap/hap.c	Thu Mar 08 09:15:26 2012 +0000
@@ -713,7 +713,7 @@
     case XEN_DOMCTL_SHADOW_OP_OFF:
         return 0;
     default:
-        HAP_ERROR("Bad hap domctl op %u\n", sc->op);
+        HAP_PRINTK("Bad hap domctl op %u\n", sc->op);
         return -EINVAL;
     }
 }

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2J-0007oo-Rz; Sat, 10 Mar 2012 06: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 1S6G2I-0007nW-QD
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:15 +0000
Received: from [85.158.143.99:46509] by server-2.bemta-4.messagelabs.com id
	D0/42-17550-E38FA5F4; Sat, 10 Mar 2012 06:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-216.messagelabs.com!1331361852!18568193!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26608 invoked from network); 10 Mar 2012 06:44:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Mar 2012 06: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 1S6G2F-0006am-JX
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2F-0004bF-I8
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:11 +0000
Message-Id: <E1S6G2F-0004bF-I8@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] NMI: Command line parameter for
	watchdog timeout
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331198607 0
# Node ID 2487f63339c00a91cf80c1a4598c10fdcaac0464
# Parent  322300fd2ebd7857b536531ccb79ceed5f799a36
NMI: Command line parameter for watchdog timeout

Introduce a command parameter to set the watchtog timeout.  Manually
specifying "watchdog_timeout=<seconds>" on the command line will also
turn the watchdog on.  For consistency, move opt_watchdog into nmi.c
along with opt_watchdog_timeout.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 322300fd2ebd -r 2487f63339c0 docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Thu Mar 08 09:17:21 2012 +0000
+++ b/docs/misc/xen-command-line.markdown	Thu Mar 08 09:23:27 2012 +0000
@@ -391,7 +391,17 @@
 ### watchdog
 > `= <boolean>`
 
-Run an NMI watchdog on each processor.  Defaults to disabled.
+> Default: `false`
+
+Run an NMI watchdog on each processor.  If a processor is stuck for longer than the watchdog\_timeout, a panic occurs.
+
+### watchdog\_timeout
+> `= <integer>`
+
+> Default: `5`
+
+Set the NMI watchdog timeout in seconds.  Specifying `0` will turn off the watchdog.
+
 ### x2apic
 ### x2apic\_phys
 ### xencons
diff -r 322300fd2ebd -r 2487f63339c0 xen/arch/x86/nmi.c
--- a/xen/arch/x86/nmi.c	Thu Mar 08 09:17:21 2012 +0000
+++ b/xen/arch/x86/nmi.c	Thu Mar 08 09:23:27 2012 +0000
@@ -40,6 +40,19 @@
 static DEFINE_PER_CPU(struct timer, nmi_timer);
 static DEFINE_PER_CPU(unsigned int, nmi_timer_ticks);
 
+/* opt_watchdog: If true, run a watchdog NMI on each processor. */
+bool_t __initdata opt_watchdog = 0;
+boolean_param("watchdog", opt_watchdog);
+
+/* opt_watchdog_timeout: Number of seconds to wait before panic. */
+static unsigned int opt_watchdog_timeout = 5;
+static void parse_watchdog_timeout(char * s)
+{
+    opt_watchdog_timeout = simple_strtoull(s, NULL, 0);
+    opt_watchdog = !!opt_watchdog_timeout;
+}
+custom_param("watchdog_timeout", parse_watchdog_timeout);
+
 /*
  * lapic_nmi_owner tracks the ownership of the lapic NMI hardware:
  * - it may be reserved by some other driver, or not
@@ -425,11 +438,11 @@
          !atomic_read(&watchdog_disable_count) )
     {
         /*
-         * Ayiee, looks like this CPU is stuck ... wait a few IRQs (5 seconds) 
+         * Ayiee, looks like this CPU is stuck ... wait for the timeout
          * before doing the oops ...
          */
         this_cpu(alert_counter)++;
-        if ( this_cpu(alert_counter) == 5*nmi_hz )
+        if ( this_cpu(alert_counter) == opt_watchdog_timeout*nmi_hz )
         {
             console_force_unlock();
             printk("Watchdog timer detects that CPU%d is stuck!\n",
diff -r 322300fd2ebd -r 2487f63339c0 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Thu Mar 08 09:17:21 2012 +0000
+++ b/xen/arch/x86/setup.c	Thu Mar 08 09:23:27 2012 +0000
@@ -45,6 +45,7 @@
 #include <asm/mach-generic/mach_apic.h> /* for generic_apic_probe */
 #include <asm/setup.h>
 #include <xen/cpu.h>
+#include <asm/nmi.h>
 
 /* opt_nosmp: If true, secondary processors are ignored. */
 static bool_t __initdata opt_nosmp;
@@ -54,10 +55,6 @@
 static unsigned int __initdata max_cpus;
 integer_param("maxcpus", max_cpus);
 
-/* opt_watchdog: If true, run a watchdog NMI on each processor. */
-static bool_t __initdata opt_watchdog;
-boolean_param("watchdog", opt_watchdog);
-
 /* smep: Enable/disable Supervisor Mode Execution Protection (default on). */
 static bool_t __initdata disable_smep;
 invbool_param("smep", disable_smep);
diff -r 322300fd2ebd -r 2487f63339c0 xen/include/asm-x86/nmi.h
--- a/xen/include/asm-x86/nmi.h	Thu Mar 08 09:17:21 2012 +0000
+++ b/xen/include/asm-x86/nmi.h	Thu Mar 08 09:23:27 2012 +0000
@@ -5,6 +5,9 @@
 #include <public/nmi.h>
 
 struct cpu_user_regs;
+
+/* Watchdog boolean from the command line */
+extern bool_t opt_watchdog;
  
 typedef int (*nmi_callback_t)(struct cpu_user_regs *regs, int cpu);
  

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2J-0007ot-V4; Sat, 10 Mar 2012 06: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 1S6G2J-0007nd-5D
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:15 +0000
Received: from [85.158.143.99:46526] by server-1.bemta-4.messagelabs.com id
	54/D7-20925-E38FA5F4; Sat, 10 Mar 2012 06:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-216.messagelabs.com!1331361852!17995279!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7054 invoked from network); 10 Mar 2012 06:44:13 -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;
	10 Mar 2012 06: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 1S6G2G-0006ap-8c
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2G-0004bl-42
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:12 +0000
Message-Id: <E1S6G2G-0004bl-42@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvm: Print support/enable status of
	HAP superpage mappings.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331199829 0
# Node ID 0384f791e5383cb91e44f1be021f335e9d92de33
# Parent  2487f63339c00a91cf80c1a4598c10fdcaac0464
hvm: Print support/enable status of HAP superpage mappings.

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


diff -r 2487f63339c0 -r 0384f791e538 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 08 09:23:27 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Mar 08 09:43:49 2012 +0000
@@ -131,7 +131,15 @@
 
     printk("HVM: %s enabled\n", hvm_funcs.name);
     if ( hvm_funcs.hap_supported )
-        printk("HVM: Hardware Assisted Paging detected.\n");
+    {
+        printk("HVM: Hardware Assisted Paging (HAP) detected\n");
+        printk("HVM: HAP page sizes: 4kB");
+        if ( hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_2MB )
+            printk(", 2MB%s", opt_hap_2mb ? "" : " [disabled]");
+        if ( hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_1GB )
+            printk(", 1GB%s", opt_hap_1gb ? "" : " [disabled]");
+        printk("\n");
+    }
 
     /*
      * Allow direct access to the PC debug ports 0x80 and 0xed (they are
diff -r 2487f63339c0 -r 0384f791e538 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Thu Mar 08 09:23:27 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Thu Mar 08 09:43:49 2012 +0000
@@ -93,11 +93,6 @@
 
     if ( !printed )
         printk(" - none\n");
-
-    if ( cpu_has_vmx_ept_1gb )
-        printk("EPT supports 1GB super page.\n");
-    if ( cpu_has_vmx_ept_2mb )
-        printk("EPT supports 2MB super page.\n");
 }
 
 static u32 adjust_vmx_controls(
diff -r 2487f63339c0 -r 0384f791e538 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Mar 08 09:23:27 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Mar 08 09:43:49 2012 +0000
@@ -40,10 +40,10 @@
 #include "mm-locks.h"
 
 /* turn on/off 1GB host page table support for hap, default on */
-static bool_t __read_mostly opt_hap_1gb = 1;
+bool_t __read_mostly opt_hap_1gb = 1;
 boolean_param("hap_1gb", opt_hap_1gb);
 
-static bool_t __read_mostly opt_hap_2mb = 1;
+bool_t __read_mostly opt_hap_2mb = 1;
 boolean_param("hap_2mb", opt_hap_2mb);
 
 /* Printouts */
diff -r 2487f63339c0 -r 0384f791e538 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Mar 08 09:23:27 2012 +0000
+++ b/xen/include/asm-x86/p2m.h	Thu Mar 08 09:43:49 2012 +0000
@@ -32,6 +32,8 @@
 #include <asm/mem_sharing.h>
 #include <asm/page.h>    /* for pagetable_t */
 
+extern bool_t opt_hap_1gb, opt_hap_2mb;
+
 /*
  * The phys_to_machine_mapping maps guest physical frame numbers 
  * to machine frame numbers.  It only exists for paging_mode_translate 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2I-0007oE-Jo; Sat, 10 Mar 2012 06:44: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 1S6G2H-0007nW-H7
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:13 +0000
Received: from [85.158.143.35:55059] by server-2.bemta-4.messagelabs.com id
	AE/32-17550-D38FA5F4; Sat, 10 Mar 2012 06:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1331361851!10934547!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13555 invoked from network); 10 Mar 2012 06:44:12 -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;
	10 Mar 2012 06: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 1S6G2E-0006ag-KM
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2E-0004aI-Fn
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:10 +0000
Message-Id: <E1S6G2E-0004aI-Fn@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Add more specific logging for
	get_page_from_l1e failures
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331198169 0
# Node ID 02216ba702b0a8f58871e1d9292b243f9b645b0b
# Parent  569ce192e3dd3beb45e311783cca1c633c28a7cc
x86: Add more specific logging for get_page_from_l1e failures

This patch should clarify which of the two possible reasons cause the
messages
of the form "(XEN) mm.c:908:d1 Error getting mfn 29b2b (pfn
5555555555555555)
from L1 entry 0000000029b2b067 for l1e_owner=1, pg_owner=1".

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


diff -r 569ce192e3dd -r 02216ba702b0 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Mar 08 09:15:26 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Mar 08 09:16:09 2012 +0000
@@ -889,7 +889,12 @@
          */
         if ( (real_pg_owner == NULL) || (pg_owner == l1e_owner) ||
              !IS_PRIV_FOR(pg_owner, real_pg_owner) )
+        {
+            MEM_LOG("pg_owner %d l1e_owner %d, but real_pg_owner %d",
+                    pg_owner->domain_id, l1e_owner->domain_id,
+                    real_pg_owner?real_pg_owner->domain_id:-1);
             goto could_not_pin;
+        }
         pg_owner = real_pg_owner;
     }
 
@@ -905,7 +910,10 @@
     write = (l1f & _PAGE_RW) &&
             ((l1e_owner == pg_owner) || !paging_mode_external(pg_owner));
     if ( write && !get_page_type(page, PGT_writable_page) )
+    {
+        MEM_LOG("Could not get page type PGT_writable_page");
         goto could_not_pin;
+    }
 
     if ( pte_flags_to_cacheattr(l1f) !=
          ((page->count_info & PGC_cacheattr_mask) >> PGC_cacheattr_base) )

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2J-0007oe-Ou; Sat, 10 Mar 2012 06: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 1S6G2I-0007nW-0B
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:14 +0000
Received: from [85.158.143.99:46496] by server-2.bemta-4.messagelabs.com id
	5F/32-17550-D38FA5F4; Sat, 10 Mar 2012 06:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1331361851!18493650!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14286 invoked from network); 10 Mar 2012 06:44: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 Mar 2012 06: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 1S6G2F-0006aj-4f
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2F-0004al-0F
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:11 +0000
Message-Id: <E1S6G2F-0004al-0F@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] svm: Fake out the Bus Unit Config
	MSR on revF AMD 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331198241 0
# Node ID 322300fd2ebd7857b536531ccb79ceed5f799a36
# Parent  02216ba702b0a8f58871e1d9292b243f9b645b0b
svm: Fake out the Bus Unit Config MSR on revF AMD CPUs

Win2k8 x64 reads this MSR on revF chips, where it wasn't publically
available; it uses a magic constant in %rdi as a password, which we
don't have in rdmsr_safe().  Since we'll ignore the later writes, just
use a plausible value here (the reset value from rev10h chips) if the
real CPU didn't provide one.

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


diff -r 02216ba702b0 -r 322300fd2ebd xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Thu Mar 08 09:16:09 2012 +0000
+++ b/xen/arch/x86/hvm/svm/svm.c	Thu Mar 08 09:17:21 2012 +0000
@@ -1505,6 +1505,18 @@
         if ( rdmsr_safe(msr, *msr_content) == 0 )
             break;
 
+        if ( msr == MSR_F10_BU_CFG )
+        {
+            /* Win2k8 x64 reads this MSR on revF chips, where it
+             * wasn't publically available; it uses a magic constant
+             * in %rdi as a password, which we don't have in
+             * rdmsr_safe().  Since we'll ignore the later writes,
+             * just use a plausible value here (the reset value from
+             * rev10h chips) if the real CPU didn't provide one. */
+            *msr_content = 0x0000000010200020ull;
+            break;
+        }
+
         goto gpf;
     }
 
diff -r 02216ba702b0 -r 322300fd2ebd xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Thu Mar 08 09:16:09 2012 +0000
+++ b/xen/include/asm-x86/msr-index.h	Thu Mar 08 09:17:21 2012 +0000
@@ -209,6 +209,9 @@
 #define MSR_F10_MC4_MISC2		0xc0000409
 #define MSR_F10_MC4_MISC3		0xc000040A
 
+/* AMD Family10h MMU control MSRs */
+#define MSR_F10_BU_CFG                  0xc0011023
+
 /* Other AMD Fam10h MSRs */
 #define MSR_FAM10H_MMIO_CONF_BASE	0xc0010058
 #define FAM10H_MMIO_CONF_ENABLE         (1<<0)

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2I-0007o9-GZ; Sat, 10 Mar 2012 06:44: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 1S6G2H-0007nd-75
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:13 +0000
Received: from [85.158.143.35:55035] by server-1.bemta-4.messagelabs.com id
	AF/C7-20925-C38FA5F4; Sat, 10 Mar 2012 06:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1331361850!3698968!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22341 invoked from network); 10 Mar 2012 06:44:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Mar 2012 06: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 1S6G2D-0006aa-HW
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2D-0004ZL-CX
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:09 +0000
Message-Id: <E1S6G2D-0004ZL-CX@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Make sure log-dirty is turned
	off before trying to dismantle it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331198005 0
# Node ID 42afd4d1669b6cdd5635ac0bf2d87f8f3917309b
# Parent  12c795ed5bec1f5f1c288b5326b9ab991b4f333c
x86: Make sure log-dirty is turned off before trying to dismantle it

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


diff -r 12c795ed5bec -r 42afd4d1669b xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Thu Mar 08 09:10:32 2012 +0000
+++ b/xen/arch/x86/mm/paging.c	Thu Mar 08 09:13:25 2012 +0000
@@ -722,6 +722,10 @@
 /* Call when destroying a domain */
 void paging_teardown(struct domain *d)
 {
+    /* Make sure log-dirty is turned off before trying to dismantle it. 
+     * Needs to be done here becuse it's covered by the hap/shadow lock */
+    d->arch.paging.log_dirty.disable_log_dirty(d);
+
     if ( hap_enabled(d) )
         hap_teardown(d);
     else

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2L-0007pd-7R; Sat, 10 Mar 2012 06: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 1S6G2K-0007nd-22
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:16 +0000
Received: from [85.158.143.35:45616] by server-1.bemta-4.messagelabs.com id
	A5/D7-20925-F38FA5F4; Sat, 10 Mar 2012 06:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1331361853!10509507!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11486 invoked from network); 10 Mar 2012 06:44:14 -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;
	10 Mar 2012 06: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 1S6G2H-0006av-84
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2H-0004cl-6V
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:13 +0000
Message-Id: <E1S6G2H-0004cl-6V@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ia64: fix build (once more)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331210964 -3600
# Node ID 07adf050e1f463987f05070d586e564d8832f224
# Parent  72cda52c45d98d674582a9b746fd0cf6ee846e78
ia64: fix build (once more)

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


diff -r 72cda52c45d9 -r 07adf050e1f4 xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c	Thu Mar 08 12:30:03 2012 +0000
+++ b/xen/arch/ia64/xen/dom0_ops.c	Thu Mar 08 13:49:24 2012 +0100
@@ -558,7 +558,7 @@
 
         switch(mec->op)
         {
-            case XEN_DOMCTL_MEM_EVENT_OP_SHARING_CONTROL:
+            case XEN_DOMCTL_MEM_SHARING_CONTROL:
             {
                 if (mec->u.enable) {
                     ret = -EINVAL; /* not implemented */
diff -r 72cda52c45d9 -r 07adf050e1f4 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Thu Mar 08 12:30:03 2012 +0000
+++ b/xen/common/tmem_xen.c	Thu Mar 08 13:49:24 2012 +0100
@@ -13,7 +13,6 @@
 #include <xen/domain_page.h>
 #include <xen/cpu.h>
 #include <xen/init.h>
-#include <asm/p2m.h>
 
 #define EXPORT /* indicates code other modules are dependent upon */
 
@@ -103,6 +102,8 @@
     ASSERT(0);
 }
 #else
+#include <asm/p2m.h>
+
 static inline void *cli_get_page(tmem_cli_mfn_t cmfn, unsigned long *pcli_mfn,
                                  pfp_t **pcli_pfp, bool_t cli_write)
 {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2H-0007no-E7; Sat, 10 Mar 2012 06:44: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 1S6G2G-0007nW-9O
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:12 +0000
Received: from [85.158.143.99:46446] by server-2.bemta-4.messagelabs.com id
	8A/32-17550-B38FA5F4; Sat, 10 Mar 2012 06:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1331361849!12251305!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14403 invoked from network); 10 Mar 2012 06:44: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;
	10 Mar 2012 06: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 1S6G2D-0006aX-87
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2C-0004Yr-Rr
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:08 +0000
Message-Id: <E1S6G2C-0004Yr-Rr@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvm: Add command line option to
	enable ASID support -- on by default
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331197832 0
# Node ID 12c795ed5bec1f5f1c288b5326b9ab991b4f333c
# Parent  56ca2b874928af0352e445ee31aefe5d7fda2f49
hvm: Add command line option to enable ASID support -- on by default

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


diff -r 56ca2b874928 -r 12c795ed5bec xen/arch/x86/hvm/asid.c
--- a/xen/arch/x86/hvm/asid.c	Thu Mar 08 09:05:22 2012 +0000
+++ b/xen/arch/x86/hvm/asid.c	Thu Mar 08 09:10:32 2012 +0000
@@ -25,6 +25,10 @@
 #include <xen/percpu.h>
 #include <asm/hvm/asid.h>
 
+/* Xen command-line option to enable ASIDs */
+static int opt_asid_enabled = 1;
+boolean_param("asid", opt_asid_enabled);
+
 /*
  * ASIDs partition the physical TLB.  In the current implementation ASIDs are
  * introduced to reduce the number of TLB flushes.  Each time the guest's
@@ -62,7 +66,7 @@
     struct hvm_asid_data *data = &this_cpu(hvm_asid_data);
 
     data->max_asid = nasids - 1;
-    data->disabled = (nasids <= 1);
+    data->disabled = !opt_asid_enabled || (nasids <= 1);
 
     if ( g_disabled != data->disabled )
     {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2L-0007pT-4N; Sat, 10 Mar 2012 06: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 1S6G2J-0007nd-KD
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:15 +0000
Received: from [85.158.143.99:46531] by server-1.bemta-4.messagelabs.com id
	35/D7-20925-F38FA5F4; Sat, 10 Mar 2012 06:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1331361853!12251312!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14471 invoked from network); 10 Mar 2012 06:44:14 -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;
	10 Mar 2012 06: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 1S6G2G-0006as-QT
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2G-0004cH-LI
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:12 +0000
Message-Id: <E1S6G2G-0004cH-LI@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Revert 24987:42afd4d1669b
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331209803 0
# Node ID 72cda52c45d98d674582a9b746fd0cf6ee846e78
# Parent  0384f791e5383cb91e44f1be021f335e9d92de33
Revert 24987:42afd4d1669b

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


diff -r 0384f791e538 -r 72cda52c45d9 xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Thu Mar 08 09:43:49 2012 +0000
+++ b/xen/arch/x86/mm/paging.c	Thu Mar 08 12:30:03 2012 +0000
@@ -722,10 +722,6 @@
 /* Call when destroying a domain */
 void paging_teardown(struct domain *d)
 {
-    /* Make sure log-dirty is turned off before trying to dismantle it. 
-     * Needs to be done here becuse it's covered by the hap/shadow lock */
-    d->arch.paging.log_dirty.disable_log_dirty(d);
-
     if ( hap_enabled(d) )
         hap_teardown(d);
     else

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2L-0007pd-7R; Sat, 10 Mar 2012 06: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 1S6G2K-0007nd-22
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:16 +0000
Received: from [85.158.143.35:45616] by server-1.bemta-4.messagelabs.com id
	A5/D7-20925-F38FA5F4; Sat, 10 Mar 2012 06:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1331361853!10509507!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11486 invoked from network); 10 Mar 2012 06:44:14 -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;
	10 Mar 2012 06: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 1S6G2H-0006av-84
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2H-0004cl-6V
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:13 +0000
Message-Id: <E1S6G2H-0004cl-6V@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ia64: fix build (once more)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331210964 -3600
# Node ID 07adf050e1f463987f05070d586e564d8832f224
# Parent  72cda52c45d98d674582a9b746fd0cf6ee846e78
ia64: fix build (once more)

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


diff -r 72cda52c45d9 -r 07adf050e1f4 xen/arch/ia64/xen/dom0_ops.c
--- a/xen/arch/ia64/xen/dom0_ops.c	Thu Mar 08 12:30:03 2012 +0000
+++ b/xen/arch/ia64/xen/dom0_ops.c	Thu Mar 08 13:49:24 2012 +0100
@@ -558,7 +558,7 @@
 
         switch(mec->op)
         {
-            case XEN_DOMCTL_MEM_EVENT_OP_SHARING_CONTROL:
+            case XEN_DOMCTL_MEM_SHARING_CONTROL:
             {
                 if (mec->u.enable) {
                     ret = -EINVAL; /* not implemented */
diff -r 72cda52c45d9 -r 07adf050e1f4 xen/common/tmem_xen.c
--- a/xen/common/tmem_xen.c	Thu Mar 08 12:30:03 2012 +0000
+++ b/xen/common/tmem_xen.c	Thu Mar 08 13:49:24 2012 +0100
@@ -13,7 +13,6 @@
 #include <xen/domain_page.h>
 #include <xen/cpu.h>
 #include <xen/init.h>
-#include <asm/p2m.h>
 
 #define EXPORT /* indicates code other modules are dependent upon */
 
@@ -103,6 +102,8 @@
     ASSERT(0);
 }
 #else
+#include <asm/p2m.h>
+
 static inline void *cli_get_page(tmem_cli_mfn_t cmfn, unsigned long *pcli_mfn,
                                  pfp_t **pcli_pfp, bool_t cli_write)
 {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2H-0007no-E7; Sat, 10 Mar 2012 06:44: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 1S6G2G-0007nW-9O
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:12 +0000
Received: from [85.158.143.99:46446] by server-2.bemta-4.messagelabs.com id
	8A/32-17550-B38FA5F4; Sat, 10 Mar 2012 06:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1331361849!12251305!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14403 invoked from network); 10 Mar 2012 06:44: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;
	10 Mar 2012 06: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 1S6G2D-0006aX-87
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2C-0004Yr-Rr
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:08 +0000
Message-Id: <E1S6G2C-0004Yr-Rr@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hvm: Add command line option to
	enable ASID support -- on by default
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331197832 0
# Node ID 12c795ed5bec1f5f1c288b5326b9ab991b4f333c
# Parent  56ca2b874928af0352e445ee31aefe5d7fda2f49
hvm: Add command line option to enable ASID support -- on by default

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


diff -r 56ca2b874928 -r 12c795ed5bec xen/arch/x86/hvm/asid.c
--- a/xen/arch/x86/hvm/asid.c	Thu Mar 08 09:05:22 2012 +0000
+++ b/xen/arch/x86/hvm/asid.c	Thu Mar 08 09:10:32 2012 +0000
@@ -25,6 +25,10 @@
 #include <xen/percpu.h>
 #include <asm/hvm/asid.h>
 
+/* Xen command-line option to enable ASIDs */
+static int opt_asid_enabled = 1;
+boolean_param("asid", opt_asid_enabled);
+
 /*
  * ASIDs partition the physical TLB.  In the current implementation ASIDs are
  * introduced to reduce the number of TLB flushes.  Each time the guest's
@@ -62,7 +66,7 @@
     struct hvm_asid_data *data = &this_cpu(hvm_asid_data);
 
     data->max_asid = nasids - 1;
-    data->disabled = (nasids <= 1);
+    data->disabled = !opt_asid_enabled || (nasids <= 1);
 
     if ( g_disabled != data->disabled )
     {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2L-0007pT-4N; Sat, 10 Mar 2012 06: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 1S6G2J-0007nd-KD
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:15 +0000
Received: from [85.158.143.99:46531] by server-1.bemta-4.messagelabs.com id
	35/D7-20925-F38FA5F4; Sat, 10 Mar 2012 06:44:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1331361853!12251312!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14471 invoked from network); 10 Mar 2012 06:44:14 -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;
	10 Mar 2012 06: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 1S6G2G-0006as-QT
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2G-0004cH-LI
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:12 +0000
Message-Id: <E1S6G2G-0004cH-LI@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Revert 24987:42afd4d1669b
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331209803 0
# Node ID 72cda52c45d98d674582a9b746fd0cf6ee846e78
# Parent  0384f791e5383cb91e44f1be021f335e9d92de33
Revert 24987:42afd4d1669b

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


diff -r 0384f791e538 -r 72cda52c45d9 xen/arch/x86/mm/paging.c
--- a/xen/arch/x86/mm/paging.c	Thu Mar 08 09:43:49 2012 +0000
+++ b/xen/arch/x86/mm/paging.c	Thu Mar 08 12:30:03 2012 +0000
@@ -722,10 +722,6 @@
 /* Call when destroying a domain */
 void paging_teardown(struct domain *d)
 {
-    /* Make sure log-dirty is turned off before trying to dismantle it. 
-     * Needs to be done here becuse it's covered by the hap/shadow lock */
-    d->arch.paging.log_dirty.disable_log_dirty(d);
-
     if ( hap_enabled(d) )
         hap_teardown(d);
     else

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2N-0007sv-QX; Sat, 10 Mar 2012 06:44: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 1S6G2M-0007nW-Bb
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:18 +0000
Received: from [85.158.143.99:38079] by server-2.bemta-4.messagelabs.com id
	E4/42-17550-248FA5F4; Sat, 10 Mar 2012 06:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331361854!13267010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13885 invoked from network); 10 Mar 2012 06:44:15 -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 Mar 2012 06:44: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 1S6G2I-0006b1-AU
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2I-0004di-8u
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:14 +0000
Message-Id: <E1S6G2I-0004di-8u@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] XENPF_set_processor_pminfo XEN_PM_CX
	overflows states array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Eric Chanudet <eric.chanudet@eu.citrix.com>
# Date 1331222672 -3600
# Node ID 396801f25e922bdf1db5fd644435f46407586524
# Parent  66de4220113e937811529b12ea7f6427c0848630
XENPF_set_processor_pminfo XEN_PM_CX overflows states array

Calling XENPF_set_processor_pminfo with XEN_PM_CX could cause states
array in "struct acpi_processor_power" to exceed its limit.

The array used to be reset (by function cpuidle_init_cpu()) for each
hypercall. The patch puts it back that way and adds an assertion to
make it clear in case that happens again.

Signed-off-by: Eric Chanudet <eric.chanudet@eu.citrix.com>

- convert assertion to printk() & bail
- eliminate struct acpi_processor_cx's valid member (not read anymore)
- further adjustments to one-time-only vs each-time operations in
  cpuidle_init_cpu()
- don't use ACPI_STATE_Cn as array index anymore

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


diff -r 66de4220113e -r 396801f25e92 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Thu Mar 08 17:02:57 2012 +0100
+++ b/xen/arch/x86/acpi/cpu_idle.c	Thu Mar 08 17:04:32 2012 +0100
@@ -73,10 +73,8 @@
 static void (*lapic_timer_off)(void);
 static void (*lapic_timer_on)(void);
 
-static uint64_t (*get_tick)(void);
-static uint64_t (*ticks_elapsed)(uint64_t t1, uint64_t t2);
-static uint64_t (*tick_to_ns)(uint64_t ticks);
-static uint64_t (*ns_to_tick)(uint64_t ticks);
+static uint64_t (*__read_mostly tick_to_ns)(uint64_t) = acpi_pm_tick_to_ns;
+static uint64_t (*__read_mostly ns_to_tick)(uint64_t) = ns_to_acpi_pm_tick;
 
 static void (*pm_idle_save) (void) __read_mostly;
 unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER - 1;
@@ -234,6 +232,10 @@
         return ((0xFFFFFFFF - t1) + t2 +1);
 }
 
+static uint64_t (*__read_mostly get_tick)(void) = get_acpi_pm_tick;
+static uint64_t (*__read_mostly ticks_elapsed)(uint64_t, uint64_t)
+    = acpi_pm_ticks_elapsed;
+
 #define MWAIT_ECX_INTERRUPT_BREAK   (0x1)
 
 /*
@@ -632,43 +634,31 @@
     acpi_power = processor_powers[cpu];
     if ( !acpi_power )
     {
-        int i;
+        unsigned int i;
+
+        if ( cpu == 0 && boot_cpu_has(X86_FEATURE_NONSTOP_TSC) )
+        {
+            get_tick = get_stime_tick;
+            ticks_elapsed = stime_ticks_elapsed;
+            tick_to_ns = stime_tick_to_ns;
+            ns_to_tick = ns_to_stime_tick;
+        }
+
         acpi_power = xzalloc(struct acpi_processor_power);
         if ( !acpi_power )
             return -ENOMEM;
 
         for ( i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++ )
             acpi_power->states[i].idx = i;
-     
-        acpi_power->states[ACPI_STATE_C1].type = ACPI_STATE_C1;
-        acpi_power->states[ACPI_STATE_C1].entry_method = ACPI_CSTATE_EM_HALT;
-     
-        acpi_power->states[ACPI_STATE_C0].valid = 1;
-        acpi_power->states[ACPI_STATE_C1].valid = 1;
-     
-        acpi_power->count = 2;
-        acpi_power->safe_state = &acpi_power->states[ACPI_STATE_C1];
+
         acpi_power->cpu = cpu;
         processor_powers[cpu] = acpi_power;
     }
 
-    if ( cpu == 0 )
-    {
-        if ( boot_cpu_has(X86_FEATURE_NONSTOP_TSC) )
-        {
-            get_tick = get_stime_tick;
-            ticks_elapsed = stime_ticks_elapsed;
-            tick_to_ns = stime_tick_to_ns;
-            ns_to_tick = ns_to_stime_tick;
-        }
-        else
-        {
-            get_tick = get_acpi_pm_tick;
-            ticks_elapsed = acpi_pm_ticks_elapsed;
-            tick_to_ns = acpi_pm_tick_to_ns;
-            ns_to_tick = ns_to_acpi_pm_tick;
-        }
-    }
+    acpi_power->count = 2;
+    acpi_power->states[1].type = ACPI_STATE_C1;
+    acpi_power->states[1].entry_method = ACPI_CSTATE_EM_HALT;
+    acpi_power->safe_state = &acpi_power->states[1];
 
     return 0;
 }
@@ -885,17 +875,25 @@
     if ( check_cx(acpi_power, xen_cx) != 0 )
         return;
 
-    if ( xen_cx->type == ACPI_STATE_C1 )
+    switch ( xen_cx->type )
+    {
+    case ACPI_STATE_C1:
         cx = &acpi_power->states[1];
-    else
-        cx = &acpi_power->states[acpi_power->count];
+        break;
+    default:
+        if ( acpi_power->count >= ACPI_PROCESSOR_MAX_POWER )
+        {
+    case ACPI_STATE_C0:
+            printk(XENLOG_WARNING "CPU%u: C%d data ignored\n",
+                   acpi_power->cpu, xen_cx->type);
+            return;
+        }
+        cx = &acpi_power->states[acpi_power->count++];
+        cx->type = xen_cx->type;
+        break;
+    }
 
-    if ( !cx->valid )
-        acpi_power->count++;
-
-    cx->valid    = 1;
-    cx->type     = xen_cx->type;
-    cx->address  = xen_cx->reg.address;
+    cx->address = xen_cx->reg.address;
 
     switch ( xen_cx->reg.space_id )
     {
diff -r 66de4220113e -r 396801f25e92 xen/include/xen/cpuidle.h
--- a/xen/include/xen/cpuidle.h	Thu Mar 08 17:02:57 2012 +0100
+++ b/xen/include/xen/cpuidle.h	Thu Mar 08 17:04:32 2012 +0100
@@ -40,7 +40,6 @@
 struct acpi_processor_cx
 {
     u8 idx;
-    u8 valid;
     u8 type;
     u32 address;
     u8 entry_method; /* ACPI_CSTATE_EM_xxx */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2N-0007sv-QX; Sat, 10 Mar 2012 06:44: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 1S6G2M-0007nW-Bb
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:18 +0000
Received: from [85.158.143.99:38079] by server-2.bemta-4.messagelabs.com id
	E4/42-17550-248FA5F4; Sat, 10 Mar 2012 06:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331361854!13267010!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13885 invoked from network); 10 Mar 2012 06:44:15 -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 Mar 2012 06:44: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 1S6G2I-0006b1-AU
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2I-0004di-8u
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:14 +0000
Message-Id: <E1S6G2I-0004di-8u@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] XENPF_set_processor_pminfo XEN_PM_CX
	overflows states array
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Eric Chanudet <eric.chanudet@eu.citrix.com>
# Date 1331222672 -3600
# Node ID 396801f25e922bdf1db5fd644435f46407586524
# Parent  66de4220113e937811529b12ea7f6427c0848630
XENPF_set_processor_pminfo XEN_PM_CX overflows states array

Calling XENPF_set_processor_pminfo with XEN_PM_CX could cause states
array in "struct acpi_processor_power" to exceed its limit.

The array used to be reset (by function cpuidle_init_cpu()) for each
hypercall. The patch puts it back that way and adds an assertion to
make it clear in case that happens again.

Signed-off-by: Eric Chanudet <eric.chanudet@eu.citrix.com>

- convert assertion to printk() & bail
- eliminate struct acpi_processor_cx's valid member (not read anymore)
- further adjustments to one-time-only vs each-time operations in
  cpuidle_init_cpu()
- don't use ACPI_STATE_Cn as array index anymore

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


diff -r 66de4220113e -r 396801f25e92 xen/arch/x86/acpi/cpu_idle.c
--- a/xen/arch/x86/acpi/cpu_idle.c	Thu Mar 08 17:02:57 2012 +0100
+++ b/xen/arch/x86/acpi/cpu_idle.c	Thu Mar 08 17:04:32 2012 +0100
@@ -73,10 +73,8 @@
 static void (*lapic_timer_off)(void);
 static void (*lapic_timer_on)(void);
 
-static uint64_t (*get_tick)(void);
-static uint64_t (*ticks_elapsed)(uint64_t t1, uint64_t t2);
-static uint64_t (*tick_to_ns)(uint64_t ticks);
-static uint64_t (*ns_to_tick)(uint64_t ticks);
+static uint64_t (*__read_mostly tick_to_ns)(uint64_t) = acpi_pm_tick_to_ns;
+static uint64_t (*__read_mostly ns_to_tick)(uint64_t) = ns_to_acpi_pm_tick;
 
 static void (*pm_idle_save) (void) __read_mostly;
 unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER - 1;
@@ -234,6 +232,10 @@
         return ((0xFFFFFFFF - t1) + t2 +1);
 }
 
+static uint64_t (*__read_mostly get_tick)(void) = get_acpi_pm_tick;
+static uint64_t (*__read_mostly ticks_elapsed)(uint64_t, uint64_t)
+    = acpi_pm_ticks_elapsed;
+
 #define MWAIT_ECX_INTERRUPT_BREAK   (0x1)
 
 /*
@@ -632,43 +634,31 @@
     acpi_power = processor_powers[cpu];
     if ( !acpi_power )
     {
-        int i;
+        unsigned int i;
+
+        if ( cpu == 0 && boot_cpu_has(X86_FEATURE_NONSTOP_TSC) )
+        {
+            get_tick = get_stime_tick;
+            ticks_elapsed = stime_ticks_elapsed;
+            tick_to_ns = stime_tick_to_ns;
+            ns_to_tick = ns_to_stime_tick;
+        }
+
         acpi_power = xzalloc(struct acpi_processor_power);
         if ( !acpi_power )
             return -ENOMEM;
 
         for ( i = 0; i < ACPI_PROCESSOR_MAX_POWER; i++ )
             acpi_power->states[i].idx = i;
-     
-        acpi_power->states[ACPI_STATE_C1].type = ACPI_STATE_C1;
-        acpi_power->states[ACPI_STATE_C1].entry_method = ACPI_CSTATE_EM_HALT;
-     
-        acpi_power->states[ACPI_STATE_C0].valid = 1;
-        acpi_power->states[ACPI_STATE_C1].valid = 1;
-     
-        acpi_power->count = 2;
-        acpi_power->safe_state = &acpi_power->states[ACPI_STATE_C1];
+
         acpi_power->cpu = cpu;
         processor_powers[cpu] = acpi_power;
     }
 
-    if ( cpu == 0 )
-    {
-        if ( boot_cpu_has(X86_FEATURE_NONSTOP_TSC) )
-        {
-            get_tick = get_stime_tick;
-            ticks_elapsed = stime_ticks_elapsed;
-            tick_to_ns = stime_tick_to_ns;
-            ns_to_tick = ns_to_stime_tick;
-        }
-        else
-        {
-            get_tick = get_acpi_pm_tick;
-            ticks_elapsed = acpi_pm_ticks_elapsed;
-            tick_to_ns = acpi_pm_tick_to_ns;
-            ns_to_tick = ns_to_acpi_pm_tick;
-        }
-    }
+    acpi_power->count = 2;
+    acpi_power->states[1].type = ACPI_STATE_C1;
+    acpi_power->states[1].entry_method = ACPI_CSTATE_EM_HALT;
+    acpi_power->safe_state = &acpi_power->states[1];
 
     return 0;
 }
@@ -885,17 +875,25 @@
     if ( check_cx(acpi_power, xen_cx) != 0 )
         return;
 
-    if ( xen_cx->type == ACPI_STATE_C1 )
+    switch ( xen_cx->type )
+    {
+    case ACPI_STATE_C1:
         cx = &acpi_power->states[1];
-    else
-        cx = &acpi_power->states[acpi_power->count];
+        break;
+    default:
+        if ( acpi_power->count >= ACPI_PROCESSOR_MAX_POWER )
+        {
+    case ACPI_STATE_C0:
+            printk(XENLOG_WARNING "CPU%u: C%d data ignored\n",
+                   acpi_power->cpu, xen_cx->type);
+            return;
+        }
+        cx = &acpi_power->states[acpi_power->count++];
+        cx->type = xen_cx->type;
+        break;
+    }
 
-    if ( !cx->valid )
-        acpi_power->count++;
-
-    cx->valid    = 1;
-    cx->type     = xen_cx->type;
-    cx->address  = xen_cx->reg.address;
+    cx->address = xen_cx->reg.address;
 
     switch ( xen_cx->reg.space_id )
     {
diff -r 66de4220113e -r 396801f25e92 xen/include/xen/cpuidle.h
--- a/xen/include/xen/cpuidle.h	Thu Mar 08 17:02:57 2012 +0100
+++ b/xen/include/xen/cpuidle.h	Thu Mar 08 17:04:32 2012 +0100
@@ -40,7 +40,6 @@
 struct acpi_processor_cx
 {
     u8 idx;
-    u8 valid;
     u8 type;
     u32 address;
     u8 entry_method; /* ACPI_CSTATE_EM_xxx */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2O-0007tE-44; Sat, 10 Mar 2012 06:44: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 1S6G2M-0007nW-Qq
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:19 +0000
Received: from [85.158.143.35:55185] by server-2.bemta-4.messagelabs.com id
	C4/42-17550-248FA5F4; Sat, 10 Mar 2012 06:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1331361854!9605306!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27398 invoked from network); 10 Mar 2012 06:44:15 -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;
	10 Mar 2012 06:44: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 1S6G2H-0006ay-T2
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2H-0004dF-OA
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:13 +0000
Message-Id: <E1S6G2H-0004dF-OA@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] oprofile: don't pass around
	redundant, easily derived arguments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331222577 -3600
# Node ID 66de4220113e937811529b12ea7f6427c0848630
# Parent  07adf050e1f463987f05070d586e564d8832f224
oprofile: don't pass around redundant, easily derived arguments

Passing both a struct vcpu pointer and the corresponding struct domain
one is simply pointless, especially when intermediate functions just
forward it without themselves making use of the already obtained value.

Also constify a few function parameters.

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


diff -r 07adf050e1f4 -r 66de4220113e xen/arch/ia64/xen/oprofile/xenoprof.c
--- a/xen/arch/ia64/xen/oprofile/xenoprof.c	Thu Mar 08 13:49:24 2012 +0100
+++ b/xen/arch/ia64/xen/oprofile/xenoprof.c	Thu Mar 08 17:02:57 2012 +0100
@@ -27,7 +27,7 @@
 #include <asm/vmx.h>    /* for vmx_user_mode() */
 
 int
-xenoprofile_get_mode(struct vcpu *v, struct cpu_user_regs * const regs)
+xenoprofile_get_mode(const struct vcpu *v, const struct cpu_user_regs *regs)
 {
     int mode;
 
diff -r 07adf050e1f4 -r 66de4220113e xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Thu Mar 08 13:49:24 2012 +0100
+++ b/xen/arch/x86/oprofile/backtrace.c	Thu Mar 08 17:02:57 2012 +0100
@@ -32,10 +32,10 @@
 #endif
 
 static struct frame_head *
-dump_hypervisor_backtrace(struct domain *d, struct vcpu *vcpu, 
-			  struct frame_head * head, int mode)
+dump_hypervisor_backtrace(struct vcpu *vcpu, const struct frame_head *head,
+                          int mode)
 {
-    if (!xenoprof_add_trace(d, vcpu, head->ret, mode))
+    if (!xenoprof_add_trace(vcpu, head->ret, mode))
         return 0;
     
     /* frame pointers should strictly progress back up the stack
@@ -57,8 +57,8 @@
 #endif
 
 static struct frame_head *
-dump_guest_backtrace(struct domain *d, struct vcpu *vcpu, 
-		     const struct frame_head *head, int mode)
+dump_guest_backtrace(struct vcpu *vcpu, const struct frame_head *head,
+                     int mode)
 {
     frame_head_t bufhead;
 
@@ -90,7 +90,7 @@
             return 0;
     }
     
-    if (!xenoprof_add_trace(d, vcpu, bufhead.ret, mode))
+    if (!xenoprof_add_trace(vcpu, bufhead.ret, mode))
         return 0;
     
     /* frame pointers should strictly progress back up the stack
@@ -132,8 +132,8 @@
  * in the kernel mode.
  */
 #if defined(CONFIG_FRAME_POINTER)
-static int valid_hypervisor_stack(struct frame_head * head, 
-				  struct cpu_user_regs * regs)
+static int valid_hypervisor_stack(const struct frame_head *head,
+				  const struct cpu_user_regs *regs)
 {
     unsigned long headaddr = (unsigned long)head;
 #ifdef CONFIG_X86_64
@@ -147,27 +147,24 @@
 }
 #else
 /* without fp, it's just junk */
-static int valid_hypervisor_stack(struct frame_head * head, 
-				  struct cpu_user_regs * regs)
+static int valid_hypervisor_stack(const struct frame_head *head,
+				  const struct cpu_user_regs *regs)
 {
     return 0;
 }
 #endif
 
-void xenoprof_backtrace(struct domain *d, struct vcpu *vcpu, 
-			struct cpu_user_regs * const regs,
+void xenoprof_backtrace(struct vcpu *vcpu, const struct cpu_user_regs *regs,
 			unsigned long depth, int mode)
 {
-    struct frame_head *head;
-
-    head = (struct frame_head *)regs->ebp;
+    const struct frame_head *head = (void *)regs->ebp;
 
     if (mode > 1) {
         while (depth-- && valid_hypervisor_stack(head, regs))
-            head = dump_hypervisor_backtrace(d, vcpu, head, mode);
+            head = dump_hypervisor_backtrace(vcpu, head, mode);
         return;
     }
 
     while (depth-- && head)
-        head = dump_guest_backtrace(d, vcpu, head, mode);
+        head = dump_guest_backtrace(vcpu, head, mode);
 }
diff -r 07adf050e1f4 -r 66de4220113e xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Thu Mar 08 13:49:24 2012 +0100
+++ b/xen/arch/x86/oprofile/xenoprof.c	Thu Mar 08 17:02:57 2012 +0100
@@ -10,6 +10,7 @@
 
 #include <xen/guest_access.h>
 #include <xen/sched.h>
+#include <xen/xenoprof.h>
 #include <public/xenoprof.h>
 #ifdef CONFIG_COMPAT
 #include <compat/xenoprof.h>
@@ -77,7 +78,8 @@
 }
 #endif
 
-int xenoprofile_get_mode(struct vcpu *v, struct cpu_user_regs * const regs)
+int xenoprofile_get_mode(const struct vcpu *v,
+                         const struct cpu_user_regs *regs)
 {
     if ( !guest_mode(regs) )
         return 2;
diff -r 07adf050e1f4 -r 66de4220113e xen/common/xenoprof.c
--- a/xen/common/xenoprof.c	Thu Mar 08 13:49:24 2012 +0100
+++ b/xen/common/xenoprof.c	Thu Mar 08 17:02:57 2012 +0100
@@ -511,24 +511,23 @@
     return 1;
 }
 
-int xenoprof_add_trace(struct domain *d, struct vcpu *vcpu,
-                       uint64_t eip, int mode)
+int xenoprof_add_trace(struct vcpu *vcpu, uint64_t pc, int mode)
 {
+    struct domain *d = vcpu->domain;
     xenoprof_buf_t *buf = d->xenoprof->vcpu[vcpu->vcpu_id].buffer;
 
     /* Do not accidentally write an escape code due to a broken frame. */
-    if ( eip == XENOPROF_ESCAPE_CODE )
+    if ( pc == XENOPROF_ESCAPE_CODE )
     {
         invalid_buffer_samples++;
         return 0;
     }
 
-    return xenoprof_add_sample(d, buf, eip, mode, 0);
+    return xenoprof_add_sample(d, buf, pc, mode, 0);
 }
 
-void xenoprof_log_event(struct vcpu *vcpu, 
-                        struct cpu_user_regs * regs, uint64_t eip, 
-                        int mode, int event)
+void xenoprof_log_event(struct vcpu *vcpu, const struct cpu_user_regs *regs,
+                        uint64_t pc, int mode, int event)
 {
     struct domain *d = vcpu->domain;
     struct xenoprof_vcpu *v;
@@ -565,7 +564,7 @@
         }
     }
 
-    if ( xenoprof_add_sample(d, buf, eip, mode, event) )
+    if ( xenoprof_add_sample(d, buf, pc, mode, event) )
     {
         if ( is_active(vcpu->domain) )
             active_samples++;
@@ -581,7 +580,7 @@
     }
 
     if ( backtrace_depth > 0 )
-        xenoprof_backtrace(d, vcpu, regs, backtrace_depth, mode);
+        xenoprof_backtrace(vcpu, regs, backtrace_depth, mode);
 }
 
 
diff -r 07adf050e1f4 -r 66de4220113e xen/include/asm-ia64/xenoprof.h
--- a/xen/include/asm-ia64/xenoprof.h	Thu Mar 08 13:49:24 2012 +0100
+++ b/xen/include/asm-ia64/xenoprof.h	Thu Mar 08 17:02:57 2012 +0100
@@ -45,14 +45,13 @@
 
 struct vcpu;
 struct cpu_user_regs;
-int xenoprofile_get_mode(struct vcpu *v, struct cpu_user_regs * const regs);
+int xenoprofile_get_mode(const struct vcpu *, const struct cpu_user_regs *);
 static inline int xenoprof_backtrace_supported(void)
 {
     return 0;
 }
-static inline void xenoprof_backtrace(
-    struct domain *d, struct vcpu *vcpu, 
-    struct pt_regs *const regs, unsigned long depth, int mode)
+static inline void xenoprof_backtrace(struct vcpu *vcpu,
+    const struct pt_regs *regs, unsigned long depth, int mode)
 {
     /* To be implemented */
     return;
diff -r 07adf050e1f4 -r 66de4220113e xen/include/asm-x86/xenoprof.h
--- a/xen/include/asm-x86/xenoprof.h	Thu Mar 08 13:49:24 2012 +0100
+++ b/xen/include/asm-x86/xenoprof.h	Thu Mar 08 17:02:57 2012 +0100
@@ -56,16 +56,15 @@
 #define ibs_caps 0
 #endif
 
-int xenoprofile_get_mode(struct vcpu *v, struct cpu_user_regs * const regs);
+int xenoprofile_get_mode(const struct vcpu *, const struct cpu_user_regs *);
 
 static inline int xenoprof_backtrace_supported(void)
 {
     return 1;
 }
 
-void xenoprof_backtrace(
-    struct domain *d, struct vcpu *vcpu, 
-    struct cpu_user_regs *const regs, unsigned long depth, int mode);
+void xenoprof_backtrace(struct vcpu *, const struct cpu_user_regs *,
+                        unsigned long depth, int mode);
 
 #define xenoprof_shared_gmfn(d, gmaddr, maddr)                      \
     do {                                                            \
diff -r 07adf050e1f4 -r 66de4220113e xen/include/xen/xenoprof.h
--- a/xen/include/xen/xenoprof.h	Thu Mar 08 13:49:24 2012 +0100
+++ b/xen/include/xen/xenoprof.h	Thu Mar 08 17:02:57 2012 +0100
@@ -68,8 +68,7 @@
 int is_passive(struct domain *d);
 void free_xenoprof_pages(struct domain *d);
 
-int xenoprof_add_trace(struct domain *d, struct vcpu *v, 
-                       uint64_t eip, int mode);
+int xenoprof_add_trace(struct vcpu *, uint64_t pc, int mode);
 
 #define PMU_OWNER_NONE          0
 #define PMU_OWNER_XENOPROF      1
@@ -77,8 +76,7 @@
 int acquire_pmu_ownship(int pmu_ownership);
 void release_pmu_ownship(int pmu_ownership);
 
-void xenoprof_log_event(struct vcpu *vcpu,
-                        struct cpu_user_regs * regs, uint64_t eip,
-                        int mode, int event);
+void xenoprof_log_event(struct vcpu *, const struct cpu_user_regs *,
+                        uint64_t pc, int mode, int event);
 
 #endif  /* __XEN__XENOPROF_H__ */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2O-0007tE-44; Sat, 10 Mar 2012 06:44: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 1S6G2M-0007nW-Qq
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:19 +0000
Received: from [85.158.143.35:55185] by server-2.bemta-4.messagelabs.com id
	C4/42-17550-248FA5F4; Sat, 10 Mar 2012 06:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1331361854!9605306!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27398 invoked from network); 10 Mar 2012 06:44:15 -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;
	10 Mar 2012 06:44: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 1S6G2H-0006ay-T2
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2H-0004dF-OA
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:13 +0000
Message-Id: <E1S6G2H-0004dF-OA@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] oprofile: don't pass around
	redundant, easily derived arguments
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331222577 -3600
# Node ID 66de4220113e937811529b12ea7f6427c0848630
# Parent  07adf050e1f463987f05070d586e564d8832f224
oprofile: don't pass around redundant, easily derived arguments

Passing both a struct vcpu pointer and the corresponding struct domain
one is simply pointless, especially when intermediate functions just
forward it without themselves making use of the already obtained value.

Also constify a few function parameters.

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


diff -r 07adf050e1f4 -r 66de4220113e xen/arch/ia64/xen/oprofile/xenoprof.c
--- a/xen/arch/ia64/xen/oprofile/xenoprof.c	Thu Mar 08 13:49:24 2012 +0100
+++ b/xen/arch/ia64/xen/oprofile/xenoprof.c	Thu Mar 08 17:02:57 2012 +0100
@@ -27,7 +27,7 @@
 #include <asm/vmx.h>    /* for vmx_user_mode() */
 
 int
-xenoprofile_get_mode(struct vcpu *v, struct cpu_user_regs * const regs)
+xenoprofile_get_mode(const struct vcpu *v, const struct cpu_user_regs *regs)
 {
     int mode;
 
diff -r 07adf050e1f4 -r 66de4220113e xen/arch/x86/oprofile/backtrace.c
--- a/xen/arch/x86/oprofile/backtrace.c	Thu Mar 08 13:49:24 2012 +0100
+++ b/xen/arch/x86/oprofile/backtrace.c	Thu Mar 08 17:02:57 2012 +0100
@@ -32,10 +32,10 @@
 #endif
 
 static struct frame_head *
-dump_hypervisor_backtrace(struct domain *d, struct vcpu *vcpu, 
-			  struct frame_head * head, int mode)
+dump_hypervisor_backtrace(struct vcpu *vcpu, const struct frame_head *head,
+                          int mode)
 {
-    if (!xenoprof_add_trace(d, vcpu, head->ret, mode))
+    if (!xenoprof_add_trace(vcpu, head->ret, mode))
         return 0;
     
     /* frame pointers should strictly progress back up the stack
@@ -57,8 +57,8 @@
 #endif
 
 static struct frame_head *
-dump_guest_backtrace(struct domain *d, struct vcpu *vcpu, 
-		     const struct frame_head *head, int mode)
+dump_guest_backtrace(struct vcpu *vcpu, const struct frame_head *head,
+                     int mode)
 {
     frame_head_t bufhead;
 
@@ -90,7 +90,7 @@
             return 0;
     }
     
-    if (!xenoprof_add_trace(d, vcpu, bufhead.ret, mode))
+    if (!xenoprof_add_trace(vcpu, bufhead.ret, mode))
         return 0;
     
     /* frame pointers should strictly progress back up the stack
@@ -132,8 +132,8 @@
  * in the kernel mode.
  */
 #if defined(CONFIG_FRAME_POINTER)
-static int valid_hypervisor_stack(struct frame_head * head, 
-				  struct cpu_user_regs * regs)
+static int valid_hypervisor_stack(const struct frame_head *head,
+				  const struct cpu_user_regs *regs)
 {
     unsigned long headaddr = (unsigned long)head;
 #ifdef CONFIG_X86_64
@@ -147,27 +147,24 @@
 }
 #else
 /* without fp, it's just junk */
-static int valid_hypervisor_stack(struct frame_head * head, 
-				  struct cpu_user_regs * regs)
+static int valid_hypervisor_stack(const struct frame_head *head,
+				  const struct cpu_user_regs *regs)
 {
     return 0;
 }
 #endif
 
-void xenoprof_backtrace(struct domain *d, struct vcpu *vcpu, 
-			struct cpu_user_regs * const regs,
+void xenoprof_backtrace(struct vcpu *vcpu, const struct cpu_user_regs *regs,
 			unsigned long depth, int mode)
 {
-    struct frame_head *head;
-
-    head = (struct frame_head *)regs->ebp;
+    const struct frame_head *head = (void *)regs->ebp;
 
     if (mode > 1) {
         while (depth-- && valid_hypervisor_stack(head, regs))
-            head = dump_hypervisor_backtrace(d, vcpu, head, mode);
+            head = dump_hypervisor_backtrace(vcpu, head, mode);
         return;
     }
 
     while (depth-- && head)
-        head = dump_guest_backtrace(d, vcpu, head, mode);
+        head = dump_guest_backtrace(vcpu, head, mode);
 }
diff -r 07adf050e1f4 -r 66de4220113e xen/arch/x86/oprofile/xenoprof.c
--- a/xen/arch/x86/oprofile/xenoprof.c	Thu Mar 08 13:49:24 2012 +0100
+++ b/xen/arch/x86/oprofile/xenoprof.c	Thu Mar 08 17:02:57 2012 +0100
@@ -10,6 +10,7 @@
 
 #include <xen/guest_access.h>
 #include <xen/sched.h>
+#include <xen/xenoprof.h>
 #include <public/xenoprof.h>
 #ifdef CONFIG_COMPAT
 #include <compat/xenoprof.h>
@@ -77,7 +78,8 @@
 }
 #endif
 
-int xenoprofile_get_mode(struct vcpu *v, struct cpu_user_regs * const regs)
+int xenoprofile_get_mode(const struct vcpu *v,
+                         const struct cpu_user_regs *regs)
 {
     if ( !guest_mode(regs) )
         return 2;
diff -r 07adf050e1f4 -r 66de4220113e xen/common/xenoprof.c
--- a/xen/common/xenoprof.c	Thu Mar 08 13:49:24 2012 +0100
+++ b/xen/common/xenoprof.c	Thu Mar 08 17:02:57 2012 +0100
@@ -511,24 +511,23 @@
     return 1;
 }
 
-int xenoprof_add_trace(struct domain *d, struct vcpu *vcpu,
-                       uint64_t eip, int mode)
+int xenoprof_add_trace(struct vcpu *vcpu, uint64_t pc, int mode)
 {
+    struct domain *d = vcpu->domain;
     xenoprof_buf_t *buf = d->xenoprof->vcpu[vcpu->vcpu_id].buffer;
 
     /* Do not accidentally write an escape code due to a broken frame. */
-    if ( eip == XENOPROF_ESCAPE_CODE )
+    if ( pc == XENOPROF_ESCAPE_CODE )
     {
         invalid_buffer_samples++;
         return 0;
     }
 
-    return xenoprof_add_sample(d, buf, eip, mode, 0);
+    return xenoprof_add_sample(d, buf, pc, mode, 0);
 }
 
-void xenoprof_log_event(struct vcpu *vcpu, 
-                        struct cpu_user_regs * regs, uint64_t eip, 
-                        int mode, int event)
+void xenoprof_log_event(struct vcpu *vcpu, const struct cpu_user_regs *regs,
+                        uint64_t pc, int mode, int event)
 {
     struct domain *d = vcpu->domain;
     struct xenoprof_vcpu *v;
@@ -565,7 +564,7 @@
         }
     }
 
-    if ( xenoprof_add_sample(d, buf, eip, mode, event) )
+    if ( xenoprof_add_sample(d, buf, pc, mode, event) )
     {
         if ( is_active(vcpu->domain) )
             active_samples++;
@@ -581,7 +580,7 @@
     }
 
     if ( backtrace_depth > 0 )
-        xenoprof_backtrace(d, vcpu, regs, backtrace_depth, mode);
+        xenoprof_backtrace(vcpu, regs, backtrace_depth, mode);
 }
 
 
diff -r 07adf050e1f4 -r 66de4220113e xen/include/asm-ia64/xenoprof.h
--- a/xen/include/asm-ia64/xenoprof.h	Thu Mar 08 13:49:24 2012 +0100
+++ b/xen/include/asm-ia64/xenoprof.h	Thu Mar 08 17:02:57 2012 +0100
@@ -45,14 +45,13 @@
 
 struct vcpu;
 struct cpu_user_regs;
-int xenoprofile_get_mode(struct vcpu *v, struct cpu_user_regs * const regs);
+int xenoprofile_get_mode(const struct vcpu *, const struct cpu_user_regs *);
 static inline int xenoprof_backtrace_supported(void)
 {
     return 0;
 }
-static inline void xenoprof_backtrace(
-    struct domain *d, struct vcpu *vcpu, 
-    struct pt_regs *const regs, unsigned long depth, int mode)
+static inline void xenoprof_backtrace(struct vcpu *vcpu,
+    const struct pt_regs *regs, unsigned long depth, int mode)
 {
     /* To be implemented */
     return;
diff -r 07adf050e1f4 -r 66de4220113e xen/include/asm-x86/xenoprof.h
--- a/xen/include/asm-x86/xenoprof.h	Thu Mar 08 13:49:24 2012 +0100
+++ b/xen/include/asm-x86/xenoprof.h	Thu Mar 08 17:02:57 2012 +0100
@@ -56,16 +56,15 @@
 #define ibs_caps 0
 #endif
 
-int xenoprofile_get_mode(struct vcpu *v, struct cpu_user_regs * const regs);
+int xenoprofile_get_mode(const struct vcpu *, const struct cpu_user_regs *);
 
 static inline int xenoprof_backtrace_supported(void)
 {
     return 1;
 }
 
-void xenoprof_backtrace(
-    struct domain *d, struct vcpu *vcpu, 
-    struct cpu_user_regs *const regs, unsigned long depth, int mode);
+void xenoprof_backtrace(struct vcpu *, const struct cpu_user_regs *,
+                        unsigned long depth, int mode);
 
 #define xenoprof_shared_gmfn(d, gmaddr, maddr)                      \
     do {                                                            \
diff -r 07adf050e1f4 -r 66de4220113e xen/include/xen/xenoprof.h
--- a/xen/include/xen/xenoprof.h	Thu Mar 08 13:49:24 2012 +0100
+++ b/xen/include/xen/xenoprof.h	Thu Mar 08 17:02:57 2012 +0100
@@ -68,8 +68,7 @@
 int is_passive(struct domain *d);
 void free_xenoprof_pages(struct domain *d);
 
-int xenoprof_add_trace(struct domain *d, struct vcpu *v, 
-                       uint64_t eip, int mode);
+int xenoprof_add_trace(struct vcpu *, uint64_t pc, int mode);
 
 #define PMU_OWNER_NONE          0
 #define PMU_OWNER_XENOPROF      1
@@ -77,8 +76,7 @@
 int acquire_pmu_ownship(int pmu_ownership);
 void release_pmu_ownship(int pmu_ownership);
 
-void xenoprof_log_event(struct vcpu *vcpu,
-                        struct cpu_user_regs * regs, uint64_t eip,
-                        int mode, int event);
+void xenoprof_log_event(struct vcpu *, const struct cpu_user_regs *,
+                        uint64_t pc, int mode, int event);
 
 #endif  /* __XEN__XENOPROF_H__ */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2N-0007ry-Bj; Sat, 10 Mar 2012 06:44: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 1S6G2M-0007nd-2I
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:18 +0000
Received: from [85.158.143.99:46592] by server-1.bemta-4.messagelabs.com id
	D7/D7-20925-148FA5F4; Sat, 10 Mar 2012 06:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331361855!13267011!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13900 invoked from network); 10 Mar 2012 06:44:16 -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 Mar 2012 06:44: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 1S6G2I-0006b4-RF
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2I-0004eB-Pn
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:14 +0000
Message-Id: <E1S6G2I-0004eB-Pn@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/cpuidle: improve data arrangement
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331222723 -3600
# Node ID a8959e0a463f0f028ffe3858d94460681b1b3659
# Parent  396801f25e922bdf1db5fd644435f46407586524
x86/cpuidle: improve data arrangement

.. to reduce the amount of holes (wasted space).

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


diff -r 396801f25e92 -r a8959e0a463f xen/include/xen/cpuidle.h
--- a/xen/include/xen/cpuidle.h	Thu Mar 08 17:04:32 2012 +0100
+++ b/xen/include/xen/cpuidle.h	Thu Mar 08 17:05:23 2012 +0100
@@ -40,9 +40,9 @@
 struct acpi_processor_cx
 {
     u8 idx;
-    u8 type;
+    u8 type;         /* ACPI_STATE_Cn */
+    u8 entry_method; /* ACPI_CSTATE_EM_xxx */
     u32 address;
-    u8 entry_method; /* ACPI_CSTATE_EM_xxx */
     u32 latency;
     u32 latency_ticks;
     u32 power;
@@ -66,8 +66,8 @@
     struct acpi_processor_flags flags;
     struct acpi_processor_cx *last_state;
     struct acpi_processor_cx *safe_state;
+    void *gdata; /* governor specific data */
     u32 last_residency;
-    void *gdata; /* governor specific data */
     u32 count;
     struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
 };

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2N-0007ry-Bj; Sat, 10 Mar 2012 06:44: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 1S6G2M-0007nd-2I
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:18 +0000
Received: from [85.158.143.99:46592] by server-1.bemta-4.messagelabs.com id
	D7/D7-20925-148FA5F4; Sat, 10 Mar 2012 06:44:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331361855!13267011!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13900 invoked from network); 10 Mar 2012 06:44:16 -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 Mar 2012 06:44: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 1S6G2I-0006b4-RF
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2I-0004eB-Pn
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:14 +0000
Message-Id: <E1S6G2I-0004eB-Pn@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/cpuidle: improve data arrangement
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331222723 -3600
# Node ID a8959e0a463f0f028ffe3858d94460681b1b3659
# Parent  396801f25e922bdf1db5fd644435f46407586524
x86/cpuidle: improve data arrangement

.. to reduce the amount of holes (wasted space).

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


diff -r 396801f25e92 -r a8959e0a463f xen/include/xen/cpuidle.h
--- a/xen/include/xen/cpuidle.h	Thu Mar 08 17:04:32 2012 +0100
+++ b/xen/include/xen/cpuidle.h	Thu Mar 08 17:05:23 2012 +0100
@@ -40,9 +40,9 @@
 struct acpi_processor_cx
 {
     u8 idx;
-    u8 type;
+    u8 type;         /* ACPI_STATE_Cn */
+    u8 entry_method; /* ACPI_CSTATE_EM_xxx */
     u32 address;
-    u8 entry_method; /* ACPI_CSTATE_EM_xxx */
     u32 latency;
     u32 latency_ticks;
     u32 power;
@@ -66,8 +66,8 @@
     struct acpi_processor_flags flags;
     struct acpi_processor_cx *last_state;
     struct acpi_processor_cx *safe_state;
+    void *gdata; /* governor specific data */
     u32 last_residency;
-    void *gdata; /* governor specific data */
     u32 count;
     struct acpi_processor_cx states[ACPI_PROCESSOR_MAX_POWER];
 };

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2O-0007tT-9y; Sat, 10 Mar 2012 06:44: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 1S6G2N-0007nW-9r
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:19 +0000
Received: from [85.158.143.35:49685] by server-2.bemta-4.messagelabs.com id
	76/42-17550-248FA5F4; Sat, 10 Mar 2012 06:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1331361855!9895839!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20470 invoked from network); 10 Mar 2012 06:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Mar 2012 06:44: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 1S6G2J-0006b7-DF
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2J-0004ee-BV
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:15 +0000
Message-Id: <E1S6G2J-0004ee-BV@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Tools: Remove shared page from
	mem_event/access/paging interfaces
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID e639e75254e9cdc95c4957c1517c145222e79f3e
# Parent  a8959e0a463f0f028ffe3858d94460681b1b3659
Tools: Remove shared page from mem_event/access/paging interfaces

Don't use the superfluous shared page, return the event channel directly as
part of the domctl struct, instead.

In-tree consumers (xenpaging, xen-access) updated. This is an ABI/API change,
so please voice any concerns.

Known pending issues:
- pager could die and its ring page could be used by some other process, yet
  Xen retains the mapping to it.
- use a saner interface for the paging_load buffer.

This change also affects the x86/mm bits in the hypervisor that process the
mem_event setup domctl.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r a8959e0a463f -r e639e75254e9 tools/libxc/xc_mem_access.c
--- a/tools/libxc/xc_mem_access.c	Thu Mar 08 17:05:23 2012 +0100
+++ b/tools/libxc/xc_mem_access.c	Thu Mar 08 16:40:05 2012 +0000
@@ -25,12 +25,18 @@
 
 
 int xc_mem_access_enable(xc_interface *xch, domid_t domain_id,
-                        void *shared_page, void *ring_page)
+                         uint32_t *port, void *ring_page)
 {
+    if ( !port )
+    {
+        errno = EINVAL;
+        return -1;
+    }
+
     return xc_mem_event_control(xch, domain_id,
                                 XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE,
                                 XEN_DOMCTL_MEM_EVENT_OP_ACCESS,
-                                shared_page, ring_page);
+                                port, ring_page);
 }
 
 int xc_mem_access_disable(xc_interface *xch, domid_t domain_id)
diff -r a8959e0a463f -r e639e75254e9 tools/libxc/xc_mem_event.c
--- a/tools/libxc/xc_mem_event.c	Thu Mar 08 17:05:23 2012 +0100
+++ b/tools/libxc/xc_mem_event.c	Thu Mar 08 16:40:05 2012 +0000
@@ -24,19 +24,21 @@
 #include "xc_private.h"
 
 int xc_mem_event_control(xc_interface *xch, domid_t domain_id, unsigned int op,
-                         unsigned int mode, void *page, void *ring_page)
+                         unsigned int mode, uint32_t *port, void *ring_page)
 {
     DECLARE_DOMCTL;
+    int rc;
 
     domctl.cmd = XEN_DOMCTL_mem_event_op;
     domctl.domain = domain_id;
     domctl.u.mem_event_op.op = op;
     domctl.u.mem_event_op.mode = mode;
-
-    domctl.u.mem_event_op.shared_addr = (unsigned long)page;
-    domctl.u.mem_event_op.ring_addr = (unsigned long)ring_page;
+    domctl.u.mem_event_op.ring_addr = (unsigned long) ring_page;
     
-    return do_domctl(xch, &domctl);
+    rc = do_domctl(xch, &domctl);
+    if ( !rc && port )
+        *port = domctl.u.mem_event_op.port;
+    return rc;
 }
 
 int xc_mem_event_memop(xc_interface *xch, domid_t domain_id, 
diff -r a8959e0a463f -r e639e75254e9 tools/libxc/xc_mem_paging.c
--- a/tools/libxc/xc_mem_paging.c	Thu Mar 08 17:05:23 2012 +0100
+++ b/tools/libxc/xc_mem_paging.c	Thu Mar 08 16:40:05 2012 +0000
@@ -25,12 +25,18 @@
 
 
 int xc_mem_paging_enable(xc_interface *xch, domid_t domain_id,
-                        void *shared_page, void *ring_page)
+                         uint32_t *port, void *ring_page)
 {
+    if ( !port )
+    {
+        errno = EINVAL;
+        return -1;
+    }
+        
     return xc_mem_event_control(xch, domain_id,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING,
-                                shared_page, ring_page);
+                                port, ring_page);
 }
 
 int xc_mem_paging_disable(xc_interface *xch, domid_t domain_id)
diff -r a8959e0a463f -r e639e75254e9 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Mar 08 17:05:23 2012 +0100
+++ b/tools/libxc/xenctrl.h	Thu Mar 08 16:40:05 2012 +0000
@@ -1892,13 +1892,13 @@
  * mem_event operations
  */
 int xc_mem_event_control(xc_interface *xch, domid_t domain_id, unsigned int op,
-                         unsigned int mode, void *shared_page, void *ring_page);
+                         unsigned int mode, uint32_t *port, void *ring_page);
 int xc_mem_event_memop(xc_interface *xch, domid_t domain_id, 
                         unsigned int op, unsigned int mode,
                         uint64_t gfn, void *buffer);
 
 int xc_mem_paging_enable(xc_interface *xch, domid_t domain_id,
-                        void *shared_page, void *ring_page);
+                         uint32_t *port, void *ring_page);
 int xc_mem_paging_disable(xc_interface *xch, domid_t domain_id);
 int xc_mem_paging_nominate(xc_interface *xch, domid_t domain_id,
                            unsigned long gfn);
@@ -1908,7 +1908,7 @@
                         unsigned long gfn, void *buffer);
 
 int xc_mem_access_enable(xc_interface *xch, domid_t domain_id,
-                        void *shared_page, void *ring_page);
+                         uint32_t *port, void *ring_page);
 int xc_mem_access_disable(xc_interface *xch, domid_t domain_id);
 int xc_mem_access_resume(xc_interface *xch, domid_t domain_id,
                          unsigned long gfn);
diff -r a8959e0a463f -r e639e75254e9 tools/tests/xen-access/xen-access.c
--- a/tools/tests/xen-access/xen-access.c	Thu Mar 08 17:05:23 2012 +0100
+++ b/tools/tests/xen-access/xen-access.c	Thu Mar 08 16:40:05 2012 +0000
@@ -98,7 +98,7 @@
     xc_evtchn *xce_handle;
     int port;
     mem_event_back_ring_t back_ring;
-    mem_event_shared_page_t *shared_page;
+    uint32_t evtchn_port;
     void *ring_page;
     spinlock_t ring_lock;
 } mem_event_t;
@@ -166,7 +166,7 @@
  err:
     return -errno;
 }
-
+ 
 static void *init_page(void)
 {
     void *buffer;
@@ -214,14 +214,6 @@
     /* Set domain id */
     xenaccess->mem_event.domain_id = domain_id;
 
-    /* Initialise shared page */
-    xenaccess->mem_event.shared_page = init_page();
-    if ( xenaccess->mem_event.shared_page == NULL )
-    {
-        ERROR("Error initialising shared page");
-        goto err;
-    }
-
     /* Initialise ring page */
     xenaccess->mem_event.ring_page = init_page();
     if ( xenaccess->mem_event.ring_page == NULL )
@@ -242,7 +234,7 @@
 
     /* Initialise Xen */
     rc = xc_mem_access_enable(xenaccess->xc_handle, xenaccess->mem_event.domain_id,
-                             xenaccess->mem_event.shared_page,
+                             &xenaccess->mem_event.evtchn_port,
                              xenaccess->mem_event.ring_page);
     if ( rc != 0 )
     {
@@ -271,7 +263,7 @@
     /* Bind event notification */
     rc = xc_evtchn_bind_interdomain(xenaccess->mem_event.xce_handle,
                                     xenaccess->mem_event.domain_id,
-                                    xenaccess->mem_event.shared_page->port);
+                                    xenaccess->mem_event.evtchn_port);
     if ( rc < 0 )
     {
         ERROR("Failed to bind event channel");
@@ -322,12 +314,6 @@
  err:
     if ( xenaccess )
     {
-        if ( xenaccess->mem_event.shared_page )
-        {
-            munlock(xenaccess->mem_event.shared_page, PAGE_SIZE);
-            free(xenaccess->mem_event.shared_page);
-        }
-
         if ( xenaccess->mem_event.ring_page )
         {
             munlock(xenaccess->mem_event.ring_page, PAGE_SIZE);
diff -r a8959e0a463f -r e639e75254e9 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Thu Mar 08 17:05:23 2012 +0100
+++ b/tools/xenpaging/xenpaging.c	Thu Mar 08 16:40:05 2012 +0000
@@ -337,14 +337,6 @@
         goto err;
     }
 
-    /* Initialise shared page */
-    paging->mem_event.shared_page = init_page();
-    if ( paging->mem_event.shared_page == NULL )
-    {
-        PERROR("Error initialising shared page");
-        goto err;
-    }
-
     /* Initialise ring page */
     paging->mem_event.ring_page = init_page();
     if ( paging->mem_event.ring_page == NULL )
@@ -361,7 +353,7 @@
     
     /* Initialise Xen */
     rc = xc_mem_paging_enable(xch, paging->mem_event.domain_id,
-                             paging->mem_event.shared_page,
+                             &paging->mem_event.evtchn_port, 
                              paging->mem_event.ring_page);
     if ( rc != 0 )
     {
@@ -393,7 +385,7 @@
     /* Bind event notification */
     rc = xc_evtchn_bind_interdomain(paging->mem_event.xce_handle,
                                     paging->mem_event.domain_id,
-                                    paging->mem_event.shared_page->port);
+                                    paging->mem_event.evtchn_port);
     if ( rc < 0 )
     {
         PERROR("Failed to bind event channel");
@@ -474,11 +466,6 @@
             munlock(paging->paging_buffer, PAGE_SIZE);
             free(paging->paging_buffer);
         }
-        if ( paging->mem_event.shared_page )
-        {
-            munlock(paging->mem_event.shared_page, PAGE_SIZE);
-            free(paging->mem_event.shared_page);
-        }
 
         if ( paging->mem_event.ring_page )
         {
diff -r a8959e0a463f -r e639e75254e9 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Thu Mar 08 17:05:23 2012 +0100
+++ b/tools/xenpaging/xenpaging.h	Thu Mar 08 16:40:05 2012 +0000
@@ -36,7 +36,7 @@
     xc_evtchn *xce_handle;
     int port;
     mem_event_back_ring_t back_ring;
-    mem_event_shared_page_t *shared_page;
+    uint32_t evtchn_port;
     void *ring_page;
 };
 
diff -r a8959e0a463f -r e639e75254e9 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 08 17:05:23 2012 +0100
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
@@ -50,12 +50,10 @@
     struct domain *dom_mem_event = current->domain;
     struct vcpu *v = current;
     unsigned long ring_addr = mec->ring_addr;
-    unsigned long shared_addr = mec->shared_addr;
     l1_pgentry_t l1e;
-    unsigned long shared_gfn = 0, ring_gfn = 0; /* gcc ... */
+    unsigned long ring_gfn = 0; /* gcc ... */
     p2m_type_t p2mt;
     mfn_t ring_mfn;
-    mfn_t shared_mfn;
 
     /* Only one helper at a time. If the helper crashed,
      * the ring is in an undefined state and so is the guest.
@@ -66,10 +64,6 @@
     /* Get MFN of ring page */
     guest_get_eff_l1e(v, ring_addr, &l1e);
     ring_gfn = l1e_get_pfn(l1e);
-    /* We're grabbing these two in an order that could deadlock
-     * dom0 if 1. it were an hvm 2. there were two concurrent
-     * enables 3. the two gfn's in each enable criss-crossed
-     * 2MB regions. Duly noted.... */
     ring_mfn = get_gfn(dom_mem_event, ring_gfn, &p2mt);
 
     if ( unlikely(!mfn_valid(mfn_x(ring_mfn))) )
@@ -80,23 +74,9 @@
 
     mem_event_ring_lock_init(med);
 
-    /* Get MFN of shared page */
-    guest_get_eff_l1e(v, shared_addr, &l1e);
-    shared_gfn = l1e_get_pfn(l1e);
-    shared_mfn = get_gfn(dom_mem_event, shared_gfn, &p2mt);
-
-    if ( unlikely(!mfn_valid(mfn_x(shared_mfn))) )
-    {
-        put_gfn(dom_mem_event, ring_gfn);
-        put_gfn(dom_mem_event, shared_gfn);
-        return -EINVAL;
-    }
-
-    /* Map ring and shared pages */
+    /* Map ring page */
     med->ring_page = map_domain_page(mfn_x(ring_mfn));
-    med->shared_page = map_domain_page(mfn_x(shared_mfn));
     put_gfn(dom_mem_event, ring_gfn);
-    put_gfn(dom_mem_event, shared_gfn); 
 
     /* Set the number of currently blocked vCPUs to 0. */
     med->blocked = 0;
@@ -108,8 +88,7 @@
     if ( rc < 0 )
         goto err;
 
-    ((mem_event_shared_page_t *)med->shared_page)->port = rc;
-    med->xen_port = rc;
+    med->xen_port = mec->port = rc;
 
     /* Prepare ring buffer */
     FRONT_RING_INIT(&med->front_ring,
@@ -125,9 +104,6 @@
     return 0;
 
  err:
-    unmap_domain_page(med->shared_page);
-    med->shared_page = NULL;
-
     unmap_domain_page(med->ring_page);
     med->ring_page = NULL;
 
@@ -249,9 +225,6 @@
         unmap_domain_page(med->ring_page);
         med->ring_page = NULL;
 
-        unmap_domain_page(med->shared_page);
-        med->shared_page = NULL;
-
         /* Unblock all vCPUs */
         for_each_vcpu ( d, v )
         {
diff -r a8959e0a463f -r e639e75254e9 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Mar 08 17:05:23 2012 +0100
+++ b/xen/include/public/domctl.h	Thu Mar 08 16:40:05 2012 +0000
@@ -747,8 +747,8 @@
     uint32_t       op;           /* XEN_DOMCTL_MEM_EVENT_OP_*_* */
     uint32_t       mode;         /* XEN_DOMCTL_MEM_EVENT_OP_* */
 
-    uint64_aligned_t shared_addr;  /* IN:  Virtual address of shared page */
-    uint64_aligned_t ring_addr;    /* IN:  Virtual address of ring page */
+    uint32_t port;              /* OUT: event channel for ring */
+    uint64_aligned_t ring_addr; /* IN:  Virtual address of ring page */
 };
 typedef struct xen_domctl_mem_event_op xen_domctl_mem_event_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_mem_event_op_t);
diff -r a8959e0a463f -r e639e75254e9 xen/include/public/mem_event.h
--- a/xen/include/public/mem_event.h	Thu Mar 08 17:05:23 2012 +0100
+++ b/xen/include/public/mem_event.h	Thu Mar 08 16:40:05 2012 +0000
@@ -46,10 +46,6 @@
 #define MEM_EVENT_REASON_INT3        5    /* int3 was hit: gla/gfn are RIP */
 #define MEM_EVENT_REASON_SINGLESTEP  6    /* single step was invoked: gla/gfn are RIP */
 
-typedef struct mem_event_shared_page {
-    uint32_t port;
-} mem_event_shared_page_t;
-
 typedef struct mem_event_st {
     uint32_t flags;
     uint32_t vcpu_id;
diff -r a8959e0a463f -r e639e75254e9 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Thu Mar 08 17:05:23 2012 +0100
+++ b/xen/include/xen/sched.h	Thu Mar 08 16:40:05 2012 +0000
@@ -190,8 +190,6 @@
     /* The ring has 64 entries */
     unsigned char foreign_producers;
     unsigned char target_producers;
-    /* shared page */
-    mem_event_shared_page_t *shared_page;
     /* shared ring page */
     void *ring_page;
     /* front-end ring */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2O-0007tT-9y; Sat, 10 Mar 2012 06:44: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 1S6G2N-0007nW-9r
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:19 +0000
Received: from [85.158.143.35:49685] by server-2.bemta-4.messagelabs.com id
	76/42-17550-248FA5F4; Sat, 10 Mar 2012 06:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1331361855!9895839!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20470 invoked from network); 10 Mar 2012 06:44:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Mar 2012 06:44: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 1S6G2J-0006b7-DF
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2J-0004ee-BV
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:15 +0000
Message-Id: <E1S6G2J-0004ee-BV@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Tools: Remove shared page from
	mem_event/access/paging interfaces
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID e639e75254e9cdc95c4957c1517c145222e79f3e
# Parent  a8959e0a463f0f028ffe3858d94460681b1b3659
Tools: Remove shared page from mem_event/access/paging interfaces

Don't use the superfluous shared page, return the event channel directly as
part of the domctl struct, instead.

In-tree consumers (xenpaging, xen-access) updated. This is an ABI/API change,
so please voice any concerns.

Known pending issues:
- pager could die and its ring page could be used by some other process, yet
  Xen retains the mapping to it.
- use a saner interface for the paging_load buffer.

This change also affects the x86/mm bits in the hypervisor that process the
mem_event setup domctl.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Acked-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r a8959e0a463f -r e639e75254e9 tools/libxc/xc_mem_access.c
--- a/tools/libxc/xc_mem_access.c	Thu Mar 08 17:05:23 2012 +0100
+++ b/tools/libxc/xc_mem_access.c	Thu Mar 08 16:40:05 2012 +0000
@@ -25,12 +25,18 @@
 
 
 int xc_mem_access_enable(xc_interface *xch, domid_t domain_id,
-                        void *shared_page, void *ring_page)
+                         uint32_t *port, void *ring_page)
 {
+    if ( !port )
+    {
+        errno = EINVAL;
+        return -1;
+    }
+
     return xc_mem_event_control(xch, domain_id,
                                 XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE,
                                 XEN_DOMCTL_MEM_EVENT_OP_ACCESS,
-                                shared_page, ring_page);
+                                port, ring_page);
 }
 
 int xc_mem_access_disable(xc_interface *xch, domid_t domain_id)
diff -r a8959e0a463f -r e639e75254e9 tools/libxc/xc_mem_event.c
--- a/tools/libxc/xc_mem_event.c	Thu Mar 08 17:05:23 2012 +0100
+++ b/tools/libxc/xc_mem_event.c	Thu Mar 08 16:40:05 2012 +0000
@@ -24,19 +24,21 @@
 #include "xc_private.h"
 
 int xc_mem_event_control(xc_interface *xch, domid_t domain_id, unsigned int op,
-                         unsigned int mode, void *page, void *ring_page)
+                         unsigned int mode, uint32_t *port, void *ring_page)
 {
     DECLARE_DOMCTL;
+    int rc;
 
     domctl.cmd = XEN_DOMCTL_mem_event_op;
     domctl.domain = domain_id;
     domctl.u.mem_event_op.op = op;
     domctl.u.mem_event_op.mode = mode;
-
-    domctl.u.mem_event_op.shared_addr = (unsigned long)page;
-    domctl.u.mem_event_op.ring_addr = (unsigned long)ring_page;
+    domctl.u.mem_event_op.ring_addr = (unsigned long) ring_page;
     
-    return do_domctl(xch, &domctl);
+    rc = do_domctl(xch, &domctl);
+    if ( !rc && port )
+        *port = domctl.u.mem_event_op.port;
+    return rc;
 }
 
 int xc_mem_event_memop(xc_interface *xch, domid_t domain_id, 
diff -r a8959e0a463f -r e639e75254e9 tools/libxc/xc_mem_paging.c
--- a/tools/libxc/xc_mem_paging.c	Thu Mar 08 17:05:23 2012 +0100
+++ b/tools/libxc/xc_mem_paging.c	Thu Mar 08 16:40:05 2012 +0000
@@ -25,12 +25,18 @@
 
 
 int xc_mem_paging_enable(xc_interface *xch, domid_t domain_id,
-                        void *shared_page, void *ring_page)
+                         uint32_t *port, void *ring_page)
 {
+    if ( !port )
+    {
+        errno = EINVAL;
+        return -1;
+    }
+        
     return xc_mem_event_control(xch, domain_id,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING,
-                                shared_page, ring_page);
+                                port, ring_page);
 }
 
 int xc_mem_paging_disable(xc_interface *xch, domid_t domain_id)
diff -r a8959e0a463f -r e639e75254e9 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Mar 08 17:05:23 2012 +0100
+++ b/tools/libxc/xenctrl.h	Thu Mar 08 16:40:05 2012 +0000
@@ -1892,13 +1892,13 @@
  * mem_event operations
  */
 int xc_mem_event_control(xc_interface *xch, domid_t domain_id, unsigned int op,
-                         unsigned int mode, void *shared_page, void *ring_page);
+                         unsigned int mode, uint32_t *port, void *ring_page);
 int xc_mem_event_memop(xc_interface *xch, domid_t domain_id, 
                         unsigned int op, unsigned int mode,
                         uint64_t gfn, void *buffer);
 
 int xc_mem_paging_enable(xc_interface *xch, domid_t domain_id,
-                        void *shared_page, void *ring_page);
+                         uint32_t *port, void *ring_page);
 int xc_mem_paging_disable(xc_interface *xch, domid_t domain_id);
 int xc_mem_paging_nominate(xc_interface *xch, domid_t domain_id,
                            unsigned long gfn);
@@ -1908,7 +1908,7 @@
                         unsigned long gfn, void *buffer);
 
 int xc_mem_access_enable(xc_interface *xch, domid_t domain_id,
-                        void *shared_page, void *ring_page);
+                         uint32_t *port, void *ring_page);
 int xc_mem_access_disable(xc_interface *xch, domid_t domain_id);
 int xc_mem_access_resume(xc_interface *xch, domid_t domain_id,
                          unsigned long gfn);
diff -r a8959e0a463f -r e639e75254e9 tools/tests/xen-access/xen-access.c
--- a/tools/tests/xen-access/xen-access.c	Thu Mar 08 17:05:23 2012 +0100
+++ b/tools/tests/xen-access/xen-access.c	Thu Mar 08 16:40:05 2012 +0000
@@ -98,7 +98,7 @@
     xc_evtchn *xce_handle;
     int port;
     mem_event_back_ring_t back_ring;
-    mem_event_shared_page_t *shared_page;
+    uint32_t evtchn_port;
     void *ring_page;
     spinlock_t ring_lock;
 } mem_event_t;
@@ -166,7 +166,7 @@
  err:
     return -errno;
 }
-
+ 
 static void *init_page(void)
 {
     void *buffer;
@@ -214,14 +214,6 @@
     /* Set domain id */
     xenaccess->mem_event.domain_id = domain_id;
 
-    /* Initialise shared page */
-    xenaccess->mem_event.shared_page = init_page();
-    if ( xenaccess->mem_event.shared_page == NULL )
-    {
-        ERROR("Error initialising shared page");
-        goto err;
-    }
-
     /* Initialise ring page */
     xenaccess->mem_event.ring_page = init_page();
     if ( xenaccess->mem_event.ring_page == NULL )
@@ -242,7 +234,7 @@
 
     /* Initialise Xen */
     rc = xc_mem_access_enable(xenaccess->xc_handle, xenaccess->mem_event.domain_id,
-                             xenaccess->mem_event.shared_page,
+                             &xenaccess->mem_event.evtchn_port,
                              xenaccess->mem_event.ring_page);
     if ( rc != 0 )
     {
@@ -271,7 +263,7 @@
     /* Bind event notification */
     rc = xc_evtchn_bind_interdomain(xenaccess->mem_event.xce_handle,
                                     xenaccess->mem_event.domain_id,
-                                    xenaccess->mem_event.shared_page->port);
+                                    xenaccess->mem_event.evtchn_port);
     if ( rc < 0 )
     {
         ERROR("Failed to bind event channel");
@@ -322,12 +314,6 @@
  err:
     if ( xenaccess )
     {
-        if ( xenaccess->mem_event.shared_page )
-        {
-            munlock(xenaccess->mem_event.shared_page, PAGE_SIZE);
-            free(xenaccess->mem_event.shared_page);
-        }
-
         if ( xenaccess->mem_event.ring_page )
         {
             munlock(xenaccess->mem_event.ring_page, PAGE_SIZE);
diff -r a8959e0a463f -r e639e75254e9 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Thu Mar 08 17:05:23 2012 +0100
+++ b/tools/xenpaging/xenpaging.c	Thu Mar 08 16:40:05 2012 +0000
@@ -337,14 +337,6 @@
         goto err;
     }
 
-    /* Initialise shared page */
-    paging->mem_event.shared_page = init_page();
-    if ( paging->mem_event.shared_page == NULL )
-    {
-        PERROR("Error initialising shared page");
-        goto err;
-    }
-
     /* Initialise ring page */
     paging->mem_event.ring_page = init_page();
     if ( paging->mem_event.ring_page == NULL )
@@ -361,7 +353,7 @@
     
     /* Initialise Xen */
     rc = xc_mem_paging_enable(xch, paging->mem_event.domain_id,
-                             paging->mem_event.shared_page,
+                             &paging->mem_event.evtchn_port, 
                              paging->mem_event.ring_page);
     if ( rc != 0 )
     {
@@ -393,7 +385,7 @@
     /* Bind event notification */
     rc = xc_evtchn_bind_interdomain(paging->mem_event.xce_handle,
                                     paging->mem_event.domain_id,
-                                    paging->mem_event.shared_page->port);
+                                    paging->mem_event.evtchn_port);
     if ( rc < 0 )
     {
         PERROR("Failed to bind event channel");
@@ -474,11 +466,6 @@
             munlock(paging->paging_buffer, PAGE_SIZE);
             free(paging->paging_buffer);
         }
-        if ( paging->mem_event.shared_page )
-        {
-            munlock(paging->mem_event.shared_page, PAGE_SIZE);
-            free(paging->mem_event.shared_page);
-        }
 
         if ( paging->mem_event.ring_page )
         {
diff -r a8959e0a463f -r e639e75254e9 tools/xenpaging/xenpaging.h
--- a/tools/xenpaging/xenpaging.h	Thu Mar 08 17:05:23 2012 +0100
+++ b/tools/xenpaging/xenpaging.h	Thu Mar 08 16:40:05 2012 +0000
@@ -36,7 +36,7 @@
     xc_evtchn *xce_handle;
     int port;
     mem_event_back_ring_t back_ring;
-    mem_event_shared_page_t *shared_page;
+    uint32_t evtchn_port;
     void *ring_page;
 };
 
diff -r a8959e0a463f -r e639e75254e9 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 08 17:05:23 2012 +0100
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
@@ -50,12 +50,10 @@
     struct domain *dom_mem_event = current->domain;
     struct vcpu *v = current;
     unsigned long ring_addr = mec->ring_addr;
-    unsigned long shared_addr = mec->shared_addr;
     l1_pgentry_t l1e;
-    unsigned long shared_gfn = 0, ring_gfn = 0; /* gcc ... */
+    unsigned long ring_gfn = 0; /* gcc ... */
     p2m_type_t p2mt;
     mfn_t ring_mfn;
-    mfn_t shared_mfn;
 
     /* Only one helper at a time. If the helper crashed,
      * the ring is in an undefined state and so is the guest.
@@ -66,10 +64,6 @@
     /* Get MFN of ring page */
     guest_get_eff_l1e(v, ring_addr, &l1e);
     ring_gfn = l1e_get_pfn(l1e);
-    /* We're grabbing these two in an order that could deadlock
-     * dom0 if 1. it were an hvm 2. there were two concurrent
-     * enables 3. the two gfn's in each enable criss-crossed
-     * 2MB regions. Duly noted.... */
     ring_mfn = get_gfn(dom_mem_event, ring_gfn, &p2mt);
 
     if ( unlikely(!mfn_valid(mfn_x(ring_mfn))) )
@@ -80,23 +74,9 @@
 
     mem_event_ring_lock_init(med);
 
-    /* Get MFN of shared page */
-    guest_get_eff_l1e(v, shared_addr, &l1e);
-    shared_gfn = l1e_get_pfn(l1e);
-    shared_mfn = get_gfn(dom_mem_event, shared_gfn, &p2mt);
-
-    if ( unlikely(!mfn_valid(mfn_x(shared_mfn))) )
-    {
-        put_gfn(dom_mem_event, ring_gfn);
-        put_gfn(dom_mem_event, shared_gfn);
-        return -EINVAL;
-    }
-
-    /* Map ring and shared pages */
+    /* Map ring page */
     med->ring_page = map_domain_page(mfn_x(ring_mfn));
-    med->shared_page = map_domain_page(mfn_x(shared_mfn));
     put_gfn(dom_mem_event, ring_gfn);
-    put_gfn(dom_mem_event, shared_gfn); 
 
     /* Set the number of currently blocked vCPUs to 0. */
     med->blocked = 0;
@@ -108,8 +88,7 @@
     if ( rc < 0 )
         goto err;
 
-    ((mem_event_shared_page_t *)med->shared_page)->port = rc;
-    med->xen_port = rc;
+    med->xen_port = mec->port = rc;
 
     /* Prepare ring buffer */
     FRONT_RING_INIT(&med->front_ring,
@@ -125,9 +104,6 @@
     return 0;
 
  err:
-    unmap_domain_page(med->shared_page);
-    med->shared_page = NULL;
-
     unmap_domain_page(med->ring_page);
     med->ring_page = NULL;
 
@@ -249,9 +225,6 @@
         unmap_domain_page(med->ring_page);
         med->ring_page = NULL;
 
-        unmap_domain_page(med->shared_page);
-        med->shared_page = NULL;
-
         /* Unblock all vCPUs */
         for_each_vcpu ( d, v )
         {
diff -r a8959e0a463f -r e639e75254e9 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Mar 08 17:05:23 2012 +0100
+++ b/xen/include/public/domctl.h	Thu Mar 08 16:40:05 2012 +0000
@@ -747,8 +747,8 @@
     uint32_t       op;           /* XEN_DOMCTL_MEM_EVENT_OP_*_* */
     uint32_t       mode;         /* XEN_DOMCTL_MEM_EVENT_OP_* */
 
-    uint64_aligned_t shared_addr;  /* IN:  Virtual address of shared page */
-    uint64_aligned_t ring_addr;    /* IN:  Virtual address of ring page */
+    uint32_t port;              /* OUT: event channel for ring */
+    uint64_aligned_t ring_addr; /* IN:  Virtual address of ring page */
 };
 typedef struct xen_domctl_mem_event_op xen_domctl_mem_event_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_mem_event_op_t);
diff -r a8959e0a463f -r e639e75254e9 xen/include/public/mem_event.h
--- a/xen/include/public/mem_event.h	Thu Mar 08 17:05:23 2012 +0100
+++ b/xen/include/public/mem_event.h	Thu Mar 08 16:40:05 2012 +0000
@@ -46,10 +46,6 @@
 #define MEM_EVENT_REASON_INT3        5    /* int3 was hit: gla/gfn are RIP */
 #define MEM_EVENT_REASON_SINGLESTEP  6    /* single step was invoked: gla/gfn are RIP */
 
-typedef struct mem_event_shared_page {
-    uint32_t port;
-} mem_event_shared_page_t;
-
 typedef struct mem_event_st {
     uint32_t flags;
     uint32_t vcpu_id;
diff -r a8959e0a463f -r e639e75254e9 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Thu Mar 08 17:05:23 2012 +0100
+++ b/xen/include/xen/sched.h	Thu Mar 08 16:40:05 2012 +0000
@@ -190,8 +190,6 @@
     /* The ring has 64 entries */
     unsigned char foreign_producers;
     unsigned char target_producers;
-    /* shared page */
-    mem_event_shared_page_t *shared_page;
     /* shared ring page */
     void *ring_page;
     /* front-end ring */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2P-0007ux-GW; Sat, 10 Mar 2012 06:44: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 1S6G2O-0007nd-3a
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:20 +0000
Received: from [85.158.143.99:46641] by server-1.bemta-4.messagelabs.com id
	9C/D7-20925-348FA5F4; Sat, 10 Mar 2012 06:44:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1331361857!18493660!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14421 invoked from network); 10 Mar 2012 06:44:18 -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 Mar 2012 06:44: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 1S6G2L-0006bG-4z
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2L-0004g7-0e
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:17 +0000
Message-Id: <E1S6G2L-0004g7-0e@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: wire up sharing 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID 42b977df17be6137cfa5e306ac2f84afafe97e73
# Parent  0d37308c46880a1f4922baa0915e853557970bb4
x86/mm: wire up sharing ring

Now that we have an interface close to finalizing, do the necessary plumbing to
set up a ring for reporting failed allocations in the unshare path.

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


diff -r 0d37308c4688 -r 42b977df17be xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
@@ -431,6 +431,13 @@
         p2m_mem_access_resume(v->domain);
 }
 
+/* Registered with Xen-bound event channel for incoming notifications. */
+static void mem_sharing_notification(struct vcpu *v, unsigned int port)
+{
+    if ( likely(v->domain->mem_event->share.ring_page != NULL) )
+        mem_sharing_sharing_resume(v->domain);
+}
+
 struct domain *get_mem_event_op_target(uint32_t domain, int *rc)
 {
     struct domain *d;
@@ -598,6 +605,40 @@
     }
     break;
 
+    case XEN_DOMCTL_MEM_EVENT_OP_SHARING: 
+    {
+        struct mem_event_domain *med = &d->mem_event->share;
+        rc = -EINVAL;
+
+        switch( mec->op )
+        {
+        case XEN_DOMCTL_MEM_EVENT_OP_SHARING_ENABLE:
+        {
+            rc = -ENODEV;
+            /* Only HAP is supported */
+            if ( !hap_enabled(d) )
+                break;
+
+            rc = mem_event_enable(d, mec, med, _VPF_mem_sharing, 
+                                    HVM_PARAM_SHARING_RING_PFN,
+                                    mem_sharing_notification);
+        }
+        break;
+
+        case XEN_DOMCTL_MEM_EVENT_OP_SHARING_DISABLE:
+        {
+            if ( med->ring_page )
+                rc = mem_event_disable(d, med);
+        }
+        break;
+
+        default:
+            rc = -ENOSYS;
+            break;
+        }
+    }
+    break;
+
     default:
         rc = -ENOSYS;
     }
diff -r 0d37308c4688 -r 42b977df17be xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/public/domctl.h	Thu Mar 08 16:40:05 2012 +0000
@@ -711,7 +711,7 @@
 /* XEN_DOMCTL_mem_event_op */
 
 /*
-* Domain memory paging
+ * Domain memory paging
  * Page memory in and out.
  * Domctl interface to set up and tear down the 
  * pager<->hypervisor interface. Use XENMEM_paging_op*
@@ -741,6 +741,24 @@
 #define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE     0
 #define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_DISABLE    1
 
+/*
+ * Sharing ENOMEM helper.
+ *
+ * As with paging, use the domctl for teardown/setup of the
+ * helper<->hypervisor interface.
+ *
+ * If setup, this ring is used to communicate failed allocations
+ * in the unshare path. XENMEM_sharing_op_resume is used to wake up
+ * vcpus that could not unshare.
+ *
+ * Note that shring can be turned on (as per the domctl below)
+ * *without* this ring being setup.
+ */
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING           3
+
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_ENABLE    0
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DISABLE   1
+
 /* Use for teardown/setup of helper<->hypervisor interface for paging, 
  * access and sharing.*/
 struct xen_domctl_mem_event_op {
diff -r 0d37308c4688 -r 42b977df17be xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/xen/sched.h	Thu Mar 08 16:40:05 2012 +0000
@@ -636,6 +636,9 @@
  /* VCPU is blocked due to missing mem_access ring. */
 #define _VPF_mem_access      5
 #define VPF_mem_access       (1UL<<_VPF_mem_access)
+ /* VCPU is blocked due to missing mem_sharing ring. */
+#define _VPF_mem_sharing     6
+#define VPF_mem_sharing      (1UL<<_VPF_mem_sharing)
 
 static inline int vcpu_runnable(struct vcpu *v)
 {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2P-0007ux-GW; Sat, 10 Mar 2012 06:44: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 1S6G2O-0007nd-3a
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:20 +0000
Received: from [85.158.143.99:46641] by server-1.bemta-4.messagelabs.com id
	9C/D7-20925-348FA5F4; Sat, 10 Mar 2012 06:44:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1331361857!18493660!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14421 invoked from network); 10 Mar 2012 06:44:18 -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 Mar 2012 06:44: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 1S6G2L-0006bG-4z
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2L-0004g7-0e
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:17 +0000
Message-Id: <E1S6G2L-0004g7-0e@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: wire up sharing 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID 42b977df17be6137cfa5e306ac2f84afafe97e73
# Parent  0d37308c46880a1f4922baa0915e853557970bb4
x86/mm: wire up sharing ring

Now that we have an interface close to finalizing, do the necessary plumbing to
set up a ring for reporting failed allocations in the unshare path.

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


diff -r 0d37308c4688 -r 42b977df17be xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
@@ -431,6 +431,13 @@
         p2m_mem_access_resume(v->domain);
 }
 
+/* Registered with Xen-bound event channel for incoming notifications. */
+static void mem_sharing_notification(struct vcpu *v, unsigned int port)
+{
+    if ( likely(v->domain->mem_event->share.ring_page != NULL) )
+        mem_sharing_sharing_resume(v->domain);
+}
+
 struct domain *get_mem_event_op_target(uint32_t domain, int *rc)
 {
     struct domain *d;
@@ -598,6 +605,40 @@
     }
     break;
 
+    case XEN_DOMCTL_MEM_EVENT_OP_SHARING: 
+    {
+        struct mem_event_domain *med = &d->mem_event->share;
+        rc = -EINVAL;
+
+        switch( mec->op )
+        {
+        case XEN_DOMCTL_MEM_EVENT_OP_SHARING_ENABLE:
+        {
+            rc = -ENODEV;
+            /* Only HAP is supported */
+            if ( !hap_enabled(d) )
+                break;
+
+            rc = mem_event_enable(d, mec, med, _VPF_mem_sharing, 
+                                    HVM_PARAM_SHARING_RING_PFN,
+                                    mem_sharing_notification);
+        }
+        break;
+
+        case XEN_DOMCTL_MEM_EVENT_OP_SHARING_DISABLE:
+        {
+            if ( med->ring_page )
+                rc = mem_event_disable(d, med);
+        }
+        break;
+
+        default:
+            rc = -ENOSYS;
+            break;
+        }
+    }
+    break;
+
     default:
         rc = -ENOSYS;
     }
diff -r 0d37308c4688 -r 42b977df17be xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/public/domctl.h	Thu Mar 08 16:40:05 2012 +0000
@@ -711,7 +711,7 @@
 /* XEN_DOMCTL_mem_event_op */
 
 /*
-* Domain memory paging
+ * Domain memory paging
  * Page memory in and out.
  * Domctl interface to set up and tear down the 
  * pager<->hypervisor interface. Use XENMEM_paging_op*
@@ -741,6 +741,24 @@
 #define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE     0
 #define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_DISABLE    1
 
+/*
+ * Sharing ENOMEM helper.
+ *
+ * As with paging, use the domctl for teardown/setup of the
+ * helper<->hypervisor interface.
+ *
+ * If setup, this ring is used to communicate failed allocations
+ * in the unshare path. XENMEM_sharing_op_resume is used to wake up
+ * vcpus that could not unshare.
+ *
+ * Note that shring can be turned on (as per the domctl below)
+ * *without* this ring being setup.
+ */
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING           3
+
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_ENABLE    0
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DISABLE   1
+
 /* Use for teardown/setup of helper<->hypervisor interface for paging, 
  * access and sharing.*/
 struct xen_domctl_mem_event_op {
diff -r 0d37308c4688 -r 42b977df17be xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/xen/sched.h	Thu Mar 08 16:40:05 2012 +0000
@@ -636,6 +636,9 @@
  /* VCPU is blocked due to missing mem_access ring. */
 #define _VPF_mem_access      5
 #define VPF_mem_access       (1UL<<_VPF_mem_access)
+ /* VCPU is blocked due to missing mem_sharing ring. */
+#define _VPF_mem_sharing     6
+#define VPF_mem_sharing      (1UL<<_VPF_mem_sharing)
 
 static inline int vcpu_runnable(struct vcpu *v)
 {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2O-0007tM-7G; Sat, 10 Mar 2012 06:44: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 1S6G2N-0007nd-0E
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:19 +0000
Received: from [85.158.143.35:55232] by server-1.bemta-4.messagelabs.com id
	FA/D7-20925-248FA5F4; Sat, 10 Mar 2012 06:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1331361856!5023637!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19226 invoked from network); 10 Mar 2012 06:44:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Mar 2012 06:44: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 1S6G2J-0006bA-VZ
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2J-0004f9-TT
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:15 +0000
Message-Id: <E1S6G2J-0004f9-TT@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: refactor calls to prepare
	and tear down a helper 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID 29c29f7a525c64ebe53d4b0fadd701302a396a06
# Parent  e639e75254e9cdc95c4957c1517c145222e79f3e
x86/hvm: refactor calls to prepare and tear down a helper ring

These are currently used for the rings connecting Xen with qemu. Refactor them
so the same code can be later used for mem event rings.

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


diff -r e639e75254e9 -r 29c29f7a525c xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Mar 08 16:40:05 2012 +0000
@@ -339,6 +339,19 @@
     domain_pause(d);
 }
 
+void destroy_ring_for_helper(
+    void **_va, struct page_info *page)
+{
+    void *va = *_va;
+
+    if ( va != NULL )
+    {
+        unmap_domain_page_global(va);
+        put_page_and_type(page);
+        *_va = NULL;
+    }
+}
+
 static void hvm_destroy_ioreq_page(
     struct domain *d, struct hvm_ioreq_page *iorp)
 {
@@ -346,18 +359,14 @@
 
     ASSERT(d->is_dying);
 
-    if ( iorp->va != NULL )
-    {
-        unmap_domain_page_global(iorp->va);
-        put_page_and_type(iorp->page);
-        iorp->va = NULL;
-    }
+    destroy_ring_for_helper(&iorp->va, iorp->page);
 
     spin_unlock(&iorp->lock);
 }
 
-static int hvm_set_ioreq_page(
-    struct domain *d, struct hvm_ioreq_page *iorp, unsigned long gmfn)
+int prepare_ring_for_helper(
+    struct domain *d, unsigned long gmfn, struct page_info **_page,
+    void **_va)
 {
     struct page_info *page;
     p2m_type_t p2mt;
@@ -398,14 +407,30 @@
         return -ENOMEM;
     }
 
+    *_va = va;
+    *_page = page;
+
+    put_gfn(d, gmfn);
+
+    return 0;
+}
+
+static int hvm_set_ioreq_page(
+    struct domain *d, struct hvm_ioreq_page *iorp, unsigned long gmfn)
+{
+    struct page_info *page;
+    void *va;
+    int rc;
+
+    if ( (rc = prepare_ring_for_helper(d, gmfn, &page, &va)) )
+        return rc;
+
     spin_lock(&iorp->lock);
 
     if ( (iorp->va != NULL) || d->is_dying )
     {
+        destroy_ring_for_helper(&iorp->va, iorp->page);
         spin_unlock(&iorp->lock);
-        unmap_domain_page_global(va);
-        put_page_and_type(mfn_to_page(mfn));
-        put_gfn(d, gmfn);
         return -EINVAL;
     }
 
@@ -413,7 +438,6 @@
     iorp->page = page;
 
     spin_unlock(&iorp->lock);
-    put_gfn(d, gmfn);
 
     domain_unpause(d);
 
diff -r e639e75254e9 -r 29c29f7a525c xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/asm-x86/hvm/hvm.h	Thu Mar 08 16:40:05 2012 +0000
@@ -26,6 +26,7 @@
 #include <asm/hvm/asid.h>
 #include <public/domctl.h>
 #include <public/hvm/save.h>
+#include <asm/mm.h>
 
 /* Interrupt acknowledgement sources. */
 enum hvm_intsrc {
@@ -191,6 +192,12 @@
 void hvm_vcpu_cacheattr_destroy(struct vcpu *v);
 void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip);
 
+/* Prepare/destroy a ring for a dom0 helper. Helper with talk
+ * with Xen on behalf of this hvm domain. */
+int prepare_ring_for_helper(struct domain *d, unsigned long gmfn, 
+                            struct page_info **_page, void **_va);
+void destroy_ring_for_helper(void **_va, struct page_info *page);
+
 bool_t hvm_send_assist_req(struct vcpu *v);
 
 void hvm_set_guest_tsc(struct vcpu *v, u64 guest_tsc);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2O-0007tM-7G; Sat, 10 Mar 2012 06:44: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 1S6G2N-0007nd-0E
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:19 +0000
Received: from [85.158.143.35:55232] by server-1.bemta-4.messagelabs.com id
	FA/D7-20925-248FA5F4; Sat, 10 Mar 2012 06:44:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1331361856!5023637!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19226 invoked from network); 10 Mar 2012 06:44:17 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Mar 2012 06:44: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 1S6G2J-0006bA-VZ
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2J-0004f9-TT
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:15 +0000
Message-Id: <E1S6G2J-0004f9-TT@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hvm: refactor calls to prepare
	and tear down a helper 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID 29c29f7a525c64ebe53d4b0fadd701302a396a06
# Parent  e639e75254e9cdc95c4957c1517c145222e79f3e
x86/hvm: refactor calls to prepare and tear down a helper ring

These are currently used for the rings connecting Xen with qemu. Refactor them
so the same code can be later used for mem event rings.

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


diff -r e639e75254e9 -r 29c29f7a525c xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Mar 08 16:40:05 2012 +0000
@@ -339,6 +339,19 @@
     domain_pause(d);
 }
 
+void destroy_ring_for_helper(
+    void **_va, struct page_info *page)
+{
+    void *va = *_va;
+
+    if ( va != NULL )
+    {
+        unmap_domain_page_global(va);
+        put_page_and_type(page);
+        *_va = NULL;
+    }
+}
+
 static void hvm_destroy_ioreq_page(
     struct domain *d, struct hvm_ioreq_page *iorp)
 {
@@ -346,18 +359,14 @@
 
     ASSERT(d->is_dying);
 
-    if ( iorp->va != NULL )
-    {
-        unmap_domain_page_global(iorp->va);
-        put_page_and_type(iorp->page);
-        iorp->va = NULL;
-    }
+    destroy_ring_for_helper(&iorp->va, iorp->page);
 
     spin_unlock(&iorp->lock);
 }
 
-static int hvm_set_ioreq_page(
-    struct domain *d, struct hvm_ioreq_page *iorp, unsigned long gmfn)
+int prepare_ring_for_helper(
+    struct domain *d, unsigned long gmfn, struct page_info **_page,
+    void **_va)
 {
     struct page_info *page;
     p2m_type_t p2mt;
@@ -398,14 +407,30 @@
         return -ENOMEM;
     }
 
+    *_va = va;
+    *_page = page;
+
+    put_gfn(d, gmfn);
+
+    return 0;
+}
+
+static int hvm_set_ioreq_page(
+    struct domain *d, struct hvm_ioreq_page *iorp, unsigned long gmfn)
+{
+    struct page_info *page;
+    void *va;
+    int rc;
+
+    if ( (rc = prepare_ring_for_helper(d, gmfn, &page, &va)) )
+        return rc;
+
     spin_lock(&iorp->lock);
 
     if ( (iorp->va != NULL) || d->is_dying )
     {
+        destroy_ring_for_helper(&iorp->va, iorp->page);
         spin_unlock(&iorp->lock);
-        unmap_domain_page_global(va);
-        put_page_and_type(mfn_to_page(mfn));
-        put_gfn(d, gmfn);
         return -EINVAL;
     }
 
@@ -413,7 +438,6 @@
     iorp->page = page;
 
     spin_unlock(&iorp->lock);
-    put_gfn(d, gmfn);
 
     domain_unpause(d);
 
diff -r e639e75254e9 -r 29c29f7a525c xen/include/asm-x86/hvm/hvm.h
--- a/xen/include/asm-x86/hvm/hvm.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/asm-x86/hvm/hvm.h	Thu Mar 08 16:40:05 2012 +0000
@@ -26,6 +26,7 @@
 #include <asm/hvm/asid.h>
 #include <public/domctl.h>
 #include <public/hvm/save.h>
+#include <asm/mm.h>
 
 /* Interrupt acknowledgement sources. */
 enum hvm_intsrc {
@@ -191,6 +192,12 @@
 void hvm_vcpu_cacheattr_destroy(struct vcpu *v);
 void hvm_vcpu_reset_state(struct vcpu *v, uint16_t cs, uint16_t ip);
 
+/* Prepare/destroy a ring for a dom0 helper. Helper with talk
+ * with Xen on behalf of this hvm domain. */
+int prepare_ring_for_helper(struct domain *d, unsigned long gmfn, 
+                            struct page_info **_page, void **_va);
+void destroy_ring_for_helper(void **_va, struct page_info *page);
+
 bool_t hvm_send_assist_req(struct vcpu *v);
 
 void hvm_set_guest_tsc(struct vcpu *v, u64 guest_tsc);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2Q-0007wo-OR; Sat, 10 Mar 2012 06:44:22 +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 1S6G2P-0007nd-2T
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:21 +0000
Received: from [85.158.143.35:49759] by server-1.bemta-4.messagelabs.com id
	0F/D7-20925-448FA5F4; Sat, 10 Mar 2012 06:44:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1331361856!10934556!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13774 invoked from network); 10 Mar 2012 06:44:18 -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;
	10 Mar 2012 06:44: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 1S6G2K-0006bD-H7
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2K-0004fe-Fi
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:16 +0000
Message-Id: <E1S6G2K-0004fe-Fi@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Use a reserved pfn in the guest
	address space to store mem event rings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID 0d37308c46880a1f4922baa0915e853557970bb4
# Parent  29c29f7a525c64ebe53d4b0fadd701302a396a06
Use a reserved pfn in the guest address space to store mem event rings

This solves a long-standing issue in which the pages backing these rings were
pages belonging to dom0 user-space processes. Thus, if the process would die
unexpectedly, Xen would keep posting events to a page now belonging to some
other process.

We update all API-consumers in tree (xenpaging and xen-access).

This is an API/ABI change, so please speak up if it breaks your accumptions.

The patch touches tools, hypervisor x86/hvm bits, and hypervisor x86/mm bits.

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


diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xc_domain_restore.c	Thu Mar 08 16:40:05 2012 +0000
@@ -677,6 +677,9 @@
     int max_vcpu_id;
     uint64_t vcpumap;
     uint64_t identpt;
+    uint64_t paging_ring_pfn;
+    uint64_t access_ring_pfn;
+    uint64_t sharing_ring_pfn;
     uint64_t vm86_tss;
     uint64_t console_pfn;
     uint64_t acpi_ioport_location;
@@ -750,6 +753,39 @@
         // DPRINTF("EPT identity map address: %llx\n", buf->identpt);
         return pagebuf_get_one(xch, ctx, buf, fd, dom);
 
+    case XC_SAVE_ID_HVM_PAGING_RING_PFN:
+        /* Skip padding 4 bytes then read the paging ring location. */
+        if ( RDEXACT(fd, &buf->paging_ring_pfn, sizeof(uint32_t)) ||
+             RDEXACT(fd, &buf->paging_ring_pfn, sizeof(uint64_t)) )
+        {
+            PERROR("error read the paging ring pfn");
+            return -1;
+        }
+        // DPRINTF("paging ring pfn address: %llx\n", buf->paging_ring_pfn);
+        return pagebuf_get_one(xch, ctx, buf, fd, dom);
+
+    case XC_SAVE_ID_HVM_ACCESS_RING_PFN:
+        /* Skip padding 4 bytes then read the mem access ring location. */
+        if ( RDEXACT(fd, &buf->access_ring_pfn, sizeof(uint32_t)) ||
+             RDEXACT(fd, &buf->access_ring_pfn, sizeof(uint64_t)) )
+        {
+            PERROR("error read the access ring pfn");
+            return -1;
+        }
+        // DPRINTF("access ring pfn address: %llx\n", buf->access_ring_pfn);
+        return pagebuf_get_one(xch, ctx, buf, fd, dom);
+
+    case XC_SAVE_ID_HVM_SHARING_RING_PFN:
+        /* Skip padding 4 bytes then read the sharing ring location. */
+        if ( RDEXACT(fd, &buf->sharing_ring_pfn, sizeof(uint32_t)) ||
+             RDEXACT(fd, &buf->sharing_ring_pfn, sizeof(uint64_t)) )
+        {
+            PERROR("error read the sharing ring pfn");
+            return -1;
+        }
+        // DPRINTF("sharing ring pfn address: %llx\n", buf->sharing_ring_pfn);
+        return pagebuf_get_one(xch, ctx, buf, fd, dom);
+
     case XC_SAVE_ID_HVM_VM86_TSS:
         /* Skip padding 4 bytes then read the vm86 TSS location. */
         if ( RDEXACT(fd, &buf->vm86_tss, sizeof(uint32_t)) ||
@@ -1460,6 +1496,12 @@
             /* should this be deferred? does it change? */
             if ( pagebuf.identpt )
                 xc_set_hvm_param(xch, dom, HVM_PARAM_IDENT_PT, pagebuf.identpt);
+            if ( pagebuf.paging_ring_pfn )
+                xc_set_hvm_param(xch, dom, HVM_PARAM_PAGING_RING_PFN, pagebuf.paging_ring_pfn);
+            if ( pagebuf.access_ring_pfn )
+                xc_set_hvm_param(xch, dom, HVM_PARAM_ACCESS_RING_PFN, pagebuf.access_ring_pfn);
+            if ( pagebuf.sharing_ring_pfn )
+                xc_set_hvm_param(xch, dom, HVM_PARAM_SHARING_RING_PFN, pagebuf.sharing_ring_pfn);
             if ( pagebuf.vm86_tss )
                 xc_set_hvm_param(xch, dom, HVM_PARAM_VM86_TSS, pagebuf.vm86_tss);
             if ( pagebuf.console_pfn )
diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xc_domain_save.c	Thu Mar 08 16:40:05 2012 +0000
@@ -1639,6 +1639,42 @@
             goto out;
         }
 
+        chunk.id = XC_SAVE_ID_HVM_PAGING_RING_PFN;
+        chunk.data = 0;
+        xc_get_hvm_param(xch, dom, HVM_PARAM_PAGING_RING_PFN,
+                         (unsigned long *)&chunk.data);
+
+        if ( (chunk.data != 0) &&
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
+        {
+            PERROR("Error when writing the paging ring pfn for guest");
+            goto out;
+        }
+
+        chunk.id = XC_SAVE_ID_HVM_ACCESS_RING_PFN;
+        chunk.data = 0;
+        xc_get_hvm_param(xch, dom, HVM_PARAM_ACCESS_RING_PFN,
+                         (unsigned long *)&chunk.data);
+
+        if ( (chunk.data != 0) &&
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
+        {
+            PERROR("Error when writing the access ring pfn for guest");
+            goto out;
+        }
+
+        chunk.id = XC_SAVE_ID_HVM_SHARING_RING_PFN;
+        chunk.data = 0;
+        xc_get_hvm_param(xch, dom, HVM_PARAM_SHARING_RING_PFN,
+                         (unsigned long *)&chunk.data);
+
+        if ( (chunk.data != 0) &&
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
+        {
+            PERROR("Error when writing the sharing ring pfn for guest");
+            goto out;
+        }
+
         chunk.id = XC_SAVE_ID_HVM_VM86_TSS;
         chunk.data = 0;
         xc_get_hvm_param(xch, dom, HVM_PARAM_VM86_TSS,
diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xc_hvm_build.c	Thu Mar 08 16:40:05 2012 +0000
@@ -38,12 +38,15 @@
 #define SUPERPAGE_1GB_SHIFT   18
 #define SUPERPAGE_1GB_NR_PFNS (1UL << SUPERPAGE_1GB_SHIFT)
 
-#define SPECIALPAGE_BUFIOREQ 0
-#define SPECIALPAGE_XENSTORE 1
-#define SPECIALPAGE_IOREQ    2
-#define SPECIALPAGE_IDENT_PT 3
-#define SPECIALPAGE_CONSOLE  4
-#define NR_SPECIAL_PAGES     5
+#define SPECIALPAGE_PAGING   0
+#define SPECIALPAGE_ACCESS   1
+#define SPECIALPAGE_SHARING  2
+#define SPECIALPAGE_BUFIOREQ 3
+#define SPECIALPAGE_XENSTORE 4
+#define SPECIALPAGE_IOREQ    5
+#define SPECIALPAGE_IDENT_PT 6
+#define SPECIALPAGE_CONSOLE  7
+#define NR_SPECIAL_PAGES     8
 #define special_pfn(x) (0xff000u - NR_SPECIAL_PAGES + (x))
 
 static void build_hvm_info(void *hvm_info_page, uint64_t mem_size,
@@ -356,6 +359,12 @@
                      special_pfn(SPECIALPAGE_IOREQ));
     xc_set_hvm_param(xch, dom, HVM_PARAM_CONSOLE_PFN,
                      special_pfn(SPECIALPAGE_CONSOLE));
+    xc_set_hvm_param(xch, dom, HVM_PARAM_PAGING_RING_PFN,
+                     special_pfn(SPECIALPAGE_PAGING));
+    xc_set_hvm_param(xch, dom, HVM_PARAM_ACCESS_RING_PFN,
+                     special_pfn(SPECIALPAGE_ACCESS));
+    xc_set_hvm_param(xch, dom, HVM_PARAM_SHARING_RING_PFN,
+                     special_pfn(SPECIALPAGE_SHARING));
 
     /*
      * Identity-map page table is required for running with CR0.PG=0 when
diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xc_mem_access.c
--- a/tools/libxc/xc_mem_access.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xc_mem_access.c	Thu Mar 08 16:40:05 2012 +0000
@@ -25,7 +25,7 @@
 
 
 int xc_mem_access_enable(xc_interface *xch, domid_t domain_id,
-                         uint32_t *port, void *ring_page)
+                         uint32_t *port)
 {
     if ( !port )
     {
@@ -36,7 +36,7 @@
     return xc_mem_event_control(xch, domain_id,
                                 XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE,
                                 XEN_DOMCTL_MEM_EVENT_OP_ACCESS,
-                                port, ring_page);
+                                port);
 }
 
 int xc_mem_access_disable(xc_interface *xch, domid_t domain_id)
@@ -44,7 +44,7 @@
     return xc_mem_event_control(xch, domain_id,
                                 XEN_DOMCTL_MEM_EVENT_OP_ACCESS_DISABLE,
                                 XEN_DOMCTL_MEM_EVENT_OP_ACCESS,
-                                NULL, NULL);
+                                NULL);
 }
 
 int xc_mem_access_resume(xc_interface *xch, domid_t domain_id, unsigned long gfn)
diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xc_mem_event.c
--- a/tools/libxc/xc_mem_event.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xc_mem_event.c	Thu Mar 08 16:40:05 2012 +0000
@@ -24,7 +24,7 @@
 #include "xc_private.h"
 
 int xc_mem_event_control(xc_interface *xch, domid_t domain_id, unsigned int op,
-                         unsigned int mode, uint32_t *port, void *ring_page)
+                         unsigned int mode, uint32_t *port)
 {
     DECLARE_DOMCTL;
     int rc;
@@ -33,7 +33,6 @@
     domctl.domain = domain_id;
     domctl.u.mem_event_op.op = op;
     domctl.u.mem_event_op.mode = mode;
-    domctl.u.mem_event_op.ring_addr = (unsigned long) ring_page;
     
     rc = do_domctl(xch, &domctl);
     if ( !rc && port )
diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xc_mem_paging.c
--- a/tools/libxc/xc_mem_paging.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xc_mem_paging.c	Thu Mar 08 16:40:05 2012 +0000
@@ -25,7 +25,7 @@
 
 
 int xc_mem_paging_enable(xc_interface *xch, domid_t domain_id,
-                         uint32_t *port, void *ring_page)
+                         uint32_t *port)
 {
     if ( !port )
     {
@@ -36,7 +36,7 @@
     return xc_mem_event_control(xch, domain_id,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING,
-                                port, ring_page);
+                                port);
 }
 
 int xc_mem_paging_disable(xc_interface *xch, domid_t domain_id)
@@ -44,7 +44,7 @@
     return xc_mem_event_control(xch, domain_id,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING_DISABLE,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING,
-                                NULL, NULL);
+                                NULL);
 }
 
 int xc_mem_paging_nominate(xc_interface *xch, domid_t domain_id, unsigned long gfn)
diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Mar 08 16:40:05 2012 +0000
@@ -1892,13 +1892,12 @@
  * mem_event operations
  */
 int xc_mem_event_control(xc_interface *xch, domid_t domain_id, unsigned int op,
-                         unsigned int mode, uint32_t *port, void *ring_page);
+                         unsigned int mode, uint32_t *port);
 int xc_mem_event_memop(xc_interface *xch, domid_t domain_id, 
                         unsigned int op, unsigned int mode,
                         uint64_t gfn, void *buffer);
 
-int xc_mem_paging_enable(xc_interface *xch, domid_t domain_id,
-                         uint32_t *port, void *ring_page);
+int xc_mem_paging_enable(xc_interface *xch, domid_t domain_id, uint32_t *port);
 int xc_mem_paging_disable(xc_interface *xch, domid_t domain_id);
 int xc_mem_paging_nominate(xc_interface *xch, domid_t domain_id,
                            unsigned long gfn);
@@ -1907,8 +1906,7 @@
 int xc_mem_paging_load(xc_interface *xch, domid_t domain_id, 
                         unsigned long gfn, void *buffer);
 
-int xc_mem_access_enable(xc_interface *xch, domid_t domain_id,
-                         uint32_t *port, void *ring_page);
+int xc_mem_access_enable(xc_interface *xch, domid_t domain_id, uint32_t *port);
 int xc_mem_access_disable(xc_interface *xch, domid_t domain_id);
 int xc_mem_access_resume(xc_interface *xch, domid_t domain_id,
                          unsigned long gfn);
diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xg_save_restore.h
--- a/tools/libxc/xg_save_restore.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xg_save_restore.h	Thu Mar 08 16:40:05 2012 +0000
@@ -254,6 +254,10 @@
 #define XC_SAVE_ID_COMPRESSED_DATA    -12 /* Marker to indicate arrival of compressed data */
 #define XC_SAVE_ID_ENABLE_COMPRESSION -13 /* Marker to enable compression logic at receiver side */
 #define XC_SAVE_ID_HVM_GENERATION_ID_ADDR -14
+/* Markers for the pfn's hosting these mem event rings */
+#define XC_SAVE_ID_HVM_PAGING_RING_PFN  -15
+#define XC_SAVE_ID_HVM_ACCESS_RING_PFN  -16
+#define XC_SAVE_ID_HVM_SHARING_RING_PFN -17
 
 /*
 ** We process save/restore/migrate in batches of pages; the below
diff -r 29c29f7a525c -r 0d37308c4688 tools/tests/xen-access/xen-access.c
--- a/tools/tests/xen-access/xen-access.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/tests/xen-access/xen-access.c	Thu Mar 08 16:40:05 2012 +0000
@@ -166,36 +166,13 @@
  err:
     return -errno;
 }
- 
-static void *init_page(void)
-{
-    void *buffer;
-    int ret;
-
-    /* Allocated page memory */
-    ret = posix_memalign(&buffer, PAGE_SIZE, PAGE_SIZE);
-    if ( ret != 0 )
-        goto out_alloc;
-
-    /* Lock buffer in memory so it can't be paged out */
-    ret = mlock(buffer, PAGE_SIZE);
-    if ( ret != 0 )
-        goto out_lock;
-
-    return buffer;
-
-    munlock(buffer, PAGE_SIZE);
- out_lock:
-    free(buffer);
- out_alloc:
-    return NULL;
-}
 
 xenaccess_t *xenaccess_init(xc_interface **xch_r, domid_t domain_id)
 {
     xenaccess_t *xenaccess;
     xc_interface *xch;
     int rc;
+    unsigned long ring_pfn, mmap_pfn;
 
     xch = xc_interface_open(NULL, NULL, 0);
     if ( !xch )
@@ -214,28 +191,42 @@
     /* Set domain id */
     xenaccess->mem_event.domain_id = domain_id;
 
-    /* Initialise ring page */
-    xenaccess->mem_event.ring_page = init_page();
-    if ( xenaccess->mem_event.ring_page == NULL )
-    {
-        ERROR("Error initialising ring page");
-        goto err;
-    }
-
-
-    /* Initialise ring */
-    SHARED_RING_INIT((mem_event_sring_t *)xenaccess->mem_event.ring_page);
-    BACK_RING_INIT(&xenaccess->mem_event.back_ring,
-                   (mem_event_sring_t *)xenaccess->mem_event.ring_page,
-                   PAGE_SIZE);
-
     /* Initialise lock */
     mem_event_ring_lock_init(&xenaccess->mem_event);
 
+    /* Map the ring page */
+    xc_get_hvm_param(xch, xenaccess->mem_event.domain_id, 
+                        HVM_PARAM_ACCESS_RING_PFN, &ring_pfn);
+    mmap_pfn = ring_pfn;
+    xenaccess->mem_event.ring_page = 
+        xc_map_foreign_batch(xch, xenaccess->mem_event.domain_id, 
+                                PROT_READ | PROT_WRITE, &mmap_pfn, 1);
+    if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+    {
+        /* Map failed, populate ring page */
+        rc = xc_domain_populate_physmap_exact(xenaccess->xc_handle, 
+                                              xenaccess->mem_event.domain_id,
+                                              1, 0, 0, &ring_pfn);
+        if ( rc != 0 )
+        {
+            PERROR("Failed to populate ring gfn\n");
+            goto err;
+        }
+
+        mmap_pfn = ring_pfn;
+        xenaccess->mem_event.ring_page = 
+            xc_map_foreign_batch(xch, xenaccess->mem_event.domain_id, 
+                                    PROT_READ | PROT_WRITE, &mmap_pfn, 1);
+        if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+        {
+            PERROR("Could not map the ring page\n");
+            goto err;
+        }
+    }
+
     /* Initialise Xen */
     rc = xc_mem_access_enable(xenaccess->xc_handle, xenaccess->mem_event.domain_id,
-                             &xenaccess->mem_event.evtchn_port,
-                             xenaccess->mem_event.ring_page);
+                             &xenaccess->mem_event.evtchn_port);
     if ( rc != 0 )
     {
         switch ( errno ) {
@@ -272,6 +263,12 @@
 
     xenaccess->mem_event.port = rc;
 
+    /* Initialise ring */
+    SHARED_RING_INIT((mem_event_sring_t *)xenaccess->mem_event.ring_page);
+    BACK_RING_INIT(&xenaccess->mem_event.back_ring,
+                   (mem_event_sring_t *)xenaccess->mem_event.ring_page,
+                   PAGE_SIZE);
+
     /* Get platform info */
     xenaccess->platform_info = malloc(sizeof(xc_platform_info_t));
     if ( xenaccess->platform_info == NULL )
@@ -316,8 +313,7 @@
     {
         if ( xenaccess->mem_event.ring_page )
         {
-            munlock(xenaccess->mem_event.ring_page, PAGE_SIZE);
-            free(xenaccess->mem_event.ring_page);
+            munmap(xenaccess->mem_event.ring_page, PAGE_SIZE);
         }
 
         free(xenaccess->platform_info);
@@ -337,6 +333,7 @@
         return 0;
 
     /* Tear down domain xenaccess in Xen */
+    munmap(xenaccess->mem_event.ring_page, PAGE_SIZE);
     rc = xc_mem_access_disable(xenaccess->xc_handle, xenaccess->mem_event.domain_id);
     if ( rc != 0 )
     {
diff -r 29c29f7a525c -r 0d37308c4688 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/xenpaging/xenpaging.c	Thu Mar 08 16:40:05 2012 +0000
@@ -281,6 +281,7 @@
     xentoollog_logger *dbg = NULL;
     char *p;
     int rc;
+    unsigned long ring_pfn, mmap_pfn;
 
     /* Allocate memory */
     paging = calloc(1, sizeof(struct xenpaging));
@@ -337,24 +338,39 @@
         goto err;
     }
 
-    /* Initialise ring page */
-    paging->mem_event.ring_page = init_page();
-    if ( paging->mem_event.ring_page == NULL )
+    /* Map the ring page */
+    xc_get_hvm_param(xch, paging->mem_event.domain_id, 
+                        HVM_PARAM_PAGING_RING_PFN, &ring_pfn);
+    mmap_pfn = ring_pfn;
+    paging->mem_event.ring_page = 
+        xc_map_foreign_batch(xch, paging->mem_event.domain_id, 
+                                PROT_READ | PROT_WRITE, &mmap_pfn, 1);
+    if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
     {
-        PERROR("Error initialising ring page");
-        goto err;
+        /* Map failed, populate ring page */
+        rc = xc_domain_populate_physmap_exact(paging->xc_handle, 
+                                              paging->mem_event.domain_id,
+                                              1, 0, 0, &ring_pfn);
+        if ( rc != 0 )
+        {
+            PERROR("Failed to populate ring gfn\n");
+            goto err;
+        }
+
+        mmap_pfn = ring_pfn;
+        paging->mem_event.ring_page = 
+            xc_map_foreign_batch(xch, paging->mem_event.domain_id, 
+                                    PROT_READ | PROT_WRITE, &mmap_pfn, 1);
+        if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+        {
+            PERROR("Could not map the ring page\n");
+            goto err;
+        }
     }
-
-    /* Initialise ring */
-    SHARED_RING_INIT((mem_event_sring_t *)paging->mem_event.ring_page);
-    BACK_RING_INIT(&paging->mem_event.back_ring,
-                   (mem_event_sring_t *)paging->mem_event.ring_page,
-                   PAGE_SIZE);
     
     /* Initialise Xen */
     rc = xc_mem_paging_enable(xch, paging->mem_event.domain_id,
-                             &paging->mem_event.evtchn_port, 
-                             paging->mem_event.ring_page);
+                             &paging->mem_event.evtchn_port);
     if ( rc != 0 )
     {
         switch ( errno ) {
@@ -394,6 +410,12 @@
 
     paging->mem_event.port = rc;
 
+    /* Initialise ring */
+    SHARED_RING_INIT((mem_event_sring_t *)paging->mem_event.ring_page);
+    BACK_RING_INIT(&paging->mem_event.back_ring,
+                   (mem_event_sring_t *)paging->mem_event.ring_page,
+                   PAGE_SIZE);
+
     /* Get max_pages from guest if not provided via cmdline */
     if ( !paging->max_pages )
     {
@@ -469,8 +491,7 @@
 
         if ( paging->mem_event.ring_page )
         {
-            munlock(paging->mem_event.ring_page, PAGE_SIZE);
-            free(paging->mem_event.ring_page);
+            munmap(paging->mem_event.ring_page, PAGE_SIZE);
         }
 
         free(dom_path);
@@ -495,6 +516,7 @@
 
     paging->xc_handle = NULL;
     /* Tear down domain paging in Xen */
+    munmap(paging->mem_event.ring_page, PAGE_SIZE);
     rc = xc_mem_paging_disable(xch, paging->mem_event.domain_id);
     if ( rc != 0 )
     {
diff -r 29c29f7a525c -r 0d37308c4688 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
@@ -44,16 +44,11 @@
     xen_domctl_mem_event_op_t *mec,
     struct mem_event_domain *med,
     int pause_flag,
+    int param,
     xen_event_channel_notification_t notification_fn)
 {
     int rc;
-    struct domain *dom_mem_event = current->domain;
-    struct vcpu *v = current;
-    unsigned long ring_addr = mec->ring_addr;
-    l1_pgentry_t l1e;
-    unsigned long ring_gfn = 0; /* gcc ... */
-    p2m_type_t p2mt;
-    mfn_t ring_mfn;
+    unsigned long ring_gfn = d->arch.hvm_domain.params[param];
 
     /* Only one helper at a time. If the helper crashed,
      * the ring is in an undefined state and so is the guest.
@@ -61,22 +56,18 @@
     if ( med->ring_page )
         return -EBUSY;
 
-    /* Get MFN of ring page */
-    guest_get_eff_l1e(v, ring_addr, &l1e);
-    ring_gfn = l1e_get_pfn(l1e);
-    ring_mfn = get_gfn(dom_mem_event, ring_gfn, &p2mt);
-
-    if ( unlikely(!mfn_valid(mfn_x(ring_mfn))) )
-    {
-        put_gfn(dom_mem_event, ring_gfn);
-        return -EINVAL;
-    }
+    /* The parameter defaults to zero, and it should be 
+     * set to something */
+    if ( ring_gfn == 0 )
+        return -ENOSYS;
 
     mem_event_ring_lock_init(med);
+    mem_event_ring_lock(med);
 
-    /* Map ring page */
-    med->ring_page = map_domain_page(mfn_x(ring_mfn));
-    put_gfn(dom_mem_event, ring_gfn);
+    rc = prepare_ring_for_helper(d, ring_gfn, &med->ring_pg_struct, 
+                                    &med->ring_page);
+    if ( rc < 0 )
+        goto err;
 
     /* Set the number of currently blocked vCPUs to 0. */
     med->blocked = 0;
@@ -101,11 +92,13 @@
     /* Initialize the last-chance wait queue. */
     init_waitqueue_head(&med->wq);
 
+    mem_event_ring_unlock(med);
     return 0;
 
  err:
-    unmap_domain_page(med->ring_page);
-    med->ring_page = NULL;
+    destroy_ring_for_helper(&med->ring_page, 
+                            med->ring_pg_struct);
+    mem_event_ring_unlock(med);
 
     return rc;
 }
@@ -221,9 +214,6 @@
 
         /* Free domU's event channel and leave the other one unbound */
         free_xen_event_channel(d->vcpu[0], med->xen_port);
-        
-        unmap_domain_page(med->ring_page);
-        med->ring_page = NULL;
 
         /* Unblock all vCPUs */
         for_each_vcpu ( d, v )
@@ -235,6 +225,8 @@
             }
         }
 
+        destroy_ring_for_helper(&med->ring_page, 
+                                med->ring_pg_struct);
         mem_event_ring_unlock(med);
     }
 
@@ -548,7 +540,9 @@
             if ( p2m->pod.entry_count )
                 break;
 
-            rc = mem_event_enable(d, mec, med, _VPF_mem_paging, mem_paging_notification);
+            rc = mem_event_enable(d, mec, med, _VPF_mem_paging, 
+                                    HVM_PARAM_PAGING_RING_PFN,
+                                    mem_paging_notification);
         }
         break;
 
@@ -584,7 +578,9 @@
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
                 break;
 
-            rc = mem_event_enable(d, mec, med, _VPF_mem_access, mem_access_notification);
+            rc = mem_event_enable(d, mec, med, _VPF_mem_access, 
+                                    HVM_PARAM_ACCESS_RING_PFN,
+                                    mem_access_notification);
         }
         break;
 
diff -r 29c29f7a525c -r 0d37308c4688 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/public/domctl.h	Thu Mar 08 16:40:05 2012 +0000
@@ -748,7 +748,6 @@
     uint32_t       mode;         /* XEN_DOMCTL_MEM_EVENT_OP_* */
 
     uint32_t port;              /* OUT: event channel for ring */
-    uint64_aligned_t ring_addr; /* IN:  Virtual address of ring page */
 };
 typedef struct xen_domctl_mem_event_op xen_domctl_mem_event_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_mem_event_op_t);
diff -r 29c29f7a525c -r 0d37308c4688 xen/include/public/hvm/params.h
--- a/xen/include/public/hvm/params.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/public/hvm/params.h	Thu Mar 08 16:40:05 2012 +0000
@@ -142,6 +142,11 @@
 /* Boolean: Enable nestedhvm (hvm only) */
 #define HVM_PARAM_NESTEDHVM    24
 
-#define HVM_NR_PARAMS          27
+/* Params for the mem event rings */
+#define HVM_PARAM_PAGING_RING_PFN   27
+#define HVM_PARAM_ACCESS_RING_PFN   28
+#define HVM_PARAM_SHARING_RING_PFN  29
+
+#define HVM_NR_PARAMS          30
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
diff -r 29c29f7a525c -r 0d37308c4688 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/xen/sched.h	Thu Mar 08 16:40:05 2012 +0000
@@ -192,6 +192,7 @@
     unsigned char target_producers;
     /* shared ring page */
     void *ring_page;
+    struct page_info *ring_pg_struct;
     /* front-end ring */
     mem_event_front_ring_t front_ring;
     /* event channel port (vcpu0 only) */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2Q-0007wo-OR; Sat, 10 Mar 2012 06:44:22 +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 1S6G2P-0007nd-2T
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:21 +0000
Received: from [85.158.143.35:49759] by server-1.bemta-4.messagelabs.com id
	0F/D7-20925-448FA5F4; Sat, 10 Mar 2012 06:44:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1331361856!10934556!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13774 invoked from network); 10 Mar 2012 06:44:18 -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;
	10 Mar 2012 06:44: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 1S6G2K-0006bD-H7
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2K-0004fe-Fi
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:16 +0000
Message-Id: <E1S6G2K-0004fe-Fi@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Use a reserved pfn in the guest
	address space to store mem event rings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID 0d37308c46880a1f4922baa0915e853557970bb4
# Parent  29c29f7a525c64ebe53d4b0fadd701302a396a06
Use a reserved pfn in the guest address space to store mem event rings

This solves a long-standing issue in which the pages backing these rings were
pages belonging to dom0 user-space processes. Thus, if the process would die
unexpectedly, Xen would keep posting events to a page now belonging to some
other process.

We update all API-consumers in tree (xenpaging and xen-access).

This is an API/ABI change, so please speak up if it breaks your accumptions.

The patch touches tools, hypervisor x86/hvm bits, and hypervisor x86/mm bits.

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


diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xc_domain_restore.c
--- a/tools/libxc/xc_domain_restore.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xc_domain_restore.c	Thu Mar 08 16:40:05 2012 +0000
@@ -677,6 +677,9 @@
     int max_vcpu_id;
     uint64_t vcpumap;
     uint64_t identpt;
+    uint64_t paging_ring_pfn;
+    uint64_t access_ring_pfn;
+    uint64_t sharing_ring_pfn;
     uint64_t vm86_tss;
     uint64_t console_pfn;
     uint64_t acpi_ioport_location;
@@ -750,6 +753,39 @@
         // DPRINTF("EPT identity map address: %llx\n", buf->identpt);
         return pagebuf_get_one(xch, ctx, buf, fd, dom);
 
+    case XC_SAVE_ID_HVM_PAGING_RING_PFN:
+        /* Skip padding 4 bytes then read the paging ring location. */
+        if ( RDEXACT(fd, &buf->paging_ring_pfn, sizeof(uint32_t)) ||
+             RDEXACT(fd, &buf->paging_ring_pfn, sizeof(uint64_t)) )
+        {
+            PERROR("error read the paging ring pfn");
+            return -1;
+        }
+        // DPRINTF("paging ring pfn address: %llx\n", buf->paging_ring_pfn);
+        return pagebuf_get_one(xch, ctx, buf, fd, dom);
+
+    case XC_SAVE_ID_HVM_ACCESS_RING_PFN:
+        /* Skip padding 4 bytes then read the mem access ring location. */
+        if ( RDEXACT(fd, &buf->access_ring_pfn, sizeof(uint32_t)) ||
+             RDEXACT(fd, &buf->access_ring_pfn, sizeof(uint64_t)) )
+        {
+            PERROR("error read the access ring pfn");
+            return -1;
+        }
+        // DPRINTF("access ring pfn address: %llx\n", buf->access_ring_pfn);
+        return pagebuf_get_one(xch, ctx, buf, fd, dom);
+
+    case XC_SAVE_ID_HVM_SHARING_RING_PFN:
+        /* Skip padding 4 bytes then read the sharing ring location. */
+        if ( RDEXACT(fd, &buf->sharing_ring_pfn, sizeof(uint32_t)) ||
+             RDEXACT(fd, &buf->sharing_ring_pfn, sizeof(uint64_t)) )
+        {
+            PERROR("error read the sharing ring pfn");
+            return -1;
+        }
+        // DPRINTF("sharing ring pfn address: %llx\n", buf->sharing_ring_pfn);
+        return pagebuf_get_one(xch, ctx, buf, fd, dom);
+
     case XC_SAVE_ID_HVM_VM86_TSS:
         /* Skip padding 4 bytes then read the vm86 TSS location. */
         if ( RDEXACT(fd, &buf->vm86_tss, sizeof(uint32_t)) ||
@@ -1460,6 +1496,12 @@
             /* should this be deferred? does it change? */
             if ( pagebuf.identpt )
                 xc_set_hvm_param(xch, dom, HVM_PARAM_IDENT_PT, pagebuf.identpt);
+            if ( pagebuf.paging_ring_pfn )
+                xc_set_hvm_param(xch, dom, HVM_PARAM_PAGING_RING_PFN, pagebuf.paging_ring_pfn);
+            if ( pagebuf.access_ring_pfn )
+                xc_set_hvm_param(xch, dom, HVM_PARAM_ACCESS_RING_PFN, pagebuf.access_ring_pfn);
+            if ( pagebuf.sharing_ring_pfn )
+                xc_set_hvm_param(xch, dom, HVM_PARAM_SHARING_RING_PFN, pagebuf.sharing_ring_pfn);
             if ( pagebuf.vm86_tss )
                 xc_set_hvm_param(xch, dom, HVM_PARAM_VM86_TSS, pagebuf.vm86_tss);
             if ( pagebuf.console_pfn )
diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xc_domain_save.c
--- a/tools/libxc/xc_domain_save.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xc_domain_save.c	Thu Mar 08 16:40:05 2012 +0000
@@ -1639,6 +1639,42 @@
             goto out;
         }
 
+        chunk.id = XC_SAVE_ID_HVM_PAGING_RING_PFN;
+        chunk.data = 0;
+        xc_get_hvm_param(xch, dom, HVM_PARAM_PAGING_RING_PFN,
+                         (unsigned long *)&chunk.data);
+
+        if ( (chunk.data != 0) &&
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
+        {
+            PERROR("Error when writing the paging ring pfn for guest");
+            goto out;
+        }
+
+        chunk.id = XC_SAVE_ID_HVM_ACCESS_RING_PFN;
+        chunk.data = 0;
+        xc_get_hvm_param(xch, dom, HVM_PARAM_ACCESS_RING_PFN,
+                         (unsigned long *)&chunk.data);
+
+        if ( (chunk.data != 0) &&
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
+        {
+            PERROR("Error when writing the access ring pfn for guest");
+            goto out;
+        }
+
+        chunk.id = XC_SAVE_ID_HVM_SHARING_RING_PFN;
+        chunk.data = 0;
+        xc_get_hvm_param(xch, dom, HVM_PARAM_SHARING_RING_PFN,
+                         (unsigned long *)&chunk.data);
+
+        if ( (chunk.data != 0) &&
+             wrexact(io_fd, &chunk, sizeof(chunk)) )
+        {
+            PERROR("Error when writing the sharing ring pfn for guest");
+            goto out;
+        }
+
         chunk.id = XC_SAVE_ID_HVM_VM86_TSS;
         chunk.data = 0;
         xc_get_hvm_param(xch, dom, HVM_PARAM_VM86_TSS,
diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xc_hvm_build.c
--- a/tools/libxc/xc_hvm_build.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xc_hvm_build.c	Thu Mar 08 16:40:05 2012 +0000
@@ -38,12 +38,15 @@
 #define SUPERPAGE_1GB_SHIFT   18
 #define SUPERPAGE_1GB_NR_PFNS (1UL << SUPERPAGE_1GB_SHIFT)
 
-#define SPECIALPAGE_BUFIOREQ 0
-#define SPECIALPAGE_XENSTORE 1
-#define SPECIALPAGE_IOREQ    2
-#define SPECIALPAGE_IDENT_PT 3
-#define SPECIALPAGE_CONSOLE  4
-#define NR_SPECIAL_PAGES     5
+#define SPECIALPAGE_PAGING   0
+#define SPECIALPAGE_ACCESS   1
+#define SPECIALPAGE_SHARING  2
+#define SPECIALPAGE_BUFIOREQ 3
+#define SPECIALPAGE_XENSTORE 4
+#define SPECIALPAGE_IOREQ    5
+#define SPECIALPAGE_IDENT_PT 6
+#define SPECIALPAGE_CONSOLE  7
+#define NR_SPECIAL_PAGES     8
 #define special_pfn(x) (0xff000u - NR_SPECIAL_PAGES + (x))
 
 static void build_hvm_info(void *hvm_info_page, uint64_t mem_size,
@@ -356,6 +359,12 @@
                      special_pfn(SPECIALPAGE_IOREQ));
     xc_set_hvm_param(xch, dom, HVM_PARAM_CONSOLE_PFN,
                      special_pfn(SPECIALPAGE_CONSOLE));
+    xc_set_hvm_param(xch, dom, HVM_PARAM_PAGING_RING_PFN,
+                     special_pfn(SPECIALPAGE_PAGING));
+    xc_set_hvm_param(xch, dom, HVM_PARAM_ACCESS_RING_PFN,
+                     special_pfn(SPECIALPAGE_ACCESS));
+    xc_set_hvm_param(xch, dom, HVM_PARAM_SHARING_RING_PFN,
+                     special_pfn(SPECIALPAGE_SHARING));
 
     /*
      * Identity-map page table is required for running with CR0.PG=0 when
diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xc_mem_access.c
--- a/tools/libxc/xc_mem_access.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xc_mem_access.c	Thu Mar 08 16:40:05 2012 +0000
@@ -25,7 +25,7 @@
 
 
 int xc_mem_access_enable(xc_interface *xch, domid_t domain_id,
-                         uint32_t *port, void *ring_page)
+                         uint32_t *port)
 {
     if ( !port )
     {
@@ -36,7 +36,7 @@
     return xc_mem_event_control(xch, domain_id,
                                 XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE,
                                 XEN_DOMCTL_MEM_EVENT_OP_ACCESS,
-                                port, ring_page);
+                                port);
 }
 
 int xc_mem_access_disable(xc_interface *xch, domid_t domain_id)
@@ -44,7 +44,7 @@
     return xc_mem_event_control(xch, domain_id,
                                 XEN_DOMCTL_MEM_EVENT_OP_ACCESS_DISABLE,
                                 XEN_DOMCTL_MEM_EVENT_OP_ACCESS,
-                                NULL, NULL);
+                                NULL);
 }
 
 int xc_mem_access_resume(xc_interface *xch, domid_t domain_id, unsigned long gfn)
diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xc_mem_event.c
--- a/tools/libxc/xc_mem_event.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xc_mem_event.c	Thu Mar 08 16:40:05 2012 +0000
@@ -24,7 +24,7 @@
 #include "xc_private.h"
 
 int xc_mem_event_control(xc_interface *xch, domid_t domain_id, unsigned int op,
-                         unsigned int mode, uint32_t *port, void *ring_page)
+                         unsigned int mode, uint32_t *port)
 {
     DECLARE_DOMCTL;
     int rc;
@@ -33,7 +33,6 @@
     domctl.domain = domain_id;
     domctl.u.mem_event_op.op = op;
     domctl.u.mem_event_op.mode = mode;
-    domctl.u.mem_event_op.ring_addr = (unsigned long) ring_page;
     
     rc = do_domctl(xch, &domctl);
     if ( !rc && port )
diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xc_mem_paging.c
--- a/tools/libxc/xc_mem_paging.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xc_mem_paging.c	Thu Mar 08 16:40:05 2012 +0000
@@ -25,7 +25,7 @@
 
 
 int xc_mem_paging_enable(xc_interface *xch, domid_t domain_id,
-                         uint32_t *port, void *ring_page)
+                         uint32_t *port)
 {
     if ( !port )
     {
@@ -36,7 +36,7 @@
     return xc_mem_event_control(xch, domain_id,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING,
-                                port, ring_page);
+                                port);
 }
 
 int xc_mem_paging_disable(xc_interface *xch, domid_t domain_id)
@@ -44,7 +44,7 @@
     return xc_mem_event_control(xch, domain_id,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING_DISABLE,
                                 XEN_DOMCTL_MEM_EVENT_OP_PAGING,
-                                NULL, NULL);
+                                NULL);
 }
 
 int xc_mem_paging_nominate(xc_interface *xch, domid_t domain_id, unsigned long gfn)
diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Mar 08 16:40:05 2012 +0000
@@ -1892,13 +1892,12 @@
  * mem_event operations
  */
 int xc_mem_event_control(xc_interface *xch, domid_t domain_id, unsigned int op,
-                         unsigned int mode, uint32_t *port, void *ring_page);
+                         unsigned int mode, uint32_t *port);
 int xc_mem_event_memop(xc_interface *xch, domid_t domain_id, 
                         unsigned int op, unsigned int mode,
                         uint64_t gfn, void *buffer);
 
-int xc_mem_paging_enable(xc_interface *xch, domid_t domain_id,
-                         uint32_t *port, void *ring_page);
+int xc_mem_paging_enable(xc_interface *xch, domid_t domain_id, uint32_t *port);
 int xc_mem_paging_disable(xc_interface *xch, domid_t domain_id);
 int xc_mem_paging_nominate(xc_interface *xch, domid_t domain_id,
                            unsigned long gfn);
@@ -1907,8 +1906,7 @@
 int xc_mem_paging_load(xc_interface *xch, domid_t domain_id, 
                         unsigned long gfn, void *buffer);
 
-int xc_mem_access_enable(xc_interface *xch, domid_t domain_id,
-                         uint32_t *port, void *ring_page);
+int xc_mem_access_enable(xc_interface *xch, domid_t domain_id, uint32_t *port);
 int xc_mem_access_disable(xc_interface *xch, domid_t domain_id);
 int xc_mem_access_resume(xc_interface *xch, domid_t domain_id,
                          unsigned long gfn);
diff -r 29c29f7a525c -r 0d37308c4688 tools/libxc/xg_save_restore.h
--- a/tools/libxc/xg_save_restore.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xg_save_restore.h	Thu Mar 08 16:40:05 2012 +0000
@@ -254,6 +254,10 @@
 #define XC_SAVE_ID_COMPRESSED_DATA    -12 /* Marker to indicate arrival of compressed data */
 #define XC_SAVE_ID_ENABLE_COMPRESSION -13 /* Marker to enable compression logic at receiver side */
 #define XC_SAVE_ID_HVM_GENERATION_ID_ADDR -14
+/* Markers for the pfn's hosting these mem event rings */
+#define XC_SAVE_ID_HVM_PAGING_RING_PFN  -15
+#define XC_SAVE_ID_HVM_ACCESS_RING_PFN  -16
+#define XC_SAVE_ID_HVM_SHARING_RING_PFN -17
 
 /*
 ** We process save/restore/migrate in batches of pages; the below
diff -r 29c29f7a525c -r 0d37308c4688 tools/tests/xen-access/xen-access.c
--- a/tools/tests/xen-access/xen-access.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/tests/xen-access/xen-access.c	Thu Mar 08 16:40:05 2012 +0000
@@ -166,36 +166,13 @@
  err:
     return -errno;
 }
- 
-static void *init_page(void)
-{
-    void *buffer;
-    int ret;
-
-    /* Allocated page memory */
-    ret = posix_memalign(&buffer, PAGE_SIZE, PAGE_SIZE);
-    if ( ret != 0 )
-        goto out_alloc;
-
-    /* Lock buffer in memory so it can't be paged out */
-    ret = mlock(buffer, PAGE_SIZE);
-    if ( ret != 0 )
-        goto out_lock;
-
-    return buffer;
-
-    munlock(buffer, PAGE_SIZE);
- out_lock:
-    free(buffer);
- out_alloc:
-    return NULL;
-}
 
 xenaccess_t *xenaccess_init(xc_interface **xch_r, domid_t domain_id)
 {
     xenaccess_t *xenaccess;
     xc_interface *xch;
     int rc;
+    unsigned long ring_pfn, mmap_pfn;
 
     xch = xc_interface_open(NULL, NULL, 0);
     if ( !xch )
@@ -214,28 +191,42 @@
     /* Set domain id */
     xenaccess->mem_event.domain_id = domain_id;
 
-    /* Initialise ring page */
-    xenaccess->mem_event.ring_page = init_page();
-    if ( xenaccess->mem_event.ring_page == NULL )
-    {
-        ERROR("Error initialising ring page");
-        goto err;
-    }
-
-
-    /* Initialise ring */
-    SHARED_RING_INIT((mem_event_sring_t *)xenaccess->mem_event.ring_page);
-    BACK_RING_INIT(&xenaccess->mem_event.back_ring,
-                   (mem_event_sring_t *)xenaccess->mem_event.ring_page,
-                   PAGE_SIZE);
-
     /* Initialise lock */
     mem_event_ring_lock_init(&xenaccess->mem_event);
 
+    /* Map the ring page */
+    xc_get_hvm_param(xch, xenaccess->mem_event.domain_id, 
+                        HVM_PARAM_ACCESS_RING_PFN, &ring_pfn);
+    mmap_pfn = ring_pfn;
+    xenaccess->mem_event.ring_page = 
+        xc_map_foreign_batch(xch, xenaccess->mem_event.domain_id, 
+                                PROT_READ | PROT_WRITE, &mmap_pfn, 1);
+    if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+    {
+        /* Map failed, populate ring page */
+        rc = xc_domain_populate_physmap_exact(xenaccess->xc_handle, 
+                                              xenaccess->mem_event.domain_id,
+                                              1, 0, 0, &ring_pfn);
+        if ( rc != 0 )
+        {
+            PERROR("Failed to populate ring gfn\n");
+            goto err;
+        }
+
+        mmap_pfn = ring_pfn;
+        xenaccess->mem_event.ring_page = 
+            xc_map_foreign_batch(xch, xenaccess->mem_event.domain_id, 
+                                    PROT_READ | PROT_WRITE, &mmap_pfn, 1);
+        if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+        {
+            PERROR("Could not map the ring page\n");
+            goto err;
+        }
+    }
+
     /* Initialise Xen */
     rc = xc_mem_access_enable(xenaccess->xc_handle, xenaccess->mem_event.domain_id,
-                             &xenaccess->mem_event.evtchn_port,
-                             xenaccess->mem_event.ring_page);
+                             &xenaccess->mem_event.evtchn_port);
     if ( rc != 0 )
     {
         switch ( errno ) {
@@ -272,6 +263,12 @@
 
     xenaccess->mem_event.port = rc;
 
+    /* Initialise ring */
+    SHARED_RING_INIT((mem_event_sring_t *)xenaccess->mem_event.ring_page);
+    BACK_RING_INIT(&xenaccess->mem_event.back_ring,
+                   (mem_event_sring_t *)xenaccess->mem_event.ring_page,
+                   PAGE_SIZE);
+
     /* Get platform info */
     xenaccess->platform_info = malloc(sizeof(xc_platform_info_t));
     if ( xenaccess->platform_info == NULL )
@@ -316,8 +313,7 @@
     {
         if ( xenaccess->mem_event.ring_page )
         {
-            munlock(xenaccess->mem_event.ring_page, PAGE_SIZE);
-            free(xenaccess->mem_event.ring_page);
+            munmap(xenaccess->mem_event.ring_page, PAGE_SIZE);
         }
 
         free(xenaccess->platform_info);
@@ -337,6 +333,7 @@
         return 0;
 
     /* Tear down domain xenaccess in Xen */
+    munmap(xenaccess->mem_event.ring_page, PAGE_SIZE);
     rc = xc_mem_access_disable(xenaccess->xc_handle, xenaccess->mem_event.domain_id);
     if ( rc != 0 )
     {
diff -r 29c29f7a525c -r 0d37308c4688 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/xenpaging/xenpaging.c	Thu Mar 08 16:40:05 2012 +0000
@@ -281,6 +281,7 @@
     xentoollog_logger *dbg = NULL;
     char *p;
     int rc;
+    unsigned long ring_pfn, mmap_pfn;
 
     /* Allocate memory */
     paging = calloc(1, sizeof(struct xenpaging));
@@ -337,24 +338,39 @@
         goto err;
     }
 
-    /* Initialise ring page */
-    paging->mem_event.ring_page = init_page();
-    if ( paging->mem_event.ring_page == NULL )
+    /* Map the ring page */
+    xc_get_hvm_param(xch, paging->mem_event.domain_id, 
+                        HVM_PARAM_PAGING_RING_PFN, &ring_pfn);
+    mmap_pfn = ring_pfn;
+    paging->mem_event.ring_page = 
+        xc_map_foreign_batch(xch, paging->mem_event.domain_id, 
+                                PROT_READ | PROT_WRITE, &mmap_pfn, 1);
+    if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
     {
-        PERROR("Error initialising ring page");
-        goto err;
+        /* Map failed, populate ring page */
+        rc = xc_domain_populate_physmap_exact(paging->xc_handle, 
+                                              paging->mem_event.domain_id,
+                                              1, 0, 0, &ring_pfn);
+        if ( rc != 0 )
+        {
+            PERROR("Failed to populate ring gfn\n");
+            goto err;
+        }
+
+        mmap_pfn = ring_pfn;
+        paging->mem_event.ring_page = 
+            xc_map_foreign_batch(xch, paging->mem_event.domain_id, 
+                                    PROT_READ | PROT_WRITE, &mmap_pfn, 1);
+        if ( mmap_pfn & XEN_DOMCTL_PFINFO_XTAB )
+        {
+            PERROR("Could not map the ring page\n");
+            goto err;
+        }
     }
-
-    /* Initialise ring */
-    SHARED_RING_INIT((mem_event_sring_t *)paging->mem_event.ring_page);
-    BACK_RING_INIT(&paging->mem_event.back_ring,
-                   (mem_event_sring_t *)paging->mem_event.ring_page,
-                   PAGE_SIZE);
     
     /* Initialise Xen */
     rc = xc_mem_paging_enable(xch, paging->mem_event.domain_id,
-                             &paging->mem_event.evtchn_port, 
-                             paging->mem_event.ring_page);
+                             &paging->mem_event.evtchn_port);
     if ( rc != 0 )
     {
         switch ( errno ) {
@@ -394,6 +410,12 @@
 
     paging->mem_event.port = rc;
 
+    /* Initialise ring */
+    SHARED_RING_INIT((mem_event_sring_t *)paging->mem_event.ring_page);
+    BACK_RING_INIT(&paging->mem_event.back_ring,
+                   (mem_event_sring_t *)paging->mem_event.ring_page,
+                   PAGE_SIZE);
+
     /* Get max_pages from guest if not provided via cmdline */
     if ( !paging->max_pages )
     {
@@ -469,8 +491,7 @@
 
         if ( paging->mem_event.ring_page )
         {
-            munlock(paging->mem_event.ring_page, PAGE_SIZE);
-            free(paging->mem_event.ring_page);
+            munmap(paging->mem_event.ring_page, PAGE_SIZE);
         }
 
         free(dom_path);
@@ -495,6 +516,7 @@
 
     paging->xc_handle = NULL;
     /* Tear down domain paging in Xen */
+    munmap(paging->mem_event.ring_page, PAGE_SIZE);
     rc = xc_mem_paging_disable(xch, paging->mem_event.domain_id);
     if ( rc != 0 )
     {
diff -r 29c29f7a525c -r 0d37308c4688 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
@@ -44,16 +44,11 @@
     xen_domctl_mem_event_op_t *mec,
     struct mem_event_domain *med,
     int pause_flag,
+    int param,
     xen_event_channel_notification_t notification_fn)
 {
     int rc;
-    struct domain *dom_mem_event = current->domain;
-    struct vcpu *v = current;
-    unsigned long ring_addr = mec->ring_addr;
-    l1_pgentry_t l1e;
-    unsigned long ring_gfn = 0; /* gcc ... */
-    p2m_type_t p2mt;
-    mfn_t ring_mfn;
+    unsigned long ring_gfn = d->arch.hvm_domain.params[param];
 
     /* Only one helper at a time. If the helper crashed,
      * the ring is in an undefined state and so is the guest.
@@ -61,22 +56,18 @@
     if ( med->ring_page )
         return -EBUSY;
 
-    /* Get MFN of ring page */
-    guest_get_eff_l1e(v, ring_addr, &l1e);
-    ring_gfn = l1e_get_pfn(l1e);
-    ring_mfn = get_gfn(dom_mem_event, ring_gfn, &p2mt);
-
-    if ( unlikely(!mfn_valid(mfn_x(ring_mfn))) )
-    {
-        put_gfn(dom_mem_event, ring_gfn);
-        return -EINVAL;
-    }
+    /* The parameter defaults to zero, and it should be 
+     * set to something */
+    if ( ring_gfn == 0 )
+        return -ENOSYS;
 
     mem_event_ring_lock_init(med);
+    mem_event_ring_lock(med);
 
-    /* Map ring page */
-    med->ring_page = map_domain_page(mfn_x(ring_mfn));
-    put_gfn(dom_mem_event, ring_gfn);
+    rc = prepare_ring_for_helper(d, ring_gfn, &med->ring_pg_struct, 
+                                    &med->ring_page);
+    if ( rc < 0 )
+        goto err;
 
     /* Set the number of currently blocked vCPUs to 0. */
     med->blocked = 0;
@@ -101,11 +92,13 @@
     /* Initialize the last-chance wait queue. */
     init_waitqueue_head(&med->wq);
 
+    mem_event_ring_unlock(med);
     return 0;
 
  err:
-    unmap_domain_page(med->ring_page);
-    med->ring_page = NULL;
+    destroy_ring_for_helper(&med->ring_page, 
+                            med->ring_pg_struct);
+    mem_event_ring_unlock(med);
 
     return rc;
 }
@@ -221,9 +214,6 @@
 
         /* Free domU's event channel and leave the other one unbound */
         free_xen_event_channel(d->vcpu[0], med->xen_port);
-        
-        unmap_domain_page(med->ring_page);
-        med->ring_page = NULL;
 
         /* Unblock all vCPUs */
         for_each_vcpu ( d, v )
@@ -235,6 +225,8 @@
             }
         }
 
+        destroy_ring_for_helper(&med->ring_page, 
+                                med->ring_pg_struct);
         mem_event_ring_unlock(med);
     }
 
@@ -548,7 +540,9 @@
             if ( p2m->pod.entry_count )
                 break;
 
-            rc = mem_event_enable(d, mec, med, _VPF_mem_paging, mem_paging_notification);
+            rc = mem_event_enable(d, mec, med, _VPF_mem_paging, 
+                                    HVM_PARAM_PAGING_RING_PFN,
+                                    mem_paging_notification);
         }
         break;
 
@@ -584,7 +578,9 @@
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
                 break;
 
-            rc = mem_event_enable(d, mec, med, _VPF_mem_access, mem_access_notification);
+            rc = mem_event_enable(d, mec, med, _VPF_mem_access, 
+                                    HVM_PARAM_ACCESS_RING_PFN,
+                                    mem_access_notification);
         }
         break;
 
diff -r 29c29f7a525c -r 0d37308c4688 xen/include/public/domctl.h
--- a/xen/include/public/domctl.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/public/domctl.h	Thu Mar 08 16:40:05 2012 +0000
@@ -748,7 +748,6 @@
     uint32_t       mode;         /* XEN_DOMCTL_MEM_EVENT_OP_* */
 
     uint32_t port;              /* OUT: event channel for ring */
-    uint64_aligned_t ring_addr; /* IN:  Virtual address of ring page */
 };
 typedef struct xen_domctl_mem_event_op xen_domctl_mem_event_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_mem_event_op_t);
diff -r 29c29f7a525c -r 0d37308c4688 xen/include/public/hvm/params.h
--- a/xen/include/public/hvm/params.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/public/hvm/params.h	Thu Mar 08 16:40:05 2012 +0000
@@ -142,6 +142,11 @@
 /* Boolean: Enable nestedhvm (hvm only) */
 #define HVM_PARAM_NESTEDHVM    24
 
-#define HVM_NR_PARAMS          27
+/* Params for the mem event rings */
+#define HVM_PARAM_PAGING_RING_PFN   27
+#define HVM_PARAM_ACCESS_RING_PFN   28
+#define HVM_PARAM_SHARING_RING_PFN  29
+
+#define HVM_NR_PARAMS          30
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
diff -r 29c29f7a525c -r 0d37308c4688 xen/include/xen/sched.h
--- a/xen/include/xen/sched.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/xen/sched.h	Thu Mar 08 16:40:05 2012 +0000
@@ -192,6 +192,7 @@
     unsigned char target_producers;
     /* shared ring page */
     void *ring_page;
+    struct page_info *ring_pg_struct;
     /* front-end ring */
     mem_event_front_ring_t front_ring;
     /* event channel port (vcpu0 only) */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2P-0007vJ-Kf; Sat, 10 Mar 2012 06:44: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 1S6G2O-0007nd-It
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:20 +0000
Received: from [85.158.143.99:38165] by server-1.bemta-4.messagelabs.com id
	AD/D7-20925-448FA5F4; Sat, 10 Mar 2012 06:44:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1331361858!12817982!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26326 invoked from network); 10 Mar 2012 06:44:19 -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;
	10 Mar 2012 06:44: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 1S6G2L-0006bJ-N1
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2L-0004gb-I8
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:17 +0000
Message-Id: <E1S6G2L-0004gb-I8@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Tools: libxc side for setting up the
	mem sharing 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID 07913faff6847f29d8d0d98608fcabf97d12fb73
# Parent  42b977df17be6137cfa5e306ac2f84afafe97e73
Tools: libxc side for setting up the mem sharing ring

This ring is used to report failed allocations in the unshare path.

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


diff -r 42b977df17be -r 07913faff684 tools/libxc/xc_memshr.c
--- a/tools/libxc/xc_memshr.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xc_memshr.c	Thu Mar 08 16:40:05 2012 +0000
@@ -42,6 +42,31 @@
     return do_domctl(xch, &domctl);
 }
 
+int xc_memshr_ring_enable(xc_interface *xch, 
+                          domid_t domid, 
+                          uint32_t *port)
+{
+    if ( !port )
+    {
+        errno = EINVAL;
+        return -1;
+    }
+        
+    return xc_mem_event_control(xch, domid,
+                                XEN_DOMCTL_MEM_EVENT_OP_SHARING_ENABLE,
+                                XEN_DOMCTL_MEM_EVENT_OP_SHARING,
+                                port);
+}
+
+int xc_memshr_ring_disable(xc_interface *xch, 
+                           domid_t domid)
+{
+    return xc_mem_event_control(xch, domid,
+                                XEN_DOMCTL_MEM_EVENT_OP_SHARING_DISABLE,
+                                XEN_DOMCTL_MEM_EVENT_OP_SHARING,
+                                NULL);
+}
+
 static int xc_memshr_memop(xc_interface *xch, domid_t domid, 
                             xen_mem_sharing_op_t *mso)
 {
diff -r 42b977df17be -r 07913faff684 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Mar 08 16:40:05 2012 +0000
@@ -1917,6 +1917,11 @@
 int xc_memshr_control(xc_interface *xch,
                       domid_t domid,
                       int enable);
+int xc_memshr_ring_enable(xc_interface *xch, 
+                          domid_t domid, 
+                          uint32_t *port);
+int xc_memshr_ring_disable(xc_interface *xch, 
+                           domid_t domid);
 int xc_memshr_nominate_gfn(xc_interface *xch,
                            domid_t domid,
                            unsigned long gfn,

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2P-0007vJ-Kf; Sat, 10 Mar 2012 06:44: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 1S6G2O-0007nd-It
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:20 +0000
Received: from [85.158.143.99:38165] by server-1.bemta-4.messagelabs.com id
	AD/D7-20925-448FA5F4; Sat, 10 Mar 2012 06:44:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1331361858!12817982!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26326 invoked from network); 10 Mar 2012 06:44:19 -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;
	10 Mar 2012 06:44: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 1S6G2L-0006bJ-N1
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2L-0004gb-I8
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:17 +0000
Message-Id: <E1S6G2L-0004gb-I8@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Tools: libxc side for setting up the
	mem sharing 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID 07913faff6847f29d8d0d98608fcabf97d12fb73
# Parent  42b977df17be6137cfa5e306ac2f84afafe97e73
Tools: libxc side for setting up the mem sharing ring

This ring is used to report failed allocations in the unshare path.

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


diff -r 42b977df17be -r 07913faff684 tools/libxc/xc_memshr.c
--- a/tools/libxc/xc_memshr.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xc_memshr.c	Thu Mar 08 16:40:05 2012 +0000
@@ -42,6 +42,31 @@
     return do_domctl(xch, &domctl);
 }
 
+int xc_memshr_ring_enable(xc_interface *xch, 
+                          domid_t domid, 
+                          uint32_t *port)
+{
+    if ( !port )
+    {
+        errno = EINVAL;
+        return -1;
+    }
+        
+    return xc_mem_event_control(xch, domid,
+                                XEN_DOMCTL_MEM_EVENT_OP_SHARING_ENABLE,
+                                XEN_DOMCTL_MEM_EVENT_OP_SHARING,
+                                port);
+}
+
+int xc_memshr_ring_disable(xc_interface *xch, 
+                           domid_t domid)
+{
+    return xc_mem_event_control(xch, domid,
+                                XEN_DOMCTL_MEM_EVENT_OP_SHARING_DISABLE,
+                                XEN_DOMCTL_MEM_EVENT_OP_SHARING,
+                                NULL);
+}
+
 static int xc_memshr_memop(xc_interface *xch, domid_t domid, 
                             xen_mem_sharing_op_t *mso)
 {
diff -r 42b977df17be -r 07913faff684 tools/libxc/xenctrl.h
--- a/tools/libxc/xenctrl.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/libxc/xenctrl.h	Thu Mar 08 16:40:05 2012 +0000
@@ -1917,6 +1917,11 @@
 int xc_memshr_control(xc_interface *xch,
                       domid_t domid,
                       int enable);
+int xc_memshr_ring_enable(xc_interface *xch, 
+                          domid_t domid, 
+                          uint32_t *port);
+int xc_memshr_ring_disable(xc_interface *xch, 
+                           domid_t domid);
 int xc_memshr_nominate_gfn(xc_interface *xch,
                            domid_t domid,
                            unsigned long gfn,

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2Q-0007x7-RU; Sat, 10 Mar 2012 06:44:22 +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 1S6G2P-0007nd-Kr
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:21 +0000
Received: from [85.158.143.35:49781] by server-1.bemta-4.messagelabs.com id
	EF/D7-20925-548FA5F4; Sat, 10 Mar 2012 06:44:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1331361859!5023644!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19287 invoked from network); 10 Mar 2012 06:44:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Mar 2012 06:44: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 1S6G2M-0006bP-M2
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2M-0004i5-Kg
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:18 +0000
Message-Id: <E1S6G2M-0004i5-Kg@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Fix mem event error message
	typos
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID 4f4e4bba555a8eca004411ecddb0a82d6adc54c6
# Parent  1ec39d7b9f22f218ed82bccd1d89402056f6d185
x86/mm: Fix mem event error message typos

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


diff -r 1ec39d7b9f22 -r 4f4e4bba555a xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
@@ -504,13 +504,13 @@
 
     if ( unlikely(d == current->domain) )
     {
-        gdprintk(XENLOG_INFO, "Tried to do a memory paging op on itself.\n");
+        gdprintk(XENLOG_INFO, "Tried to do a memory event op on itself.\n");
         return -EINVAL;
     }
 
     if ( unlikely(d->is_dying) )
     {
-        gdprintk(XENLOG_INFO, "Ignoring memory paging op on dying domain %u\n",
+        gdprintk(XENLOG_INFO, "Ignoring memory event op on dying domain %u\n",
                  d->domain_id);
         return 0;
     }
@@ -518,7 +518,7 @@
     if ( unlikely(d->vcpu == NULL) || unlikely(d->vcpu[0] == NULL) )
     {
         gdprintk(XENLOG_INFO,
-                 "Memory paging op on a domain (%u) with no vcpus\n",
+                 "Memory event op on a domain (%u) with no vcpus\n",
                  d->domain_id);
         return -EINVAL;
     }

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2Q-0007x7-RU; Sat, 10 Mar 2012 06:44:22 +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 1S6G2P-0007nd-Kr
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:21 +0000
Received: from [85.158.143.35:49781] by server-1.bemta-4.messagelabs.com id
	EF/D7-20925-548FA5F4; Sat, 10 Mar 2012 06:44:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-21.messagelabs.com!1331361859!5023644!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19287 invoked from network); 10 Mar 2012 06:44:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	10 Mar 2012 06:44: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 1S6G2M-0006bP-M2
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2M-0004i5-Kg
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:18 +0000
Message-Id: <E1S6G2M-0004i5-Kg@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Fix mem event error message
	typos
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID 4f4e4bba555a8eca004411ecddb0a82d6adc54c6
# Parent  1ec39d7b9f22f218ed82bccd1d89402056f6d185
x86/mm: Fix mem event error message typos

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


diff -r 1ec39d7b9f22 -r 4f4e4bba555a xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
@@ -504,13 +504,13 @@
 
     if ( unlikely(d == current->domain) )
     {
-        gdprintk(XENLOG_INFO, "Tried to do a memory paging op on itself.\n");
+        gdprintk(XENLOG_INFO, "Tried to do a memory event op on itself.\n");
         return -EINVAL;
     }
 
     if ( unlikely(d->is_dying) )
     {
-        gdprintk(XENLOG_INFO, "Ignoring memory paging op on dying domain %u\n",
+        gdprintk(XENLOG_INFO, "Ignoring memory event op on dying domain %u\n",
                  d->domain_id);
         return 0;
     }
@@ -518,7 +518,7 @@
     if ( unlikely(d->vcpu == NULL) || unlikely(d->vcpu[0] == NULL) )
     {
         gdprintk(XENLOG_INFO,
-                 "Memory paging op on a domain (%u) with no vcpus\n",
+                 "Memory event op on a domain (%u) with no vcpus\n",
                  d->domain_id);
         return -EINVAL;
     }

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2S-0007yo-1g; Sat, 10 Mar 2012 06:44: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 1S6G2Q-0007nW-54
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:22 +0000
Received: from [85.158.143.99:38202] by server-2.bemta-4.messagelabs.com id
	AD/42-17550-548FA5F4; Sat, 10 Mar 2012 06:44:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1331361859!14571235!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11650 invoked from network); 10 Mar 2012 06:44:20 -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;
	10 Mar 2012 06:44: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 1S6G2N-0006bS-9h
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2N-0004iY-59
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:19 +0000
Message-Id: <E1S6G2N-0004iY-59@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Tools: After a helper maps a ring,
	yank it from the guest physmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID 04673ecb9d78ff6b0089a3befd3a86cd895bdb9e
# Parent  4f4e4bba555a8eca004411ecddb0a82d6adc54c6
Tools: After a helper maps a ring, yank it from the guest physmap

This limits the ability of the guest to play around with its own rings, and DoS
itself.

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


diff -r 4f4e4bba555a -r 04673ecb9d78 tools/tests/xen-access/xen-access.c
--- a/tools/tests/xen-access/xen-access.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/tests/xen-access/xen-access.c	Thu Mar 08 16:40:05 2012 +0000
@@ -269,6 +269,11 @@
                    (mem_event_sring_t *)xenaccess->mem_event.ring_page,
                    PAGE_SIZE);
 
+    /* Now that the ring is set, remove it from the guest's physmap */
+    if ( xc_domain_decrease_reservation_exact(xch, 
+                    xenaccess->mem_event.domain_id, 1, 0, &ring_pfn) )
+        PERROR("Failed to remove ring from guest physmap");
+
     /* Get platform info */
     xenaccess->platform_info = malloc(sizeof(xc_platform_info_t));
     if ( xenaccess->platform_info == NULL )
diff -r 4f4e4bba555a -r 04673ecb9d78 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/xenpaging/xenpaging.c	Thu Mar 08 16:40:05 2012 +0000
@@ -416,6 +416,11 @@
                    (mem_event_sring_t *)paging->mem_event.ring_page,
                    PAGE_SIZE);
 
+    /* Now that the ring is set, remove it from the guest's physmap */
+    if ( xc_domain_decrease_reservation_exact(xch, 
+                    paging->mem_event.domain_id, 1, 0, &ring_pfn) )
+        PERROR("Failed to remove ring from guest physmap");
+
     /* Get max_pages from guest if not provided via cmdline */
     if ( !paging->max_pages )
     {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:44:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:44:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S6G2S-0007yo-1g; Sat, 10 Mar 2012 06:44: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 1S6G2Q-0007nW-54
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:22 +0000
Received: from [85.158.143.99:38202] by server-2.bemta-4.messagelabs.com id
	AD/42-17550-548FA5F4; Sat, 10 Mar 2012 06:44:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1331361859!14571235!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11650 invoked from network); 10 Mar 2012 06:44:20 -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;
	10 Mar 2012 06:44: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 1S6G2N-0006bS-9h
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2N-0004iY-59
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:19 +0000
Message-Id: <E1S6G2N-0004iY-59@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Tools: After a helper maps a ring,
	yank it from the guest physmap
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID 04673ecb9d78ff6b0089a3befd3a86cd895bdb9e
# Parent  4f4e4bba555a8eca004411ecddb0a82d6adc54c6
Tools: After a helper maps a ring, yank it from the guest physmap

This limits the ability of the guest to play around with its own rings, and DoS
itself.

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


diff -r 4f4e4bba555a -r 04673ecb9d78 tools/tests/xen-access/xen-access.c
--- a/tools/tests/xen-access/xen-access.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/tests/xen-access/xen-access.c	Thu Mar 08 16:40:05 2012 +0000
@@ -269,6 +269,11 @@
                    (mem_event_sring_t *)xenaccess->mem_event.ring_page,
                    PAGE_SIZE);
 
+    /* Now that the ring is set, remove it from the guest's physmap */
+    if ( xc_domain_decrease_reservation_exact(xch, 
+                    xenaccess->mem_event.domain_id, 1, 0, &ring_pfn) )
+        PERROR("Failed to remove ring from guest physmap");
+
     /* Get platform info */
     xenaccess->platform_info = malloc(sizeof(xc_platform_info_t));
     if ( xenaccess->platform_info == NULL )
diff -r 4f4e4bba555a -r 04673ecb9d78 tools/xenpaging/xenpaging.c
--- a/tools/xenpaging/xenpaging.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/tools/xenpaging/xenpaging.c	Thu Mar 08 16:40:05 2012 +0000
@@ -416,6 +416,11 @@
                    (mem_event_sring_t *)paging->mem_event.ring_page,
                    PAGE_SIZE);
 
+    /* Now that the ring is set, remove it from the guest's physmap */
+    if ( xc_domain_decrease_reservation_exact(xch, 
+                    paging->mem_event.domain_id, 1, 0, &ring_pfn) )
+        PERROR("Failed to remove ring from guest physmap");
+
     /* Get max_pages from guest if not provided via cmdline */
     if ( !paging->max_pages )
     {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:51:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:51: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 1S6G9Y-000097-Lp; Sat, 10 Mar 2012 06:51:44 +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 1S6G2Q-0007nd-Eb
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:22 +0000
Received: from [85.158.143.99:38209] by server-1.bemta-4.messagelabs.com id
	81/E7-20925-648FA5F4; Sat, 10 Mar 2012 06:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331361860!13267016!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13957 invoked from network); 10 Mar 2012 06:44:21 -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 Mar 2012 06:44: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 1S6G2N-0006bV-Nr
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2N-0004j1-Ma
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:19 +0000
Message-Id: <E1S6G2N-0004j1-Ma@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] low-mem virq: Parentheses around
	ternary operator in check_low_mem_virq()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331287121 0
# Node ID 10c5ba0b5af2dd209d4f7d27649dea5827652d9c
# Parent  04673ecb9d78ff6b0089a3befd3a86cd895bdb9e
low-mem virq: Parentheses around ternary operator in check_low_mem_virq()

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


diff -r 04673ecb9d78 -r 10c5ba0b5af2 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/common/page_alloc.c	Fri Mar 09 09:58:41 2012 +0000
@@ -374,7 +374,7 @@
 static void check_low_mem_virq(void)
 {
     unsigned long avail_pages = total_avail_pages +
-        opt_tmem ? tmem_freeable_pages() : 0;
+        (opt_tmem ? tmem_freeable_pages() : 0);
 
     if ( unlikely(avail_pages <= low_mem_virq_th) )
     {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:51:47 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:51: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 1S6G9Y-000097-Lp; Sat, 10 Mar 2012 06:51:44 +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 1S6G2Q-0007nd-Eb
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:22 +0000
Received: from [85.158.143.99:38209] by server-1.bemta-4.messagelabs.com id
	81/E7-20925-648FA5F4; Sat, 10 Mar 2012 06:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331361860!13267016!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13957 invoked from network); 10 Mar 2012 06:44:21 -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 Mar 2012 06:44: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 1S6G2N-0006bV-Nr
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2N-0004j1-Ma
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:19 +0000
Message-Id: <E1S6G2N-0004j1-Ma@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] low-mem virq: Parentheses around
	ternary operator in check_low_mem_virq()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331287121 0
# Node ID 10c5ba0b5af2dd209d4f7d27649dea5827652d9c
# Parent  04673ecb9d78ff6b0089a3befd3a86cd895bdb9e
low-mem virq: Parentheses around ternary operator in check_low_mem_virq()

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


diff -r 04673ecb9d78 -r 10c5ba0b5af2 xen/common/page_alloc.c
--- a/xen/common/page_alloc.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/common/page_alloc.c	Fri Mar 09 09:58:41 2012 +0000
@@ -374,7 +374,7 @@
 static void check_low_mem_virq(void)
 {
     unsigned long avail_pages = total_avail_pages +
-        opt_tmem ? tmem_freeable_pages() : 0;
+        (opt_tmem ? tmem_freeable_pages() : 0);
 
     if ( unlikely(avail_pages <= low_mem_virq_th) )
     {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:52:43 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:52: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 1S6GAS-0000FZ-QM; Sat, 10 Mar 2012 06:52:40 +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 1S6G2R-0007nd-5Y
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:23 +0000
Received: from [85.158.143.99:46715] by server-1.bemta-4.messagelabs.com id
	53/E7-20925-648FA5F4; Sat, 10 Mar 2012 06:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1331361860!18238889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14783 invoked from network); 10 Mar 2012 06:44:21 -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;
	10 Mar 2012 06:44: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 1S6G2O-0006bY-9f
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2O-0004jW-89
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:20 +0000
Message-Id: <E1S6G2O-0004jW-89@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: drop gfn ref before calling
	handle_mmio()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331312064 0
# Node ID 5d20d2f6ffed0a49f030f04a8870f1926babbcbf
# Parent  10c5ba0b5af2dd209d4f7d27649dea5827652d9c
x86/mm: drop gfn ref before calling handle_mmio()

Otherwise we get a deadlock between the p2m lock and the event lock,
which handle_mmio() acquires.

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


diff -r 10c5ba0b5af2 -r 5d20d2f6ffed xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Mar 09 09:58:41 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Fri Mar 09 16:54:24 2012 +0000
@@ -1324,10 +1324,11 @@
     if ( (p2mt == p2m_mmio_dm) || 
          (access_w && (p2mt == p2m_ram_ro)) )
     {
+        put_gfn(p2m->domain, gfn);
         if ( !handle_mmio() )
             hvm_inject_exception(TRAP_gp_fault, 0, 0);
         rc = 1;
-        goto out_put_gfn;
+        goto out;
     }
 
 #ifdef __x86_64__
@@ -1379,6 +1380,7 @@
 
 out_put_gfn:
     put_gfn(p2m->domain, gfn);
+out:
     if ( paged )
         p2m_mem_paging_populate(v->domain, gfn);
     if ( req_ptr )

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:52:43 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:52: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 1S6GAS-0000FZ-QM; Sat, 10 Mar 2012 06:52:40 +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 1S6G2R-0007nd-5Y
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:23 +0000
Received: from [85.158.143.99:46715] by server-1.bemta-4.messagelabs.com id
	53/E7-20925-648FA5F4; Sat, 10 Mar 2012 06:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1331361860!18238889!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14783 invoked from network); 10 Mar 2012 06:44:21 -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;
	10 Mar 2012 06:44: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 1S6G2O-0006bY-9f
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2O-0004jW-89
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:20 +0000
Message-Id: <E1S6G2O-0004jW-89@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: drop gfn ref before calling
	handle_mmio()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331312064 0
# Node ID 5d20d2f6ffed0a49f030f04a8870f1926babbcbf
# Parent  10c5ba0b5af2dd209d4f7d27649dea5827652d9c
x86/mm: drop gfn ref before calling handle_mmio()

Otherwise we get a deadlock between the p2m lock and the event lock,
which handle_mmio() acquires.

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


diff -r 10c5ba0b5af2 -r 5d20d2f6ffed xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Fri Mar 09 09:58:41 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Fri Mar 09 16:54:24 2012 +0000
@@ -1324,10 +1324,11 @@
     if ( (p2mt == p2m_mmio_dm) || 
          (access_w && (p2mt == p2m_ram_ro)) )
     {
+        put_gfn(p2m->domain, gfn);
         if ( !handle_mmio() )
             hvm_inject_exception(TRAP_gp_fault, 0, 0);
         rc = 1;
-        goto out_put_gfn;
+        goto out;
     }
 
 #ifdef __x86_64__
@@ -1379,6 +1380,7 @@
 
 out_put_gfn:
     put_gfn(p2m->domain, gfn);
+out:
     if ( paged )
         p2m_mem_paging_populate(v->domain, gfn);
     if ( req_ptr )

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:52:43 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:52: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 1S6GAU-0000IA-T9; Sat, 10 Mar 2012 06:52:42 +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 1S6G2Q-0007nd-29
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:22 +0000
Received: from [85.158.143.35:55326] by server-1.bemta-4.messagelabs.com id
	40/E7-20925-548FA5F4; Sat, 10 Mar 2012 06:44:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1331361858!10934561!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13817 invoked from network); 10 Mar 2012 06:44:19 -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;
	10 Mar 2012 06:44: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 1S6G2M-0006bM-4k
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2M-0004hb-3Q
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:18 +0000
Message-Id: <E1S6G2M-0004hb-3Q@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Clean up mem event
	structures on domain destruction
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID 1ec39d7b9f22f218ed82bccd1d89402056f6d185
# Parent  07913faff6847f29d8d0d98608fcabf97d12fb73
x86/mm: Clean up mem event structures on domain destruction

Otherwise we wind up with zombie domains, still holding onto refs to the mem
event ring pages.

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


diff -r 07913faff684 -r 1ec39d7b9f22 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
@@ -486,6 +486,17 @@
     return ret;
 }
 
+/* Clean up on domain destruction */
+void mem_event_cleanup(struct domain *d)
+{
+    if ( d->mem_event->paging.ring_page )
+        (void)mem_event_disable(d, &d->mem_event->paging);
+    if ( d->mem_event->access.ring_page )
+        (void)mem_event_disable(d, &d->mem_event->access);
+    if ( d->mem_event->share.ring_page )
+        (void)mem_event_disable(d, &d->mem_event->share);
+}
+
 int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
                      XEN_GUEST_HANDLE(void) u_domctl)
 {
diff -r 07913faff684 -r 1ec39d7b9f22 xen/common/domain.c
--- a/xen/common/domain.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/common/domain.c	Thu Mar 08 16:40:05 2012 +0000
@@ -479,6 +479,9 @@
             break;
         }
         d->is_dying = DOMDYING_dead;
+        /* Mem event cleanup has to go here because the rings 
+         * have to be put before we call put_domain. */
+        mem_event_cleanup(d);
         put_domain(d);
         send_global_virq(VIRQ_DOM_EXC);
         /* fallthrough */
diff -r 07913faff684 -r 1ec39d7b9f22 xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/asm-arm/mm.h	Thu Mar 08 16:40:05 2012 +0000
@@ -247,7 +247,8 @@
         machine_to_phys_mapping[(mfn)] = (pfn);                \
     })
 
-#define put_gfn(d, g)   ((void)0)
+static inline void put_gfn(struct domain *d, unsigned long gfn) {}
+static inline void mem_event_cleanup(struct domain *d) {}
 
 #define INVALID_MFN             (~0UL)
 
diff -r 07913faff684 -r 1ec39d7b9f22 xen/include/asm-ia64/mm.h
--- a/xen/include/asm-ia64/mm.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/asm-ia64/mm.h	Thu Mar 08 16:40:05 2012 +0000
@@ -551,7 +551,8 @@
     gmfn_to_mfn_foreign((_d), (gpfn))
 
 #define get_gfn_untyped(d, gpfn) gmfn_to_mfn(d, gpfn)
-#define put_gfn(d, g)   ((void)0)
+static inline void put_gfn(struct domain *d, unsigned long gfn) {}
+static inline void mem_event_cleanup(struct domain *d) {}
 
 #define __gpfn_invalid(_d, gpfn)			\
 	(lookup_domain_mpa((_d), ((gpfn)<<PAGE_SHIFT), NULL) == INVALID_MFN)
diff -r 07913faff684 -r 1ec39d7b9f22 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/asm-x86/mm.h	Thu Mar 08 16:40:05 2012 +0000
@@ -634,6 +634,12 @@
 
 unsigned long domain_get_maximum_gpfn(struct domain *d);
 
+#ifdef CONFIG_X86_64
+void mem_event_cleanup(struct domain *d);
+#else
+static inline void mem_event_cleanup(struct domain *d) {}
+#endif
+
 extern struct domain *dom_xen, *dom_io, *dom_cow;	/* for vmcoreinfo */
 
 /* Definition of an mm lock: spinlock with extra fields for debugging */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 06:52:43 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 06:52: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 1S6GAU-0000IA-T9; Sat, 10 Mar 2012 06:52:42 +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 1S6G2Q-0007nd-29
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:22 +0000
Received: from [85.158.143.35:55326] by server-1.bemta-4.messagelabs.com id
	40/E7-20925-548FA5F4; Sat, 10 Mar 2012 06:44:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1331361858!10934561!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13817 invoked from network); 10 Mar 2012 06:44:19 -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;
	10 Mar 2012 06:44: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 1S6G2M-0006bM-4k
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6G2M-0004hb-3Q
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 06:44:18 +0000
Message-Id: <E1S6G2M-0004hb-3Q@xenbits.xen.org>
Date: Sat, 10 Mar 2012 06:44:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Clean up mem event
	structures on domain destruction
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331224805 0
# Node ID 1ec39d7b9f22f218ed82bccd1d89402056f6d185
# Parent  07913faff6847f29d8d0d98608fcabf97d12fb73
x86/mm: Clean up mem event structures on domain destruction

Otherwise we wind up with zombie domains, still holding onto refs to the mem
event ring pages.

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


diff -r 07913faff684 -r 1ec39d7b9f22 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 08 16:40:05 2012 +0000
@@ -486,6 +486,17 @@
     return ret;
 }
 
+/* Clean up on domain destruction */
+void mem_event_cleanup(struct domain *d)
+{
+    if ( d->mem_event->paging.ring_page )
+        (void)mem_event_disable(d, &d->mem_event->paging);
+    if ( d->mem_event->access.ring_page )
+        (void)mem_event_disable(d, &d->mem_event->access);
+    if ( d->mem_event->share.ring_page )
+        (void)mem_event_disable(d, &d->mem_event->share);
+}
+
 int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,
                      XEN_GUEST_HANDLE(void) u_domctl)
 {
diff -r 07913faff684 -r 1ec39d7b9f22 xen/common/domain.c
--- a/xen/common/domain.c	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/common/domain.c	Thu Mar 08 16:40:05 2012 +0000
@@ -479,6 +479,9 @@
             break;
         }
         d->is_dying = DOMDYING_dead;
+        /* Mem event cleanup has to go here because the rings 
+         * have to be put before we call put_domain. */
+        mem_event_cleanup(d);
         put_domain(d);
         send_global_virq(VIRQ_DOM_EXC);
         /* fallthrough */
diff -r 07913faff684 -r 1ec39d7b9f22 xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/asm-arm/mm.h	Thu Mar 08 16:40:05 2012 +0000
@@ -247,7 +247,8 @@
         machine_to_phys_mapping[(mfn)] = (pfn);                \
     })
 
-#define put_gfn(d, g)   ((void)0)
+static inline void put_gfn(struct domain *d, unsigned long gfn) {}
+static inline void mem_event_cleanup(struct domain *d) {}
 
 #define INVALID_MFN             (~0UL)
 
diff -r 07913faff684 -r 1ec39d7b9f22 xen/include/asm-ia64/mm.h
--- a/xen/include/asm-ia64/mm.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/asm-ia64/mm.h	Thu Mar 08 16:40:05 2012 +0000
@@ -551,7 +551,8 @@
     gmfn_to_mfn_foreign((_d), (gpfn))
 
 #define get_gfn_untyped(d, gpfn) gmfn_to_mfn(d, gpfn)
-#define put_gfn(d, g)   ((void)0)
+static inline void put_gfn(struct domain *d, unsigned long gfn) {}
+static inline void mem_event_cleanup(struct domain *d) {}
 
 #define __gpfn_invalid(_d, gpfn)			\
 	(lookup_domain_mpa((_d), ((gpfn)<<PAGE_SHIFT), NULL) == INVALID_MFN)
diff -r 07913faff684 -r 1ec39d7b9f22 xen/include/asm-x86/mm.h
--- a/xen/include/asm-x86/mm.h	Thu Mar 08 16:40:05 2012 +0000
+++ b/xen/include/asm-x86/mm.h	Thu Mar 08 16:40:05 2012 +0000
@@ -634,6 +634,12 @@
 
 unsigned long domain_get_maximum_gpfn(struct domain *d);
 
+#ifdef CONFIG_X86_64
+void mem_event_cleanup(struct domain *d);
+#else
+static inline void mem_event_cleanup(struct domain *d) {}
+#endif
+
 extern struct domain *dom_xen, *dom_io, *dom_cow;	/* for vmcoreinfo */
 
 /* Definition of an mm lock: spinlock with extra fields for debugging */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 08:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 08: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 1S6I59-0003GE-My; Sat, 10 Mar 2012 08: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 1S6I57-0003G6-Sx
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 08:55:18 +0000
Received: from [85.158.139.83:38704] by server-4.bemta-5.messagelabs.com id
	78/17-10788-4F61B5F4; Sat, 10 Mar 2012 08:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1331369714!18709309!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2477 invoked from network); 10 Mar 2012 08:55:15 -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;
	10 Mar 2012 08: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 1S6I54-0008Mw-2A
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 08:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6I53-0001vJ-Kw
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 08:55:13 +0000
Message-Id: <E1S6I53-0001vJ-Kw@xenbits.xen.org>
Date: Sat, 10 Mar 2012 08: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] hvm: Print support/enable status
	of HAP superpage mappings.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331287384 0
# Node ID 3f158dd40b314e0a4cb24acda69257c20e269cbb
# Parent  b01091775dd9bfe2ea3ebad478a1668703c19434
hvm: Print support/enable status of HAP superpage mappings.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24992:0384f791e538
xen-unstable date:        Thu Mar 08 09:43:49 2012 +0000
---


diff -r b01091775dd9 -r 3f158dd40b31 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 08 10:05:04 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Fri Mar 09 10:03:04 2012 +0000
@@ -132,7 +132,15 @@
 
     printk("HVM: %s enabled\n", hvm_funcs.name);
     if ( hvm_funcs.hap_supported )
-        printk("HVM: Hardware Assisted Paging detected.\n");
+    {
+        printk("HVM: Hardware Assisted Paging (HAP) detected\n");
+        printk("HVM: HAP page sizes: 4kB");
+        if ( hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_2MB )
+            printk(", 2MB%s", opt_hap_2mb ? "" : " [disabled]");
+        if ( hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_1GB )
+            printk(", 1GB%s", opt_hap_1gb ? "" : " [disabled]");
+        printk("\n");
+    }
 
     /*
      * Allow direct access to the PC debug ports 0x80 and 0xed (they are
diff -r b01091775dd9 -r 3f158dd40b31 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Thu Mar 08 10:05:04 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Fri Mar 09 10:03:04 2012 +0000
@@ -92,11 +92,6 @@
 
     if ( !printed )
         printk(" - none\n");
-
-    if ( cpu_has_vmx_ept_1gb )
-        printk("EPT supports 1GB super page.\n");
-    if ( cpu_has_vmx_ept_2mb )
-        printk("EPT supports 2MB super page.\n");
 }
 
 static u32 adjust_vmx_controls(
diff -r b01091775dd9 -r 3f158dd40b31 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Mar 08 10:05:04 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Fri Mar 09 10:03:04 2012 +0000
@@ -40,10 +40,10 @@
 #define P2M_DEBUGGING 0
 
 /* turn on/off 1GB host page table support for hap, default on */
-static bool_t __read_mostly opt_hap_1gb = 1;
+bool_t __read_mostly opt_hap_1gb = 1;
 boolean_param("hap_1gb", opt_hap_1gb);
 
-static bool_t __read_mostly opt_hap_2mb = 1;
+bool_t __read_mostly opt_hap_2mb = 1;
 boolean_param("hap_2mb", opt_hap_2mb);
 
 /* Printouts */
diff -r b01091775dd9 -r 3f158dd40b31 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Mar 08 10:05:04 2012 +0000
+++ b/xen/include/asm-x86/p2m.h	Fri Mar 09 10:03:04 2012 +0000
@@ -31,6 +31,8 @@
 #include <asm/mem_sharing.h>
 #include <asm/page.h>    /* for pagetable_t */
 
+extern bool_t opt_hap_1gb, opt_hap_2mb;
+
 /*
  * The phys_to_machine_mapping maps guest physical frame numbers 
  * to machine frame numbers.  It only exists for paging_mode_translate 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 10 08:55:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 10 Mar 2012 08: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 1S6I59-0003GE-My; Sat, 10 Mar 2012 08: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 1S6I57-0003G6-Sx
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 08:55:18 +0000
Received: from [85.158.139.83:38704] by server-4.bemta-5.messagelabs.com id
	78/17-10788-4F61B5F4; Sat, 10 Mar 2012 08:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1331369714!18709309!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2477 invoked from network); 10 Mar 2012 08:55:15 -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;
	10 Mar 2012 08: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 1S6I54-0008Mw-2A
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 08:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S6I53-0001vJ-Kw
	for xen-changelog@lists.xensource.com; Sat, 10 Mar 2012 08:55:13 +0000
Message-Id: <E1S6I53-0001vJ-Kw@xenbits.xen.org>
Date: Sat, 10 Mar 2012 08: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] hvm: Print support/enable status
	of HAP superpage mappings.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331287384 0
# Node ID 3f158dd40b314e0a4cb24acda69257c20e269cbb
# Parent  b01091775dd9bfe2ea3ebad478a1668703c19434
hvm: Print support/enable status of HAP superpage mappings.

Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24992:0384f791e538
xen-unstable date:        Thu Mar 08 09:43:49 2012 +0000
---


diff -r b01091775dd9 -r 3f158dd40b31 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 08 10:05:04 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Fri Mar 09 10:03:04 2012 +0000
@@ -132,7 +132,15 @@
 
     printk("HVM: %s enabled\n", hvm_funcs.name);
     if ( hvm_funcs.hap_supported )
-        printk("HVM: Hardware Assisted Paging detected.\n");
+    {
+        printk("HVM: Hardware Assisted Paging (HAP) detected\n");
+        printk("HVM: HAP page sizes: 4kB");
+        if ( hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_2MB )
+            printk(", 2MB%s", opt_hap_2mb ? "" : " [disabled]");
+        if ( hvm_funcs.hap_capabilities & HVM_HAP_SUPERPAGE_1GB )
+            printk(", 1GB%s", opt_hap_1gb ? "" : " [disabled]");
+        printk("\n");
+    }
 
     /*
      * Allow direct access to the PC debug ports 0x80 and 0xed (they are
diff -r b01091775dd9 -r 3f158dd40b31 xen/arch/x86/hvm/vmx/vmcs.c
--- a/xen/arch/x86/hvm/vmx/vmcs.c	Thu Mar 08 10:05:04 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vmcs.c	Fri Mar 09 10:03:04 2012 +0000
@@ -92,11 +92,6 @@
 
     if ( !printed )
         printk(" - none\n");
-
-    if ( cpu_has_vmx_ept_1gb )
-        printk("EPT supports 1GB super page.\n");
-    if ( cpu_has_vmx_ept_2mb )
-        printk("EPT supports 2MB super page.\n");
 }
 
 static u32 adjust_vmx_controls(
diff -r b01091775dd9 -r 3f158dd40b31 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Mar 08 10:05:04 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Fri Mar 09 10:03:04 2012 +0000
@@ -40,10 +40,10 @@
 #define P2M_DEBUGGING 0
 
 /* turn on/off 1GB host page table support for hap, default on */
-static bool_t __read_mostly opt_hap_1gb = 1;
+bool_t __read_mostly opt_hap_1gb = 1;
 boolean_param("hap_1gb", opt_hap_1gb);
 
-static bool_t __read_mostly opt_hap_2mb = 1;
+bool_t __read_mostly opt_hap_2mb = 1;
 boolean_param("hap_2mb", opt_hap_2mb);
 
 /* Printouts */
diff -r b01091775dd9 -r 3f158dd40b31 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Mar 08 10:05:04 2012 +0000
+++ b/xen/include/asm-x86/p2m.h	Fri Mar 09 10:03:04 2012 +0000
@@ -31,6 +31,8 @@
 #include <asm/mem_sharing.h>
 #include <asm/page.h>    /* for pagetable_t */
 
+extern bool_t opt_hap_1gb, opt_hap_2mb;
+
 /*
  * The phys_to_machine_mapping maps guest physical frame numbers 
  * to machine frame numbers.  It only exists for paging_mode_translate 

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

From xen-changelog-bounces@lists.xen.org Mon Mar 12 11:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Mar 2012 11:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S73V8-0002fp-Cv; Mon, 12 Mar 2012 11:33: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 1S73V6-0002fS-92
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:16 +0000
Received: from [85.158.143.99:27974] by server-2.bemta-4.messagelabs.com id
	66/EE-17550-BFEDD5F4; Mon, 12 Mar 2012 11:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1331551990!13516690!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28763 invoked from network); 12 Mar 2012 11:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Mar 2012 11:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S73Uw-0003Lf-TA
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S73Uu-0001wM-6P
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:04 +0000
Message-Id: <E1S73Uu-0001wM-6P@xenbits.xen.org>
Date: Mon, 12 Mar 2012 11:33:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] gnttab: add deferred freeing
	logic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331551736 -3600
# Node ID e0596f39eaefb9962a934aae45e1fffabb925e78
# Parent  4c2b7dcbfd8b87a82a0e6c4606f1a4079ab91952
gnttab: add deferred freeing logic

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


diff -r 4c2b7dcbfd8b -r e0596f39eaef drivers/xen/core/gnttab.c
--- a/drivers/xen/core/gnttab.c	Mon Mar 12 12:28:03 2012 +0100
+++ b/drivers/xen/core/gnttab.c	Mon Mar 12 12:28:56 2012 +0100
@@ -35,6 +35,7 @@
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/seqlock.h>
+#include <linux/timer.h>
 #include <xen/interface/xen.h>
 #include <xen/gnttab.h>
 #include <asm/pgtable.h>
@@ -183,35 +184,119 @@
 }
 EXPORT_SYMBOL_GPL(gnttab_query_foreign_access);
 
-int gnttab_end_foreign_access_ref(grant_ref_t ref)
+static inline int _gnttab_end_foreign_access_ref(grant_ref_t ref)
 {
 	u16 flags, nflags;
 
 	nflags = shared[ref].flags;
 	do {
-		if ((flags = nflags) & (GTF_reading|GTF_writing)) {
-			printk(KERN_DEBUG "WARNING: g.e. still in use!\n");
+		if ((flags = nflags) & (GTF_reading|GTF_writing))
 			return 0;
-		}
 	} while ((nflags = synch_cmpxchg_subword(&shared[ref].flags, flags, 0)) !=
 		 flags);
 
 	return 1;
 }
+
+int gnttab_end_foreign_access_ref(grant_ref_t ref)
+{
+	if (_gnttab_end_foreign_access_ref(ref))
+		return 1;
+	printk(KERN_DEBUG "WARNING: g.e. %#x still in use!\n", ref);
+	return 0;
+}
 EXPORT_SYMBOL_GPL(gnttab_end_foreign_access_ref);
 
+struct deferred_entry {
+	struct list_head list;
+	grant_ref_t ref;
+	uint16_t warn_delay;
+	struct page *page;
+};
+static LIST_HEAD(deferred_list);
+static void gnttab_handle_deferred(unsigned long);
+static DEFINE_TIMER(deferred_timer, gnttab_handle_deferred, 0, 0);
+
+static void gnttab_handle_deferred(unsigned long unused)
+{
+	unsigned int nr = 10;
+	struct deferred_entry *first = NULL;
+	unsigned long flags;
+
+	spin_lock_irqsave(&gnttab_list_lock, flags);
+	while (nr--) {
+		struct deferred_entry *entry
+			= list_first_entry(&deferred_list,
+					   struct deferred_entry, list);
+
+		if (entry == first)
+			break;
+		list_del(&entry->list);
+		spin_unlock_irqrestore(&gnttab_list_lock, flags);
+		if (_gnttab_end_foreign_access_ref(entry->ref)) {
+			put_free_entry(entry->ref);
+			if (entry->page) {
+				printk(KERN_DEBUG
+				       "freeing g.e. %#x (pfn %#lx)\n",
+				       entry->ref, page_to_pfn(entry->page));
+				__free_page(entry->page);
+			} else
+				printk(KERN_DEBUG "freeing g.e. %#x\n",
+				       entry->ref);
+			kfree(entry);
+			entry = NULL;
+		} else {
+			if (!--entry->warn_delay)
+				printk(KERN_INFO "g.e. %#x still pending\n",
+				       entry->ref);
+			if (!first)
+				first = entry;
+		}
+		spin_lock_irqsave(&gnttab_list_lock, flags);
+		if (entry)
+			list_add_tail(&entry->list, &deferred_list);
+		else if (list_empty(&deferred_list))
+			break;
+	}
+	if (!list_empty(&deferred_list) && !timer_pending(&deferred_timer)) {
+		deferred_timer.expires = jiffies + HZ;
+		add_timer(&deferred_timer);
+	}
+	spin_unlock_irqrestore(&gnttab_list_lock, flags);
+}
+
+static void gnttab_add_deferred(grant_ref_t ref, struct page *page)
+{
+	struct deferred_entry *entry = kmalloc(sizeof(*entry), GFP_ATOMIC);
+	const char *what = KERN_WARNING "leaking";
+
+	if (entry) {
+		unsigned long flags;
+
+		entry->ref = ref;
+		entry->page = page;
+		entry->warn_delay = 60;
+		spin_lock_irqsave(&gnttab_list_lock, flags);
+		list_add_tail(&entry->list, &deferred_list);
+		if (!timer_pending(&deferred_timer)) {
+			deferred_timer.expires = jiffies + HZ;
+			add_timer(&deferred_timer);
+		}
+		spin_unlock_irqrestore(&gnttab_list_lock, flags);
+		what = KERN_DEBUG "deferring";
+	}
+	printk("%s g.e. %#x (pfn %lx)\n", what,
+	       ref, page ? page_to_pfn(page) : -1);
+}
+
 void gnttab_end_foreign_access(grant_ref_t ref, unsigned long page)
 {
 	if (gnttab_end_foreign_access_ref(ref)) {
 		put_free_entry(ref);
 		if (page != 0)
 			free_page(page);
-	} else {
-		/* XXX This needs to be fixed so that the ref and page are
-		   placed on a list to be freed up later. */
-		printk(KERN_DEBUG
-		       "WARNING: leaking g.e. and page still in use!\n");
-	}
+	} else
+		gnttab_add_deferred(ref, page ? virt_to_page(page) : NULL);
 }
 EXPORT_SYMBOL_GPL(gnttab_end_foreign_access);
 

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

From xen-changelog-bounces@lists.xen.org Mon Mar 12 11:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Mar 2012 11:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S73V7-0002fb-7y; Mon, 12 Mar 2012 11:33:17 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S73V5-0002fM-Dy
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1331551990!156562!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15131 invoked from network); 12 Mar 2012 11:33: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;
	12 Mar 2012 11:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S73Uw-0003Le-8e
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S73Ut-0001vx-PQ
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:03 +0000
Message-Id: <E1S73Ut-0001vx-PQ@xenbits.xen.org>
Date: Mon, 12 Mar 2012 11:33:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] blkback: also call
	blkif_disconnect() when frontend switched to closed
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331551683 -3600
# Node ID 4c2b7dcbfd8b87a82a0e6c4606f1a4079ab91952
# Parent  1a12d75a97bdea29e646956e1b4483f7e37b6076
blkback: also call blkif_disconnect() when frontend switched to closed

blkfront doesn't normally set its state to XenbusStateClosing, yet
blkback should not hang on to resources when there's no connection. As
frontend_changed() already makes use of blkif_disconnect() being
idempotent, we're fine to utilize this here too.

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


diff -r 1a12d75a97bd -r 4c2b7dcbfd8b drivers/xen/blkback/xenbus.c
--- a/drivers/xen/blkback/xenbus.c	Mon Mar 12 12:26:58 2012 +0100
+++ b/drivers/xen/blkback/xenbus.c	Mon Mar 12 12:28:03 2012 +0100
@@ -392,13 +392,11 @@
 		break;
 
 	case XenbusStateClosing:
+	case XenbusStateClosed:
 		blkif_disconnect(be->blkif);
-		xenbus_switch_state(dev, XenbusStateClosing);
-		break;
-
-	case XenbusStateClosed:
-		xenbus_switch_state(dev, XenbusStateClosed);
-		if (xenbus_dev_is_online(dev))
+		xenbus_switch_state(dev, frontend_state);
+		if (frontend_state != XenbusStateClosed ||
+		    xenbus_dev_is_online(dev))
 			break;
 		/* fall through if not online */
 	case XenbusStateUnknown:

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

From xen-changelog-bounces@lists.xen.org Mon Mar 12 11:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Mar 2012 11:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S73V8-0002fp-Cv; Mon, 12 Mar 2012 11:33: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 1S73V6-0002fS-92
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:16 +0000
Received: from [85.158.143.99:27974] by server-2.bemta-4.messagelabs.com id
	66/EE-17550-BFEDD5F4; Mon, 12 Mar 2012 11:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1331551990!13516690!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28763 invoked from network); 12 Mar 2012 11:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	12 Mar 2012 11:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S73Uw-0003Lf-TA
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:07 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S73Uu-0001wM-6P
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:04 +0000
Message-Id: <E1S73Uu-0001wM-6P@xenbits.xen.org>
Date: Mon, 12 Mar 2012 11:33:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] gnttab: add deferred freeing
	logic
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331551736 -3600
# Node ID e0596f39eaefb9962a934aae45e1fffabb925e78
# Parent  4c2b7dcbfd8b87a82a0e6c4606f1a4079ab91952
gnttab: add deferred freeing logic

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


diff -r 4c2b7dcbfd8b -r e0596f39eaef drivers/xen/core/gnttab.c
--- a/drivers/xen/core/gnttab.c	Mon Mar 12 12:28:03 2012 +0100
+++ b/drivers/xen/core/gnttab.c	Mon Mar 12 12:28:56 2012 +0100
@@ -35,6 +35,7 @@
 #include <linux/sched.h>
 #include <linux/mm.h>
 #include <linux/seqlock.h>
+#include <linux/timer.h>
 #include <xen/interface/xen.h>
 #include <xen/gnttab.h>
 #include <asm/pgtable.h>
@@ -183,35 +184,119 @@
 }
 EXPORT_SYMBOL_GPL(gnttab_query_foreign_access);
 
-int gnttab_end_foreign_access_ref(grant_ref_t ref)
+static inline int _gnttab_end_foreign_access_ref(grant_ref_t ref)
 {
 	u16 flags, nflags;
 
 	nflags = shared[ref].flags;
 	do {
-		if ((flags = nflags) & (GTF_reading|GTF_writing)) {
-			printk(KERN_DEBUG "WARNING: g.e. still in use!\n");
+		if ((flags = nflags) & (GTF_reading|GTF_writing))
 			return 0;
-		}
 	} while ((nflags = synch_cmpxchg_subword(&shared[ref].flags, flags, 0)) !=
 		 flags);
 
 	return 1;
 }
+
+int gnttab_end_foreign_access_ref(grant_ref_t ref)
+{
+	if (_gnttab_end_foreign_access_ref(ref))
+		return 1;
+	printk(KERN_DEBUG "WARNING: g.e. %#x still in use!\n", ref);
+	return 0;
+}
 EXPORT_SYMBOL_GPL(gnttab_end_foreign_access_ref);
 
+struct deferred_entry {
+	struct list_head list;
+	grant_ref_t ref;
+	uint16_t warn_delay;
+	struct page *page;
+};
+static LIST_HEAD(deferred_list);
+static void gnttab_handle_deferred(unsigned long);
+static DEFINE_TIMER(deferred_timer, gnttab_handle_deferred, 0, 0);
+
+static void gnttab_handle_deferred(unsigned long unused)
+{
+	unsigned int nr = 10;
+	struct deferred_entry *first = NULL;
+	unsigned long flags;
+
+	spin_lock_irqsave(&gnttab_list_lock, flags);
+	while (nr--) {
+		struct deferred_entry *entry
+			= list_first_entry(&deferred_list,
+					   struct deferred_entry, list);
+
+		if (entry == first)
+			break;
+		list_del(&entry->list);
+		spin_unlock_irqrestore(&gnttab_list_lock, flags);
+		if (_gnttab_end_foreign_access_ref(entry->ref)) {
+			put_free_entry(entry->ref);
+			if (entry->page) {
+				printk(KERN_DEBUG
+				       "freeing g.e. %#x (pfn %#lx)\n",
+				       entry->ref, page_to_pfn(entry->page));
+				__free_page(entry->page);
+			} else
+				printk(KERN_DEBUG "freeing g.e. %#x\n",
+				       entry->ref);
+			kfree(entry);
+			entry = NULL;
+		} else {
+			if (!--entry->warn_delay)
+				printk(KERN_INFO "g.e. %#x still pending\n",
+				       entry->ref);
+			if (!first)
+				first = entry;
+		}
+		spin_lock_irqsave(&gnttab_list_lock, flags);
+		if (entry)
+			list_add_tail(&entry->list, &deferred_list);
+		else if (list_empty(&deferred_list))
+			break;
+	}
+	if (!list_empty(&deferred_list) && !timer_pending(&deferred_timer)) {
+		deferred_timer.expires = jiffies + HZ;
+		add_timer(&deferred_timer);
+	}
+	spin_unlock_irqrestore(&gnttab_list_lock, flags);
+}
+
+static void gnttab_add_deferred(grant_ref_t ref, struct page *page)
+{
+	struct deferred_entry *entry = kmalloc(sizeof(*entry), GFP_ATOMIC);
+	const char *what = KERN_WARNING "leaking";
+
+	if (entry) {
+		unsigned long flags;
+
+		entry->ref = ref;
+		entry->page = page;
+		entry->warn_delay = 60;
+		spin_lock_irqsave(&gnttab_list_lock, flags);
+		list_add_tail(&entry->list, &deferred_list);
+		if (!timer_pending(&deferred_timer)) {
+			deferred_timer.expires = jiffies + HZ;
+			add_timer(&deferred_timer);
+		}
+		spin_unlock_irqrestore(&gnttab_list_lock, flags);
+		what = KERN_DEBUG "deferring";
+	}
+	printk("%s g.e. %#x (pfn %lx)\n", what,
+	       ref, page ? page_to_pfn(page) : -1);
+}
+
 void gnttab_end_foreign_access(grant_ref_t ref, unsigned long page)
 {
 	if (gnttab_end_foreign_access_ref(ref)) {
 		put_free_entry(ref);
 		if (page != 0)
 			free_page(page);
-	} else {
-		/* XXX This needs to be fixed so that the ref and page are
-		   placed on a list to be freed up later. */
-		printk(KERN_DEBUG
-		       "WARNING: leaking g.e. and page still in use!\n");
-	}
+	} else
+		gnttab_add_deferred(ref, page ? virt_to_page(page) : NULL);
 }
 EXPORT_SYMBOL_GPL(gnttab_end_foreign_access);
 

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

From xen-changelog-bounces@lists.xen.org Mon Mar 12 11:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Mar 2012 11:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S73V7-0002fb-7y; Mon, 12 Mar 2012 11:33:17 +0000
Received: from mail27.messagelabs.com ([193.109.254.147])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S73V5-0002fM-Dy
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-27.messagelabs.com!1331551990!156562!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15131 invoked from network); 12 Mar 2012 11:33: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;
	12 Mar 2012 11:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S73Uw-0003Le-8e
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S73Ut-0001vx-PQ
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:03 +0000
Message-Id: <E1S73Ut-0001vx-PQ@xenbits.xen.org>
Date: Mon, 12 Mar 2012 11:33:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] blkback: also call
	blkif_disconnect() when frontend switched to closed
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331551683 -3600
# Node ID 4c2b7dcbfd8b87a82a0e6c4606f1a4079ab91952
# Parent  1a12d75a97bdea29e646956e1b4483f7e37b6076
blkback: also call blkif_disconnect() when frontend switched to closed

blkfront doesn't normally set its state to XenbusStateClosing, yet
blkback should not hang on to resources when there's no connection. As
frontend_changed() already makes use of blkif_disconnect() being
idempotent, we're fine to utilize this here too.

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


diff -r 1a12d75a97bd -r 4c2b7dcbfd8b drivers/xen/blkback/xenbus.c
--- a/drivers/xen/blkback/xenbus.c	Mon Mar 12 12:26:58 2012 +0100
+++ b/drivers/xen/blkback/xenbus.c	Mon Mar 12 12:28:03 2012 +0100
@@ -392,13 +392,11 @@
 		break;
 
 	case XenbusStateClosing:
+	case XenbusStateClosed:
 		blkif_disconnect(be->blkif);
-		xenbus_switch_state(dev, XenbusStateClosing);
-		break;
-
-	case XenbusStateClosed:
-		xenbus_switch_state(dev, XenbusStateClosed);
-		if (xenbus_dev_is_online(dev))
+		xenbus_switch_state(dev, frontend_state);
+		if (frontend_state != XenbusStateClosed ||
+		    xenbus_dev_is_online(dev))
 			break;
 		/* fall through if not online */
 	case XenbusStateUnknown:

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

From xen-changelog-bounces@lists.xen.org Mon Mar 12 11:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Mar 2012 11:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S73V7-0002fg-AN; Mon, 12 Mar 2012 11:33: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 1S73V5-0002fN-To
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:16 +0000
Received: from [85.158.138.51:54281] by server-5.bemta-3.messagelabs.com id
	6A/9B-09139-AFEDD5F4; Mon, 12 Mar 2012 11:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1331551989!17267636!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2735 invoked from network); 12 Mar 2012 11:33:13 -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;
	12 Mar 2012 11:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S73Uw-0003Ld-DV
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S73Ut-0001vX-Bl
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:03 +0000
Message-Id: <E1S73Ut-0001vX-Bl@xenbits.xen.org>
Date: Mon, 12 Mar 2012 11:33:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] consolidate GRANT_INVALID_REF
	definitions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331551618 -3600
# Node ID 1a12d75a97bdea29e646956e1b4483f7e37b6076
# Parent  0db21b31377ffd8e08d5aa43e346be6a8e9a304f
consolidate GRANT_INVALID_REF definitions

No need for each frontend to define this for itself, the more that this
really is a property of the gnttab.c code.

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


diff -r 0db21b31377f -r 1a12d75a97bd drivers/char/tpm/tpm_xen.c
--- a/drivers/char/tpm/tpm_xen.c	Wed Mar 07 14:33:13 2012 +0100
+++ b/drivers/char/tpm/tpm_xen.c	Mon Mar 12 12:26:58 2012 +0100
@@ -109,8 +109,6 @@
 #define WPRINTK(fmt, args...) \
     printk(KERN_WARNING "xen_tpm_fr: " fmt, ##args)
 
-#define GRANT_INVALID_REF	0
-
 
 static inline int
 tx_buffer_copy(struct tx_buffer *txb, const u8 *src, int len,
diff -r 0db21b31377f -r 1a12d75a97bd drivers/xen/blkfront/blkfront.c
--- a/drivers/xen/blkfront/blkfront.c	Wed Mar 07 14:33:13 2012 +0100
+++ b/drivers/xen/blkfront/blkfront.c	Mon Mar 12 12:26:58 2012 +0100
@@ -60,7 +60,6 @@
 
 #define MAXIMUM_OUTSTANDING_BLOCK_REQS \
     (BLKIF_MAX_SEGMENTS_PER_REQUEST * BLK_RING_SIZE)
-#define GRANT_INVALID_REF	0
 
 static void connect(struct blkfront_info *);
 static void blkfront_closing(struct blkfront_info *);
diff -r 0db21b31377f -r 1a12d75a97bd drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c	Wed Mar 07 14:33:13 2012 +0100
+++ b/drivers/xen/netfront/netfront.c	Mon Mar 12 12:26:58 2012 +0100
@@ -147,8 +147,6 @@
 #define ethtool_op_set_tso(dev, data)	(-ENOSYS)
 #endif
 
-#define GRANT_INVALID_REF	0
-
 struct netfront_rx_info {
 	struct netif_rx_response rx;
 	struct netif_extra_info extras[XEN_NETIF_EXTRA_TYPE_MAX - 1];
diff -r 0db21b31377f -r 1a12d75a97bd drivers/xen/pcifront/xenbus.c
--- a/drivers/xen/pcifront/xenbus.c	Wed Mar 07 14:33:13 2012 +0100
+++ b/drivers/xen/pcifront/xenbus.c	Mon Mar 12 12:26:58 2012 +0100
@@ -15,7 +15,6 @@
 #define __init_refok
 #endif
 
-#define INVALID_GRANT_REF (0)
 #define INVALID_EVTCHN    (-1)
 
 static struct pcifront_device *alloc_pdev(struct xenbus_device *xdev)
@@ -47,7 +46,7 @@
 	spin_lock_init(&pdev->sh_info_lock);
 
 	pdev->evtchn = INVALID_EVTCHN;
-	pdev->gnt_ref = INVALID_GRANT_REF;
+	pdev->gnt_ref = GRANT_INVALID_REF;
 	pdev->irq = -1;
 
 	INIT_WORK(&pdev->op_work, pcifront_do_aer, pdev);
@@ -73,7 +72,7 @@
 	if (pdev->evtchn != INVALID_EVTCHN)
 		xenbus_free_evtchn(pdev->xdev, pdev->evtchn);
 
-	if (pdev->gnt_ref != INVALID_GRANT_REF)
+	if (pdev->gnt_ref != GRANT_INVALID_REF)
 		gnttab_end_foreign_access(pdev->gnt_ref,
 					  (unsigned long)pdev->sh_info);
 	else
diff -r 0db21b31377f -r 1a12d75a97bd drivers/xen/scsifront/common.h
--- a/drivers/xen/scsifront/common.h	Wed Mar 07 14:33:13 2012 +0100
+++ b/drivers/xen/scsifront/common.h	Mon Mar 12 12:26:58 2012 +0100
@@ -61,7 +61,6 @@
 #include <xen/platform-compat.h>
 #endif
 
-#define GRANT_INVALID_REF	0
 #define VSCSI_IN_ABORT		1
 #define VSCSI_IN_RESET		2
 
diff -r 0db21b31377f -r 1a12d75a97bd drivers/xen/usbfront/xenbus.c
--- a/drivers/xen/usbfront/xenbus.c	Wed Mar 07 14:33:13 2012 +0100
+++ b/drivers/xen/usbfront/xenbus.c	Mon Mar 12 12:26:58 2012 +0100
@@ -45,8 +45,6 @@
 
 #include "usbfront.h"
 
-#define GRANT_INVALID_REF 0
-
 static void destroy_rings(struct usbfront_info *info)
 {
 	if (info->irq)
diff -r 0db21b31377f -r 1a12d75a97bd include/xen/gnttab.h
--- a/include/xen/gnttab.h	Wed Mar 07 14:33:13 2012 +0100
+++ b/include/xen/gnttab.h	Mon Mar 12 12:26:58 2012 +0100
@@ -44,6 +44,8 @@
 #include <xen/interface/grant_table.h>
 #include <xen/features.h>
 
+#define GRANT_INVALID_REF	0
+
 struct gnttab_free_callback {
 	struct gnttab_free_callback *next;
 	void (*fn)(void *);

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

From xen-changelog-bounces@lists.xen.org Mon Mar 12 11:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 12 Mar 2012 11:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S73V7-0002fg-AN; Mon, 12 Mar 2012 11:33: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 1S73V5-0002fN-To
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:16 +0000
Received: from [85.158.138.51:54281] by server-5.bemta-3.messagelabs.com id
	6A/9B-09139-AFEDD5F4; Mon, 12 Mar 2012 11:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1331551989!17267636!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2735 invoked from network); 12 Mar 2012 11:33:13 -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;
	12 Mar 2012 11:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S73Uw-0003Ld-DV
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S73Ut-0001vX-Bl
	for xen-changelog@lists.xensource.com; Mon, 12 Mar 2012 11:33:03 +0000
Message-Id: <E1S73Ut-0001vX-Bl@xenbits.xen.org>
Date: Mon, 12 Mar 2012 11:33:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] consolidate GRANT_INVALID_REF
	definitions
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331551618 -3600
# Node ID 1a12d75a97bdea29e646956e1b4483f7e37b6076
# Parent  0db21b31377ffd8e08d5aa43e346be6a8e9a304f
consolidate GRANT_INVALID_REF definitions

No need for each frontend to define this for itself, the more that this
really is a property of the gnttab.c code.

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


diff -r 0db21b31377f -r 1a12d75a97bd drivers/char/tpm/tpm_xen.c
--- a/drivers/char/tpm/tpm_xen.c	Wed Mar 07 14:33:13 2012 +0100
+++ b/drivers/char/tpm/tpm_xen.c	Mon Mar 12 12:26:58 2012 +0100
@@ -109,8 +109,6 @@
 #define WPRINTK(fmt, args...) \
     printk(KERN_WARNING "xen_tpm_fr: " fmt, ##args)
 
-#define GRANT_INVALID_REF	0
-
 
 static inline int
 tx_buffer_copy(struct tx_buffer *txb, const u8 *src, int len,
diff -r 0db21b31377f -r 1a12d75a97bd drivers/xen/blkfront/blkfront.c
--- a/drivers/xen/blkfront/blkfront.c	Wed Mar 07 14:33:13 2012 +0100
+++ b/drivers/xen/blkfront/blkfront.c	Mon Mar 12 12:26:58 2012 +0100
@@ -60,7 +60,6 @@
 
 #define MAXIMUM_OUTSTANDING_BLOCK_REQS \
     (BLKIF_MAX_SEGMENTS_PER_REQUEST * BLK_RING_SIZE)
-#define GRANT_INVALID_REF	0
 
 static void connect(struct blkfront_info *);
 static void blkfront_closing(struct blkfront_info *);
diff -r 0db21b31377f -r 1a12d75a97bd drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c	Wed Mar 07 14:33:13 2012 +0100
+++ b/drivers/xen/netfront/netfront.c	Mon Mar 12 12:26:58 2012 +0100
@@ -147,8 +147,6 @@
 #define ethtool_op_set_tso(dev, data)	(-ENOSYS)
 #endif
 
-#define GRANT_INVALID_REF	0
-
 struct netfront_rx_info {
 	struct netif_rx_response rx;
 	struct netif_extra_info extras[XEN_NETIF_EXTRA_TYPE_MAX - 1];
diff -r 0db21b31377f -r 1a12d75a97bd drivers/xen/pcifront/xenbus.c
--- a/drivers/xen/pcifront/xenbus.c	Wed Mar 07 14:33:13 2012 +0100
+++ b/drivers/xen/pcifront/xenbus.c	Mon Mar 12 12:26:58 2012 +0100
@@ -15,7 +15,6 @@
 #define __init_refok
 #endif
 
-#define INVALID_GRANT_REF (0)
 #define INVALID_EVTCHN    (-1)
 
 static struct pcifront_device *alloc_pdev(struct xenbus_device *xdev)
@@ -47,7 +46,7 @@
 	spin_lock_init(&pdev->sh_info_lock);
 
 	pdev->evtchn = INVALID_EVTCHN;
-	pdev->gnt_ref = INVALID_GRANT_REF;
+	pdev->gnt_ref = GRANT_INVALID_REF;
 	pdev->irq = -1;
 
 	INIT_WORK(&pdev->op_work, pcifront_do_aer, pdev);
@@ -73,7 +72,7 @@
 	if (pdev->evtchn != INVALID_EVTCHN)
 		xenbus_free_evtchn(pdev->xdev, pdev->evtchn);
 
-	if (pdev->gnt_ref != INVALID_GRANT_REF)
+	if (pdev->gnt_ref != GRANT_INVALID_REF)
 		gnttab_end_foreign_access(pdev->gnt_ref,
 					  (unsigned long)pdev->sh_info);
 	else
diff -r 0db21b31377f -r 1a12d75a97bd drivers/xen/scsifront/common.h
--- a/drivers/xen/scsifront/common.h	Wed Mar 07 14:33:13 2012 +0100
+++ b/drivers/xen/scsifront/common.h	Mon Mar 12 12:26:58 2012 +0100
@@ -61,7 +61,6 @@
 #include <xen/platform-compat.h>
 #endif
 
-#define GRANT_INVALID_REF	0
 #define VSCSI_IN_ABORT		1
 #define VSCSI_IN_RESET		2
 
diff -r 0db21b31377f -r 1a12d75a97bd drivers/xen/usbfront/xenbus.c
--- a/drivers/xen/usbfront/xenbus.c	Wed Mar 07 14:33:13 2012 +0100
+++ b/drivers/xen/usbfront/xenbus.c	Mon Mar 12 12:26:58 2012 +0100
@@ -45,8 +45,6 @@
 
 #include "usbfront.h"
 
-#define GRANT_INVALID_REF 0
-
 static void destroy_rings(struct usbfront_info *info)
 {
 	if (info->irq)
diff -r 0db21b31377f -r 1a12d75a97bd include/xen/gnttab.h
--- a/include/xen/gnttab.h	Wed Mar 07 14:33:13 2012 +0100
+++ b/include/xen/gnttab.h	Mon Mar 12 12:26:58 2012 +0100
@@ -44,6 +44,8 @@
 #include <xen/interface/grant_table.h>
 #include <xen/features.h>
 
+#define GRANT_INVALID_REF	0
+
 struct gnttab_free_callback {
 	struct gnttab_free_callback *next;
 	void (*fn)(void *);

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

From xen-changelog-bounces@lists.xen.org Tue Mar 13 22:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Mar 2012 22: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 1S7aRx-0008TX-8O; Tue, 13 Mar 2012 22:44: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 1S7aRv-0008TO-Sd
	for xen-changelog@lists.xensource.com; Tue, 13 Mar 2012 22:44:11 +0000
Received: from [85.158.138.51:3585] by server-1.bemta-3.messagelabs.com id
	40/B0-02415-BBDCF5F4; Tue, 13 Mar 2012 22:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1331678648!15673563!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23252 invoked from network); 13 Mar 2012 22:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Mar 2012 22: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 1S7aRs-00052R-Ak
	for xen-changelog@lists.xensource.com; Tue, 13 Mar 2012 22:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7aRs-00022U-1N
	for xen-changelog@lists.xensource.com; Tue, 13 Mar 2012 22:44:08 +0000
Message-Id: <E1S7aRs-00022U-1N@xenbits.xen.org>
Date: Tue, 13 Mar 2012 22:44:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] libxl: print out vifname in
	create dryrun.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Liu <wei.liu2@citrix.com>
# Date 1331657343 0
# Node ID 0f19588760900e3428b7fec8b97b7736d71285b4
# Parent  3f158dd40b314e0a4cb24acda69257c20e269cbb
libxl: print out vifname in create dryrun.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>

xen-unstable changeset: 24458:19ac027a3c31
Backport-requested-by: Roderick Colenbrander <thunderbird2k@gmail.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 3f158dd40b31 -r 0f1958876090 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Mar 09 10:03:04 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Mar 13 16:49:03 2012 +0000
@@ -393,6 +393,8 @@
     for (i = 0; i < d_config->num_vifs; i++) {
         printf("\t(device\n");
         printf("\t\t(vif\n");
+        if (d_config->vifs[i].ifname)
+            printf("\t\t\t(vifname %s)\n", d_config->vifs[i].ifname);
         printf("\t\t\t(backend_domid %d)\n", d_config->vifs[i].backend_domid);
         printf("\t\t\t(frontend_domid %d)\n", d_config->vifs[i].domid);
         printf("\t\t\t(devid %d)\n", d_config->vifs[i].devid);

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

From xen-changelog-bounces@lists.xen.org Tue Mar 13 22:44:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 13 Mar 2012 22: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 1S7aRx-0008TX-8O; Tue, 13 Mar 2012 22:44: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 1S7aRv-0008TO-Sd
	for xen-changelog@lists.xensource.com; Tue, 13 Mar 2012 22:44:11 +0000
Received: from [85.158.138.51:3585] by server-1.bemta-3.messagelabs.com id
	40/B0-02415-BBDCF5F4; Tue, 13 Mar 2012 22:44:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1331678648!15673563!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23252 invoked from network); 13 Mar 2012 22:44:10 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	13 Mar 2012 22: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 1S7aRs-00052R-Ak
	for xen-changelog@lists.xensource.com; Tue, 13 Mar 2012 22:44:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7aRs-00022U-1N
	for xen-changelog@lists.xensource.com; Tue, 13 Mar 2012 22:44:08 +0000
Message-Id: <E1S7aRs-00022U-1N@xenbits.xen.org>
Date: Tue, 13 Mar 2012 22:44:07 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] libxl: print out vifname in
	create dryrun.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Liu <wei.liu2@citrix.com>
# Date 1331657343 0
# Node ID 0f19588760900e3428b7fec8b97b7736d71285b4
# Parent  3f158dd40b314e0a4cb24acda69257c20e269cbb
libxl: print out vifname in create dryrun.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell.com>
Committed-by: Ian Jackson <ian.jackson.citrix.com>

xen-unstable changeset: 24458:19ac027a3c31
Backport-requested-by: Roderick Colenbrander <thunderbird2k@gmail.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 3f158dd40b31 -r 0f1958876090 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Fri Mar 09 10:03:04 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Mar 13 16:49:03 2012 +0000
@@ -393,6 +393,8 @@
     for (i = 0; i < d_config->num_vifs; i++) {
         printf("\t(device\n");
         printf("\t\t(vif\n");
+        if (d_config->vifs[i].ifname)
+            printf("\t\t\t(vifname %s)\n", d_config->vifs[i].ifname);
         printf("\t\t\t(backend_domid %d)\n", d_config->vifs[i].backend_domid);
         printf("\t\t\t(frontend_domid %d)\n", d_config->vifs[i].domid);
         printf("\t\t\t(devid %d)\n", d_config->vifs[i].devid);

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:11:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12: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 1S7n2u-000116-0f; Wed, 14 Mar 2012 12:11:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1S7n2t-000111-4F
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:11:11 +0000
Received: from [85.158.138.51:33774] by server-10.bemta-3.messagelabs.com id
	2F/D6-13338-EDA806F4; Wed, 14 Mar 2012 12:11:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1331727068!17622181!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23996 invoked from network); 14 Mar 2012 12:11:09 -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;
	14 Mar 2012 12:11:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1S7n2q-0007DJ-6S
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1S7n2p-0007aS-Nq
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:11:07 +0000
Date: Wed, 14 Mar 2012 12:11:07 +0000
Message-Id: <E1S7n2p-0007aS-Nq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.1-testing] qemu-xen: ignore console
	disconnect events for console/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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 06d2e688405932841e9a1c27e2eaaef315298a66
Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date:   Thu Mar 1 18:58:27 2012 +0000

    qemu-xen: ignore console disconnect events for console/0
    
    The first console has a different location compared to other PV devices
    (console, rather than device/console/0) and doesn't obey the xenstore
    state protocol. We already special case the first console in con_init
    and con_initialise, we should also do it in con_disconnect.
    
    This patch should be applied to 4.1 too.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    (cherry picked from commit 2503d4d5a29e7af8dffd1e11229e11c1917d2ccf)
---
 hw/xen_console.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/xen_console.c b/hw/xen_console.c
index 0a2374c..f036b8d 100644
--- a/hw/xen_console.c
+++ b/hw/xen_console.c
@@ -253,6 +253,8 @@ static void con_disconnect(struct XenDevice *xendev)
 {
     struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);
 
+    if (!xendev->dev)
+        return;
     if (con->chr)
         qemu_chr_add_handlers(con->chr, NULL, NULL, NULL, NULL);
     xen_be_unbind_evtchn(&con->xendev);
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.1-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:11:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12: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 1S7n2u-000116-0f; Wed, 14 Mar 2012 12:11:12 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1S7n2t-000111-4F
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:11:11 +0000
Received: from [85.158.138.51:33774] by server-10.bemta-3.messagelabs.com id
	2F/D6-13338-EDA806F4; Wed, 14 Mar 2012 12:11:10 +0000
X-Env-Sender: ian.jackson@eu.citrix.com
X-Msg-Ref: server-5.tower-174.messagelabs.com!1331727068!17622181!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23996 invoked from network); 14 Mar 2012 12:11:09 -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;
	14 Mar 2012 12:11:09 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1S7n2q-0007DJ-6S
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:11:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <ian.jackson@eu.citrix.com>) id 1S7n2p-0007aS-Nq
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:11:07 +0000
Date: Wed, 14 Mar 2012 12:11:07 +0000
Message-Id: <E1S7n2p-0007aS-Nq@xenbits.xen.org>
From: patchbot@xen.org
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [qemu-xen-4.1-testing] qemu-xen: ignore console
	disconnect events for console/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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

commit 06d2e688405932841e9a1c27e2eaaef315298a66
Author: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Date:   Thu Mar 1 18:58:27 2012 +0000

    qemu-xen: ignore console disconnect events for console/0
    
    The first console has a different location compared to other PV devices
    (console, rather than device/console/0) and doesn't obey the xenstore
    state protocol. We already special case the first console in con_init
    and con_initialise, we should also do it in con_disconnect.
    
    This patch should be applied to 4.1 too.
    
    Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
    (cherry picked from commit 2503d4d5a29e7af8dffd1e11229e11c1917d2ccf)
---
 hw/xen_console.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/hw/xen_console.c b/hw/xen_console.c
index 0a2374c..f036b8d 100644
--- a/hw/xen_console.c
+++ b/hw/xen_console.c
@@ -253,6 +253,8 @@ static void con_disconnect(struct XenDevice *xendev)
 {
     struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);
 
+    if (!xendev->dev)
+        return;
     if (con->chr)
         qemu_chr_add_handlers(con->chr, NULL, NULL, NULL, NULL);
     xen_be_unbind_evtchn(&con->xendev);
--
generated by git-patchbot for /home/xen/git/qemu-xen-4.1-testing.git

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12: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 1S7nOF-0001hP-7Q; Wed, 14 Mar 2012 12:33: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 1S7nOD-0001go-JQ
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:13 +0000
Received: from [85.158.139.83:10270] by server-5.bemta-5.messagelabs.com id
	DC/24-13566-800906F4; Wed, 14 Mar 2012 12:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1331728391!8052323!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19158 invoked from network); 14 Mar 2012 12:33:12 -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;
	14 Mar 2012 12:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOA-0007TY-Rh
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOA-0008Fn-QU
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:10 +0000
Message-Id: <E1S7nOA-0008Fn-QU@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: per-cpu areas
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651454 0
# Node ID 77a77518cac153036b33f56dc8a1f9d6083459bf
# Parent  265024d6540c2c215ae72e6d0bd9ddce8d747747
arm: per-cpu areas

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 265024d6540c -r 77a77518cac1 xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/Makefile	Tue Mar 13 15:10:54 2012 +0000
@@ -13,6 +13,7 @@
 obj-y += kernel.o
 obj-y += mm.o
 obj-y += p2m.o
+obj-y += percpu.o
 obj-y += guestcopy.o
 obj-y += setup.o
 obj-y += time.o
diff -r 265024d6540c -r 77a77518cac1 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/dummy.S	Tue Mar 13 15:10:54 2012 +0000
@@ -14,7 +14,6 @@
 DUMMY(per_cpu__cpu_sibling_mask);
 DUMMY(node_online_map);
 DUMMY(smp_send_state_dump);
-DUMMY(__per_cpu_offset);
 
 /* PIRQ support */
 DUMMY(alloc_pirq_struct);
diff -r 265024d6540c -r 77a77518cac1 xen/arch/arm/percpu.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/percpu.c	Tue Mar 13 15:10:54 2012 +0000
@@ -0,0 +1,85 @@
+#include <xen/config.h>
+#include <xen/percpu.h>
+#include <xen/cpu.h>
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/rcupdate.h>
+
+unsigned long __per_cpu_offset[NR_CPUS];
+#define INVALID_PERCPU_AREA (-(long)__per_cpu_start)
+#define PERCPU_ORDER (get_order_from_bytes(__per_cpu_data_end-__per_cpu_start))
+
+void __init percpu_init_areas(void)
+{
+    unsigned int cpu;
+    for ( cpu = 1; cpu < NR_CPUS; cpu++ )
+        __per_cpu_offset[cpu] = INVALID_PERCPU_AREA;
+}
+
+static int init_percpu_area(unsigned int cpu)
+{
+    char *p;
+    if ( __per_cpu_offset[cpu] != INVALID_PERCPU_AREA )
+        return -EBUSY;
+    if ( (p = alloc_xenheap_pages(PERCPU_ORDER, 0)) == NULL )
+        return -ENOMEM;
+    memset(p, 0, __per_cpu_data_end - __per_cpu_start);
+    __per_cpu_offset[cpu] = p - __per_cpu_start;
+    return 0;
+}
+
+struct free_info {
+    unsigned int cpu;
+    struct rcu_head rcu;
+};
+static DEFINE_PER_CPU(struct free_info, free_info);
+
+static void _free_percpu_area(struct rcu_head *head)
+{
+    struct free_info *info = container_of(head, struct free_info, rcu);
+    unsigned int cpu = info->cpu;
+    char *p = __per_cpu_start + __per_cpu_offset[cpu];
+    free_xenheap_pages(p, PERCPU_ORDER);
+    __per_cpu_offset[cpu] = INVALID_PERCPU_AREA;
+}
+
+static void free_percpu_area(unsigned int cpu)
+{
+    struct free_info *info = &per_cpu(free_info, cpu);
+    info->cpu = cpu;
+    call_rcu(&info->rcu, _free_percpu_area);
+}
+
+static int cpu_percpu_callback(
+    struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    int rc = 0;
+
+    switch ( action )
+    {
+    case CPU_UP_PREPARE:
+        rc = init_percpu_area(cpu);
+        break;
+    case CPU_UP_CANCELED:
+    case CPU_DEAD:
+        free_percpu_area(cpu);
+        break;
+    default:
+        break;
+    }
+
+    return !rc ? NOTIFY_DONE : notifier_from_errno(rc);
+}
+
+static struct notifier_block cpu_percpu_nfb = {
+    .notifier_call = cpu_percpu_callback,
+    .priority = 100 /* highest priority */
+};
+
+static int __init percpu_presmp_init(void)
+{
+    register_cpu_notifier(&cpu_percpu_nfb);
+    return 0;
+}
+presmp_initcall(percpu_presmp_init);
diff -r 265024d6540c -r 77a77518cac1 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/setup.c	Tue Mar 13 15:10:54 2012 +0000
@@ -182,6 +182,9 @@
     console_init_preirq();
 #endif
 
+    percpu_init_areas();
+    set_processor_id(0); /* needed early, for smp_processor_id() */
+
     cpus = gic_init();
 
     printk("Waiting for %i other CPUs to be ready\n", cpus - 1);
@@ -200,7 +203,6 @@
 
     __set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
-    set_processor_id(0); /* needed early, for smp_processor_id() */
 
     smp_prepare_cpus(max_cpus);
 
diff -r 265024d6540c -r 77a77518cac1 xen/include/asm-arm/current.h
--- a/xen/include/asm-arm/current.h	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/include/asm-arm/current.h	Tue Mar 13 15:10:54 2012 +0000
@@ -40,7 +40,9 @@
 #define get_current()         (this_cpu(curr_vcpu))
 #define __set_current(vcpu)   (this_cpu(curr_vcpu) = (vcpu))
 #define set_current(vcpu)     do {                                      \
-    vcpu->arch.cpu_info->processor_id = get_processor_id();             \
+    int cpu = get_processor_id();                                       \
+    vcpu->arch.cpu_info->processor_id = cpu;                            \
+    vcpu->arch.cpu_info->per_cpu_offset = __per_cpu_offset[cpu];        \
     __set_current(vcpu);                                                \
 } while (0)
 #define current               (get_current())
diff -r 265024d6540c -r 77a77518cac1 xen/include/asm-arm/percpu.h
--- a/xen/include/asm-arm/percpu.h	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/include/asm-arm/percpu.h	Tue Mar 13 15:10:54 2012 +0000
@@ -12,8 +12,11 @@
     __attribute__((__section__(".bss.percpu" #suffix)))         \
     __typeof__(type) per_cpu_##name
 
-#define per_cpu(var, cpu) ((&per_cpu__##var)[cpu?0:0])
-#define __get_cpu_var(var) per_cpu__##var
+
+#define per_cpu(var, cpu)  \
+    (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
+#define __get_cpu_var(var) \
+    (*RELOC_HIDE(&per_cpu__##var, get_cpu_info()->per_cpu_offset))
 
 #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12: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 1S7nOF-0001hP-7Q; Wed, 14 Mar 2012 12:33: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 1S7nOD-0001go-JQ
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:13 +0000
Received: from [85.158.139.83:10270] by server-5.bemta-5.messagelabs.com id
	DC/24-13566-800906F4; Wed, 14 Mar 2012 12:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1331728391!8052323!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19158 invoked from network); 14 Mar 2012 12:33:12 -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;
	14 Mar 2012 12:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOA-0007TY-Rh
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOA-0008Fn-QU
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:10 +0000
Message-Id: <E1S7nOA-0008Fn-QU@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: per-cpu areas
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651454 0
# Node ID 77a77518cac153036b33f56dc8a1f9d6083459bf
# Parent  265024d6540c2c215ae72e6d0bd9ddce8d747747
arm: per-cpu areas

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 265024d6540c -r 77a77518cac1 xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/Makefile	Tue Mar 13 15:10:54 2012 +0000
@@ -13,6 +13,7 @@
 obj-y += kernel.o
 obj-y += mm.o
 obj-y += p2m.o
+obj-y += percpu.o
 obj-y += guestcopy.o
 obj-y += setup.o
 obj-y += time.o
diff -r 265024d6540c -r 77a77518cac1 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/dummy.S	Tue Mar 13 15:10:54 2012 +0000
@@ -14,7 +14,6 @@
 DUMMY(per_cpu__cpu_sibling_mask);
 DUMMY(node_online_map);
 DUMMY(smp_send_state_dump);
-DUMMY(__per_cpu_offset);
 
 /* PIRQ support */
 DUMMY(alloc_pirq_struct);
diff -r 265024d6540c -r 77a77518cac1 xen/arch/arm/percpu.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/percpu.c	Tue Mar 13 15:10:54 2012 +0000
@@ -0,0 +1,85 @@
+#include <xen/config.h>
+#include <xen/percpu.h>
+#include <xen/cpu.h>
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/rcupdate.h>
+
+unsigned long __per_cpu_offset[NR_CPUS];
+#define INVALID_PERCPU_AREA (-(long)__per_cpu_start)
+#define PERCPU_ORDER (get_order_from_bytes(__per_cpu_data_end-__per_cpu_start))
+
+void __init percpu_init_areas(void)
+{
+    unsigned int cpu;
+    for ( cpu = 1; cpu < NR_CPUS; cpu++ )
+        __per_cpu_offset[cpu] = INVALID_PERCPU_AREA;
+}
+
+static int init_percpu_area(unsigned int cpu)
+{
+    char *p;
+    if ( __per_cpu_offset[cpu] != INVALID_PERCPU_AREA )
+        return -EBUSY;
+    if ( (p = alloc_xenheap_pages(PERCPU_ORDER, 0)) == NULL )
+        return -ENOMEM;
+    memset(p, 0, __per_cpu_data_end - __per_cpu_start);
+    __per_cpu_offset[cpu] = p - __per_cpu_start;
+    return 0;
+}
+
+struct free_info {
+    unsigned int cpu;
+    struct rcu_head rcu;
+};
+static DEFINE_PER_CPU(struct free_info, free_info);
+
+static void _free_percpu_area(struct rcu_head *head)
+{
+    struct free_info *info = container_of(head, struct free_info, rcu);
+    unsigned int cpu = info->cpu;
+    char *p = __per_cpu_start + __per_cpu_offset[cpu];
+    free_xenheap_pages(p, PERCPU_ORDER);
+    __per_cpu_offset[cpu] = INVALID_PERCPU_AREA;
+}
+
+static void free_percpu_area(unsigned int cpu)
+{
+    struct free_info *info = &per_cpu(free_info, cpu);
+    info->cpu = cpu;
+    call_rcu(&info->rcu, _free_percpu_area);
+}
+
+static int cpu_percpu_callback(
+    struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    int rc = 0;
+
+    switch ( action )
+    {
+    case CPU_UP_PREPARE:
+        rc = init_percpu_area(cpu);
+        break;
+    case CPU_UP_CANCELED:
+    case CPU_DEAD:
+        free_percpu_area(cpu);
+        break;
+    default:
+        break;
+    }
+
+    return !rc ? NOTIFY_DONE : notifier_from_errno(rc);
+}
+
+static struct notifier_block cpu_percpu_nfb = {
+    .notifier_call = cpu_percpu_callback,
+    .priority = 100 /* highest priority */
+};
+
+static int __init percpu_presmp_init(void)
+{
+    register_cpu_notifier(&cpu_percpu_nfb);
+    return 0;
+}
+presmp_initcall(percpu_presmp_init);
diff -r 265024d6540c -r 77a77518cac1 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/setup.c	Tue Mar 13 15:10:54 2012 +0000
@@ -182,6 +182,9 @@
     console_init_preirq();
 #endif
 
+    percpu_init_areas();
+    set_processor_id(0); /* needed early, for smp_processor_id() */
+
     cpus = gic_init();
 
     printk("Waiting for %i other CPUs to be ready\n", cpus - 1);
@@ -200,7 +203,6 @@
 
     __set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
-    set_processor_id(0); /* needed early, for smp_processor_id() */
 
     smp_prepare_cpus(max_cpus);
 
diff -r 265024d6540c -r 77a77518cac1 xen/include/asm-arm/current.h
--- a/xen/include/asm-arm/current.h	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/include/asm-arm/current.h	Tue Mar 13 15:10:54 2012 +0000
@@ -40,7 +40,9 @@
 #define get_current()         (this_cpu(curr_vcpu))
 #define __set_current(vcpu)   (this_cpu(curr_vcpu) = (vcpu))
 #define set_current(vcpu)     do {                                      \
-    vcpu->arch.cpu_info->processor_id = get_processor_id();             \
+    int cpu = get_processor_id();                                       \
+    vcpu->arch.cpu_info->processor_id = cpu;                            \
+    vcpu->arch.cpu_info->per_cpu_offset = __per_cpu_offset[cpu];        \
     __set_current(vcpu);                                                \
 } while (0)
 #define current               (get_current())
diff -r 265024d6540c -r 77a77518cac1 xen/include/asm-arm/percpu.h
--- a/xen/include/asm-arm/percpu.h	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/include/asm-arm/percpu.h	Tue Mar 13 15:10:54 2012 +0000
@@ -12,8 +12,11 @@
     __attribute__((__section__(".bss.percpu" #suffix)))         \
     __typeof__(type) per_cpu_##name
 
-#define per_cpu(var, cpu) ((&per_cpu__##var)[cpu?0:0])
-#define __get_cpu_var(var) per_cpu__##var
+
+#define per_cpu(var, cpu)  \
+    (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
+#define __get_cpu_var(var) \
+    (*RELOC_HIDE(&per_cpu__##var, get_cpu_info()->per_cpu_offset))
 
 #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12: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 1S7nOG-0001iB-Hc; Wed, 14 Mar 2012 12:33: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 1S7nOE-0001gV-VL
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:15 +0000
Received: from [85.158.143.99:36787] by server-1.bemta-4.messagelabs.com id
	5E/D5-20925-A00906F4; Wed, 14 Mar 2012 12:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331728393!13861887!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29106 invoked from network); 14 Mar 2012 12:33: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;
	14 Mar 2012 12:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOC-0007Tk-Vz
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOC-0008Hg-UY
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:12 +0000
Message-Id: <E1S7nOC-0008Hg-UY@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Shutdown and 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651457 0
# Node ID 1e5da26611f36b90c70b3827edc33caa26bd7942
# Parent  d21c626d89c65aadbb7f8dac23e8e8f5344bb48e
arm: Shutdown and reboot

Reboot runes grabbed from linux's SP810 reset function.
Doesn't seem to work on the model, though.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d21c626d89c6 -r 1e5da26611f3 xen/arch/arm/shutdown.c
--- a/xen/arch/arm/shutdown.c	Tue Mar 13 15:10:56 2012 +0000
+++ b/xen/arch/arm/shutdown.c	Tue Mar 13 15:10:57 2012 +0000
@@ -1,18 +1,64 @@
 #include <xen/config.h>
+#include <xen/console.h>
+#include <xen/cpu.h>
+#include <xen/delay.h>
 #include <xen/lib.h>
+#include <xen/mm.h>
+#include <xen/smp.h>
+
+static void raw_machine_reset(void)
+{
+    /* XXX get this from device tree */
+#ifdef SP810_ADDRESS
+    /* Use the SP810 system controller to force a reset */
+    volatile uint32_t *sp810;
+    set_fixmap(FIXMAP_MISC, SP810_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
+    sp810 = ((uint32_t *)
+             (FIXMAP_ADDR(FIXMAP_MISC) + (SP810_ADDRESS & ~PAGE_MASK)));
+    sp810[0] = 0x3; /* switch to slow mode */
+    dsb(); isb();
+    sp810[1] = 0x1; /* writing any value to SCSYSSTAT reg will reset system */
+    dsb(); isb();
+    clear_fixmap(FIXMAP_MISC);
+#endif
+}
+
+static void halt_this_cpu(void *arg)
+{
+    __cpu_disable();
+    stop_cpu();
+}
 
 void machine_halt(void)
 {
-        /* TODO: halt */
-        while(1) ;
+    watchdog_disable();
+    console_start_sync();
+    local_irq_enable();
+    smp_call_function(halt_this_cpu, NULL, 0);
+    halt_this_cpu(NULL);
 }
 
 void machine_restart(unsigned int delay_millisecs)
 {
-        /* TODO: restart */
-        printk("Cannot restart yet\n");
-        while(1);
+    int timeout = 10;
+
+    local_irq_enable();
+    smp_call_function(halt_this_cpu, NULL, 0);
+    local_irq_disable();
+
+    mdelay(delay_millisecs);
+
+    /* Wait at most another 10ms for all other CPUs to go offline. */
+    while ( (num_online_cpus() > 1) && (timeout-- > 0) )
+        mdelay(1);
+
+    while ( 1 )
+    {
+        raw_machine_reset();
+        mdelay(100);
+    }
 }
+
 /*
  * Local variables:
  * mode: C
diff -r d21c626d89c6 -r 1e5da26611f3 xen/include/asm-arm/config.h
--- a/xen/include/asm-arm/config.h	Tue Mar 13 15:10:56 2012 +0000
+++ b/xen/include/asm-arm/config.h	Tue Mar 13 15:10:57 2012 +0000
@@ -119,6 +119,9 @@
 #define GIC_CR_OFFSET 0x2000
 #define GIC_HR_OFFSET 0x4000 /* Guess work http://lists.infradead.org/pipermail/linux-arm-kernel/2011-September/064219.html */
 #define GIC_VR_OFFSET 0x6000 /* Virtual Machine CPU interface) */
+/* Board-specific: base address of system controller */
+#define SP810_ADDRESS 0x1C020000
+
 
 #endif /* __ARM_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 Mar 14 12:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12: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 1S7nOG-0001iB-Hc; Wed, 14 Mar 2012 12:33: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 1S7nOE-0001gV-VL
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:15 +0000
Received: from [85.158.143.99:36787] by server-1.bemta-4.messagelabs.com id
	5E/D5-20925-A00906F4; Wed, 14 Mar 2012 12:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331728393!13861887!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29106 invoked from network); 14 Mar 2012 12:33: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;
	14 Mar 2012 12:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOC-0007Tk-Vz
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOC-0008Hg-UY
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:12 +0000
Message-Id: <E1S7nOC-0008Hg-UY@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Shutdown and 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651457 0
# Node ID 1e5da26611f36b90c70b3827edc33caa26bd7942
# Parent  d21c626d89c65aadbb7f8dac23e8e8f5344bb48e
arm: Shutdown and reboot

Reboot runes grabbed from linux's SP810 reset function.
Doesn't seem to work on the model, though.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d21c626d89c6 -r 1e5da26611f3 xen/arch/arm/shutdown.c
--- a/xen/arch/arm/shutdown.c	Tue Mar 13 15:10:56 2012 +0000
+++ b/xen/arch/arm/shutdown.c	Tue Mar 13 15:10:57 2012 +0000
@@ -1,18 +1,64 @@
 #include <xen/config.h>
+#include <xen/console.h>
+#include <xen/cpu.h>
+#include <xen/delay.h>
 #include <xen/lib.h>
+#include <xen/mm.h>
+#include <xen/smp.h>
+
+static void raw_machine_reset(void)
+{
+    /* XXX get this from device tree */
+#ifdef SP810_ADDRESS
+    /* Use the SP810 system controller to force a reset */
+    volatile uint32_t *sp810;
+    set_fixmap(FIXMAP_MISC, SP810_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
+    sp810 = ((uint32_t *)
+             (FIXMAP_ADDR(FIXMAP_MISC) + (SP810_ADDRESS & ~PAGE_MASK)));
+    sp810[0] = 0x3; /* switch to slow mode */
+    dsb(); isb();
+    sp810[1] = 0x1; /* writing any value to SCSYSSTAT reg will reset system */
+    dsb(); isb();
+    clear_fixmap(FIXMAP_MISC);
+#endif
+}
+
+static void halt_this_cpu(void *arg)
+{
+    __cpu_disable();
+    stop_cpu();
+}
 
 void machine_halt(void)
 {
-        /* TODO: halt */
-        while(1) ;
+    watchdog_disable();
+    console_start_sync();
+    local_irq_enable();
+    smp_call_function(halt_this_cpu, NULL, 0);
+    halt_this_cpu(NULL);
 }
 
 void machine_restart(unsigned int delay_millisecs)
 {
-        /* TODO: restart */
-        printk("Cannot restart yet\n");
-        while(1);
+    int timeout = 10;
+
+    local_irq_enable();
+    smp_call_function(halt_this_cpu, NULL, 0);
+    local_irq_disable();
+
+    mdelay(delay_millisecs);
+
+    /* Wait at most another 10ms for all other CPUs to go offline. */
+    while ( (num_online_cpus() > 1) && (timeout-- > 0) )
+        mdelay(1);
+
+    while ( 1 )
+    {
+        raw_machine_reset();
+        mdelay(100);
+    }
 }
+
 /*
  * Local variables:
  * mode: C
diff -r d21c626d89c6 -r 1e5da26611f3 xen/include/asm-arm/config.h
--- a/xen/include/asm-arm/config.h	Tue Mar 13 15:10:56 2012 +0000
+++ b/xen/include/asm-arm/config.h	Tue Mar 13 15:10:57 2012 +0000
@@ -119,6 +119,9 @@
 #define GIC_CR_OFFSET 0x2000
 #define GIC_HR_OFFSET 0x4000 /* Guess work http://lists.infradead.org/pipermail/linux-arm-kernel/2011-September/064219.html */
 #define GIC_VR_OFFSET 0x6000 /* Virtual Machine CPU interface) */
+/* Board-specific: base address of system controller */
+#define SP810_ADDRESS 0x1C020000
+
 
 #endif /* __ARM_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 Mar 14 12:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12: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 1S7nOD-0001gl-2G; Wed, 14 Mar 2012 12: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 1S7nOC-0001gV-8c
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:12 +0000
Received: from [85.158.143.35:12956] by server-1.bemta-4.messagelabs.com id
	51/C5-20925-700906F4; Wed, 14 Mar 2012 12:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1331728389!5042357!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24730 invoked from network); 14 Mar 2012 12:33:10 -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;
	14 Mar 2012 12: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 1S7nO9-0007TP-Eb
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nO9-0008EO-6K
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:09 +0000
Message-Id: <E1S7nO9-0008EO-6K@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: implement udelay()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651452 0
# Node ID cc1225c9690c89fae4622dcaf0fc01ce89546a32
# Parent  5d20d2f6ffed0a49f030f04a8870f1926babbcbf
arm: implement udelay()

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 5d20d2f6ffed -r cc1225c9690c xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Fri Mar 09 16:54:24 2012 +0000
+++ b/xen/arch/arm/dummy.S	Tue Mar 13 15:10:52 2012 +0000
@@ -62,5 +62,4 @@
 DUMMY(hypercall_create_continuation);
 DUMMY(send_timer_event);
 DUMMY(share_xen_page_with_privileged_guests);
-DUMMY(__udelay);
 DUMMY(wallclock_time);
diff -r 5d20d2f6ffed -r cc1225c9690c xen/arch/arm/time.c
--- a/xen/arch/arm/time.c	Fri Mar 09 16:54:24 2012 +0000
+++ b/xen/arch/arm/time.c	Tue Mar 13 15:10:52 2012 +0000
@@ -171,6 +171,16 @@
     request_irq(30, timer_interrupt, 0, "phytimer", NULL);
 }
 
+/* Wait a set number of microseconds */
+void udelay(unsigned long usecs)
+{
+    s_time_t deadline = get_s_time() + 1000 * (s_time_t) usecs;
+    while ( get_s_time() - deadline < 0 )
+        ;
+    dsb();
+    isb();
+}
+
 /*
  * Local variables:
  * mode: C
diff -r 5d20d2f6ffed -r cc1225c9690c xen/include/asm-arm/delay.h
--- a/xen/include/asm-arm/delay.h	Fri Mar 09 16:54:24 2012 +0000
+++ b/xen/include/asm-arm/delay.h	Tue Mar 13 15:10:52 2012 +0000
@@ -1,8 +1,7 @@
 #ifndef _ARM_DELAY_H
 #define _ARM_DELAY_H
 
-extern void __udelay(unsigned long usecs);
-#define udelay(n) __udelay(n)
+extern void udelay(unsigned long usecs);
 
 #endif /* defined(_ARM_DELAY_H) */
 /*

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12: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 1S7nOD-0001gl-2G; Wed, 14 Mar 2012 12: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 1S7nOC-0001gV-8c
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:12 +0000
Received: from [85.158.143.35:12956] by server-1.bemta-4.messagelabs.com id
	51/C5-20925-700906F4; Wed, 14 Mar 2012 12:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1331728389!5042357!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24730 invoked from network); 14 Mar 2012 12:33:10 -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;
	14 Mar 2012 12: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 1S7nO9-0007TP-Eb
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nO9-0008EO-6K
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:09 +0000
Message-Id: <E1S7nO9-0008EO-6K@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: implement udelay()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651452 0
# Node ID cc1225c9690c89fae4622dcaf0fc01ce89546a32
# Parent  5d20d2f6ffed0a49f030f04a8870f1926babbcbf
arm: implement udelay()

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 5d20d2f6ffed -r cc1225c9690c xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Fri Mar 09 16:54:24 2012 +0000
+++ b/xen/arch/arm/dummy.S	Tue Mar 13 15:10:52 2012 +0000
@@ -62,5 +62,4 @@
 DUMMY(hypercall_create_continuation);
 DUMMY(send_timer_event);
 DUMMY(share_xen_page_with_privileged_guests);
-DUMMY(__udelay);
 DUMMY(wallclock_time);
diff -r 5d20d2f6ffed -r cc1225c9690c xen/arch/arm/time.c
--- a/xen/arch/arm/time.c	Fri Mar 09 16:54:24 2012 +0000
+++ b/xen/arch/arm/time.c	Tue Mar 13 15:10:52 2012 +0000
@@ -171,6 +171,16 @@
     request_irq(30, timer_interrupt, 0, "phytimer", NULL);
 }
 
+/* Wait a set number of microseconds */
+void udelay(unsigned long usecs)
+{
+    s_time_t deadline = get_s_time() + 1000 * (s_time_t) usecs;
+    while ( get_s_time() - deadline < 0 )
+        ;
+    dsb();
+    isb();
+}
+
 /*
  * Local variables:
  * mode: C
diff -r 5d20d2f6ffed -r cc1225c9690c xen/include/asm-arm/delay.h
--- a/xen/include/asm-arm/delay.h	Fri Mar 09 16:54:24 2012 +0000
+++ b/xen/include/asm-arm/delay.h	Tue Mar 13 15:10:52 2012 +0000
@@ -1,8 +1,7 @@
 #ifndef _ARM_DELAY_H
 #define _ARM_DELAY_H
 
-extern void __udelay(unsigned long usecs);
-#define udelay(n) __udelay(n)
+extern void udelay(unsigned long usecs);
 
 #endif /* defined(_ARM_DELAY_H) */
 /*

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12: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 1S7nOG-0001i3-F3; Wed, 14 Mar 2012 12:33: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 1S7nOE-0001gH-QT
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:15 +0000
Received: from [85.158.143.35:13197] by server-2.bemta-4.messagelabs.com id
	30/1A-17550-A00906F4; Wed, 14 Mar 2012 12:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1331728392!13757843!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24020 invoked from network); 14 Mar 2012 12:33:13 -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;
	14 Mar 2012 12:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOC-0007Th-F5
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOC-0008HC-DD
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:12 +0000
Message-Id: <E1S7nOC-0008HC-DD@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: SMP CPU shutdown
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651456 0
# Node ID d21c626d89c65aadbb7f8dac23e8e8f5344bb48e
# Parent  7008b235d33da50fa75e3b38e5b1eb08cf38f6a4
arm: SMP CPU shutdown

For completeness, also implelent the CPU shutdown path.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 7008b235d33d -r d21c626d89c6 xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Tue Mar 13 15:10:56 2012 +0000
+++ b/xen/arch/arm/domain.c	Tue Mar 13 15:10:56 2012 +0000
@@ -31,12 +31,10 @@
 {
     for ( ; ; )
     {
-        /* TODO
-           if ( cpu_is_offline(smp_processor_id()) )
-           play_dead();
-           (*pm_idle)();
-           BUG();
-        */
+        if ( cpu_is_offline(smp_processor_id()) )
+            stop_cpu();
+
+        /* TODO: (*pm_idle)(); */
         do_tasklet();
         do_softirq();
     }
diff -r 7008b235d33d -r d21c626d89c6 xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Mar 13 15:10:56 2012 +0000
+++ b/xen/arch/arm/gic.c	Tue Mar 13 15:10:56 2012 +0000
@@ -239,6 +239,11 @@
     GICC[GICC_CTLR] = GICC_CTL_ENABLE|GICC_CTL_EOI;    /* Turn on delivery */
 }
 
+static void gic_cpu_disable(void)
+{
+    GICC[GICC_CTLR] = 0;
+}
+
 static void __cpuinit gic_hyp_init(void)
 {
     uint32_t vtr;
@@ -250,6 +255,11 @@
     GICH[GICH_MISR] = GICH_MISR_EOI;
 }
 
+static void __cpuinit gic_hyp_disable(void)
+{
+    GICH[GICH_HCR] = 0;
+}
+
 /* Set up the GIC */
 int __init gic_init(void)
 {
@@ -286,6 +296,15 @@
     spin_unlock(&gic.lock);
 }
 
+/* Shut down the per-CPU GIC interface */
+void gic_disable_cpu(void)
+{
+    spin_lock(&gic.lock);
+    gic_cpu_disable();
+    gic_hyp_disable();
+    spin_unlock(&gic.lock);
+}
+
 void gic_route_irqs(void)
 {
     /* XXX should get these from DT */
diff -r 7008b235d33d -r d21c626d89c6 xen/arch/arm/gic.h
--- a/xen/arch/arm/gic.h	Tue Mar 13 15:10:56 2012 +0000
+++ b/xen/arch/arm/gic.h	Tue Mar 13 15:10:56 2012 +0000
@@ -142,6 +142,8 @@
 extern int gic_init(void);
 /* Bring up a secondary CPU's per-CPU GIC interface */
 extern void gic_init_secondary_cpu(void);
+/* Take down a CPU's per-CPU GIC interface */
+extern void gic_disable_cpu(void);
 /* setup the gic virtual interface for a guest */
 extern void gicv_setup(struct domain *d);
 #endif
diff -r 7008b235d33d -r d21c626d89c6 xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:56 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:56 2012 +0000
@@ -18,6 +18,7 @@
 
 #include <xen/cpu.h>
 #include <xen/cpumask.h>
+#include <xen/delay.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/mm.h>
@@ -57,6 +58,7 @@
 
 /* Shared state for coordinating CPU bringup */
 unsigned long smp_up_cpu = 0;
+static bool_t cpu_is_dead = 0;
 
 /* Boot the current CPU */
 void __cpuinit start_secondary(unsigned long boot_phys_offset,
@@ -97,8 +99,35 @@
 /* Shut down the current CPU */
 void __cpu_disable(void)
 {
-    /* TODO: take down timers, GIC, &c. */
-    BUG();
+    unsigned int cpu = get_processor_id();
+
+    local_irq_disable();
+    gic_disable_cpu();
+    /* Allow any queued timer interrupts to get serviced */
+    local_irq_enable();
+    mdelay(1);
+    local_irq_disable();
+
+    /* It's now safe to remove this processor from the online map */
+    cpumask_clear_cpu(cpu, &cpu_online_map);
+
+    if ( cpu_disable_scheduler(cpu) )
+        BUG();
+    mb();
+
+    /* Return to caller; eventually the IPI mechanism will unwind and the 
+     * scheduler will drop to the idle loop, which will call stop_cpu(). */
+}
+
+void stop_cpu(void)
+{
+    local_irq_disable();
+    cpu_is_dead = 1;
+    /* Make sure the write happens before we sleep forever */
+    dsb();
+    isb();
+    while ( 1 ) 
+        asm volatile("wfi");
 }
 
 /* Bring up a remote CPU */
@@ -124,8 +153,19 @@
 /* Wait for a remote CPU to die */
 void __cpu_die(unsigned int cpu)
 {
-    /* TODO: interlock with __cpu_disable */
-    BUG();
+    unsigned int i = 0;
+
+    while ( !cpu_is_dead )
+    {
+        mdelay(100);
+        cpu_relax();
+        process_pending_softirqs();
+        if ( (++i % 10) == 0 )
+            printk(KERN_ERR "CPU %u still not dead...\n", cpu);
+        mb();
+    }
+    cpu_is_dead = 0;
+    mb();
 }
 
 
diff -r 7008b235d33d -r d21c626d89c6 xen/include/asm-arm/smp.h
--- a/xen/include/asm-arm/smp.h	Tue Mar 13 15:10:56 2012 +0000
+++ b/xen/include/asm-arm/smp.h	Tue Mar 13 15:10:56 2012 +0000
@@ -14,6 +14,8 @@
 
 #define raw_smp_processor_id() (get_processor_id())
 
+extern void stop_cpu(void);
+
 #endif
 /*
  * Local variables:

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12: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 1S7nOG-0001i3-F3; Wed, 14 Mar 2012 12:33: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 1S7nOE-0001gH-QT
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:15 +0000
Received: from [85.158.143.35:13197] by server-2.bemta-4.messagelabs.com id
	30/1A-17550-A00906F4; Wed, 14 Mar 2012 12:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1331728392!13757843!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24020 invoked from network); 14 Mar 2012 12:33:13 -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;
	14 Mar 2012 12:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOC-0007Th-F5
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOC-0008HC-DD
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:12 +0000
Message-Id: <E1S7nOC-0008HC-DD@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: SMP CPU shutdown
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651456 0
# Node ID d21c626d89c65aadbb7f8dac23e8e8f5344bb48e
# Parent  7008b235d33da50fa75e3b38e5b1eb08cf38f6a4
arm: SMP CPU shutdown

For completeness, also implelent the CPU shutdown path.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 7008b235d33d -r d21c626d89c6 xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Tue Mar 13 15:10:56 2012 +0000
+++ b/xen/arch/arm/domain.c	Tue Mar 13 15:10:56 2012 +0000
@@ -31,12 +31,10 @@
 {
     for ( ; ; )
     {
-        /* TODO
-           if ( cpu_is_offline(smp_processor_id()) )
-           play_dead();
-           (*pm_idle)();
-           BUG();
-        */
+        if ( cpu_is_offline(smp_processor_id()) )
+            stop_cpu();
+
+        /* TODO: (*pm_idle)(); */
         do_tasklet();
         do_softirq();
     }
diff -r 7008b235d33d -r d21c626d89c6 xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Mar 13 15:10:56 2012 +0000
+++ b/xen/arch/arm/gic.c	Tue Mar 13 15:10:56 2012 +0000
@@ -239,6 +239,11 @@
     GICC[GICC_CTLR] = GICC_CTL_ENABLE|GICC_CTL_EOI;    /* Turn on delivery */
 }
 
+static void gic_cpu_disable(void)
+{
+    GICC[GICC_CTLR] = 0;
+}
+
 static void __cpuinit gic_hyp_init(void)
 {
     uint32_t vtr;
@@ -250,6 +255,11 @@
     GICH[GICH_MISR] = GICH_MISR_EOI;
 }
 
+static void __cpuinit gic_hyp_disable(void)
+{
+    GICH[GICH_HCR] = 0;
+}
+
 /* Set up the GIC */
 int __init gic_init(void)
 {
@@ -286,6 +296,15 @@
     spin_unlock(&gic.lock);
 }
 
+/* Shut down the per-CPU GIC interface */
+void gic_disable_cpu(void)
+{
+    spin_lock(&gic.lock);
+    gic_cpu_disable();
+    gic_hyp_disable();
+    spin_unlock(&gic.lock);
+}
+
 void gic_route_irqs(void)
 {
     /* XXX should get these from DT */
diff -r 7008b235d33d -r d21c626d89c6 xen/arch/arm/gic.h
--- a/xen/arch/arm/gic.h	Tue Mar 13 15:10:56 2012 +0000
+++ b/xen/arch/arm/gic.h	Tue Mar 13 15:10:56 2012 +0000
@@ -142,6 +142,8 @@
 extern int gic_init(void);
 /* Bring up a secondary CPU's per-CPU GIC interface */
 extern void gic_init_secondary_cpu(void);
+/* Take down a CPU's per-CPU GIC interface */
+extern void gic_disable_cpu(void);
 /* setup the gic virtual interface for a guest */
 extern void gicv_setup(struct domain *d);
 #endif
diff -r 7008b235d33d -r d21c626d89c6 xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:56 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:56 2012 +0000
@@ -18,6 +18,7 @@
 
 #include <xen/cpu.h>
 #include <xen/cpumask.h>
+#include <xen/delay.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/mm.h>
@@ -57,6 +58,7 @@
 
 /* Shared state for coordinating CPU bringup */
 unsigned long smp_up_cpu = 0;
+static bool_t cpu_is_dead = 0;
 
 /* Boot the current CPU */
 void __cpuinit start_secondary(unsigned long boot_phys_offset,
@@ -97,8 +99,35 @@
 /* Shut down the current CPU */
 void __cpu_disable(void)
 {
-    /* TODO: take down timers, GIC, &c. */
-    BUG();
+    unsigned int cpu = get_processor_id();
+
+    local_irq_disable();
+    gic_disable_cpu();
+    /* Allow any queued timer interrupts to get serviced */
+    local_irq_enable();
+    mdelay(1);
+    local_irq_disable();
+
+    /* It's now safe to remove this processor from the online map */
+    cpumask_clear_cpu(cpu, &cpu_online_map);
+
+    if ( cpu_disable_scheduler(cpu) )
+        BUG();
+    mb();
+
+    /* Return to caller; eventually the IPI mechanism will unwind and the 
+     * scheduler will drop to the idle loop, which will call stop_cpu(). */
+}
+
+void stop_cpu(void)
+{
+    local_irq_disable();
+    cpu_is_dead = 1;
+    /* Make sure the write happens before we sleep forever */
+    dsb();
+    isb();
+    while ( 1 ) 
+        asm volatile("wfi");
 }
 
 /* Bring up a remote CPU */
@@ -124,8 +153,19 @@
 /* Wait for a remote CPU to die */
 void __cpu_die(unsigned int cpu)
 {
-    /* TODO: interlock with __cpu_disable */
-    BUG();
+    unsigned int i = 0;
+
+    while ( !cpu_is_dead )
+    {
+        mdelay(100);
+        cpu_relax();
+        process_pending_softirqs();
+        if ( (++i % 10) == 0 )
+            printk(KERN_ERR "CPU %u still not dead...\n", cpu);
+        mb();
+    }
+    cpu_is_dead = 0;
+    mb();
 }
 
 
diff -r 7008b235d33d -r d21c626d89c6 xen/include/asm-arm/smp.h
--- a/xen/include/asm-arm/smp.h	Tue Mar 13 15:10:56 2012 +0000
+++ b/xen/include/asm-arm/smp.h	Tue Mar 13 15:10:56 2012 +0000
@@ -14,6 +14,8 @@
 
 #define raw_smp_processor_id() (get_processor_id())
 
+extern void stop_cpu(void);
+
 #endif
 /*
  * Local variables:

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12: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 1S7nOG-0001hw-CN; Wed, 14 Mar 2012 12:33: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 1S7nOE-0001gt-9O
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:14 +0000
Received: from [193.109.254.147:38774] by server-8.bemta-14.messagelabs.com id
	7F/17-04087-900906F4; Wed, 14 Mar 2012 12:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1331728390!504850!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15808 invoked from network); 14 Mar 2012 12:33:12 -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;
	14 Mar 2012 12:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOA-0007TV-NS
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOA-0008FK-8r
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:10 +0000
Message-Id: <E1S7nOA-0008FK-8r@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: More SMP bringup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651453 0
# Node ID 265024d6540c2c215ae72e6d0bd9ddce8d747747
# Parent  0cc21e35cbdd66a2b16dccb7f51612fa20b0c79f
arm: More SMP bringup

Bring non-boot CPUs up as far as running on the relocated pagetables,
one at a time, before the non-relocated copy of Xen gets reused for
general memory pools.

Don't yet bring them up into C; that will happen later when stacks are
allocated.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 0cc21e35cbdd -r 265024d6540c xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/gic.c	Tue Mar 13 15:10:53 2012 +0000
@@ -252,7 +252,7 @@
 }
 
 /* Set up the GIC */
-void gic_init(void)
+int __init gic_init(void)
 {
     /* XXX FIXME get this from devicetree */
     gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
@@ -274,6 +274,8 @@
     gic_hyp_init();
 
     spin_unlock(&gic.lock);
+
+    return gic.cpus;
 }
 
 void gic_route_irqs(void)
diff -r 0cc21e35cbdd -r 265024d6540c xen/arch/arm/gic.h
--- a/xen/arch/arm/gic.h	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/gic.h	Tue Mar 13 15:10:53 2012 +0000
@@ -138,8 +138,8 @@
 
 /* Accept an interrupt from the GIC and dispatch its handler */
 extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
-/* Bring up the interrupt controller */
-extern void gic_init(void);
+/* Bring up the interrupt controller, and report # cpus attached */
+extern int gic_init(void);
 /* setup the gic virtual interface for a guest */
 extern void gicv_setup(struct domain *d);
 #endif
diff -r 0cc21e35cbdd -r 265024d6540c xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/head.S	Tue Mar 13 15:10:53 2012 +0000
@@ -62,22 +62,36 @@
 #endif
 
 	/* Are we the boot CPU? */
+	mov   r12, #0                /* r12 := CPU ID */
 	mrc   CP32(r0, MPIDR)
 	tst   r0, #(1<<31)           /* Multiprocessor extension supported? */
 	beq   boot_cpu
 	tst   r0, #(1<<30)           /* Uniprocessor system? */
 	bne   boot_cpu
-	bics  r0, r0, #(0xff << 24)  /* Ignore flags */
-	beq   boot_cpu               /* If all other fields are 0, we win */
+	bics  r12, r0, #(0xff << 24) /* Mask out flags to get CPU ID */
+	beq   boot_cpu               /* If we're CPU 0, boot now */
 
-1:	wfi
-	b     1b
-	
+	/* Non-boot CPUs wait here to be woken up one at a time.
+	 * This is basically an open-coded spin-lock to serialize. */
+	ldr   r0, =boot_gate         /* VA of gate */
+	add   r0, r0, r10            /* PA of gate */
+	mov   r1, #1                 /* (1 == locked) */
+1:	wfe
+	ldrex r2, [r0]               /* Linked read of current value */
+	teq   r2, #0                 /* (0 == unlocked) */
+	strexeq r2, r1, [r0]         /* Matching update -> locked */
+	teq   r2, #0                 /* (0 == succeeded) */
+	bne   1b
+
 boot_cpu:
 #ifdef EARLY_UART_ADDRESS
-	/* Say hello */
 	ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
-	bl    init_uart
+	teq   r12, #0                   /* CPU 0 sets up the UART too */
+	bleq  init_uart
+	PRINT("- CPU ")
+	mov   r0, r12
+	bl    putn
+	PRINT(" booting -\r\n")
 #endif
 
 	/* Check that this CPU has Hyp mode */
@@ -85,7 +99,6 @@
 	and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
 	teq   r0, #0x1000            /* Must == 0x1 or may be incompatible */
 	beq   1f
-	bl    putn
 	PRINT("- CPU doesn't support the virtualization extensions -\r\n")
 	b     fail
 1:
@@ -185,6 +198,10 @@
 	mov   r5, #0                 /* r4:r5 is paddr (xen_pagetable) */
 	mcrr  CP64(r4, r5, HTTBR)
 
+	/* Non-boot CPUs don't need to rebuild the pagetable */
+	teq   r12, #0
+	bne   pt_ready
+	
 	/* Build the baseline idle pagetable's first-level entries */
 	ldr   r1, =xen_second
 	add   r1, r1, r10            /* r1 := paddr (xen_second) */
@@ -226,6 +243,7 @@
 	add   r4, r4, #8
 	strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */
 
+pt_ready:
 	PRINT("- Turning on paging -\r\n")
 
 	ldr   r1, =paging            /* Explicit vaddr, not RIP-relative */
@@ -238,7 +256,7 @@
 paging:
 
 #ifdef EARLY_UART_ADDRESS
-	/* Recover the UART address in the new address space */
+	/* Recover the UART address in the new address space. */
 	lsl   r11, #11
 	lsr   r11, #11               /* UART base's offset from 2MB base */
 	adr   r0, start
@@ -246,14 +264,59 @@
 	add   r11, r11, r0           /* r11 := vaddr (UART base address) */
 #endif
 
-	PRINT("- Entering C -\r\n")
+	PRINT("- Ready -\r\n")
 
+	/* The boot CPU should go straight into C now */
+	teq   r12, #0
+	beq   launch
+
+	/* Signal the next non-boot CPU to come and join us here */
+	ldr   r0, =boot_gate         /* VA of gate */
+	add   r0, r0, r10            /* PA of gate */
+	mov   r1, #0                 /* (0 == unlocked) */
+	str   r1, [r0]
+	dsb
+	isb
+	sev
+
+	/* Move on to the relocated pagetables */
+	mov   r0, #0
+	ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
+	add   r4, r4, r10            /* PA of it */
+	ldrd  r4, r5, [r4]           /* Actual value */
+	mcrr  CP64(r4, r5, HTTBR)
+	mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
+	mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
+	dsb                          /* Ensure completion of TLB+BP flush */
+	isb
+ 	/* Now, the UART is in its proper fixmap address */
+	ldrne r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
+
+	/* Non-boot CPUs report that they've got this far */
+	ldr   r0, =ready_cpus
+1:	ldrex r1, [r0]               /*            { read # of ready CPUs } */
+	add   r1, r1, #1             /* Atomically { ++                   } */
+	strex r2, r1, [r0]           /*            { writeback            } */
+	teq   r2, #0
+	bne   1b
+	dsb
+
+	/* Here, the non-boot CPUs must wait again -- they're now running on
+	 * the boot CPU's pagetables so it's safe for the boot CPU to
+	 * overwrite the non-relocated copy of Xen.  Once it's done that,
+	 * and brought up the memory allocator, non-boot CPUs can get their
+	 * own stacks and enter C. */
+1:	wfe
+	b 1b
+
+launch:	
 	ldr   sp, =init_stack        /* Supply a stack */
 	add   sp, #STACK_SIZE        /* (which grows down from the top). */
 	sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
 	mov   r0, r10                /* Marshal args: - phys_offset */
 	mov   r1, r7                 /*               - machine type */
 	mov   r2, r8                 /*               - ATAG address */
+	mov   r3, r12                /*               - CPU ID */
 	b     start_xen              /* and disappear into the land of C */
 
 /* Fail-stop
@@ -288,7 +351,7 @@
 	tst   r2, #0x8               /* Check BUSY bit */
 	bne   puts                   /* Wait for the UART to be ready */
 	ldrb  r2, [r0], #1           /* Load next char */
-	teq   r2, #0                 /* Exit on nul*/
+	teq   r2, #0                 /* Exit on nul */
 	moveq pc, lr
 	str   r2, [r11]              /* -> UARTDR (Data Register) */
 	b     puts
@@ -308,10 +371,8 @@
 	lsl   r0, #4                 /* Roll it through one nybble at a time */
 	subs  r3, r3, #1
 	bne   1b
-	adr   r0, crlf               /* Finish with a newline */
-	b     puts
+	mov   pc, lr
 
-crlf:	.asciz "\r\n"
 hex:	.ascii "0123456789abcdef"
 	.align 2
 
diff -r 0cc21e35cbdd -r 265024d6540c xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/mm.c	Tue Mar 13 15:10:53 2012 +0000
@@ -36,6 +36,9 @@
 static lpae_t xen_fixmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 static lpae_t xen_xenmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 
+/* Non-boot CPUs use this to find the correct pagetables. */
+uint64_t boot_httbr;
+
 /* Limits of the Xen heap */
 unsigned long xenheap_mfn_start, xenheap_mfn_end;
 unsigned long xenheap_virt_end;
@@ -156,14 +159,6 @@
     lpae_t pte, *p;
     int i;
 
-    if ( boot_phys_offset != 0 )
-    {
-        /* Remove the old identity mapping of the boot paddr */
-        pte.bits = 0;
-        dest_va = (unsigned long)_start + boot_phys_offset;
-        write_pte(xen_second + second_linear_offset(dest_va), pte);
-    }
-
     xen_paddr = device_tree_get_xen_paddr();
 
     /* Map the destination in the boot misc area. */
@@ -186,11 +181,18 @@
     for ( i = 0; i < 4; i++)
         p[i].pt.base += (phys_offset - boot_phys_offset) >> PAGE_SHIFT;
     p = (void *) xen_second + dest_va - (unsigned long) _start;
+    if ( boot_phys_offset != 0 )
+    {
+        /* Remove the old identity mapping of the boot paddr */
+        unsigned long va = (unsigned long)_start + boot_phys_offset;
+        p[second_linear_offset(va)].bits = 0;
+    }
     for ( i = 0; i < 4 * LPAE_ENTRIES; i++)
         if ( p[i].pt.valid )
                 p[i].pt.base += (phys_offset - boot_phys_offset) >> PAGE_SHIFT;
 
     /* Change pagetables to the copy in the relocated Xen */
+    boot_httbr = (unsigned long) xen_pgtable + phys_offset;
     asm volatile (
         STORE_CP64(0, HTTBR)          /* Change translation base */
         "dsb;"                        /* Ensure visibility of HTTBR update */
@@ -198,7 +200,7 @@
         STORE_CP32(0, BPIALL)         /* Flush branch predictor */
         "dsb;"                        /* Ensure completion of TLB+BP flush */
         "isb;"
-        : : "r" ((unsigned long) xen_pgtable + phys_offset) : "memory");
+        : : "r" (boot_httbr) : "memory");
 
     /* Undo the temporary map */
     pte.bits = 0;
diff -r 0cc21e35cbdd -r 265024d6540c xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/setup.c	Tue Mar 13 15:10:53 2012 +0000
@@ -44,7 +44,12 @@
 /* Xen stack for bringing up the first CPU. */
 unsigned char __initdata init_stack[STACK_SIZE] __attribute__((__aligned__(STACK_SIZE)));
 
-extern char __init_begin[], __init_end[], __bss_start[];
+extern const char __init_begin[], __init_end[], __bss_start[];
+
+/* Spinlock for serializing CPU bringup */
+unsigned long __initdata boot_gate = 1;
+/* Number of non-boot CPUs ready to enter C */
+unsigned long __initdata ready_cpus = 0;
 
 static __attribute_used__ void init_done(void)
 {
@@ -151,14 +156,17 @@
     end_boot_allocator();
 }
 
+/* C entry point for boot CPU */
 void __init start_xen(unsigned long boot_phys_offset,
                       unsigned long arm_type,
-                      unsigned long atag_paddr)
-
+                      unsigned long atag_paddr,
+                      unsigned long cpuid)
 {
     void *fdt;
     size_t fdt_size;
-    int i;
+    int cpus, i;
+    paddr_t gate_pa;
+    unsigned long *gate;
 
     fdt = (void *)BOOT_MISC_VIRT_START
         + (atag_paddr & ((1 << SECOND_SHIFT) - 1));
@@ -174,14 +182,26 @@
     console_init_preirq();
 #endif
 
+    cpus = gic_init();
+
+    printk("Waiting for %i other CPUs to be ready\n", cpus - 1);
+    /* Bring the other CPUs up to paging before the original
+     * copy of .text gets overwritten.  We need to use the unrelocated
+     * copy of boot_gate as that's the one the others can see. */ 
+    gate_pa = ((unsigned long) &boot_gate) + boot_phys_offset;
+    gate = map_domain_page(gate_pa >> PAGE_SHIFT) + (gate_pa & ~PAGE_MASK); 
+    *gate = 0;
+    unmap_domain_page(gate);
+    /* Now send an event to wake the first non-boot CPU */
+    asm volatile("dsb; isb; sev");
+    /* And wait for them all to be ready. */
+    while ( ready_cpus + 1 < cpus )
+        smp_rmb();
+
     __set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
     set_processor_id(0); /* needed early, for smp_processor_id() */
 
-    /* TODO: smp_prepare_boot_cpu(void) */
-    cpumask_set_cpu(smp_processor_id(), &cpu_online_map);
-    cpumask_set_cpu(smp_processor_id(), &cpu_present_map);
-
     smp_prepare_cpus(max_cpus);
 
     init_xen_time();
@@ -208,8 +228,6 @@
 
     init_IRQ();
 
-    gic_init();
-
     gic_route_irqs();
 
     init_maintenance_interrupt();

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12: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 1S7nOE-0001h2-4o; Wed, 14 Mar 2012 12:33: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 1S7nOC-0001gX-J2
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:12 +0000
Received: from [85.158.139.83:10157] by server-7.bemta-5.messagelabs.com id
	04/73-16195-700906F4; Wed, 14 Mar 2012 12:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1331728390!19322319!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3734 invoked from network); 14 Mar 2012 12:33:11 -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;
	14 Mar 2012 12:33: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 1S7nO9-0007TS-Tl
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nO9-0008Es-O5
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:09 +0000
Message-Id: <E1S7nO9-0008Es-O5@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Add a comment explaining the
	GICD writes in the GICC init 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651453 0
# Node ID 0cc21e35cbdd66a2b16dccb7f51612fa20b0c79f
# Parent  cc1225c9690c89fae4622dcaf0fc01ce89546a32
arm: Add a comment explaining the GICD writes in the GICC init function

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r cc1225c9690c -r 0cc21e35cbdd xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Mar 13 15:10:52 2012 +0000
+++ b/xen/arch/arm/gic.c	Tue Mar 13 15:10:53 2012 +0000
@@ -224,7 +224,9 @@
 {
     int i;
 
-    /* Disable all PPI and enable all SGI */
+    /* 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 */
     /* Set PPI and SGI priorities */

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12: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 1S7nOE-0001h2-4o; Wed, 14 Mar 2012 12:33: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 1S7nOC-0001gX-J2
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:12 +0000
Received: from [85.158.139.83:10157] by server-7.bemta-5.messagelabs.com id
	04/73-16195-700906F4; Wed, 14 Mar 2012 12:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1331728390!19322319!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3734 invoked from network); 14 Mar 2012 12:33:11 -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;
	14 Mar 2012 12:33: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 1S7nO9-0007TS-Tl
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nO9-0008Es-O5
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:09 +0000
Message-Id: <E1S7nO9-0008Es-O5@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Add a comment explaining the
	GICD writes in the GICC init 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651453 0
# Node ID 0cc21e35cbdd66a2b16dccb7f51612fa20b0c79f
# Parent  cc1225c9690c89fae4622dcaf0fc01ce89546a32
arm: Add a comment explaining the GICD writes in the GICC init function

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r cc1225c9690c -r 0cc21e35cbdd xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Mar 13 15:10:52 2012 +0000
+++ b/xen/arch/arm/gic.c	Tue Mar 13 15:10:53 2012 +0000
@@ -224,7 +224,9 @@
 {
     int i;
 
-    /* Disable all PPI and enable all SGI */
+    /* 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 */
     /* Set PPI and SGI priorities */

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12: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 1S7nOG-0001hw-CN; Wed, 14 Mar 2012 12:33: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 1S7nOE-0001gt-9O
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:14 +0000
Received: from [193.109.254.147:38774] by server-8.bemta-14.messagelabs.com id
	7F/17-04087-900906F4; Wed, 14 Mar 2012 12:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1331728390!504850!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15808 invoked from network); 14 Mar 2012 12:33:12 -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;
	14 Mar 2012 12:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOA-0007TV-NS
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOA-0008FK-8r
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:10 +0000
Message-Id: <E1S7nOA-0008FK-8r@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: More SMP bringup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651453 0
# Node ID 265024d6540c2c215ae72e6d0bd9ddce8d747747
# Parent  0cc21e35cbdd66a2b16dccb7f51612fa20b0c79f
arm: More SMP bringup

Bring non-boot CPUs up as far as running on the relocated pagetables,
one at a time, before the non-relocated copy of Xen gets reused for
general memory pools.

Don't yet bring them up into C; that will happen later when stacks are
allocated.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 0cc21e35cbdd -r 265024d6540c xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/gic.c	Tue Mar 13 15:10:53 2012 +0000
@@ -252,7 +252,7 @@
 }
 
 /* Set up the GIC */
-void gic_init(void)
+int __init gic_init(void)
 {
     /* XXX FIXME get this from devicetree */
     gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
@@ -274,6 +274,8 @@
     gic_hyp_init();
 
     spin_unlock(&gic.lock);
+
+    return gic.cpus;
 }
 
 void gic_route_irqs(void)
diff -r 0cc21e35cbdd -r 265024d6540c xen/arch/arm/gic.h
--- a/xen/arch/arm/gic.h	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/gic.h	Tue Mar 13 15:10:53 2012 +0000
@@ -138,8 +138,8 @@
 
 /* Accept an interrupt from the GIC and dispatch its handler */
 extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
-/* Bring up the interrupt controller */
-extern void gic_init(void);
+/* Bring up the interrupt controller, and report # cpus attached */
+extern int gic_init(void);
 /* setup the gic virtual interface for a guest */
 extern void gicv_setup(struct domain *d);
 #endif
diff -r 0cc21e35cbdd -r 265024d6540c xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/head.S	Tue Mar 13 15:10:53 2012 +0000
@@ -62,22 +62,36 @@
 #endif
 
 	/* Are we the boot CPU? */
+	mov   r12, #0                /* r12 := CPU ID */
 	mrc   CP32(r0, MPIDR)
 	tst   r0, #(1<<31)           /* Multiprocessor extension supported? */
 	beq   boot_cpu
 	tst   r0, #(1<<30)           /* Uniprocessor system? */
 	bne   boot_cpu
-	bics  r0, r0, #(0xff << 24)  /* Ignore flags */
-	beq   boot_cpu               /* If all other fields are 0, we win */
+	bics  r12, r0, #(0xff << 24) /* Mask out flags to get CPU ID */
+	beq   boot_cpu               /* If we're CPU 0, boot now */
 
-1:	wfi
-	b     1b
-	
+	/* Non-boot CPUs wait here to be woken up one at a time.
+	 * This is basically an open-coded spin-lock to serialize. */
+	ldr   r0, =boot_gate         /* VA of gate */
+	add   r0, r0, r10            /* PA of gate */
+	mov   r1, #1                 /* (1 == locked) */
+1:	wfe
+	ldrex r2, [r0]               /* Linked read of current value */
+	teq   r2, #0                 /* (0 == unlocked) */
+	strexeq r2, r1, [r0]         /* Matching update -> locked */
+	teq   r2, #0                 /* (0 == succeeded) */
+	bne   1b
+
 boot_cpu:
 #ifdef EARLY_UART_ADDRESS
-	/* Say hello */
 	ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
-	bl    init_uart
+	teq   r12, #0                   /* CPU 0 sets up the UART too */
+	bleq  init_uart
+	PRINT("- CPU ")
+	mov   r0, r12
+	bl    putn
+	PRINT(" booting -\r\n")
 #endif
 
 	/* Check that this CPU has Hyp mode */
@@ -85,7 +99,6 @@
 	and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
 	teq   r0, #0x1000            /* Must == 0x1 or may be incompatible */
 	beq   1f
-	bl    putn
 	PRINT("- CPU doesn't support the virtualization extensions -\r\n")
 	b     fail
 1:
@@ -185,6 +198,10 @@
 	mov   r5, #0                 /* r4:r5 is paddr (xen_pagetable) */
 	mcrr  CP64(r4, r5, HTTBR)
 
+	/* Non-boot CPUs don't need to rebuild the pagetable */
+	teq   r12, #0
+	bne   pt_ready
+	
 	/* Build the baseline idle pagetable's first-level entries */
 	ldr   r1, =xen_second
 	add   r1, r1, r10            /* r1 := paddr (xen_second) */
@@ -226,6 +243,7 @@
 	add   r4, r4, #8
 	strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */
 
+pt_ready:
 	PRINT("- Turning on paging -\r\n")
 
 	ldr   r1, =paging            /* Explicit vaddr, not RIP-relative */
@@ -238,7 +256,7 @@
 paging:
 
 #ifdef EARLY_UART_ADDRESS
-	/* Recover the UART address in the new address space */
+	/* Recover the UART address in the new address space. */
 	lsl   r11, #11
 	lsr   r11, #11               /* UART base's offset from 2MB base */
 	adr   r0, start
@@ -246,14 +264,59 @@
 	add   r11, r11, r0           /* r11 := vaddr (UART base address) */
 #endif
 
-	PRINT("- Entering C -\r\n")
+	PRINT("- Ready -\r\n")
 
+	/* The boot CPU should go straight into C now */
+	teq   r12, #0
+	beq   launch
+
+	/* Signal the next non-boot CPU to come and join us here */
+	ldr   r0, =boot_gate         /* VA of gate */
+	add   r0, r0, r10            /* PA of gate */
+	mov   r1, #0                 /* (0 == unlocked) */
+	str   r1, [r0]
+	dsb
+	isb
+	sev
+
+	/* Move on to the relocated pagetables */
+	mov   r0, #0
+	ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
+	add   r4, r4, r10            /* PA of it */
+	ldrd  r4, r5, [r4]           /* Actual value */
+	mcrr  CP64(r4, r5, HTTBR)
+	mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
+	mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
+	dsb                          /* Ensure completion of TLB+BP flush */
+	isb
+ 	/* Now, the UART is in its proper fixmap address */
+	ldrne r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
+
+	/* Non-boot CPUs report that they've got this far */
+	ldr   r0, =ready_cpus
+1:	ldrex r1, [r0]               /*            { read # of ready CPUs } */
+	add   r1, r1, #1             /* Atomically { ++                   } */
+	strex r2, r1, [r0]           /*            { writeback            } */
+	teq   r2, #0
+	bne   1b
+	dsb
+
+	/* Here, the non-boot CPUs must wait again -- they're now running on
+	 * the boot CPU's pagetables so it's safe for the boot CPU to
+	 * overwrite the non-relocated copy of Xen.  Once it's done that,
+	 * and brought up the memory allocator, non-boot CPUs can get their
+	 * own stacks and enter C. */
+1:	wfe
+	b 1b
+
+launch:	
 	ldr   sp, =init_stack        /* Supply a stack */
 	add   sp, #STACK_SIZE        /* (which grows down from the top). */
 	sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
 	mov   r0, r10                /* Marshal args: - phys_offset */
 	mov   r1, r7                 /*               - machine type */
 	mov   r2, r8                 /*               - ATAG address */
+	mov   r3, r12                /*               - CPU ID */
 	b     start_xen              /* and disappear into the land of C */
 
 /* Fail-stop
@@ -288,7 +351,7 @@
 	tst   r2, #0x8               /* Check BUSY bit */
 	bne   puts                   /* Wait for the UART to be ready */
 	ldrb  r2, [r0], #1           /* Load next char */
-	teq   r2, #0                 /* Exit on nul*/
+	teq   r2, #0                 /* Exit on nul */
 	moveq pc, lr
 	str   r2, [r11]              /* -> UARTDR (Data Register) */
 	b     puts
@@ -308,10 +371,8 @@
 	lsl   r0, #4                 /* Roll it through one nybble at a time */
 	subs  r3, r3, #1
 	bne   1b
-	adr   r0, crlf               /* Finish with a newline */
-	b     puts
+	mov   pc, lr
 
-crlf:	.asciz "\r\n"
 hex:	.ascii "0123456789abcdef"
 	.align 2
 
diff -r 0cc21e35cbdd -r 265024d6540c xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/mm.c	Tue Mar 13 15:10:53 2012 +0000
@@ -36,6 +36,9 @@
 static lpae_t xen_fixmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 static lpae_t xen_xenmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 
+/* Non-boot CPUs use this to find the correct pagetables. */
+uint64_t boot_httbr;
+
 /* Limits of the Xen heap */
 unsigned long xenheap_mfn_start, xenheap_mfn_end;
 unsigned long xenheap_virt_end;
@@ -156,14 +159,6 @@
     lpae_t pte, *p;
     int i;
 
-    if ( boot_phys_offset != 0 )
-    {
-        /* Remove the old identity mapping of the boot paddr */
-        pte.bits = 0;
-        dest_va = (unsigned long)_start + boot_phys_offset;
-        write_pte(xen_second + second_linear_offset(dest_va), pte);
-    }
-
     xen_paddr = device_tree_get_xen_paddr();
 
     /* Map the destination in the boot misc area. */
@@ -186,11 +181,18 @@
     for ( i = 0; i < 4; i++)
         p[i].pt.base += (phys_offset - boot_phys_offset) >> PAGE_SHIFT;
     p = (void *) xen_second + dest_va - (unsigned long) _start;
+    if ( boot_phys_offset != 0 )
+    {
+        /* Remove the old identity mapping of the boot paddr */
+        unsigned long va = (unsigned long)_start + boot_phys_offset;
+        p[second_linear_offset(va)].bits = 0;
+    }
     for ( i = 0; i < 4 * LPAE_ENTRIES; i++)
         if ( p[i].pt.valid )
                 p[i].pt.base += (phys_offset - boot_phys_offset) >> PAGE_SHIFT;
 
     /* Change pagetables to the copy in the relocated Xen */
+    boot_httbr = (unsigned long) xen_pgtable + phys_offset;
     asm volatile (
         STORE_CP64(0, HTTBR)          /* Change translation base */
         "dsb;"                        /* Ensure visibility of HTTBR update */
@@ -198,7 +200,7 @@
         STORE_CP32(0, BPIALL)         /* Flush branch predictor */
         "dsb;"                        /* Ensure completion of TLB+BP flush */
         "isb;"
-        : : "r" ((unsigned long) xen_pgtable + phys_offset) : "memory");
+        : : "r" (boot_httbr) : "memory");
 
     /* Undo the temporary map */
     pte.bits = 0;
diff -r 0cc21e35cbdd -r 265024d6540c xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Tue Mar 13 15:10:53 2012 +0000
+++ b/xen/arch/arm/setup.c	Tue Mar 13 15:10:53 2012 +0000
@@ -44,7 +44,12 @@
 /* Xen stack for bringing up the first CPU. */
 unsigned char __initdata init_stack[STACK_SIZE] __attribute__((__aligned__(STACK_SIZE)));
 
-extern char __init_begin[], __init_end[], __bss_start[];
+extern const char __init_begin[], __init_end[], __bss_start[];
+
+/* Spinlock for serializing CPU bringup */
+unsigned long __initdata boot_gate = 1;
+/* Number of non-boot CPUs ready to enter C */
+unsigned long __initdata ready_cpus = 0;
 
 static __attribute_used__ void init_done(void)
 {
@@ -151,14 +156,17 @@
     end_boot_allocator();
 }
 
+/* C entry point for boot CPU */
 void __init start_xen(unsigned long boot_phys_offset,
                       unsigned long arm_type,
-                      unsigned long atag_paddr)
-
+                      unsigned long atag_paddr,
+                      unsigned long cpuid)
 {
     void *fdt;
     size_t fdt_size;
-    int i;
+    int cpus, i;
+    paddr_t gate_pa;
+    unsigned long *gate;
 
     fdt = (void *)BOOT_MISC_VIRT_START
         + (atag_paddr & ((1 << SECOND_SHIFT) - 1));
@@ -174,14 +182,26 @@
     console_init_preirq();
 #endif
 
+    cpus = gic_init();
+
+    printk("Waiting for %i other CPUs to be ready\n", cpus - 1);
+    /* Bring the other CPUs up to paging before the original
+     * copy of .text gets overwritten.  We need to use the unrelocated
+     * copy of boot_gate as that's the one the others can see. */ 
+    gate_pa = ((unsigned long) &boot_gate) + boot_phys_offset;
+    gate = map_domain_page(gate_pa >> PAGE_SHIFT) + (gate_pa & ~PAGE_MASK); 
+    *gate = 0;
+    unmap_domain_page(gate);
+    /* Now send an event to wake the first non-boot CPU */
+    asm volatile("dsb; isb; sev");
+    /* And wait for them all to be ready. */
+    while ( ready_cpus + 1 < cpus )
+        smp_rmb();
+
     __set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
     set_processor_id(0); /* needed early, for smp_processor_id() */
 
-    /* TODO: smp_prepare_boot_cpu(void) */
-    cpumask_set_cpu(smp_processor_id(), &cpu_online_map);
-    cpumask_set_cpu(smp_processor_id(), &cpu_present_map);
-
     smp_prepare_cpus(max_cpus);
 
     init_xen_time();
@@ -208,8 +228,6 @@
 
     init_IRQ();
 
-    gic_init();
-
     gic_route_irqs();
 
     init_maintenance_interrupt();

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOF-0001hV-9t; Wed, 14 Mar 2012 12:33: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 1S7nOD-0001gH-J6
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:13 +0000
Received: from [85.158.143.35:13092] by server-2.bemta-4.messagelabs.com id
	83/0A-17550-900906F4; Wed, 14 Mar 2012 12:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1331728391!11578460!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28230 invoked from network); 14 Mar 2012 12:33:12 -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;
	14 Mar 2012 12:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOB-0007Tb-Cq
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOB-0008GF-BE
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:11 +0000
Message-Id: <E1S7nOB-0008GF-BE@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: start plumbing in SMP bringup
	in 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651455 0
# Node ID 0fa661b533d6106ca9678a263d9059ac667905b9
# Parent  77a77518cac153036b33f56dc8a1f9d6083459bf
arm: start plumbing in SMP bringup in C

Still a noop, but no longer just a dummy symbol.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 77a77518cac1 -r 0fa661b533d6 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Tue Mar 13 15:10:54 2012 +0000
+++ b/xen/arch/arm/dummy.S	Tue Mar 13 15:10:55 2012 +0000
@@ -7,9 +7,6 @@
 x:	mov pc, lr
 	
 /* SMP support */
-DUMMY(__cpu_die);
-DUMMY(__cpu_disable);
-DUMMY(__cpu_up);
 DUMMY(per_cpu__cpu_core_mask);
 DUMMY(per_cpu__cpu_sibling_mask);
 DUMMY(node_online_map);
diff -r 77a77518cac1 -r 0fa661b533d6 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Tue Mar 13 15:10:54 2012 +0000
+++ b/xen/arch/arm/setup.c	Tue Mar 13 15:10:55 2012 +0000
@@ -38,9 +38,6 @@
 #include <asm/setup.h>
 #include "gic.h"
 
-/* maxcpus: maximum number of CPUs to activate. */
-static unsigned int __initdata max_cpus = NR_CPUS;
-
 /* Xen stack for bringing up the first CPU. */
 unsigned char __initdata init_stack[STACK_SIZE] __attribute__((__aligned__(STACK_SIZE)));
 
@@ -204,7 +201,7 @@
     __set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
 
-    smp_prepare_cpus(max_cpus);
+    smp_prepare_cpus(cpus);
 
     init_xen_time();
 
@@ -251,7 +248,7 @@
 
     for_each_present_cpu ( i )
     {
-        if ( (num_online_cpus() < max_cpus) && !cpu_online(i) )
+        if ( (num_online_cpus() < cpus) && !cpu_online(i) )
         {
             int ret = cpu_up(i);
             if ( ret != 0 )
diff -r 77a77518cac1 -r 0fa661b533d6 xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:54 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:55 2012 +0000
@@ -19,6 +19,7 @@
 #include <xen/cpumask.h>
 #include <xen/smp.h>
 #include <xen/init.h>
+#include <xen/errno.h>
 
 cpumask_t cpu_online_map;
 EXPORT_SYMBOL(cpu_online_map);
@@ -30,16 +31,40 @@
 void __init
 smp_prepare_cpus (unsigned int max_cpus)
 {
-        set_processor_id(0); /* needed early, for smp_processor_id() */
+    int i;
+    set_processor_id(0); /* needed early, for smp_processor_id() */
 
-        cpumask_clear(&cpu_online_map);
-        cpumask_clear(&cpu_present_map);
-        cpumask_clear(&cpu_possible_map);
-        cpumask_set_cpu(0, &cpu_online_map);
-        cpumask_set_cpu(0, &cpu_present_map);
-        cpumask_set_cpu(0, &cpu_possible_map);
-        return;
+    cpumask_clear(&cpu_online_map);
+    cpumask_set_cpu(0, &cpu_online_map);
+
+    cpumask_clear(&cpu_possible_map);
+    for ( i = 0; i < max_cpus; i++ )
+        cpumask_set_cpu(i, &cpu_possible_map);
+    cpumask_copy(&cpu_present_map, &cpu_possible_map);
 }
+
+/* Bring up a non-boot CPU */
+int __cpu_up(unsigned int cpu)
+{
+    /* Not yet... */
+    return -ENODEV;
+}
+
+/* Shut down the current CPU */
+void __cpu_disable(void)
+{
+    /* TODO: take down timers, GIC, &c. */
+    BUG();
+}
+
+/* Wait for a remote CPU to die */
+void __cpu_die(unsigned int cpu)
+{
+    /* TODO: interlock with __cpu_disable */
+    BUG();
+}
+
+
 /*
  * 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 Mar 14 12:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOF-0001hV-9t; Wed, 14 Mar 2012 12:33: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 1S7nOD-0001gH-J6
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:13 +0000
Received: from [85.158.143.35:13092] by server-2.bemta-4.messagelabs.com id
	83/0A-17550-900906F4; Wed, 14 Mar 2012 12:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-21.messagelabs.com!1331728391!11578460!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28230 invoked from network); 14 Mar 2012 12:33:12 -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;
	14 Mar 2012 12:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOB-0007Tb-Cq
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOB-0008GF-BE
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:11 +0000
Message-Id: <E1S7nOB-0008GF-BE@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: start plumbing in SMP bringup
	in 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651455 0
# Node ID 0fa661b533d6106ca9678a263d9059ac667905b9
# Parent  77a77518cac153036b33f56dc8a1f9d6083459bf
arm: start plumbing in SMP bringup in C

Still a noop, but no longer just a dummy symbol.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 77a77518cac1 -r 0fa661b533d6 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Tue Mar 13 15:10:54 2012 +0000
+++ b/xen/arch/arm/dummy.S	Tue Mar 13 15:10:55 2012 +0000
@@ -7,9 +7,6 @@
 x:	mov pc, lr
 	
 /* SMP support */
-DUMMY(__cpu_die);
-DUMMY(__cpu_disable);
-DUMMY(__cpu_up);
 DUMMY(per_cpu__cpu_core_mask);
 DUMMY(per_cpu__cpu_sibling_mask);
 DUMMY(node_online_map);
diff -r 77a77518cac1 -r 0fa661b533d6 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Tue Mar 13 15:10:54 2012 +0000
+++ b/xen/arch/arm/setup.c	Tue Mar 13 15:10:55 2012 +0000
@@ -38,9 +38,6 @@
 #include <asm/setup.h>
 #include "gic.h"
 
-/* maxcpus: maximum number of CPUs to activate. */
-static unsigned int __initdata max_cpus = NR_CPUS;
-
 /* Xen stack for bringing up the first CPU. */
 unsigned char __initdata init_stack[STACK_SIZE] __attribute__((__aligned__(STACK_SIZE)));
 
@@ -204,7 +201,7 @@
     __set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
 
-    smp_prepare_cpus(max_cpus);
+    smp_prepare_cpus(cpus);
 
     init_xen_time();
 
@@ -251,7 +248,7 @@
 
     for_each_present_cpu ( i )
     {
-        if ( (num_online_cpus() < max_cpus) && !cpu_online(i) )
+        if ( (num_online_cpus() < cpus) && !cpu_online(i) )
         {
             int ret = cpu_up(i);
             if ( ret != 0 )
diff -r 77a77518cac1 -r 0fa661b533d6 xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:54 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:55 2012 +0000
@@ -19,6 +19,7 @@
 #include <xen/cpumask.h>
 #include <xen/smp.h>
 #include <xen/init.h>
+#include <xen/errno.h>
 
 cpumask_t cpu_online_map;
 EXPORT_SYMBOL(cpu_online_map);
@@ -30,16 +31,40 @@
 void __init
 smp_prepare_cpus (unsigned int max_cpus)
 {
-        set_processor_id(0); /* needed early, for smp_processor_id() */
+    int i;
+    set_processor_id(0); /* needed early, for smp_processor_id() */
 
-        cpumask_clear(&cpu_online_map);
-        cpumask_clear(&cpu_present_map);
-        cpumask_clear(&cpu_possible_map);
-        cpumask_set_cpu(0, &cpu_online_map);
-        cpumask_set_cpu(0, &cpu_present_map);
-        cpumask_set_cpu(0, &cpu_possible_map);
-        return;
+    cpumask_clear(&cpu_online_map);
+    cpumask_set_cpu(0, &cpu_online_map);
+
+    cpumask_clear(&cpu_possible_map);
+    for ( i = 0; i < max_cpus; i++ )
+        cpumask_set_cpu(i, &cpu_possible_map);
+    cpumask_copy(&cpu_present_map, &cpu_possible_map);
 }
+
+/* Bring up a non-boot CPU */
+int __cpu_up(unsigned int cpu)
+{
+    /* Not yet... */
+    return -ENODEV;
+}
+
+/* Shut down the current CPU */
+void __cpu_disable(void)
+{
+    /* TODO: take down timers, GIC, &c. */
+    BUG();
+}
+
+/* Wait for a remote CPU to die */
+void __cpu_die(unsigned int cpu)
+{
+    /* TODO: interlock with __cpu_disable */
+    BUG();
+}
+
+
 /*
  * 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 Mar 14 12:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOH-0001iu-Ma; Wed, 14 Mar 2012 12:33: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 1S7nOF-0001hE-Fc
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:15 +0000
Received: from [85.158.138.51:42819] by server-8.bemta-3.messagelabs.com id
	3C/94-13762-A00906F4; Wed, 14 Mar 2012 12:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1331728392!17561890!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8423 invoked from network); 14 Mar 2012 12:33:13 -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;
	14 Mar 2012 12:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOB-0007Te-Tt
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOB-0008Gj-SO
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:11 +0000
Message-Id: <E1S7nOB-0008Gj-SO@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Boot secondary CPUs into 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651456 0
# Node ID 7008b235d33da50fa75e3b38e5b1eb08cf38f6a4
# Parent  0fa661b533d6106ca9678a263d9059ac667905b9
arm: Boot secondary CPUs into C

Secondary CPUs come up directly onto the stack of the appropriate idle
vcpu; the boot CPU starts on a statically allocated stack and switches
over to the idle vcpu's one once the idle domain has been built.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 0fa661b533d6 -r 7008b235d33d xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Mar 13 15:10:55 2012 +0000
+++ b/xen/arch/arm/gic.c	Tue Mar 13 15:10:56 2012 +0000
@@ -245,7 +245,6 @@
 
     vtr = GICH[GICH_VTR];
     nr_lrs  = (vtr & GICH_VTR_NRLRGS) + 1;
-    printk("GICH: %d list registers available\n", nr_lrs);
 
     GICH[GICH_HCR] = GICH_HCR_EN;
     GICH[GICH_MISR] = GICH_MISR_EOI;
@@ -278,6 +277,15 @@
     return gic.cpus;
 }
 
+/* Set up the per-CPU parts of the GIC for a secondary CPU */
+void __cpuinit gic_init_secondary_cpu(void)
+{
+    spin_lock(&gic.lock);
+    gic_cpu_init();
+    gic_hyp_init();
+    spin_unlock(&gic.lock);
+}
+
 void gic_route_irqs(void)
 {
     /* XXX should get these from DT */
diff -r 0fa661b533d6 -r 7008b235d33d xen/arch/arm/gic.h
--- a/xen/arch/arm/gic.h	Tue Mar 13 15:10:55 2012 +0000
+++ b/xen/arch/arm/gic.h	Tue Mar 13 15:10:56 2012 +0000
@@ -140,6 +140,8 @@
 extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
 /* Bring up the interrupt controller, and report # cpus attached */
 extern int gic_init(void);
+/* Bring up a secondary CPU's per-CPU GIC interface */
+extern void gic_init_secondary_cpu(void);
 /* setup the gic virtual interface for a guest */
 extern void gicv_setup(struct domain *d);
 #endif
diff -r 0fa661b533d6 -r 7008b235d33d xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Tue Mar 13 15:10:55 2012 +0000
+++ b/xen/arch/arm/head.S	Tue Mar 13 15:10:56 2012 +0000
@@ -307,17 +307,23 @@
 	 * and brought up the memory allocator, non-boot CPUs can get their
 	 * own stacks and enter C. */
 1:	wfe
-	b 1b
+	dsb
+	ldr   r0, =smp_up_cpu
+	ldr   r1, [r0]               /* Which CPU is being booted? */
+	teq   r1, r12                /* Is it us? */
+	bne   1b
 
 launch:	
-	ldr   sp, =init_stack        /* Supply a stack */
+	ldr   r0, =init_stack        /* Find the boot-time stack */
+	ldr   sp, [r0]
 	add   sp, #STACK_SIZE        /* (which grows down from the top). */
 	sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
 	mov   r0, r10                /* Marshal args: - phys_offset */
 	mov   r1, r7                 /*               - machine type */
 	mov   r2, r8                 /*               - ATAG address */
-	mov   r3, r12                /*               - CPU ID */
-	b     start_xen              /* and disappear into the land of C */
+	movs  r3, r12                /*               - CPU ID */
+	beq   start_xen              /* and disappear into the land of C */
+	b     start_secondary        /* (to the appropriate entry point) */
 
 /* Fail-stop
  * r0: string explaining why */
diff -r 0fa661b533d6 -r 7008b235d33d xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Tue Mar 13 15:10:55 2012 +0000
+++ b/xen/arch/arm/setup.c	Tue Mar 13 15:10:56 2012 +0000
@@ -38,9 +38,6 @@
 #include <asm/setup.h>
 #include "gic.h"
 
-/* Xen stack for bringing up the first CPU. */
-unsigned char __initdata init_stack[STACK_SIZE] __attribute__((__aligned__(STACK_SIZE)));
-
 extern const char __init_begin[], __init_end[], __bss_start[];
 
 /* Spinlock for serializing CPU bringup */
@@ -286,7 +283,11 @@
 
     domain_unpause_by_systemcontroller(dom0);
 
-    reset_stack_and_jump(init_done);
+    /* Switch on to the dynamically allocated stack for the idle vcpu
+     * since the static one we're running on is about to be freed. */
+    memcpy(idle_vcpu[0]->arch.cpu_info, get_cpu_info(), 
+           sizeof(struct cpu_info));
+    switch_stack_and_jump(idle_vcpu[0]->arch.cpu_info, init_done);
 }
 
 void arch_get_xen_caps(xen_capabilities_info_t *info)
diff -r 0fa661b533d6 -r 7008b235d33d xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:55 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:56 2012 +0000
@@ -16,10 +16,15 @@
  * GNU General Public License for more details.
  */
 
+#include <xen/cpu.h>
 #include <xen/cpumask.h>
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/sched.h>
 #include <xen/smp.h>
-#include <xen/init.h>
-#include <xen/errno.h>
+#include <xen/softirq.h>
+#include "gic.h"
 
 cpumask_t cpu_online_map;
 EXPORT_SYMBOL(cpu_online_map);
@@ -28,6 +33,13 @@
 cpumask_t cpu_possible_map;
 EXPORT_SYMBOL(cpu_possible_map);
 
+/* Xen stack for bringing up the first CPU. */
+static unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
+       __attribute__((__aligned__(STACK_SIZE)));
+
+/* Pointer to the stack, used by head.S when entering C */
+unsigned char *init_stack = cpu0_boot_stack;
+
 void __init
 smp_prepare_cpus (unsigned int max_cpus)
 {
@@ -43,11 +55,43 @@
     cpumask_copy(&cpu_present_map, &cpu_possible_map);
 }
 
-/* Bring up a non-boot CPU */
-int __cpu_up(unsigned int cpu)
+/* Shared state for coordinating CPU bringup */
+unsigned long smp_up_cpu = 0;
+
+/* Boot the current CPU */
+void __cpuinit start_secondary(unsigned long boot_phys_offset,
+                               unsigned long arm_type,
+                               unsigned long atag_paddr,
+                               unsigned long cpuid)
 {
-    /* Not yet... */
-    return -ENODEV;
+    memset(get_cpu_info(), 0, sizeof (struct cpu_info));
+
+    /* TODO: handle boards where CPUIDs are not contiguous */
+    set_processor_id(cpuid);
+
+    /* Setup Hyp vector base */
+    WRITE_CP32((uint32_t) hyp_traps_vector, HVBAR);
+
+    dprintk(XENLOG_DEBUG, "CPU %li awake.\n", cpuid);
+
+    gic_init_secondary_cpu();
+
+    set_current(idle_vcpu[cpuid]);
+    this_cpu(curr_vcpu) = current;
+
+    /* Run local notifiers */
+    notify_cpu_starting(cpuid);
+    wmb();
+
+    /* Now report this CPU is up */
+    cpumask_set_cpu(cpuid, &cpu_online_map);
+    wmb();
+
+    local_irq_enable();
+
+    dprintk(XENLOG_DEBUG, "CPU %li booted.\n", cpuid);
+
+    startup_cpu_idle_loop();
 }
 
 /* Shut down the current CPU */
@@ -57,6 +101,26 @@
     BUG();
 }
 
+/* Bring up a remote CPU */
+int __cpu_up(unsigned int cpu)
+{
+    /* Tell the remote CPU which stack to boot on. */
+    init_stack = idle_vcpu[cpu]->arch.stack;
+
+    /* Unblock the CPU.  It should be waiting in the loop in head.S
+     * for an event to arrive when smp_up_cpu matches its cpuid. */
+    smp_up_cpu = cpu;
+    asm volatile("dsb; isb; sev");
+
+    while ( !cpu_online(cpu) )
+    {
+        cpu_relax();
+        process_pending_softirqs();
+    }
+
+    return 0;
+}
+
 /* Wait for a remote CPU to die */
 void __cpu_die(unsigned int cpu)
 {
diff -r 0fa661b533d6 -r 7008b235d33d xen/include/asm-arm/current.h
--- a/xen/include/asm-arm/current.h	Tue Mar 13 15:10:55 2012 +0000
+++ b/xen/include/asm-arm/current.h	Tue Mar 13 15:10:56 2012 +0000
@@ -49,10 +49,10 @@
 
 #define guest_cpu_user_regs() (&get_cpu_info()->guest_cpu_user_regs)
 
-#define reset_stack_and_jump(__fn)              \
-    __asm__ __volatile__ (                      \
-        "mov sp,%0; b "STR(__fn)      \
-        : : "r" (guest_cpu_user_regs()) : "memory" )
+#define switch_stack_and_jump(stack, fn)                                \
+    asm volatile ("mov sp,%0; b " STR(fn) : : "r" (stack) : "memory" )
+
+#define reset_stack_and_jump(fn) switch_stack_and_jump(get_cpu_info(), fn)
 
 #endif
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOH-0001iu-Ma; Wed, 14 Mar 2012 12:33: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 1S7nOF-0001hE-Fc
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:15 +0000
Received: from [85.158.138.51:42819] by server-8.bemta-3.messagelabs.com id
	3C/94-13762-A00906F4; Wed, 14 Mar 2012 12:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1331728392!17561890!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8423 invoked from network); 14 Mar 2012 12:33:13 -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;
	14 Mar 2012 12:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOB-0007Te-Tt
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOB-0008Gj-SO
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:11 +0000
Message-Id: <E1S7nOB-0008Gj-SO@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Boot secondary CPUs into 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651456 0
# Node ID 7008b235d33da50fa75e3b38e5b1eb08cf38f6a4
# Parent  0fa661b533d6106ca9678a263d9059ac667905b9
arm: Boot secondary CPUs into C

Secondary CPUs come up directly onto the stack of the appropriate idle
vcpu; the boot CPU starts on a statically allocated stack and switches
over to the idle vcpu's one once the idle domain has been built.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 0fa661b533d6 -r 7008b235d33d xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Mar 13 15:10:55 2012 +0000
+++ b/xen/arch/arm/gic.c	Tue Mar 13 15:10:56 2012 +0000
@@ -245,7 +245,6 @@
 
     vtr = GICH[GICH_VTR];
     nr_lrs  = (vtr & GICH_VTR_NRLRGS) + 1;
-    printk("GICH: %d list registers available\n", nr_lrs);
 
     GICH[GICH_HCR] = GICH_HCR_EN;
     GICH[GICH_MISR] = GICH_MISR_EOI;
@@ -278,6 +277,15 @@
     return gic.cpus;
 }
 
+/* Set up the per-CPU parts of the GIC for a secondary CPU */
+void __cpuinit gic_init_secondary_cpu(void)
+{
+    spin_lock(&gic.lock);
+    gic_cpu_init();
+    gic_hyp_init();
+    spin_unlock(&gic.lock);
+}
+
 void gic_route_irqs(void)
 {
     /* XXX should get these from DT */
diff -r 0fa661b533d6 -r 7008b235d33d xen/arch/arm/gic.h
--- a/xen/arch/arm/gic.h	Tue Mar 13 15:10:55 2012 +0000
+++ b/xen/arch/arm/gic.h	Tue Mar 13 15:10:56 2012 +0000
@@ -140,6 +140,8 @@
 extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
 /* Bring up the interrupt controller, and report # cpus attached */
 extern int gic_init(void);
+/* Bring up a secondary CPU's per-CPU GIC interface */
+extern void gic_init_secondary_cpu(void);
 /* setup the gic virtual interface for a guest */
 extern void gicv_setup(struct domain *d);
 #endif
diff -r 0fa661b533d6 -r 7008b235d33d xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Tue Mar 13 15:10:55 2012 +0000
+++ b/xen/arch/arm/head.S	Tue Mar 13 15:10:56 2012 +0000
@@ -307,17 +307,23 @@
 	 * and brought up the memory allocator, non-boot CPUs can get their
 	 * own stacks and enter C. */
 1:	wfe
-	b 1b
+	dsb
+	ldr   r0, =smp_up_cpu
+	ldr   r1, [r0]               /* Which CPU is being booted? */
+	teq   r1, r12                /* Is it us? */
+	bne   1b
 
 launch:	
-	ldr   sp, =init_stack        /* Supply a stack */
+	ldr   r0, =init_stack        /* Find the boot-time stack */
+	ldr   sp, [r0]
 	add   sp, #STACK_SIZE        /* (which grows down from the top). */
 	sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
 	mov   r0, r10                /* Marshal args: - phys_offset */
 	mov   r1, r7                 /*               - machine type */
 	mov   r2, r8                 /*               - ATAG address */
-	mov   r3, r12                /*               - CPU ID */
-	b     start_xen              /* and disappear into the land of C */
+	movs  r3, r12                /*               - CPU ID */
+	beq   start_xen              /* and disappear into the land of C */
+	b     start_secondary        /* (to the appropriate entry point) */
 
 /* Fail-stop
  * r0: string explaining why */
diff -r 0fa661b533d6 -r 7008b235d33d xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Tue Mar 13 15:10:55 2012 +0000
+++ b/xen/arch/arm/setup.c	Tue Mar 13 15:10:56 2012 +0000
@@ -38,9 +38,6 @@
 #include <asm/setup.h>
 #include "gic.h"
 
-/* Xen stack for bringing up the first CPU. */
-unsigned char __initdata init_stack[STACK_SIZE] __attribute__((__aligned__(STACK_SIZE)));
-
 extern const char __init_begin[], __init_end[], __bss_start[];
 
 /* Spinlock for serializing CPU bringup */
@@ -286,7 +283,11 @@
 
     domain_unpause_by_systemcontroller(dom0);
 
-    reset_stack_and_jump(init_done);
+    /* Switch on to the dynamically allocated stack for the idle vcpu
+     * since the static one we're running on is about to be freed. */
+    memcpy(idle_vcpu[0]->arch.cpu_info, get_cpu_info(), 
+           sizeof(struct cpu_info));
+    switch_stack_and_jump(idle_vcpu[0]->arch.cpu_info, init_done);
 }
 
 void arch_get_xen_caps(xen_capabilities_info_t *info)
diff -r 0fa661b533d6 -r 7008b235d33d xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:55 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:56 2012 +0000
@@ -16,10 +16,15 @@
  * GNU General Public License for more details.
  */
 
+#include <xen/cpu.h>
 #include <xen/cpumask.h>
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/sched.h>
 #include <xen/smp.h>
-#include <xen/init.h>
-#include <xen/errno.h>
+#include <xen/softirq.h>
+#include "gic.h"
 
 cpumask_t cpu_online_map;
 EXPORT_SYMBOL(cpu_online_map);
@@ -28,6 +33,13 @@
 cpumask_t cpu_possible_map;
 EXPORT_SYMBOL(cpu_possible_map);
 
+/* Xen stack for bringing up the first CPU. */
+static unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
+       __attribute__((__aligned__(STACK_SIZE)));
+
+/* Pointer to the stack, used by head.S when entering C */
+unsigned char *init_stack = cpu0_boot_stack;
+
 void __init
 smp_prepare_cpus (unsigned int max_cpus)
 {
@@ -43,11 +55,43 @@
     cpumask_copy(&cpu_present_map, &cpu_possible_map);
 }
 
-/* Bring up a non-boot CPU */
-int __cpu_up(unsigned int cpu)
+/* Shared state for coordinating CPU bringup */
+unsigned long smp_up_cpu = 0;
+
+/* Boot the current CPU */
+void __cpuinit start_secondary(unsigned long boot_phys_offset,
+                               unsigned long arm_type,
+                               unsigned long atag_paddr,
+                               unsigned long cpuid)
 {
-    /* Not yet... */
-    return -ENODEV;
+    memset(get_cpu_info(), 0, sizeof (struct cpu_info));
+
+    /* TODO: handle boards where CPUIDs are not contiguous */
+    set_processor_id(cpuid);
+
+    /* Setup Hyp vector base */
+    WRITE_CP32((uint32_t) hyp_traps_vector, HVBAR);
+
+    dprintk(XENLOG_DEBUG, "CPU %li awake.\n", cpuid);
+
+    gic_init_secondary_cpu();
+
+    set_current(idle_vcpu[cpuid]);
+    this_cpu(curr_vcpu) = current;
+
+    /* Run local notifiers */
+    notify_cpu_starting(cpuid);
+    wmb();
+
+    /* Now report this CPU is up */
+    cpumask_set_cpu(cpuid, &cpu_online_map);
+    wmb();
+
+    local_irq_enable();
+
+    dprintk(XENLOG_DEBUG, "CPU %li booted.\n", cpuid);
+
+    startup_cpu_idle_loop();
 }
 
 /* Shut down the current CPU */
@@ -57,6 +101,26 @@
     BUG();
 }
 
+/* Bring up a remote CPU */
+int __cpu_up(unsigned int cpu)
+{
+    /* Tell the remote CPU which stack to boot on. */
+    init_stack = idle_vcpu[cpu]->arch.stack;
+
+    /* Unblock the CPU.  It should be waiting in the loop in head.S
+     * for an event to arrive when smp_up_cpu matches its cpuid. */
+    smp_up_cpu = cpu;
+    asm volatile("dsb; isb; sev");
+
+    while ( !cpu_online(cpu) )
+    {
+        cpu_relax();
+        process_pending_softirqs();
+    }
+
+    return 0;
+}
+
 /* Wait for a remote CPU to die */
 void __cpu_die(unsigned int cpu)
 {
diff -r 0fa661b533d6 -r 7008b235d33d xen/include/asm-arm/current.h
--- a/xen/include/asm-arm/current.h	Tue Mar 13 15:10:55 2012 +0000
+++ b/xen/include/asm-arm/current.h	Tue Mar 13 15:10:56 2012 +0000
@@ -49,10 +49,10 @@
 
 #define guest_cpu_user_regs() (&get_cpu_info()->guest_cpu_user_regs)
 
-#define reset_stack_and_jump(__fn)              \
-    __asm__ __volatile__ (                      \
-        "mov sp,%0; b "STR(__fn)      \
-        : : "r" (guest_cpu_user_regs()) : "memory" )
+#define switch_stack_and_jump(stack, fn)                                \
+    asm volatile ("mov sp,%0; b " STR(fn) : : "r" (stack) : "memory" )
+
+#define reset_stack_and_jump(fn) switch_stack_and_jump(get_cpu_info(), fn)
 
 #endif
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOJ-0001kN-0O; Wed, 14 Mar 2012 12:33: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 1S7nOG-0001gH-QY
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:16 +0000
Received: from [85.158.143.99:36923] by server-2.bemta-4.messagelabs.com id
	30/3A-17550-C00906F4; Wed, 14 Mar 2012 12:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1331728394!13888744!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21212 invoked from network); 14 Mar 2012 12:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Mar 2012 12:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOE-0007Tt-IU
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOE-0008J4-Gq
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:14 +0000
Message-Id: <E1S7nOE-0008J4-Gq@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Put the CPU into a sleep state
	in the idle loop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651460 0
# Node ID 773d0367087212c43faf8cdcc21cf443b1ea0046
# Parent  a9f64424f76fd8df233297589e6070f2f557251c
arm: Put the CPU into a sleep state in the idle loop

The ARM doesn't actually say that the WFI instruction will return
immediately if CPSR.I is clear and an instruction is pending, but
this seems to match up with how linux uses it.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r a9f64424f76f -r 773d03670872 xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Tue Mar 13 15:10:59 2012 +0000
+++ b/xen/arch/arm/domain.c	Tue Mar 13 15:11:00 2012 +0000
@@ -34,7 +34,11 @@
         if ( cpu_is_offline(smp_processor_id()) )
             stop_cpu();
 
-        /* TODO: (*pm_idle)(); */
+        local_irq_disable();
+        if ( cpu_is_haltable(smp_processor_id()) )
+            asm volatile ("dsb; wfi");
+        local_irq_enable();
+
         do_tasklet();
         do_softirq();
     }

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOJ-0001kN-0O; Wed, 14 Mar 2012 12:33: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 1S7nOG-0001gH-QY
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:16 +0000
Received: from [85.158.143.99:36923] by server-2.bemta-4.messagelabs.com id
	30/3A-17550-C00906F4; Wed, 14 Mar 2012 12:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1331728394!13888744!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 21212 invoked from network); 14 Mar 2012 12:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Mar 2012 12:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOE-0007Tt-IU
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOE-0008J4-Gq
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:14 +0000
Message-Id: <E1S7nOE-0008J4-Gq@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Put the CPU into a sleep state
	in the idle loop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651460 0
# Node ID 773d0367087212c43faf8cdcc21cf443b1ea0046
# Parent  a9f64424f76fd8df233297589e6070f2f557251c
arm: Put the CPU into a sleep state in the idle loop

The ARM doesn't actually say that the WFI instruction will return
immediately if CPSR.I is clear and an instruction is pending, but
this seems to match up with how linux uses it.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r a9f64424f76f -r 773d03670872 xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Tue Mar 13 15:10:59 2012 +0000
+++ b/xen/arch/arm/domain.c	Tue Mar 13 15:11:00 2012 +0000
@@ -34,7 +34,11 @@
         if ( cpu_is_offline(smp_processor_id()) )
             stop_cpu();
 
-        /* TODO: (*pm_idle)(); */
+        local_irq_disable();
+        if ( cpu_is_haltable(smp_processor_id()) )
+            asm volatile ("dsb; wfi");
+        local_irq_enable();
+
         do_tasklet();
         do_softirq();
     }

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOJ-0001l0-7I; Wed, 14 Mar 2012 12:33:19 +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 1S7nOH-0001iE-9p
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:17 +0000
Received: from [193.109.254.147:4432] by server-7.bemta-14.messagelabs.com id
	BD/46-09610-C00906F4; Wed, 14 Mar 2012 12:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1331728394!504030!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16045 invoked from network); 14 Mar 2012 12:33:15 -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;
	14 Mar 2012 12:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOE-0007Tq-1e
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOE-0008Ib-0D
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:14 +0000
Message-Id: <E1S7nOE-0008Ib-0D@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Actually free __init/__initdata
	ranges on boot
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651459 0
# Node ID a9f64424f76fd8df233297589e6070f2f557251c
# Parent  4e448a7d4c0e9e5a034539a4590751aa4c28902a
arm: Actually free __init/__initdata ranges on boot

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4e448a7d4c0e -r a9f64424f76f xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Tue Mar 13 15:10:58 2012 +0000
+++ b/xen/arch/arm/mm.c	Tue Mar 13 15:10:59 2012 +0000
@@ -48,6 +48,8 @@
 
 unsigned long max_page;
 
+extern char __init_begin[], __init_end[];
+
 /* Map a 4k page in a fixmap entry */
 void set_fixmap(unsigned map, unsigned long mfn, unsigned attributes)
 {
@@ -205,17 +207,7 @@
     /* Undo the temporary map */
     pte.bits = 0;
     write_pte(xen_second + second_table_offset(dest_va), pte);
-    /*
-     * Have removed a mapping previously used for .text. Flush everything
-     * for safety.
-     */
-    asm volatile (
-        "dsb;"                        /* Ensure visibility of PTE write */
-        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
-        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
-        "dsb;"                        /* Ensure completion of TLB+BP flush */
-        "isb;"
-        : : "r" (i /*dummy*/) : "memory");
+    flush_xen_text_tlb();
 
     /* Link in the fixmap pagetable */
     pte = mfn_to_xen_entry((((unsigned long) xen_fixmap) + phys_offset)
@@ -251,13 +243,7 @@
     pte.pt.table = 1;
     write_pte(xen_second + second_linear_offset(XEN_VIRT_START), pte);
     /* Have changed a mapping used for .text. Flush everything for safety. */
-    asm volatile (
-        "dsb;"                        /* Ensure visibility of PTE write */
-        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
-        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
-        "dsb;"                        /* Ensure completion of TLB+BP flush */
-        "isb;"
-        : : "r" (i /*dummy*/) : "memory");
+    flush_xen_text_tlb();
 
     /* From now on, no mapping may be both writable and executable. */
     WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
@@ -328,6 +314,64 @@
     frametable_virt_end = FRAMETABLE_VIRT_START + (nr_pages * sizeof(struct page_info));
 }
 
+enum mg { mg_clear, mg_ro, mg_rw, mg_rx };
+static void set_pte_flags_on_range(const char *p, unsigned long l, enum mg mg)
+{
+    lpae_t pte;
+    int i;
+
+    ASSERT(is_kernel(p) && is_kernel(p + l));
+
+    /* Can only guard in page granularity */
+    ASSERT(!((unsigned long) p & ~PAGE_MASK));
+    ASSERT(!(l & ~PAGE_MASK));
+
+    for ( i = (p - _start) / PAGE_SIZE; 
+          i < (p + l - _start) / PAGE_SIZE; 
+          i++ )
+    {
+        pte = xen_xenmap[i];
+        switch ( mg )
+        {
+        case mg_clear:
+            pte.pt.valid = 0;
+            break;
+        case mg_ro:
+            pte.pt.valid = 1;
+            pte.pt.pxn = 1;
+            pte.pt.xn = 1;
+            pte.pt.ro = 1;
+            break;
+        case mg_rw:
+            pte.pt.valid = 1;
+            pte.pt.pxn = 1;
+            pte.pt.xn = 1;
+            pte.pt.ro = 0;
+            break;
+        case mg_rx:
+            pte.pt.valid = 1;
+            pte.pt.pxn = 0;
+            pte.pt.xn = 0;
+            pte.pt.ro = 1;
+            break;
+        }
+        write_pte(xen_xenmap + i, pte);
+    }
+    flush_xen_text_tlb();
+}
+
+/* Release all __init and __initdata ranges to be reused */
+void free_init_memory(void)
+{
+    paddr_t pa = virt_to_maddr(__init_begin);
+    unsigned long len = __init_end - __init_begin;
+    set_pte_flags_on_range(__init_begin, len, mg_rw);
+    memset(__init_begin, 0xcc, len);
+    set_pte_flags_on_range(__init_begin, len, mg_clear);
+    init_domheap_pages(pa, pa + len);
+    printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
+}
+
 void arch_dump_shared_mem_info(void)
 {
 }
diff -r 4e448a7d4c0e -r a9f64424f76f xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Tue Mar 13 15:10:58 2012 +0000
+++ b/xen/arch/arm/setup.c	Tue Mar 13 15:10:59 2012 +0000
@@ -38,8 +38,6 @@
 #include <asm/setup.h>
 #include "gic.h"
 
-extern const char __init_begin[], __init_end[], __bss_start[];
-
 /* Spinlock for serializing CPU bringup */
 unsigned long __initdata boot_gate = 1;
 /* Number of non-boot CPUs ready to enter C */
@@ -47,12 +45,7 @@
 
 static __attribute_used__ void init_done(void)
 {
-    /* TODO: free (or page-protect) the init areas.
-       memset(__init_begin, 0xcc, __init_end - __init_begin);
-       free_xen_data(__init_begin, __init_end);
-    */
-    printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
-
+    free_init_memory();
     startup_cpu_idle_loop();
 }
 
diff -r 4e448a7d4c0e -r a9f64424f76f xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Tue Mar 13 15:10:58 2012 +0000
+++ b/xen/include/asm-arm/mm.h	Tue Mar 13 15:10:59 2012 +0000
@@ -278,6 +278,10 @@
 #define memguard_guard_stack(_p)       ((void)0)
 #define memguard_guard_range(_p,_l)    ((void)0)
 #define memguard_unguard_range(_p,_l)  ((void)0)
+
+/* Release all __init and __initdata ranges to be reused */
+void free_init_memory(void);
+
 int guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
                                           unsigned int order);
 
diff -r 4e448a7d4c0e -r a9f64424f76f xen/include/asm-arm/page.h
--- a/xen/include/asm-arm/page.h	Tue Mar 13 15:10:58 2012 +0000
+++ b/xen/include/asm-arm/page.h	Tue Mar 13 15:10:59 2012 +0000
@@ -203,6 +203,22 @@
 }
 
 /*
+ * Flush all hypervisor mappings from the TLB and branch predictor.
+ * This is needed after changing Xen code mappings. 
+ */
+static inline void flush_xen_text_tlb(void)
+{
+    register unsigned long r0 asm ("r0");
+    asm volatile (
+        "dsb;"                        /* Ensure visibility of PTE writes */
+        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
+        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
+        "dsb;"                        /* Ensure completion of TLB+BP flush */
+        "isb;"
+        : : "r" (r0) /*dummy*/ : "memory");
+}
+
+/*
  * Flush all hypervisor mappings from the data TLB. This is not
  * sufficient when changing code mappings or for self modifying code.
  */

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOJ-0001l0-7I; Wed, 14 Mar 2012 12:33:19 +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 1S7nOH-0001iE-9p
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:17 +0000
Received: from [193.109.254.147:4432] by server-7.bemta-14.messagelabs.com id
	BD/46-09610-C00906F4; Wed, 14 Mar 2012 12:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-27.messagelabs.com!1331728394!504030!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16045 invoked from network); 14 Mar 2012 12:33:15 -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;
	14 Mar 2012 12:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOE-0007Tq-1e
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOE-0008Ib-0D
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:14 +0000
Message-Id: <E1S7nOE-0008Ib-0D@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: Actually free __init/__initdata
	ranges on boot
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651459 0
# Node ID a9f64424f76fd8df233297589e6070f2f557251c
# Parent  4e448a7d4c0e9e5a034539a4590751aa4c28902a
arm: Actually free __init/__initdata ranges on boot

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4e448a7d4c0e -r a9f64424f76f xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Tue Mar 13 15:10:58 2012 +0000
+++ b/xen/arch/arm/mm.c	Tue Mar 13 15:10:59 2012 +0000
@@ -48,6 +48,8 @@
 
 unsigned long max_page;
 
+extern char __init_begin[], __init_end[];
+
 /* Map a 4k page in a fixmap entry */
 void set_fixmap(unsigned map, unsigned long mfn, unsigned attributes)
 {
@@ -205,17 +207,7 @@
     /* Undo the temporary map */
     pte.bits = 0;
     write_pte(xen_second + second_table_offset(dest_va), pte);
-    /*
-     * Have removed a mapping previously used for .text. Flush everything
-     * for safety.
-     */
-    asm volatile (
-        "dsb;"                        /* Ensure visibility of PTE write */
-        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
-        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
-        "dsb;"                        /* Ensure completion of TLB+BP flush */
-        "isb;"
-        : : "r" (i /*dummy*/) : "memory");
+    flush_xen_text_tlb();
 
     /* Link in the fixmap pagetable */
     pte = mfn_to_xen_entry((((unsigned long) xen_fixmap) + phys_offset)
@@ -251,13 +243,7 @@
     pte.pt.table = 1;
     write_pte(xen_second + second_linear_offset(XEN_VIRT_START), pte);
     /* Have changed a mapping used for .text. Flush everything for safety. */
-    asm volatile (
-        "dsb;"                        /* Ensure visibility of PTE write */
-        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
-        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
-        "dsb;"                        /* Ensure completion of TLB+BP flush */
-        "isb;"
-        : : "r" (i /*dummy*/) : "memory");
+    flush_xen_text_tlb();
 
     /* From now on, no mapping may be both writable and executable. */
     WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
@@ -328,6 +314,64 @@
     frametable_virt_end = FRAMETABLE_VIRT_START + (nr_pages * sizeof(struct page_info));
 }
 
+enum mg { mg_clear, mg_ro, mg_rw, mg_rx };
+static void set_pte_flags_on_range(const char *p, unsigned long l, enum mg mg)
+{
+    lpae_t pte;
+    int i;
+
+    ASSERT(is_kernel(p) && is_kernel(p + l));
+
+    /* Can only guard in page granularity */
+    ASSERT(!((unsigned long) p & ~PAGE_MASK));
+    ASSERT(!(l & ~PAGE_MASK));
+
+    for ( i = (p - _start) / PAGE_SIZE; 
+          i < (p + l - _start) / PAGE_SIZE; 
+          i++ )
+    {
+        pte = xen_xenmap[i];
+        switch ( mg )
+        {
+        case mg_clear:
+            pte.pt.valid = 0;
+            break;
+        case mg_ro:
+            pte.pt.valid = 1;
+            pte.pt.pxn = 1;
+            pte.pt.xn = 1;
+            pte.pt.ro = 1;
+            break;
+        case mg_rw:
+            pte.pt.valid = 1;
+            pte.pt.pxn = 1;
+            pte.pt.xn = 1;
+            pte.pt.ro = 0;
+            break;
+        case mg_rx:
+            pte.pt.valid = 1;
+            pte.pt.pxn = 0;
+            pte.pt.xn = 0;
+            pte.pt.ro = 1;
+            break;
+        }
+        write_pte(xen_xenmap + i, pte);
+    }
+    flush_xen_text_tlb();
+}
+
+/* Release all __init and __initdata ranges to be reused */
+void free_init_memory(void)
+{
+    paddr_t pa = virt_to_maddr(__init_begin);
+    unsigned long len = __init_end - __init_begin;
+    set_pte_flags_on_range(__init_begin, len, mg_rw);
+    memset(__init_begin, 0xcc, len);
+    set_pte_flags_on_range(__init_begin, len, mg_clear);
+    init_domheap_pages(pa, pa + len);
+    printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
+}
+
 void arch_dump_shared_mem_info(void)
 {
 }
diff -r 4e448a7d4c0e -r a9f64424f76f xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Tue Mar 13 15:10:58 2012 +0000
+++ b/xen/arch/arm/setup.c	Tue Mar 13 15:10:59 2012 +0000
@@ -38,8 +38,6 @@
 #include <asm/setup.h>
 #include "gic.h"
 
-extern const char __init_begin[], __init_end[], __bss_start[];
-
 /* Spinlock for serializing CPU bringup */
 unsigned long __initdata boot_gate = 1;
 /* Number of non-boot CPUs ready to enter C */
@@ -47,12 +45,7 @@
 
 static __attribute_used__ void init_done(void)
 {
-    /* TODO: free (or page-protect) the init areas.
-       memset(__init_begin, 0xcc, __init_end - __init_begin);
-       free_xen_data(__init_begin, __init_end);
-    */
-    printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
-
+    free_init_memory();
     startup_cpu_idle_loop();
 }
 
diff -r 4e448a7d4c0e -r a9f64424f76f xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Tue Mar 13 15:10:58 2012 +0000
+++ b/xen/include/asm-arm/mm.h	Tue Mar 13 15:10:59 2012 +0000
@@ -278,6 +278,10 @@
 #define memguard_guard_stack(_p)       ((void)0)
 #define memguard_guard_range(_p,_l)    ((void)0)
 #define memguard_unguard_range(_p,_l)  ((void)0)
+
+/* Release all __init and __initdata ranges to be reused */
+void free_init_memory(void);
+
 int guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
                                           unsigned int order);
 
diff -r 4e448a7d4c0e -r a9f64424f76f xen/include/asm-arm/page.h
--- a/xen/include/asm-arm/page.h	Tue Mar 13 15:10:58 2012 +0000
+++ b/xen/include/asm-arm/page.h	Tue Mar 13 15:10:59 2012 +0000
@@ -203,6 +203,22 @@
 }
 
 /*
+ * Flush all hypervisor mappings from the TLB and branch predictor.
+ * This is needed after changing Xen code mappings. 
+ */
+static inline void flush_xen_text_tlb(void)
+{
+    register unsigned long r0 asm ("r0");
+    asm volatile (
+        "dsb;"                        /* Ensure visibility of PTE writes */
+        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
+        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
+        "dsb;"                        /* Ensure completion of TLB+BP flush */
+        "isb;"
+        : : "r" (r0) /*dummy*/ : "memory");
+}
+
+/*
  * Flush all hypervisor mappings from the data TLB. This is not
  * sufficient when changing code mappings or for self modifying code.
  */

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOI-0001jm-Rl; Wed, 14 Mar 2012 12:33: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 1S7nOG-0001hp-Jg
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:16 +0000
Received: from [85.158.138.51:42903] by server-2.bemta-3.messagelabs.com id
	07/F2-28206-B00906F4; Wed, 14 Mar 2012 12:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1331728393!6592519!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29435 invoked from network); 14 Mar 2012 12:33:15 -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;
	14 Mar 2012 12:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOD-0007Tn-Gt
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOD-0008I9-Fl
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:13 +0000
Message-Id: <E1S7nOD-0008I9-Fl@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: new hook for late MMU setup on
	secondary 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651458 0
# Node ID 4e448a7d4c0e9e5a034539a4590751aa4c28902a
# Parent  1e5da26611f36b90c70b3827edc33caa26bd7942
arm: new hook for late MMU setup on secondary CPUs

The boot CPU turns on W^X in setup_pagetables().  Do the same for other
CPUs after they boot.  If we go to per-CPU pagetables, this is where
that will happen.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 1e5da26611f3 -r 4e448a7d4c0e xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Tue Mar 13 15:10:57 2012 +0000
+++ b/xen/arch/arm/mm.c	Tue Mar 13 15:10:58 2012 +0000
@@ -263,6 +263,13 @@
     WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
 }
 
+/* MMU setup for secondary CPUS (which already have paging enabled) */
+void __cpuinit mmu_init_secondary_cpu(void)
+{
+    /* From now on, no mapping may be both writable and executable. */
+    WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
+}
+
 /* Create Xen's mappings of memory.
  * Base and virt must be 32MB aligned and size a multiple of 32MB. */
 static void __init create_mappings(unsigned long virt,
diff -r 1e5da26611f3 -r 4e448a7d4c0e xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:57 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:58 2012 +0000
@@ -76,6 +76,7 @@
 
     dprintk(XENLOG_DEBUG, "CPU %li awake.\n", cpuid);
 
+    mmu_init_secondary_cpu();
     gic_init_secondary_cpu();
 
     set_current(idle_vcpu[cpuid]);
diff -r 1e5da26611f3 -r 4e448a7d4c0e xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Tue Mar 13 15:10:57 2012 +0000
+++ b/xen/include/asm-arm/mm.h	Tue Mar 13 15:10:58 2012 +0000
@@ -136,6 +136,8 @@
 
 /* Boot-time pagetable setup */
 extern void setup_pagetables(unsigned long boot_phys_offset);
+/* 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.
  * Base must be 32MB aligned and size a multiple of 32MB. */
 extern void setup_xenheap_mappings(unsigned long base_mfn, unsigned long nr_mfns);

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOI-0001jm-Rl; Wed, 14 Mar 2012 12:33: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 1S7nOG-0001hp-Jg
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:16 +0000
Received: from [85.158.138.51:42903] by server-2.bemta-3.messagelabs.com id
	07/F2-28206-B00906F4; Wed, 14 Mar 2012 12:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1331728393!6592519!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29435 invoked from network); 14 Mar 2012 12:33:15 -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;
	14 Mar 2012 12:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOD-0007Tn-Gt
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOD-0008I9-Fl
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:13 +0000
Message-Id: <E1S7nOD-0008I9-Fl@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: new hook for late MMU setup on
	secondary 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331651458 0
# Node ID 4e448a7d4c0e9e5a034539a4590751aa4c28902a
# Parent  1e5da26611f36b90c70b3827edc33caa26bd7942
arm: new hook for late MMU setup on secondary CPUs

The boot CPU turns on W^X in setup_pagetables().  Do the same for other
CPUs after they boot.  If we go to per-CPU pagetables, this is where
that will happen.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 1e5da26611f3 -r 4e448a7d4c0e xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Tue Mar 13 15:10:57 2012 +0000
+++ b/xen/arch/arm/mm.c	Tue Mar 13 15:10:58 2012 +0000
@@ -263,6 +263,13 @@
     WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
 }
 
+/* MMU setup for secondary CPUS (which already have paging enabled) */
+void __cpuinit mmu_init_secondary_cpu(void)
+{
+    /* From now on, no mapping may be both writable and executable. */
+    WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
+}
+
 /* Create Xen's mappings of memory.
  * Base and virt must be 32MB aligned and size a multiple of 32MB. */
 static void __init create_mappings(unsigned long virt,
diff -r 1e5da26611f3 -r 4e448a7d4c0e xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:57 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Tue Mar 13 15:10:58 2012 +0000
@@ -76,6 +76,7 @@
 
     dprintk(XENLOG_DEBUG, "CPU %li awake.\n", cpuid);
 
+    mmu_init_secondary_cpu();
     gic_init_secondary_cpu();
 
     set_current(idle_vcpu[cpuid]);
diff -r 1e5da26611f3 -r 4e448a7d4c0e xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Tue Mar 13 15:10:57 2012 +0000
+++ b/xen/include/asm-arm/mm.h	Tue Mar 13 15:10:58 2012 +0000
@@ -136,6 +136,8 @@
 
 /* Boot-time pagetable setup */
 extern void setup_pagetables(unsigned long boot_phys_offset);
+/* 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.
  * Base must be 32MB aligned and size a multiple of 32MB. */
 extern void setup_xenheap_mappings(unsigned long base_mfn, unsigned long nr_mfns);

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOJ-0001lV-GR; Wed, 14 Mar 2012 12:33: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 1S7nOI-0001j2-Bi
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:18 +0000
Received: from [85.158.139.83:14251] by server-2.bemta-5.messagelabs.com id
	1F/82-17016-D00906F4; Wed, 14 Mar 2012 12:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1331728395!18427282!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25487 invoked from network); 14 Mar 2012 12:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Mar 2012 12:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOF-0007Tw-4U
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOF-0008JX-2m
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:15 +0000
Message-Id: <E1S7nOF-0008JX-2m@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] autoconf: add check for curses
	library
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1331652215 0
# Node ID 703a339e11abf1ea14ee528f4194b308fcb3ea88
# Parent  5d20d2f6ffed0a49f030f04a8870f1926babbcbf
autoconf: add check for curses library

Check for a curses compatible library (curses or ncurses basically).
One of those is needed to compile Xen tools (gtraceview and xentop).

Modify Makefiles/sources to use configure output (fetch CURSES_LIBS
from tools/Tools.mk and header to include from tools/config.h)

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 5d20d2f6ffed -r 703a339e11ab config/NetBSD.mk
--- a/config/NetBSD.mk	Fri Mar 09 16:54:24 2012 +0000
+++ b/config/NetBSD.mk	Tue Mar 13 15:23:35 2012 +0000
@@ -1,8 +1,6 @@
 include $(XEN_ROOT)/config/StdGNU.mk
 
 # Override settings for this OS
-CURSES_LIBS = -lcurses
-
 LIBLEAFDIR_x86_64 = lib
 LIBEXEC = $(PREFIX)/libexec
 PRIVATE_BINDIR = $(BINDIR)
diff -r 5d20d2f6ffed -r 703a339e11ab config/StdGNU.mk
--- a/config/StdGNU.mk	Fri Mar 09 16:54:24 2012 +0000
+++ b/config/StdGNU.mk	Tue Mar 13 15:23:35 2012 +0000
@@ -67,7 +67,6 @@
 XEN_SCRIPT_DIR = $(XEN_CONFIG_DIR)/scripts
 
 SOCKET_LIBS =
-CURSES_LIBS = -lncurses
 PTHREAD_LIBS = -lpthread
 UTIL_LIBS = -lutil
 DLOPEN_LIBS = -ldl
diff -r 5d20d2f6ffed -r 703a339e11ab config/SunOS.mk
--- a/config/SunOS.mk	Fri Mar 09 16:54:24 2012 +0000
+++ b/config/SunOS.mk	Tue Mar 13 15:23:35 2012 +0000
@@ -47,7 +47,6 @@
 SunOS_LIBDIR_x86_64 = /usr/sfw/lib/amd64
 
 SOCKET_LIBS = -lsocket
-CURSES_LIBS = -lcurses
 PTHREAD_LIBS = -lpthread
 UTIL_LIBS =
 DLOPEN_LIBS = -ldl
diff -r 5d20d2f6ffed -r 703a339e11ab config/Tools.mk.in
--- a/config/Tools.mk.in	Fri Mar 09 16:54:24 2012 +0000
+++ b/config/Tools.mk.in	Tue Mar 13 15:23:35 2012 +0000
@@ -43,3 +43,4 @@
 CONFIG_LIBICONV     := @libiconv@
 CONFIG_GCRYPT       := @libgcrypt@
 CONFIG_EXT2FS       := @libext2fs@
+CURSES_LIBS         := @CURSES_LIBS@
diff -r 5d20d2f6ffed -r 703a339e11ab tools/config.h.in
--- a/tools/config.h.in	Fri Mar 09 16:54:24 2012 +0000
+++ b/tools/config.h.in	Tue Mar 13 15:23:35 2012 +0000
@@ -14,3 +14,6 @@
 
 /* Define to 1 if you have the <yajl/yajl_version.h> header file. */
 #undef HAVE_YAJL_YAJL_VERSION_H
+
+/* Define curses header to include. */
+#undef INCLUDE_CURSES_H
diff -r 5d20d2f6ffed -r 703a339e11ab tools/configure
--- a/tools/configure	Fri Mar 09 16:54:24 2012 +0000
+++ b/tools/configure	Tue Mar 13 15:23:35 2012 +0000
@@ -611,6 +611,7 @@
 PKG_CONFIG_LIBDIR
 PKG_CONFIG_PATH
 PKG_CONFIG
+CURSES_LIBS
 PYTHONPATH
 OCAMLBUILD
 OCAMLDOC
@@ -3904,6 +3905,8 @@
 # PKG_CHECK_MODULES
 
 
+
+
 # Enable/disable options
 # Check whether --enable-githttp was given.
 if test "${enable_githttp+set}" = set; then :
@@ -6227,6 +6230,132 @@
 fi
 
 
+ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default"
+if test "x$ac_cv_header_curses_h" = x""yes; then :
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lcurses" >&5
+$as_echo_n "checking for clear in -lcurses... " >&6; }
+if test "${ac_cv_lib_curses_clear+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcurses  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clear ();
+int
+main ()
+{
+return clear ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_curses_clear=yes
+else
+  ac_cv_lib_curses_clear=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_clear" >&5
+$as_echo "$ac_cv_lib_curses_clear" >&6; }
+if test "x$ac_cv_lib_curses_clear" = x""yes; then :
+  curses="y"
+else
+  curses="n"
+fi
+
+
+else
+  curses="n"
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default"
+if test "x$ac_cv_header_ncurses_h" = x""yes; then :
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lncurses" >&5
+$as_echo_n "checking for clear in -lncurses... " >&6; }
+if test "${ac_cv_lib_ncurses_clear+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lncurses  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clear ();
+int
+main ()
+{
+return clear ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ncurses_clear=yes
+else
+  ac_cv_lib_ncurses_clear=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_clear" >&5
+$as_echo "$ac_cv_lib_ncurses_clear" >&6; }
+if test "x$ac_cv_lib_ncurses_clear" = x""yes; then :
+  ncurses="y"
+else
+  ncurses="n"
+fi
+
+
+else
+  ncurses="n"
+fi
+
+
+if test "$curses" = "n" && test "$ncurses" = "n"; then :
+
+    as_fn_error $? "Unable to find a suitable curses library" "$LINENO" 5
+
+fi
+# Prefer ncurses over curses if both are present
+if test "$ncurses" = "y"; then :
+
+    CURSES_LIBS="-lncurses"
+
+$as_echo "#define INCLUDE_CURSES_H <ncurses.h>" >>confdefs.h
+
+
+else
+
+    CURSES_LIBS="-lcurses"
+
+$as_echo "#define INCLUDE_CURSES_H <curses.h>" >>confdefs.h
+
+
+fi
+
+
+
 
 
 
diff -r 5d20d2f6ffed -r 703a339e11ab tools/configure.ac
--- a/tools/configure.ac	Fri Mar 09 16:54:24 2012 +0000
+++ b/tools/configure.ac	Tue Mar 13 15:23:35 2012 +0000
@@ -33,6 +33,7 @@
 m4_include([m4/set_cflags_ldflags.m4])
 m4_include([m4/uuid.m4])
 m4_include([m4/pkg.m4])
+m4_include([m4/curses.m4])
 
 # Enable/disable options
 AX_ARG_ENABLE_AND_EXPORT([githttp], [Download GIT repositories via HTTP])
@@ -98,6 +99,7 @@
 ])
 AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
 AX_CHECK_UUID
+AX_CHECK_CURSES
 PKG_CHECK_MODULES(glib, glib-2.0)
 
 # Check library path
diff -r 5d20d2f6ffed -r 703a339e11ab tools/m4/curses.m4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/m4/curses.m4	Tue Mar 13 15:23:35 2012 +0000
@@ -0,0 +1,20 @@
+AC_DEFUN([AX_CHECK_CURSES], [
+AC_CHECK_HEADER([curses.h], [
+    AC_CHECK_LIB([curses], [clear], [curses="y"], [curses="n"])
+], [curses="n"])
+AC_CHECK_HEADER([ncurses.h], [
+    AC_CHECK_LIB([ncurses], [clear], [ncurses="y"], [ncurses="n"])
+], [ncurses="n"])
+AS_IF([test "$curses" = "n" && test "$ncurses" = "n"], [
+    AC_MSG_ERROR([Unable to find a suitable curses library])
+])
+# Prefer ncurses over curses if both are present
+AS_IF([test "$ncurses" = "y"], [
+    CURSES_LIBS="-lncurses"
+    AC_DEFINE([INCLUDE_CURSES_H], [<ncurses.h>], [Define curses header to use])
+], [
+    CURSES_LIBS="-lcurses"
+    AC_DEFINE([INCLUDE_CURSES_H], [<curses.h>], [Define curses header to use])
+])
+AC_SUBST(CURSES_LIBS)
+])
diff -r 5d20d2f6ffed -r 703a339e11ab tools/misc/Makefile
--- a/tools/misc/Makefile	Fri Mar 09 16:54:24 2012 +0000
+++ b/tools/misc/Makefile	Tue Mar 13 15:23:35 2012 +0000
@@ -27,6 +27,9 @@
 INSTALL_SBIN-$(CONFIG_MIGRATE) += xen-hptool
 INSTALL_SBIN := $(INSTALL_SBIN-y)
 
+# Include configure output (config.h) to headers search path
+CFLAGS += -I$(XEN_ROOT)/tools
+
 .PHONY: all
 all: build
 
diff -r 5d20d2f6ffed -r 703a339e11ab tools/misc/gtraceview.c
--- a/tools/misc/gtraceview.c	Fri Mar 09 16:54:24 2012 +0000
+++ b/tools/misc/gtraceview.c	Tue Mar 13 15:23:35 2012 +0000
@@ -16,6 +16,9 @@
  * Place - Suite 330, Boston, MA 02111-1307 USA.
  */
 
+/* Include output from configure */
+#include <config.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -30,12 +33,8 @@
 #include <xenctrl.h>
 #include <xen/trace.h>
 
-#ifdef __linux__
-#include <ncurses.h>
-#endif
-#ifdef __NetBSD__
-#include <curses.h>
-#endif
+/* get curses header from configure */
+#include INCLUDE_CURSES_H
 
 /********** MACROS **********/
 #define MAX_CPU_NR  32
diff -r 5d20d2f6ffed -r 703a339e11ab tools/xenstat/xentop/Makefile
--- a/tools/xenstat/xentop/Makefile	Fri Mar 09 16:54:24 2012 +0000
+++ b/tools/xenstat/xentop/Makefile	Tue Mar 13 15:23:35 2012 +0000
@@ -22,6 +22,9 @@
 LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(SOCKET_LIBS)
 CFLAGS += -DHOST_$(XEN_OS)
 
+# Include configure output (config.h) to headers search path
+CFLAGS += -I$(XEN_ROOT)/tools
+
 .PHONY: all
 all: xentop
 
diff -r 5d20d2f6ffed -r 703a339e11ab tools/xenstat/xentop/xentop.c
--- a/tools/xenstat/xentop/xentop.c	Fri Mar 09 16:54:24 2012 +0000
+++ b/tools/xenstat/xentop/xentop.c	Tue Mar 13 15:23:35 2012 +0000
@@ -18,7 +18,13 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#include <curses.h>
+
+/* Include output from configure */
+#include <config.h>
+
+/* get curses header from configure */
+#include INCLUDE_CURSES_H
+
 #include <ctype.h>
 #include <errno.h>
 #include <stdio.h>

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOJ-0001lV-GR; Wed, 14 Mar 2012 12:33: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 1S7nOI-0001j2-Bi
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:18 +0000
Received: from [85.158.139.83:14251] by server-2.bemta-5.messagelabs.com id
	1F/82-17016-D00906F4; Wed, 14 Mar 2012 12:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1331728395!18427282!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25487 invoked from network); 14 Mar 2012 12:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Mar 2012 12:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOF-0007Tw-4U
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOF-0008JX-2m
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:15 +0000
Message-Id: <E1S7nOF-0008JX-2m@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] autoconf: add check for curses
	library
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1331652215 0
# Node ID 703a339e11abf1ea14ee528f4194b308fcb3ea88
# Parent  5d20d2f6ffed0a49f030f04a8870f1926babbcbf
autoconf: add check for curses library

Check for a curses compatible library (curses or ncurses basically).
One of those is needed to compile Xen tools (gtraceview and xentop).

Modify Makefiles/sources to use configure output (fetch CURSES_LIBS
from tools/Tools.mk and header to include from tools/config.h)

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 5d20d2f6ffed -r 703a339e11ab config/NetBSD.mk
--- a/config/NetBSD.mk	Fri Mar 09 16:54:24 2012 +0000
+++ b/config/NetBSD.mk	Tue Mar 13 15:23:35 2012 +0000
@@ -1,8 +1,6 @@
 include $(XEN_ROOT)/config/StdGNU.mk
 
 # Override settings for this OS
-CURSES_LIBS = -lcurses
-
 LIBLEAFDIR_x86_64 = lib
 LIBEXEC = $(PREFIX)/libexec
 PRIVATE_BINDIR = $(BINDIR)
diff -r 5d20d2f6ffed -r 703a339e11ab config/StdGNU.mk
--- a/config/StdGNU.mk	Fri Mar 09 16:54:24 2012 +0000
+++ b/config/StdGNU.mk	Tue Mar 13 15:23:35 2012 +0000
@@ -67,7 +67,6 @@
 XEN_SCRIPT_DIR = $(XEN_CONFIG_DIR)/scripts
 
 SOCKET_LIBS =
-CURSES_LIBS = -lncurses
 PTHREAD_LIBS = -lpthread
 UTIL_LIBS = -lutil
 DLOPEN_LIBS = -ldl
diff -r 5d20d2f6ffed -r 703a339e11ab config/SunOS.mk
--- a/config/SunOS.mk	Fri Mar 09 16:54:24 2012 +0000
+++ b/config/SunOS.mk	Tue Mar 13 15:23:35 2012 +0000
@@ -47,7 +47,6 @@
 SunOS_LIBDIR_x86_64 = /usr/sfw/lib/amd64
 
 SOCKET_LIBS = -lsocket
-CURSES_LIBS = -lcurses
 PTHREAD_LIBS = -lpthread
 UTIL_LIBS =
 DLOPEN_LIBS = -ldl
diff -r 5d20d2f6ffed -r 703a339e11ab config/Tools.mk.in
--- a/config/Tools.mk.in	Fri Mar 09 16:54:24 2012 +0000
+++ b/config/Tools.mk.in	Tue Mar 13 15:23:35 2012 +0000
@@ -43,3 +43,4 @@
 CONFIG_LIBICONV     := @libiconv@
 CONFIG_GCRYPT       := @libgcrypt@
 CONFIG_EXT2FS       := @libext2fs@
+CURSES_LIBS         := @CURSES_LIBS@
diff -r 5d20d2f6ffed -r 703a339e11ab tools/config.h.in
--- a/tools/config.h.in	Fri Mar 09 16:54:24 2012 +0000
+++ b/tools/config.h.in	Tue Mar 13 15:23:35 2012 +0000
@@ -14,3 +14,6 @@
 
 /* Define to 1 if you have the <yajl/yajl_version.h> header file. */
 #undef HAVE_YAJL_YAJL_VERSION_H
+
+/* Define curses header to include. */
+#undef INCLUDE_CURSES_H
diff -r 5d20d2f6ffed -r 703a339e11ab tools/configure
--- a/tools/configure	Fri Mar 09 16:54:24 2012 +0000
+++ b/tools/configure	Tue Mar 13 15:23:35 2012 +0000
@@ -611,6 +611,7 @@
 PKG_CONFIG_LIBDIR
 PKG_CONFIG_PATH
 PKG_CONFIG
+CURSES_LIBS
 PYTHONPATH
 OCAMLBUILD
 OCAMLDOC
@@ -3904,6 +3905,8 @@
 # PKG_CHECK_MODULES
 
 
+
+
 # Enable/disable options
 # Check whether --enable-githttp was given.
 if test "${enable_githttp+set}" = set; then :
@@ -6227,6 +6230,132 @@
 fi
 
 
+ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default"
+if test "x$ac_cv_header_curses_h" = x""yes; then :
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lcurses" >&5
+$as_echo_n "checking for clear in -lcurses... " >&6; }
+if test "${ac_cv_lib_curses_clear+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcurses  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clear ();
+int
+main ()
+{
+return clear ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_curses_clear=yes
+else
+  ac_cv_lib_curses_clear=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_clear" >&5
+$as_echo "$ac_cv_lib_curses_clear" >&6; }
+if test "x$ac_cv_lib_curses_clear" = x""yes; then :
+  curses="y"
+else
+  curses="n"
+fi
+
+
+else
+  curses="n"
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "ncurses.h" "ac_cv_header_ncurses_h" "$ac_includes_default"
+if test "x$ac_cv_header_ncurses_h" = x""yes; then :
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clear in -lncurses" >&5
+$as_echo_n "checking for clear in -lncurses... " >&6; }
+if test "${ac_cv_lib_ncurses_clear+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lncurses  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char clear ();
+int
+main ()
+{
+return clear ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_ncurses_clear=yes
+else
+  ac_cv_lib_ncurses_clear=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_clear" >&5
+$as_echo "$ac_cv_lib_ncurses_clear" >&6; }
+if test "x$ac_cv_lib_ncurses_clear" = x""yes; then :
+  ncurses="y"
+else
+  ncurses="n"
+fi
+
+
+else
+  ncurses="n"
+fi
+
+
+if test "$curses" = "n" && test "$ncurses" = "n"; then :
+
+    as_fn_error $? "Unable to find a suitable curses library" "$LINENO" 5
+
+fi
+# Prefer ncurses over curses if both are present
+if test "$ncurses" = "y"; then :
+
+    CURSES_LIBS="-lncurses"
+
+$as_echo "#define INCLUDE_CURSES_H <ncurses.h>" >>confdefs.h
+
+
+else
+
+    CURSES_LIBS="-lcurses"
+
+$as_echo "#define INCLUDE_CURSES_H <curses.h>" >>confdefs.h
+
+
+fi
+
+
+
 
 
 
diff -r 5d20d2f6ffed -r 703a339e11ab tools/configure.ac
--- a/tools/configure.ac	Fri Mar 09 16:54:24 2012 +0000
+++ b/tools/configure.ac	Tue Mar 13 15:23:35 2012 +0000
@@ -33,6 +33,7 @@
 m4_include([m4/set_cflags_ldflags.m4])
 m4_include([m4/uuid.m4])
 m4_include([m4/pkg.m4])
+m4_include([m4/curses.m4])
 
 # Enable/disable options
 AX_ARG_ENABLE_AND_EXPORT([githttp], [Download GIT repositories via HTTP])
@@ -98,6 +99,7 @@
 ])
 AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext])
 AX_CHECK_UUID
+AX_CHECK_CURSES
 PKG_CHECK_MODULES(glib, glib-2.0)
 
 # Check library path
diff -r 5d20d2f6ffed -r 703a339e11ab tools/m4/curses.m4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/m4/curses.m4	Tue Mar 13 15:23:35 2012 +0000
@@ -0,0 +1,20 @@
+AC_DEFUN([AX_CHECK_CURSES], [
+AC_CHECK_HEADER([curses.h], [
+    AC_CHECK_LIB([curses], [clear], [curses="y"], [curses="n"])
+], [curses="n"])
+AC_CHECK_HEADER([ncurses.h], [
+    AC_CHECK_LIB([ncurses], [clear], [ncurses="y"], [ncurses="n"])
+], [ncurses="n"])
+AS_IF([test "$curses" = "n" && test "$ncurses" = "n"], [
+    AC_MSG_ERROR([Unable to find a suitable curses library])
+])
+# Prefer ncurses over curses if both are present
+AS_IF([test "$ncurses" = "y"], [
+    CURSES_LIBS="-lncurses"
+    AC_DEFINE([INCLUDE_CURSES_H], [<ncurses.h>], [Define curses header to use])
+], [
+    CURSES_LIBS="-lcurses"
+    AC_DEFINE([INCLUDE_CURSES_H], [<curses.h>], [Define curses header to use])
+])
+AC_SUBST(CURSES_LIBS)
+])
diff -r 5d20d2f6ffed -r 703a339e11ab tools/misc/Makefile
--- a/tools/misc/Makefile	Fri Mar 09 16:54:24 2012 +0000
+++ b/tools/misc/Makefile	Tue Mar 13 15:23:35 2012 +0000
@@ -27,6 +27,9 @@
 INSTALL_SBIN-$(CONFIG_MIGRATE) += xen-hptool
 INSTALL_SBIN := $(INSTALL_SBIN-y)
 
+# Include configure output (config.h) to headers search path
+CFLAGS += -I$(XEN_ROOT)/tools
+
 .PHONY: all
 all: build
 
diff -r 5d20d2f6ffed -r 703a339e11ab tools/misc/gtraceview.c
--- a/tools/misc/gtraceview.c	Fri Mar 09 16:54:24 2012 +0000
+++ b/tools/misc/gtraceview.c	Tue Mar 13 15:23:35 2012 +0000
@@ -16,6 +16,9 @@
  * Place - Suite 330, Boston, MA 02111-1307 USA.
  */
 
+/* Include output from configure */
+#include <config.h>
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -30,12 +33,8 @@
 #include <xenctrl.h>
 #include <xen/trace.h>
 
-#ifdef __linux__
-#include <ncurses.h>
-#endif
-#ifdef __NetBSD__
-#include <curses.h>
-#endif
+/* get curses header from configure */
+#include INCLUDE_CURSES_H
 
 /********** MACROS **********/
 #define MAX_CPU_NR  32
diff -r 5d20d2f6ffed -r 703a339e11ab tools/xenstat/xentop/Makefile
--- a/tools/xenstat/xentop/Makefile	Fri Mar 09 16:54:24 2012 +0000
+++ b/tools/xenstat/xentop/Makefile	Tue Mar 13 15:23:35 2012 +0000
@@ -22,6 +22,9 @@
 LDLIBS += $(LDLIBS_libxenstat) $(CURSES_LIBS) $(SOCKET_LIBS)
 CFLAGS += -DHOST_$(XEN_OS)
 
+# Include configure output (config.h) to headers search path
+CFLAGS += -I$(XEN_ROOT)/tools
+
 .PHONY: all
 all: xentop
 
diff -r 5d20d2f6ffed -r 703a339e11ab tools/xenstat/xentop/xentop.c
--- a/tools/xenstat/xentop/xentop.c	Fri Mar 09 16:54:24 2012 +0000
+++ b/tools/xenstat/xentop/xentop.c	Tue Mar 13 15:23:35 2012 +0000
@@ -18,7 +18,13 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
-#include <curses.h>
+
+/* Include output from configure */
+#include <config.h>
+
+/* get curses header from configure */
+#include INCLUDE_CURSES_H
+
 #include <ctype.h>
 #include <errno.h>
 #include <stdio.h>

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOK-0001nI-J9; Wed, 14 Mar 2012 12:33: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 1S7nOI-0001gH-U3
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:19 +0000
Received: from [85.158.143.35:13536] by server-2.bemta-4.messagelabs.com id
	DB/4A-17550-E00906F4; Wed, 14 Mar 2012 12:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1331728396!11845677!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25868 invoked from network); 14 Mar 2012 12:33:17 -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;
	14 Mar 2012 12:33: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 1S7nOG-0007U2-Bg
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOG-0008KX-AO
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:16 +0000
Message-Id: <E1S7nOG-0008KX-AO@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update SEABIOS_UPSTREAM_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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331652730 0
# Node ID 9e2c6d4a0da0bd1c86598244f7f5284eff1fbbdd
# Parent  d54cf3fa7ee6d57acf7500cd53da135e0c584948
Update SEABIOS_UPSTREAM_TAG

Switch to recently released 1.6.3.2 from upstream. This incorporates all the
changesets which we previously applied to 1.6.3.1.

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


diff -r d54cf3fa7ee6 -r 9e2c6d4a0da0 Config.mk
--- a/Config.mk	Tue Mar 13 15:28:41 2012 +0000
+++ b/Config.mk	Tue Mar 13 15:32:10 2012 +0000
@@ -198,9 +198,9 @@
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 QEMU_UPSTREAM_REVISION ?= master
-SEABIOS_UPSTREAM_TAG ?= c69e288adfe6c273df4b1f3d9c223d8a4fb613cd
-# Wed Feb 8 20:23:36 2012 -0500
-# Permit .rodata.__PRETTY_FUNCTION__. sections in roms.
+SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
+# Sun Mar 11 09:27:07 2012 -0400
+# Update version to 1.6.3.2
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOK-0001nI-J9; Wed, 14 Mar 2012 12:33: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 1S7nOI-0001gH-U3
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:19 +0000
Received: from [85.158.143.35:13536] by server-2.bemta-4.messagelabs.com id
	DB/4A-17550-E00906F4; Wed, 14 Mar 2012 12:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1331728396!11845677!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25868 invoked from network); 14 Mar 2012 12:33:17 -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;
	14 Mar 2012 12:33: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 1S7nOG-0007U2-Bg
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOG-0008KX-AO
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:16 +0000
Message-Id: <E1S7nOG-0008KX-AO@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Update SEABIOS_UPSTREAM_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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331652730 0
# Node ID 9e2c6d4a0da0bd1c86598244f7f5284eff1fbbdd
# Parent  d54cf3fa7ee6d57acf7500cd53da135e0c584948
Update SEABIOS_UPSTREAM_TAG

Switch to recently released 1.6.3.2 from upstream. This incorporates all the
changesets which we previously applied to 1.6.3.1.

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


diff -r d54cf3fa7ee6 -r 9e2c6d4a0da0 Config.mk
--- a/Config.mk	Tue Mar 13 15:28:41 2012 +0000
+++ b/Config.mk	Tue Mar 13 15:32:10 2012 +0000
@@ -198,9 +198,9 @@
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
 QEMU_UPSTREAM_REVISION ?= master
-SEABIOS_UPSTREAM_TAG ?= c69e288adfe6c273df4b1f3d9c223d8a4fb613cd
-# Wed Feb 8 20:23:36 2012 -0500
-# Permit .rodata.__PRETTY_FUNCTION__. sections in roms.
+SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
+# Sun Mar 11 09:27:07 2012 -0400
+# Update version to 1.6.3.2
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOK-0001nX-Lf; Wed, 14 Mar 2012 12:33: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 1S7nOJ-0001gV-K9
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:19 +0000
Received: from [85.158.143.99:56568] by server-1.bemta-4.messagelabs.com id
	55/16-20925-F00906F4; Wed, 14 Mar 2012 12:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1331728397!13409478!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12906 invoked from network); 14 Mar 2012 12:33: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;
	14 Mar 2012 12:33: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 1S7nOH-0007U8-Ex
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOH-0008LX-D8
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:17 +0000
Message-Id: <E1S7nOH-0008LX-D8@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix libxl_get_cpu_topology
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Liu <wei.liu2@citrix.com>
# Date 1331653018 0
# Node ID 83ae523c96b45f6a6a32c518b2f320563dc17ea1
# Parent  0c4385ac103d1283cfbba31ca8f5cd9d520ff8f0
libxl: fix libxl_get_cpu_topology

Fix upper bound of for loop, thus preventing memory corruption.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-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 0c4385ac103d -r 83ae523c96b4 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Tue Mar 13 15:34:54 2012 +0000
+++ b/tools/libxl/libxl.c	Tue Mar 13 15:36:58 2012 +0000
@@ -2873,7 +2873,7 @@
         goto fail;
     }
 
-    for (i = 0; i <= max_cpus; i++) {
+    for (i = 0; i < max_cpus; i++) {
 #define V(map, i) (map[i] == INVALID_TOPOLOGY_ID) ? \
     LIBXL_CPUTOPOLOGY_INVALID_ENTRY : map[i]
         ret[i].core = V(coremap, i);

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOK-0001nX-Lf; Wed, 14 Mar 2012 12:33: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 1S7nOJ-0001gV-K9
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:19 +0000
Received: from [85.158.143.99:56568] by server-1.bemta-4.messagelabs.com id
	55/16-20925-F00906F4; Wed, 14 Mar 2012 12:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1331728397!13409478!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12906 invoked from network); 14 Mar 2012 12:33: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;
	14 Mar 2012 12:33: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 1S7nOH-0007U8-Ex
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOH-0008LX-D8
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:17 +0000
Message-Id: <E1S7nOH-0008LX-D8@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: fix libxl_get_cpu_topology
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Liu <wei.liu2@citrix.com>
# Date 1331653018 0
# Node ID 83ae523c96b45f6a6a32c518b2f320563dc17ea1
# Parent  0c4385ac103d1283cfbba31ca8f5cd9d520ff8f0
libxl: fix libxl_get_cpu_topology

Fix upper bound of for loop, thus preventing memory corruption.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-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 0c4385ac103d -r 83ae523c96b4 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Tue Mar 13 15:34:54 2012 +0000
+++ b/tools/libxl/libxl.c	Tue Mar 13 15:36:58 2012 +0000
@@ -2873,7 +2873,7 @@
         goto fail;
     }
 
-    for (i = 0; i <= max_cpus; i++) {
+    for (i = 0; i < max_cpus; i++) {
 #define V(map, i) (map[i] == INVALID_TOPOLOGY_ID) ? \
     LIBXL_CPUTOPOLOGY_INVALID_ENTRY : map[i]
         ret[i].core = V(coremap, i);

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOL-0001or-OD; Wed, 14 Mar 2012 12:33: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 1S7nOK-0001gH-6q
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Received: from [85.158.143.99:37271] by server-2.bemta-4.messagelabs.com id
	D8/5A-17550-F00906F4; Wed, 14 Mar 2012 12:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1331728398!13409480!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12957 invoked from network); 14 Mar 2012 12:33:19 -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;
	14 Mar 2012 12:33: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 1S7nOH-0007UB-Vk
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOH-0008Lz-UQ
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:17 +0000
Message-Id: <E1S7nOH-0008Lz-UQ@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: use r12 to pass the hypercall
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331654645 0
# Node ID b8a5e8100c5d5d4e162a99f4582186fa77080391
# Parent  83ae523c96b45f6a6a32c518b2f320563dc17ea1
arm: use r12 to pass the hypercall number

** This is a guest visible ABI change which requires an updated guest kernel **

Use r12 to pass the hypercall number and r0-r4 for the hypercall
arguments.

Use the ISS to pass an hypervisor specific tag.

Remove passing unused registers to arm_hypercall_table: we don't have 6
arguments hypercalls and we never use 64 bit values as hypercall
arguments, 64 bit values are only contained within structs passed as
arguments.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[ use #ifndef NDEBUG, fix coding style, expand calling convention comment
  slightly and added a big fat note about ABI change - ijc ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 83ae523c96b4 -r b8a5e8100c5d xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c	Tue Mar 13 15:36:58 2012 +0000
+++ b/xen/arch/arm/traps.c	Tue Mar 13 16:04:05 2012 +0000
@@ -367,7 +367,6 @@
 }
 
 typedef unsigned long arm_hypercall_t(
-    unsigned int, unsigned int, unsigned int, unsigned int, unsigned int,
     unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
 
 #define HYPERCALL(x)                                        \
@@ -407,18 +406,30 @@
 
 static void do_trap_hypercall(struct cpu_user_regs *regs, unsigned long iss)
 {
+    arm_hypercall_t *call = NULL;
     local_irq_enable();
 
-    regs->r0 = arm_hypercall_table[iss](regs->r0,
-                             regs->r1,
-                             regs->r2,
-                             regs->r3,
-                             regs->r4,
-                             regs->r5,
-                             regs->r6,
-                             regs->r7,
-                             regs->r8,
-                             regs->r9);
+    if ( iss != XEN_HYPERCALL_TAG )
+    {
+        printk("%s %d: received an alien hypercall iss=%lx\n", __func__ ,
+                __LINE__ , iss);
+        regs->r0 = -EINVAL;
+        return;
+    }
+
+    call = arm_hypercall_table[regs->r12];
+    if ( call == NULL )
+    {
+        regs->r0 = -ENOSYS;
+        return;
+    }
+
+    regs->r0 = call(regs->r0, regs->r1, regs->r2, regs->r3, regs->r4);
+
+#ifndef NDEBUG
+    /* clobber registers */
+    regs->r1 = regs->r2 = regs->r3 = regs->r4 = regs->r12 = 0xDEADBEEF;
+#endif
 }
 
 static void do_cp15_32(struct cpu_user_regs *regs,
diff -r 83ae523c96b4 -r b8a5e8100c5d xen/include/public/arch-arm.h
--- a/xen/include/public/arch-arm.h	Tue Mar 13 15:36:58 2012 +0000
+++ b/xen/include/public/arch-arm.h	Tue Mar 13 16:04:05 2012 +0000
@@ -27,6 +27,29 @@
 #ifndef __XEN_PUBLIC_ARCH_ARM_H__
 #define __XEN_PUBLIC_ARCH_ARM_H__
 
+/* hypercall calling convention
+ * ----------------------------
+ *
+ * A hypercall is issued using the ARM HVC instruction.
+ *
+ * A hypercall can take up to 5 arguments. These are passed in
+ * registers, the first argument in r0, the second argument in r1, the
+ * third in r2, the forth in r3 and the fifth in r4.
+ *
+ * The hypercall number is passed in r12.
+ *
+ * The HVC ISS must contain a Xen specific TAG: XEN_HYPERCALL_TAG.
+ *
+ * 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.
+ *
+ */
+
+#define XEN_HYPERCALL_TAG   0XEA1
+
+
 #ifndef __ASSEMBLY__
 #define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
     typedef struct { type *p; } __guest_handle_ ## name

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOL-0001or-OD; Wed, 14 Mar 2012 12:33: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 1S7nOK-0001gH-6q
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Received: from [85.158.143.99:37271] by server-2.bemta-4.messagelabs.com id
	D8/5A-17550-F00906F4; Wed, 14 Mar 2012 12:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1331728398!13409480!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12957 invoked from network); 14 Mar 2012 12:33:19 -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;
	14 Mar 2012 12:33: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 1S7nOH-0007UB-Vk
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOH-0008Lz-UQ
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:17 +0000
Message-Id: <E1S7nOH-0008Lz-UQ@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: use r12 to pass the hypercall
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331654645 0
# Node ID b8a5e8100c5d5d4e162a99f4582186fa77080391
# Parent  83ae523c96b45f6a6a32c518b2f320563dc17ea1
arm: use r12 to pass the hypercall number

** This is a guest visible ABI change which requires an updated guest kernel **

Use r12 to pass the hypercall number and r0-r4 for the hypercall
arguments.

Use the ISS to pass an hypervisor specific tag.

Remove passing unused registers to arm_hypercall_table: we don't have 6
arguments hypercalls and we never use 64 bit values as hypercall
arguments, 64 bit values are only contained within structs passed as
arguments.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
[ use #ifndef NDEBUG, fix coding style, expand calling convention comment
  slightly and added a big fat note about ABI change - ijc ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 83ae523c96b4 -r b8a5e8100c5d xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c	Tue Mar 13 15:36:58 2012 +0000
+++ b/xen/arch/arm/traps.c	Tue Mar 13 16:04:05 2012 +0000
@@ -367,7 +367,6 @@
 }
 
 typedef unsigned long arm_hypercall_t(
-    unsigned int, unsigned int, unsigned int, unsigned int, unsigned int,
     unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
 
 #define HYPERCALL(x)                                        \
@@ -407,18 +406,30 @@
 
 static void do_trap_hypercall(struct cpu_user_regs *regs, unsigned long iss)
 {
+    arm_hypercall_t *call = NULL;
     local_irq_enable();
 
-    regs->r0 = arm_hypercall_table[iss](regs->r0,
-                             regs->r1,
-                             regs->r2,
-                             regs->r3,
-                             regs->r4,
-                             regs->r5,
-                             regs->r6,
-                             regs->r7,
-                             regs->r8,
-                             regs->r9);
+    if ( iss != XEN_HYPERCALL_TAG )
+    {
+        printk("%s %d: received an alien hypercall iss=%lx\n", __func__ ,
+                __LINE__ , iss);
+        regs->r0 = -EINVAL;
+        return;
+    }
+
+    call = arm_hypercall_table[regs->r12];
+    if ( call == NULL )
+    {
+        regs->r0 = -ENOSYS;
+        return;
+    }
+
+    regs->r0 = call(regs->r0, regs->r1, regs->r2, regs->r3, regs->r4);
+
+#ifndef NDEBUG
+    /* clobber registers */
+    regs->r1 = regs->r2 = regs->r3 = regs->r4 = regs->r12 = 0xDEADBEEF;
+#endif
 }
 
 static void do_cp15_32(struct cpu_user_regs *regs,
diff -r 83ae523c96b4 -r b8a5e8100c5d xen/include/public/arch-arm.h
--- a/xen/include/public/arch-arm.h	Tue Mar 13 15:36:58 2012 +0000
+++ b/xen/include/public/arch-arm.h	Tue Mar 13 16:04:05 2012 +0000
@@ -27,6 +27,29 @@
 #ifndef __XEN_PUBLIC_ARCH_ARM_H__
 #define __XEN_PUBLIC_ARCH_ARM_H__
 
+/* hypercall calling convention
+ * ----------------------------
+ *
+ * A hypercall is issued using the ARM HVC instruction.
+ *
+ * A hypercall can take up to 5 arguments. These are passed in
+ * registers, the first argument in r0, the second argument in r1, the
+ * third in r2, the forth in r3 and the fifth in r4.
+ *
+ * The hypercall number is passed in r12.
+ *
+ * The HVC ISS must contain a Xen specific TAG: XEN_HYPERCALL_TAG.
+ *
+ * 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.
+ *
+ */
+
+#define XEN_HYPERCALL_TAG   0XEA1
+
+
 #ifndef __ASSEMBLY__
 #define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
     typedef struct { type *p; } __guest_handle_ ## name

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOL-0001oy-Qx; Wed, 14 Mar 2012 12:33: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 1S7nOK-0001gV-Dd
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Received: from [85.158.143.35:13674] by server-1.bemta-4.messagelabs.com id
	35/26-20925-010906F4; Wed, 14 Mar 2012 12:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1331728397!10539885!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29703 invoked from network); 14 Mar 2012 12:33:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Mar 2012 12:33: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 1S7nOG-0007U5-T8
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOG-0008L1-Rq
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:16 +0000
Message-Id: <E1S7nOG-0008L1-Rq@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: publish number of paged 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331652894 0
# Node ID 0c4385ac103d1283cfbba31ca8f5cd9d520ff8f0
# Parent  9e2c6d4a0da0bd1c86598244f7f5284eff1fbbdd
libxl: publish number of paged pages.

This is information is currently not harvested from libxc.

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


diff -r 9e2c6d4a0da0 -r 0c4385ac103d tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Tue Mar 13 15:32:10 2012 +0000
+++ b/tools/libxl/libxl.c	Tue Mar 13 15:34:54 2012 +0000
@@ -460,6 +460,7 @@
 
     xlinfo->current_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages);
     xlinfo->shared_memkb = PAGE_TO_MEMKB(xcinfo->shr_pages);
+    xlinfo->paged_memkb = PAGE_TO_MEMKB(xcinfo->paged_pages);
     xlinfo->max_memkb = PAGE_TO_MEMKB(xcinfo->max_pages);
     xlinfo->cpu_time = xcinfo->cpu_time;
     xlinfo->vcpu_max_id = xcinfo->max_vcpu_id;
diff -r 9e2c6d4a0da0 -r 0c4385ac103d tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Tue Mar 13 15:32:10 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Tue Mar 13 15:34:54 2012 +0000
@@ -175,6 +175,7 @@
     ("shutdown_reason", libxl_shutdown_reason),
     ("current_memkb",   MemKB),
     ("shared_memkb", MemKB),
+    ("paged_memkb", MemKB),
     ("max_memkb",   MemKB),
     ("cpu_time",    uint64),
     ("vcpu_max_id", uint32),

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOL-0001oy-Qx; Wed, 14 Mar 2012 12:33: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 1S7nOK-0001gV-Dd
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Received: from [85.158.143.35:13674] by server-1.bemta-4.messagelabs.com id
	35/26-20925-010906F4; Wed, 14 Mar 2012 12:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-21.messagelabs.com!1331728397!10539885!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29703 invoked from network); 14 Mar 2012 12:33:18 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-10.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Mar 2012 12:33: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 1S7nOG-0007U5-T8
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOG-0008L1-Rq
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:16 +0000
Message-Id: <E1S7nOG-0008L1-Rq@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: publish number of paged 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331652894 0
# Node ID 0c4385ac103d1283cfbba31ca8f5cd9d520ff8f0
# Parent  9e2c6d4a0da0bd1c86598244f7f5284eff1fbbdd
libxl: publish number of paged pages.

This is information is currently not harvested from libxc.

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


diff -r 9e2c6d4a0da0 -r 0c4385ac103d tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Tue Mar 13 15:32:10 2012 +0000
+++ b/tools/libxl/libxl.c	Tue Mar 13 15:34:54 2012 +0000
@@ -460,6 +460,7 @@
 
     xlinfo->current_memkb = PAGE_TO_MEMKB(xcinfo->tot_pages);
     xlinfo->shared_memkb = PAGE_TO_MEMKB(xcinfo->shr_pages);
+    xlinfo->paged_memkb = PAGE_TO_MEMKB(xcinfo->paged_pages);
     xlinfo->max_memkb = PAGE_TO_MEMKB(xcinfo->max_pages);
     xlinfo->cpu_time = xcinfo->cpu_time;
     xlinfo->vcpu_max_id = xcinfo->max_vcpu_id;
diff -r 9e2c6d4a0da0 -r 0c4385ac103d tools/libxl/libxl_types.idl
--- a/tools/libxl/libxl_types.idl	Tue Mar 13 15:32:10 2012 +0000
+++ b/tools/libxl/libxl_types.idl	Tue Mar 13 15:34:54 2012 +0000
@@ -175,6 +175,7 @@
     ("shutdown_reason", libxl_shutdown_reason),
     ("current_memkb",   MemKB),
     ("shared_memkb", MemKB),
+    ("paged_memkb", MemKB),
     ("max_memkb",   MemKB),
     ("cpu_time",    uint64),
     ("vcpu_max_id", uint32),

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOM-0001pG-11; Wed, 14 Mar 2012 12:33:22 +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 1S7nOK-0001m3-Cc
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Received: from [193.109.254.147:4708] by server-8.bemta-14.messagelabs.com id
	A3/47-04087-F00906F4; Wed, 14 Mar 2012 12:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1331728396!506012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6394 invoked from network); 14 Mar 2012 12:33:17 -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;
	14 Mar 2012 12:33: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 1S7nOG-0007Tz-0W
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOF-0008K3-MU
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:15 +0000
Message-Id: <E1S7nOF-0008K3-MU@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Merge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331652521 0
# Node ID d54cf3fa7ee6d57acf7500cd53da135e0c584948
# Parent  703a339e11abf1ea14ee528f4194b308fcb3ea88
# Parent  773d0367087212c43faf8cdcc21cf443b1ea0046
Merge
---


diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/Makefile	Tue Mar 13 15:28:41 2012 +0000
@@ -13,6 +13,7 @@
 obj-y += kernel.o
 obj-y += mm.o
 obj-y += p2m.o
+obj-y += percpu.o
 obj-y += guestcopy.o
 obj-y += setup.o
 obj-y += time.o
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/domain.c	Tue Mar 13 15:28:41 2012 +0000
@@ -31,12 +31,14 @@
 {
     for ( ; ; )
     {
-        /* TODO
-           if ( cpu_is_offline(smp_processor_id()) )
-           play_dead();
-           (*pm_idle)();
-           BUG();
-        */
+        if ( cpu_is_offline(smp_processor_id()) )
+            stop_cpu();
+
+        local_irq_disable();
+        if ( cpu_is_haltable(smp_processor_id()) )
+            asm volatile ("dsb; wfi");
+        local_irq_enable();
+
         do_tasklet();
         do_softirq();
     }
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/dummy.S	Tue Mar 13 15:28:41 2012 +0000
@@ -7,14 +7,10 @@
 x:	mov pc, lr
 	
 /* SMP support */
-DUMMY(__cpu_die);
-DUMMY(__cpu_disable);
-DUMMY(__cpu_up);
 DUMMY(per_cpu__cpu_core_mask);
 DUMMY(per_cpu__cpu_sibling_mask);
 DUMMY(node_online_map);
 DUMMY(smp_send_state_dump);
-DUMMY(__per_cpu_offset);
 
 /* PIRQ support */
 DUMMY(alloc_pirq_struct);
@@ -62,5 +58,4 @@
 DUMMY(hypercall_create_continuation);
 DUMMY(send_timer_event);
 DUMMY(share_xen_page_with_privileged_guests);
-DUMMY(__udelay);
 DUMMY(wallclock_time);
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/gic.c	Tue Mar 13 15:28:41 2012 +0000
@@ -224,7 +224,9 @@
 {
     int i;
 
-    /* Disable all PPI and enable all SGI */
+    /* 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 */
     /* Set PPI and SGI priorities */
@@ -237,20 +239,29 @@
     GICC[GICC_CTLR] = GICC_CTL_ENABLE|GICC_CTL_EOI;    /* Turn on delivery */
 }
 
+static void gic_cpu_disable(void)
+{
+    GICC[GICC_CTLR] = 0;
+}
+
 static void __cpuinit gic_hyp_init(void)
 {
     uint32_t vtr;
 
     vtr = GICH[GICH_VTR];
     nr_lrs  = (vtr & GICH_VTR_NRLRGS) + 1;
-    printk("GICH: %d list registers available\n", nr_lrs);
 
     GICH[GICH_HCR] = GICH_HCR_EN;
     GICH[GICH_MISR] = GICH_MISR_EOI;
 }
 
+static void __cpuinit gic_hyp_disable(void)
+{
+    GICH[GICH_HCR] = 0;
+}
+
 /* Set up the GIC */
-void gic_init(void)
+int __init gic_init(void)
 {
     /* XXX FIXME get this from devicetree */
     gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
@@ -272,6 +283,26 @@
     gic_hyp_init();
 
     spin_unlock(&gic.lock);
+
+    return gic.cpus;
+}
+
+/* Set up the per-CPU parts of the GIC for a secondary CPU */
+void __cpuinit gic_init_secondary_cpu(void)
+{
+    spin_lock(&gic.lock);
+    gic_cpu_init();
+    gic_hyp_init();
+    spin_unlock(&gic.lock);
+}
+
+/* Shut down the per-CPU GIC interface */
+void gic_disable_cpu(void)
+{
+    spin_lock(&gic.lock);
+    gic_cpu_disable();
+    gic_hyp_disable();
+    spin_unlock(&gic.lock);
 }
 
 void gic_route_irqs(void)
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/gic.h
--- a/xen/arch/arm/gic.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/gic.h	Tue Mar 13 15:28:41 2012 +0000
@@ -138,8 +138,12 @@
 
 /* Accept an interrupt from the GIC and dispatch its handler */
 extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
-/* Bring up the interrupt controller */
-extern void gic_init(void);
+/* Bring up the interrupt controller, and report # cpus attached */
+extern int gic_init(void);
+/* Bring up a secondary CPU's per-CPU GIC interface */
+extern void gic_init_secondary_cpu(void);
+/* Take down a CPU's per-CPU GIC interface */
+extern void gic_disable_cpu(void);
 /* setup the gic virtual interface for a guest */
 extern void gicv_setup(struct domain *d);
 #endif
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/head.S	Tue Mar 13 15:28:41 2012 +0000
@@ -62,22 +62,36 @@
 #endif
 
 	/* Are we the boot CPU? */
+	mov   r12, #0                /* r12 := CPU ID */
 	mrc   CP32(r0, MPIDR)
 	tst   r0, #(1<<31)           /* Multiprocessor extension supported? */
 	beq   boot_cpu
 	tst   r0, #(1<<30)           /* Uniprocessor system? */
 	bne   boot_cpu
-	bics  r0, r0, #(0xff << 24)  /* Ignore flags */
-	beq   boot_cpu               /* If all other fields are 0, we win */
+	bics  r12, r0, #(0xff << 24) /* Mask out flags to get CPU ID */
+	beq   boot_cpu               /* If we're CPU 0, boot now */
 
-1:	wfi
-	b     1b
-	
+	/* Non-boot CPUs wait here to be woken up one at a time.
+	 * This is basically an open-coded spin-lock to serialize. */
+	ldr   r0, =boot_gate         /* VA of gate */
+	add   r0, r0, r10            /* PA of gate */
+	mov   r1, #1                 /* (1 == locked) */
+1:	wfe
+	ldrex r2, [r0]               /* Linked read of current value */
+	teq   r2, #0                 /* (0 == unlocked) */
+	strexeq r2, r1, [r0]         /* Matching update -> locked */
+	teq   r2, #0                 /* (0 == succeeded) */
+	bne   1b
+
 boot_cpu:
 #ifdef EARLY_UART_ADDRESS
-	/* Say hello */
 	ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
-	bl    init_uart
+	teq   r12, #0                   /* CPU 0 sets up the UART too */
+	bleq  init_uart
+	PRINT("- CPU ")
+	mov   r0, r12
+	bl    putn
+	PRINT(" booting -\r\n")
 #endif
 
 	/* Check that this CPU has Hyp mode */
@@ -85,7 +99,6 @@
 	and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
 	teq   r0, #0x1000            /* Must == 0x1 or may be incompatible */
 	beq   1f
-	bl    putn
 	PRINT("- CPU doesn't support the virtualization extensions -\r\n")
 	b     fail
 1:
@@ -185,6 +198,10 @@
 	mov   r5, #0                 /* r4:r5 is paddr (xen_pagetable) */
 	mcrr  CP64(r4, r5, HTTBR)
 
+	/* Non-boot CPUs don't need to rebuild the pagetable */
+	teq   r12, #0
+	bne   pt_ready
+	
 	/* Build the baseline idle pagetable's first-level entries */
 	ldr   r1, =xen_second
 	add   r1, r1, r10            /* r1 := paddr (xen_second) */
@@ -226,6 +243,7 @@
 	add   r4, r4, #8
 	strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */
 
+pt_ready:
 	PRINT("- Turning on paging -\r\n")
 
 	ldr   r1, =paging            /* Explicit vaddr, not RIP-relative */
@@ -238,7 +256,7 @@
 paging:
 
 #ifdef EARLY_UART_ADDRESS
-	/* Recover the UART address in the new address space */
+	/* Recover the UART address in the new address space. */
 	lsl   r11, #11
 	lsr   r11, #11               /* UART base's offset from 2MB base */
 	adr   r0, start
@@ -246,15 +264,66 @@
 	add   r11, r11, r0           /* r11 := vaddr (UART base address) */
 #endif
 
-	PRINT("- Entering C -\r\n")
+	PRINT("- Ready -\r\n")
 
-	ldr   sp, =init_stack        /* Supply a stack */
+	/* The boot CPU should go straight into C now */
+	teq   r12, #0
+	beq   launch
+
+	/* Signal the next non-boot CPU to come and join us here */
+	ldr   r0, =boot_gate         /* VA of gate */
+	add   r0, r0, r10            /* PA of gate */
+	mov   r1, #0                 /* (0 == unlocked) */
+	str   r1, [r0]
+	dsb
+	isb
+	sev
+
+	/* Move on to the relocated pagetables */
+	mov   r0, #0
+	ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
+	add   r4, r4, r10            /* PA of it */
+	ldrd  r4, r5, [r4]           /* Actual value */
+	mcrr  CP64(r4, r5, HTTBR)
+	mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
+	mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
+	dsb                          /* Ensure completion of TLB+BP flush */
+	isb
+ 	/* Now, the UART is in its proper fixmap address */
+	ldrne r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
+
+	/* Non-boot CPUs report that they've got this far */
+	ldr   r0, =ready_cpus
+1:	ldrex r1, [r0]               /*            { read # of ready CPUs } */
+	add   r1, r1, #1             /* Atomically { ++                   } */
+	strex r2, r1, [r0]           /*            { writeback            } */
+	teq   r2, #0
+	bne   1b
+	dsb
+
+	/* Here, the non-boot CPUs must wait again -- they're now running on
+	 * the boot CPU's pagetables so it's safe for the boot CPU to
+	 * overwrite the non-relocated copy of Xen.  Once it's done that,
+	 * and brought up the memory allocator, non-boot CPUs can get their
+	 * own stacks and enter C. */
+1:	wfe
+	dsb
+	ldr   r0, =smp_up_cpu
+	ldr   r1, [r0]               /* Which CPU is being booted? */
+	teq   r1, r12                /* Is it us? */
+	bne   1b
+
+launch:	
+	ldr   r0, =init_stack        /* Find the boot-time stack */
+	ldr   sp, [r0]
 	add   sp, #STACK_SIZE        /* (which grows down from the top). */
 	sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
 	mov   r0, r10                /* Marshal args: - phys_offset */
 	mov   r1, r7                 /*               - machine type */
 	mov   r2, r8                 /*               - ATAG address */
-	b     start_xen              /* and disappear into the land of C */
+	movs  r3, r12                /*               - CPU ID */
+	beq   start_xen              /* and disappear into the land of C */
+	b     start_secondary        /* (to the appropriate entry point) */
 
 /* Fail-stop
  * r0: string explaining why */
@@ -288,7 +357,7 @@
 	tst   r2, #0x8               /* Check BUSY bit */
 	bne   puts                   /* Wait for the UART to be ready */
 	ldrb  r2, [r0], #1           /* Load next char */
-	teq   r2, #0                 /* Exit on nul*/
+	teq   r2, #0                 /* Exit on nul */
 	moveq pc, lr
 	str   r2, [r11]              /* -> UARTDR (Data Register) */
 	b     puts
@@ -308,10 +377,8 @@
 	lsl   r0, #4                 /* Roll it through one nybble at a time */
 	subs  r3, r3, #1
 	bne   1b
-	adr   r0, crlf               /* Finish with a newline */
-	b     puts
+	mov   pc, lr
 
-crlf:	.asciz "\r\n"
 hex:	.ascii "0123456789abcdef"
 	.align 2
 
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/mm.c	Tue Mar 13 15:28:41 2012 +0000
@@ -36,6 +36,9 @@
 static lpae_t xen_fixmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 static lpae_t xen_xenmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 
+/* Non-boot CPUs use this to find the correct pagetables. */
+uint64_t boot_httbr;
+
 /* Limits of the Xen heap */
 unsigned long xenheap_mfn_start, xenheap_mfn_end;
 unsigned long xenheap_virt_end;
@@ -45,6 +48,8 @@
 
 unsigned long max_page;
 
+extern char __init_begin[], __init_end[];
+
 /* Map a 4k page in a fixmap entry */
 void set_fixmap(unsigned map, unsigned long mfn, unsigned attributes)
 {
@@ -156,14 +161,6 @@
     lpae_t pte, *p;
     int i;
 
-    if ( boot_phys_offset != 0 )
-    {
-        /* Remove the old identity mapping of the boot paddr */
-        pte.bits = 0;
-        dest_va = (unsigned long)_start + boot_phys_offset;
-        write_pte(xen_second + second_linear_offset(dest_va), pte);
-    }
-
     xen_paddr = device_tree_get_xen_paddr();
 
     /* Map the destination in the boot misc area. */
@@ -186,11 +183,18 @@
     for ( i = 0; i < 4; i++)
         p[i].pt.base += (phys_offset - boot_phys_offset) >> PAGE_SHIFT;
     p = (void *) xen_second + dest_va - (unsigned long) _start;
+    if ( boot_phys_offset != 0 )
+    {
+        /* Remove the old identity mapping of the boot paddr */
+        unsigned long va = (unsigned long)_start + boot_phys_offset;
+        p[second_linear_offset(va)].bits = 0;
+    }
     for ( i = 0; i < 4 * LPAE_ENTRIES; i++)
         if ( p[i].pt.valid )
                 p[i].pt.base += (phys_offset - boot_phys_offset) >> PAGE_SHIFT;
 
     /* Change pagetables to the copy in the relocated Xen */
+    boot_httbr = (unsigned long) xen_pgtable + phys_offset;
     asm volatile (
         STORE_CP64(0, HTTBR)          /* Change translation base */
         "dsb;"                        /* Ensure visibility of HTTBR update */
@@ -198,22 +202,12 @@
         STORE_CP32(0, BPIALL)         /* Flush branch predictor */
         "dsb;"                        /* Ensure completion of TLB+BP flush */
         "isb;"
-        : : "r" ((unsigned long) xen_pgtable + phys_offset) : "memory");
+        : : "r" (boot_httbr) : "memory");
 
     /* Undo the temporary map */
     pte.bits = 0;
     write_pte(xen_second + second_table_offset(dest_va), pte);
-    /*
-     * Have removed a mapping previously used for .text. Flush everything
-     * for safety.
-     */
-    asm volatile (
-        "dsb;"                        /* Ensure visibility of PTE write */
-        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
-        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
-        "dsb;"                        /* Ensure completion of TLB+BP flush */
-        "isb;"
-        : : "r" (i /*dummy*/) : "memory");
+    flush_xen_text_tlb();
 
     /* Link in the fixmap pagetable */
     pte = mfn_to_xen_entry((((unsigned long) xen_fixmap) + phys_offset)
@@ -249,18 +243,19 @@
     pte.pt.table = 1;
     write_pte(xen_second + second_linear_offset(XEN_VIRT_START), pte);
     /* Have changed a mapping used for .text. Flush everything for safety. */
-    asm volatile (
-        "dsb;"                        /* Ensure visibility of PTE write */
-        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
-        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
-        "dsb;"                        /* Ensure completion of TLB+BP flush */
-        "isb;"
-        : : "r" (i /*dummy*/) : "memory");
+    flush_xen_text_tlb();
 
     /* From now on, no mapping may be both writable and executable. */
     WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
 }
 
+/* MMU setup for secondary CPUS (which already have paging enabled) */
+void __cpuinit mmu_init_secondary_cpu(void)
+{
+    /* From now on, no mapping may be both writable and executable. */
+    WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
+}
+
 /* Create Xen's mappings of memory.
  * Base and virt must be 32MB aligned and size a multiple of 32MB. */
 static void __init create_mappings(unsigned long virt,
@@ -319,6 +314,64 @@
     frametable_virt_end = FRAMETABLE_VIRT_START + (nr_pages * sizeof(struct page_info));
 }
 
+enum mg { mg_clear, mg_ro, mg_rw, mg_rx };
+static void set_pte_flags_on_range(const char *p, unsigned long l, enum mg mg)
+{
+    lpae_t pte;
+    int i;
+
+    ASSERT(is_kernel(p) && is_kernel(p + l));
+
+    /* Can only guard in page granularity */
+    ASSERT(!((unsigned long) p & ~PAGE_MASK));
+    ASSERT(!(l & ~PAGE_MASK));
+
+    for ( i = (p - _start) / PAGE_SIZE; 
+          i < (p + l - _start) / PAGE_SIZE; 
+          i++ )
+    {
+        pte = xen_xenmap[i];
+        switch ( mg )
+        {
+        case mg_clear:
+            pte.pt.valid = 0;
+            break;
+        case mg_ro:
+            pte.pt.valid = 1;
+            pte.pt.pxn = 1;
+            pte.pt.xn = 1;
+            pte.pt.ro = 1;
+            break;
+        case mg_rw:
+            pte.pt.valid = 1;
+            pte.pt.pxn = 1;
+            pte.pt.xn = 1;
+            pte.pt.ro = 0;
+            break;
+        case mg_rx:
+            pte.pt.valid = 1;
+            pte.pt.pxn = 0;
+            pte.pt.xn = 0;
+            pte.pt.ro = 1;
+            break;
+        }
+        write_pte(xen_xenmap + i, pte);
+    }
+    flush_xen_text_tlb();
+}
+
+/* Release all __init and __initdata ranges to be reused */
+void free_init_memory(void)
+{
+    paddr_t pa = virt_to_maddr(__init_begin);
+    unsigned long len = __init_end - __init_begin;
+    set_pte_flags_on_range(__init_begin, len, mg_rw);
+    memset(__init_begin, 0xcc, len);
+    set_pte_flags_on_range(__init_begin, len, mg_clear);
+    init_domheap_pages(pa, pa + len);
+    printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
+}
+
 void arch_dump_shared_mem_info(void)
 {
 }
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/percpu.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/percpu.c	Tue Mar 13 15:28:41 2012 +0000
@@ -0,0 +1,85 @@
+#include <xen/config.h>
+#include <xen/percpu.h>
+#include <xen/cpu.h>
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/rcupdate.h>
+
+unsigned long __per_cpu_offset[NR_CPUS];
+#define INVALID_PERCPU_AREA (-(long)__per_cpu_start)
+#define PERCPU_ORDER (get_order_from_bytes(__per_cpu_data_end-__per_cpu_start))
+
+void __init percpu_init_areas(void)
+{
+    unsigned int cpu;
+    for ( cpu = 1; cpu < NR_CPUS; cpu++ )
+        __per_cpu_offset[cpu] = INVALID_PERCPU_AREA;
+}
+
+static int init_percpu_area(unsigned int cpu)
+{
+    char *p;
+    if ( __per_cpu_offset[cpu] != INVALID_PERCPU_AREA )
+        return -EBUSY;
+    if ( (p = alloc_xenheap_pages(PERCPU_ORDER, 0)) == NULL )
+        return -ENOMEM;
+    memset(p, 0, __per_cpu_data_end - __per_cpu_start);
+    __per_cpu_offset[cpu] = p - __per_cpu_start;
+    return 0;
+}
+
+struct free_info {
+    unsigned int cpu;
+    struct rcu_head rcu;
+};
+static DEFINE_PER_CPU(struct free_info, free_info);
+
+static void _free_percpu_area(struct rcu_head *head)
+{
+    struct free_info *info = container_of(head, struct free_info, rcu);
+    unsigned int cpu = info->cpu;
+    char *p = __per_cpu_start + __per_cpu_offset[cpu];
+    free_xenheap_pages(p, PERCPU_ORDER);
+    __per_cpu_offset[cpu] = INVALID_PERCPU_AREA;
+}
+
+static void free_percpu_area(unsigned int cpu)
+{
+    struct free_info *info = &per_cpu(free_info, cpu);
+    info->cpu = cpu;
+    call_rcu(&info->rcu, _free_percpu_area);
+}
+
+static int cpu_percpu_callback(
+    struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    int rc = 0;
+
+    switch ( action )
+    {
+    case CPU_UP_PREPARE:
+        rc = init_percpu_area(cpu);
+        break;
+    case CPU_UP_CANCELED:
+    case CPU_DEAD:
+        free_percpu_area(cpu);
+        break;
+    default:
+        break;
+    }
+
+    return !rc ? NOTIFY_DONE : notifier_from_errno(rc);
+}
+
+static struct notifier_block cpu_percpu_nfb = {
+    .notifier_call = cpu_percpu_callback,
+    .priority = 100 /* highest priority */
+};
+
+static int __init percpu_presmp_init(void)
+{
+    register_cpu_notifier(&cpu_percpu_nfb);
+    return 0;
+}
+presmp_initcall(percpu_presmp_init);
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/setup.c	Tue Mar 13 15:28:41 2012 +0000
@@ -38,22 +38,14 @@
 #include <asm/setup.h>
 #include "gic.h"
 
-/* maxcpus: maximum number of CPUs to activate. */
-static unsigned int __initdata max_cpus = NR_CPUS;
-
-/* Xen stack for bringing up the first CPU. */
-unsigned char __initdata init_stack[STACK_SIZE] __attribute__((__aligned__(STACK_SIZE)));
-
-extern char __init_begin[], __init_end[], __bss_start[];
+/* Spinlock for serializing CPU bringup */
+unsigned long __initdata boot_gate = 1;
+/* Number of non-boot CPUs ready to enter C */
+unsigned long __initdata ready_cpus = 0;
 
 static __attribute_used__ void init_done(void)
 {
-    /* TODO: free (or page-protect) the init areas.
-       memset(__init_begin, 0xcc, __init_end - __init_begin);
-       free_xen_data(__init_begin, __init_end);
-    */
-    printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
-
+    free_init_memory();
     startup_cpu_idle_loop();
 }
 
@@ -151,14 +143,17 @@
     end_boot_allocator();
 }
 
+/* C entry point for boot CPU */
 void __init start_xen(unsigned long boot_phys_offset,
                       unsigned long arm_type,
-                      unsigned long atag_paddr)
-
+                      unsigned long atag_paddr,
+                      unsigned long cpuid)
 {
     void *fdt;
     size_t fdt_size;
-    int i;
+    int cpus, i;
+    paddr_t gate_pa;
+    unsigned long *gate;
 
     fdt = (void *)BOOT_MISC_VIRT_START
         + (atag_paddr & ((1 << SECOND_SHIFT) - 1));
@@ -174,15 +169,29 @@
     console_init_preirq();
 #endif
 
+    percpu_init_areas();
+    set_processor_id(0); /* needed early, for smp_processor_id() */
+
+    cpus = gic_init();
+
+    printk("Waiting for %i other CPUs to be ready\n", cpus - 1);
+    /* Bring the other CPUs up to paging before the original
+     * copy of .text gets overwritten.  We need to use the unrelocated
+     * copy of boot_gate as that's the one the others can see. */ 
+    gate_pa = ((unsigned long) &boot_gate) + boot_phys_offset;
+    gate = map_domain_page(gate_pa >> PAGE_SHIFT) + (gate_pa & ~PAGE_MASK); 
+    *gate = 0;
+    unmap_domain_page(gate);
+    /* Now send an event to wake the first non-boot CPU */
+    asm volatile("dsb; isb; sev");
+    /* And wait for them all to be ready. */
+    while ( ready_cpus + 1 < cpus )
+        smp_rmb();
+
     __set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
-    set_processor_id(0); /* needed early, for smp_processor_id() */
 
-    /* TODO: smp_prepare_boot_cpu(void) */
-    cpumask_set_cpu(smp_processor_id(), &cpu_online_map);
-    cpumask_set_cpu(smp_processor_id(), &cpu_present_map);
-
-    smp_prepare_cpus(max_cpus);
+    smp_prepare_cpus(cpus);
 
     init_xen_time();
 
@@ -208,8 +217,6 @@
 
     init_IRQ();
 
-    gic_init();
-
     gic_route_irqs();
 
     init_maintenance_interrupt();
@@ -231,7 +238,7 @@
 
     for_each_present_cpu ( i )
     {
-        if ( (num_online_cpus() < max_cpus) && !cpu_online(i) )
+        if ( (num_online_cpus() < cpus) && !cpu_online(i) )
         {
             int ret = cpu_up(i);
             if ( ret != 0 )
@@ -269,7 +276,11 @@
 
     domain_unpause_by_systemcontroller(dom0);
 
-    reset_stack_and_jump(init_done);
+    /* Switch on to the dynamically allocated stack for the idle vcpu
+     * since the static one we're running on is about to be freed. */
+    memcpy(idle_vcpu[0]->arch.cpu_info, get_cpu_info(), 
+           sizeof(struct cpu_info));
+    switch_stack_and_jump(idle_vcpu[0]->arch.cpu_info, init_done);
 }
 
 void arch_get_xen_caps(xen_capabilities_info_t *info)
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/shutdown.c
--- a/xen/arch/arm/shutdown.c	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/shutdown.c	Tue Mar 13 15:28:41 2012 +0000
@@ -1,18 +1,64 @@
 #include <xen/config.h>
+#include <xen/console.h>
+#include <xen/cpu.h>
+#include <xen/delay.h>
 #include <xen/lib.h>
+#include <xen/mm.h>
+#include <xen/smp.h>
+
+static void raw_machine_reset(void)
+{
+    /* XXX get this from device tree */
+#ifdef SP810_ADDRESS
+    /* Use the SP810 system controller to force a reset */
+    volatile uint32_t *sp810;
+    set_fixmap(FIXMAP_MISC, SP810_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
+    sp810 = ((uint32_t *)
+             (FIXMAP_ADDR(FIXMAP_MISC) + (SP810_ADDRESS & ~PAGE_MASK)));
+    sp810[0] = 0x3; /* switch to slow mode */
+    dsb(); isb();
+    sp810[1] = 0x1; /* writing any value to SCSYSSTAT reg will reset system */
+    dsb(); isb();
+    clear_fixmap(FIXMAP_MISC);
+#endif
+}
+
+static void halt_this_cpu(void *arg)
+{
+    __cpu_disable();
+    stop_cpu();
+}
 
 void machine_halt(void)
 {
-        /* TODO: halt */
-        while(1) ;
+    watchdog_disable();
+    console_start_sync();
+    local_irq_enable();
+    smp_call_function(halt_this_cpu, NULL, 0);
+    halt_this_cpu(NULL);
 }
 
 void machine_restart(unsigned int delay_millisecs)
 {
-        /* TODO: restart */
-        printk("Cannot restart yet\n");
-        while(1);
+    int timeout = 10;
+
+    local_irq_enable();
+    smp_call_function(halt_this_cpu, NULL, 0);
+    local_irq_disable();
+
+    mdelay(delay_millisecs);
+
+    /* Wait at most another 10ms for all other CPUs to go offline. */
+    while ( (num_online_cpus() > 1) && (timeout-- > 0) )
+        mdelay(1);
+
+    while ( 1 )
+    {
+        raw_machine_reset();
+        mdelay(100);
+    }
 }
+
 /*
  * Local variables:
  * mode: C
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Tue Mar 13 15:28:41 2012 +0000
@@ -16,9 +16,16 @@
  * GNU General Public License for more details.
  */
 
+#include <xen/cpu.h>
 #include <xen/cpumask.h>
+#include <xen/delay.h>
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/sched.h>
 #include <xen/smp.h>
-#include <xen/init.h>
+#include <xen/softirq.h>
+#include "gic.h"
 
 cpumask_t cpu_online_map;
 EXPORT_SYMBOL(cpu_online_map);
@@ -27,19 +34,142 @@
 cpumask_t cpu_possible_map;
 EXPORT_SYMBOL(cpu_possible_map);
 
+/* Xen stack for bringing up the first CPU. */
+static unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
+       __attribute__((__aligned__(STACK_SIZE)));
+
+/* Pointer to the stack, used by head.S when entering C */
+unsigned char *init_stack = cpu0_boot_stack;
+
 void __init
 smp_prepare_cpus (unsigned int max_cpus)
 {
-        set_processor_id(0); /* needed early, for smp_processor_id() */
+    int i;
+    set_processor_id(0); /* needed early, for smp_processor_id() */
 
-        cpumask_clear(&cpu_online_map);
-        cpumask_clear(&cpu_present_map);
-        cpumask_clear(&cpu_possible_map);
-        cpumask_set_cpu(0, &cpu_online_map);
-        cpumask_set_cpu(0, &cpu_present_map);
-        cpumask_set_cpu(0, &cpu_possible_map);
-        return;
+    cpumask_clear(&cpu_online_map);
+    cpumask_set_cpu(0, &cpu_online_map);
+
+    cpumask_clear(&cpu_possible_map);
+    for ( i = 0; i < max_cpus; i++ )
+        cpumask_set_cpu(i, &cpu_possible_map);
+    cpumask_copy(&cpu_present_map, &cpu_possible_map);
 }
+
+/* Shared state for coordinating CPU bringup */
+unsigned long smp_up_cpu = 0;
+static bool_t cpu_is_dead = 0;
+
+/* Boot the current CPU */
+void __cpuinit start_secondary(unsigned long boot_phys_offset,
+                               unsigned long arm_type,
+                               unsigned long atag_paddr,
+                               unsigned long cpuid)
+{
+    memset(get_cpu_info(), 0, sizeof (struct cpu_info));
+
+    /* TODO: handle boards where CPUIDs are not contiguous */
+    set_processor_id(cpuid);
+
+    /* Setup Hyp vector base */
+    WRITE_CP32((uint32_t) hyp_traps_vector, HVBAR);
+
+    dprintk(XENLOG_DEBUG, "CPU %li awake.\n", cpuid);
+
+    mmu_init_secondary_cpu();
+    gic_init_secondary_cpu();
+
+    set_current(idle_vcpu[cpuid]);
+    this_cpu(curr_vcpu) = current;
+
+    /* Run local notifiers */
+    notify_cpu_starting(cpuid);
+    wmb();
+
+    /* Now report this CPU is up */
+    cpumask_set_cpu(cpuid, &cpu_online_map);
+    wmb();
+
+    local_irq_enable();
+
+    dprintk(XENLOG_DEBUG, "CPU %li booted.\n", cpuid);
+
+    startup_cpu_idle_loop();
+}
+
+/* Shut down the current CPU */
+void __cpu_disable(void)
+{
+    unsigned int cpu = get_processor_id();
+
+    local_irq_disable();
+    gic_disable_cpu();
+    /* Allow any queued timer interrupts to get serviced */
+    local_irq_enable();
+    mdelay(1);
+    local_irq_disable();
+
+    /* It's now safe to remove this processor from the online map */
+    cpumask_clear_cpu(cpu, &cpu_online_map);
+
+    if ( cpu_disable_scheduler(cpu) )
+        BUG();
+    mb();
+
+    /* Return to caller; eventually the IPI mechanism will unwind and the 
+     * scheduler will drop to the idle loop, which will call stop_cpu(). */
+}
+
+void stop_cpu(void)
+{
+    local_irq_disable();
+    cpu_is_dead = 1;
+    /* Make sure the write happens before we sleep forever */
+    dsb();
+    isb();
+    while ( 1 ) 
+        asm volatile("wfi");
+}
+
+/* Bring up a remote CPU */
+int __cpu_up(unsigned int cpu)
+{
+    /* Tell the remote CPU which stack to boot on. */
+    init_stack = idle_vcpu[cpu]->arch.stack;
+
+    /* Unblock the CPU.  It should be waiting in the loop in head.S
+     * for an event to arrive when smp_up_cpu matches its cpuid. */
+    smp_up_cpu = cpu;
+    asm volatile("dsb; isb; sev");
+
+    while ( !cpu_online(cpu) )
+    {
+        cpu_relax();
+        process_pending_softirqs();
+    }
+
+    return 0;
+}
+
+/* Wait for a remote CPU to die */
+void __cpu_die(unsigned int cpu)
+{
+    unsigned int i = 0;
+
+    while ( !cpu_is_dead )
+    {
+        mdelay(100);
+        cpu_relax();
+        process_pending_softirqs();
+        if ( (++i % 10) == 0 )
+            printk(KERN_ERR "CPU %u still not dead...\n", cpu);
+        mb();
+    }
+    cpu_is_dead = 0;
+    mb();
+}
+
+
 /*
  * Local variables:
  * mode: C
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/time.c
--- a/xen/arch/arm/time.c	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/time.c	Tue Mar 13 15:28:41 2012 +0000
@@ -171,6 +171,16 @@
     request_irq(30, timer_interrupt, 0, "phytimer", NULL);
 }
 
+/* Wait a set number of microseconds */
+void udelay(unsigned long usecs)
+{
+    s_time_t deadline = get_s_time() + 1000 * (s_time_t) usecs;
+    while ( get_s_time() - deadline < 0 )
+        ;
+    dsb();
+    isb();
+}
+
 /*
  * Local variables:
  * mode: C
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/include/asm-arm/config.h
--- a/xen/include/asm-arm/config.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/include/asm-arm/config.h	Tue Mar 13 15:28:41 2012 +0000
@@ -119,6 +119,9 @@
 #define GIC_CR_OFFSET 0x2000
 #define GIC_HR_OFFSET 0x4000 /* Guess work http://lists.infradead.org/pipermail/linux-arm-kernel/2011-September/064219.html */
 #define GIC_VR_OFFSET 0x6000 /* Virtual Machine CPU interface) */
+/* Board-specific: base address of system controller */
+#define SP810_ADDRESS 0x1C020000
+
 
 #endif /* __ARM_CONFIG_H__ */
 /*
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/include/asm-arm/current.h
--- a/xen/include/asm-arm/current.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/include/asm-arm/current.h	Tue Mar 13 15:28:41 2012 +0000
@@ -40,17 +40,19 @@
 #define get_current()         (this_cpu(curr_vcpu))
 #define __set_current(vcpu)   (this_cpu(curr_vcpu) = (vcpu))
 #define set_current(vcpu)     do {                                      \
-    vcpu->arch.cpu_info->processor_id = get_processor_id();             \
+    int cpu = get_processor_id();                                       \
+    vcpu->arch.cpu_info->processor_id = cpu;                            \
+    vcpu->arch.cpu_info->per_cpu_offset = __per_cpu_offset[cpu];        \
     __set_current(vcpu);                                                \
 } while (0)
 #define current               (get_current())
 
 #define guest_cpu_user_regs() (&get_cpu_info()->guest_cpu_user_regs)
 
-#define reset_stack_and_jump(__fn)              \
-    __asm__ __volatile__ (                      \
-        "mov sp,%0; b "STR(__fn)      \
-        : : "r" (guest_cpu_user_regs()) : "memory" )
+#define switch_stack_and_jump(stack, fn)                                \
+    asm volatile ("mov sp,%0; b " STR(fn) : : "r" (stack) : "memory" )
+
+#define reset_stack_and_jump(fn) switch_stack_and_jump(get_cpu_info(), fn)
 
 #endif
 
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/include/asm-arm/delay.h
--- a/xen/include/asm-arm/delay.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/include/asm-arm/delay.h	Tue Mar 13 15:28:41 2012 +0000
@@ -1,8 +1,7 @@
 #ifndef _ARM_DELAY_H
 #define _ARM_DELAY_H
 
-extern void __udelay(unsigned long usecs);
-#define udelay(n) __udelay(n)
+extern void udelay(unsigned long usecs);
 
 #endif /* defined(_ARM_DELAY_H) */
 /*
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/include/asm-arm/mm.h	Tue Mar 13 15:28:41 2012 +0000
@@ -136,6 +136,8 @@
 
 /* Boot-time pagetable setup */
 extern void setup_pagetables(unsigned long boot_phys_offset);
+/* 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.
  * Base must be 32MB aligned and size a multiple of 32MB. */
 extern void setup_xenheap_mappings(unsigned long base_mfn, unsigned long nr_mfns);
@@ -276,6 +278,10 @@
 #define memguard_guard_stack(_p)       ((void)0)
 #define memguard_guard_range(_p,_l)    ((void)0)
 #define memguard_unguard_range(_p,_l)  ((void)0)
+
+/* Release all __init and __initdata ranges to be reused */
+void free_init_memory(void);
+
 int guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
                                           unsigned int order);
 
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/include/asm-arm/page.h
--- a/xen/include/asm-arm/page.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/include/asm-arm/page.h	Tue Mar 13 15:28:41 2012 +0000
@@ -203,6 +203,22 @@
 }
 
 /*
+ * Flush all hypervisor mappings from the TLB and branch predictor.
+ * This is needed after changing Xen code mappings. 
+ */
+static inline void flush_xen_text_tlb(void)
+{
+    register unsigned long r0 asm ("r0");
+    asm volatile (
+        "dsb;"                        /* Ensure visibility of PTE writes */
+        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
+        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
+        "dsb;"                        /* Ensure completion of TLB+BP flush */
+        "isb;"
+        : : "r" (r0) /*dummy*/ : "memory");
+}
+
+/*
  * Flush all hypervisor mappings from the data TLB. This is not
  * sufficient when changing code mappings or for self modifying code.
  */
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/include/asm-arm/percpu.h
--- a/xen/include/asm-arm/percpu.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/include/asm-arm/percpu.h	Tue Mar 13 15:28:41 2012 +0000
@@ -12,8 +12,11 @@
     __attribute__((__section__(".bss.percpu" #suffix)))         \
     __typeof__(type) per_cpu_##name
 
-#define per_cpu(var, cpu) ((&per_cpu__##var)[cpu?0:0])
-#define __get_cpu_var(var) per_cpu__##var
+
+#define per_cpu(var, cpu)  \
+    (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
+#define __get_cpu_var(var) \
+    (*RELOC_HIDE(&per_cpu__##var, get_cpu_info()->per_cpu_offset))
 
 #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
 
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/include/asm-arm/smp.h
--- a/xen/include/asm-arm/smp.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/include/asm-arm/smp.h	Tue Mar 13 15:28:41 2012 +0000
@@ -14,6 +14,8 @@
 
 #define raw_smp_processor_id() (get_processor_id())
 
+extern void stop_cpu(void);
+
 #endif
 /*
  * Local variables:

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOM-0001pG-11; Wed, 14 Mar 2012 12:33:22 +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 1S7nOK-0001m3-Cc
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Received: from [193.109.254.147:4708] by server-8.bemta-14.messagelabs.com id
	A3/47-04087-F00906F4; Wed, 14 Mar 2012 12:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-27.messagelabs.com!1331728396!506012!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6394 invoked from network); 14 Mar 2012 12:33:17 -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;
	14 Mar 2012 12:33: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 1S7nOG-0007Tz-0W
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOF-0008K3-MU
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:15 +0000
Message-Id: <E1S7nOF-0008K3-MU@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Merge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331652521 0
# Node ID d54cf3fa7ee6d57acf7500cd53da135e0c584948
# Parent  703a339e11abf1ea14ee528f4194b308fcb3ea88
# Parent  773d0367087212c43faf8cdcc21cf443b1ea0046
Merge
---


diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/Makefile	Tue Mar 13 15:28:41 2012 +0000
@@ -13,6 +13,7 @@
 obj-y += kernel.o
 obj-y += mm.o
 obj-y += p2m.o
+obj-y += percpu.o
 obj-y += guestcopy.o
 obj-y += setup.o
 obj-y += time.o
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/domain.c
--- a/xen/arch/arm/domain.c	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/domain.c	Tue Mar 13 15:28:41 2012 +0000
@@ -31,12 +31,14 @@
 {
     for ( ; ; )
     {
-        /* TODO
-           if ( cpu_is_offline(smp_processor_id()) )
-           play_dead();
-           (*pm_idle)();
-           BUG();
-        */
+        if ( cpu_is_offline(smp_processor_id()) )
+            stop_cpu();
+
+        local_irq_disable();
+        if ( cpu_is_haltable(smp_processor_id()) )
+            asm volatile ("dsb; wfi");
+        local_irq_enable();
+
         do_tasklet();
         do_softirq();
     }
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/dummy.S
--- a/xen/arch/arm/dummy.S	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/dummy.S	Tue Mar 13 15:28:41 2012 +0000
@@ -7,14 +7,10 @@
 x:	mov pc, lr
 	
 /* SMP support */
-DUMMY(__cpu_die);
-DUMMY(__cpu_disable);
-DUMMY(__cpu_up);
 DUMMY(per_cpu__cpu_core_mask);
 DUMMY(per_cpu__cpu_sibling_mask);
 DUMMY(node_online_map);
 DUMMY(smp_send_state_dump);
-DUMMY(__per_cpu_offset);
 
 /* PIRQ support */
 DUMMY(alloc_pirq_struct);
@@ -62,5 +58,4 @@
 DUMMY(hypercall_create_continuation);
 DUMMY(send_timer_event);
 DUMMY(share_xen_page_with_privileged_guests);
-DUMMY(__udelay);
 DUMMY(wallclock_time);
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/gic.c	Tue Mar 13 15:28:41 2012 +0000
@@ -224,7 +224,9 @@
 {
     int i;
 
-    /* Disable all PPI and enable all SGI */
+    /* 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 */
     /* Set PPI and SGI priorities */
@@ -237,20 +239,29 @@
     GICC[GICC_CTLR] = GICC_CTL_ENABLE|GICC_CTL_EOI;    /* Turn on delivery */
 }
 
+static void gic_cpu_disable(void)
+{
+    GICC[GICC_CTLR] = 0;
+}
+
 static void __cpuinit gic_hyp_init(void)
 {
     uint32_t vtr;
 
     vtr = GICH[GICH_VTR];
     nr_lrs  = (vtr & GICH_VTR_NRLRGS) + 1;
-    printk("GICH: %d list registers available\n", nr_lrs);
 
     GICH[GICH_HCR] = GICH_HCR_EN;
     GICH[GICH_MISR] = GICH_MISR_EOI;
 }
 
+static void __cpuinit gic_hyp_disable(void)
+{
+    GICH[GICH_HCR] = 0;
+}
+
 /* Set up the GIC */
-void gic_init(void)
+int __init gic_init(void)
 {
     /* XXX FIXME get this from devicetree */
     gic.dbase = GIC_BASE_ADDRESS + GIC_DR_OFFSET;
@@ -272,6 +283,26 @@
     gic_hyp_init();
 
     spin_unlock(&gic.lock);
+
+    return gic.cpus;
+}
+
+/* Set up the per-CPU parts of the GIC for a secondary CPU */
+void __cpuinit gic_init_secondary_cpu(void)
+{
+    spin_lock(&gic.lock);
+    gic_cpu_init();
+    gic_hyp_init();
+    spin_unlock(&gic.lock);
+}
+
+/* Shut down the per-CPU GIC interface */
+void gic_disable_cpu(void)
+{
+    spin_lock(&gic.lock);
+    gic_cpu_disable();
+    gic_hyp_disable();
+    spin_unlock(&gic.lock);
 }
 
 void gic_route_irqs(void)
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/gic.h
--- a/xen/arch/arm/gic.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/gic.h	Tue Mar 13 15:28:41 2012 +0000
@@ -138,8 +138,12 @@
 
 /* Accept an interrupt from the GIC and dispatch its handler */
 extern void gic_interrupt(struct cpu_user_regs *regs, int is_fiq);
-/* Bring up the interrupt controller */
-extern void gic_init(void);
+/* Bring up the interrupt controller, and report # cpus attached */
+extern int gic_init(void);
+/* Bring up a secondary CPU's per-CPU GIC interface */
+extern void gic_init_secondary_cpu(void);
+/* Take down a CPU's per-CPU GIC interface */
+extern void gic_disable_cpu(void);
 /* setup the gic virtual interface for a guest */
 extern void gicv_setup(struct domain *d);
 #endif
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/head.S	Tue Mar 13 15:28:41 2012 +0000
@@ -62,22 +62,36 @@
 #endif
 
 	/* Are we the boot CPU? */
+	mov   r12, #0                /* r12 := CPU ID */
 	mrc   CP32(r0, MPIDR)
 	tst   r0, #(1<<31)           /* Multiprocessor extension supported? */
 	beq   boot_cpu
 	tst   r0, #(1<<30)           /* Uniprocessor system? */
 	bne   boot_cpu
-	bics  r0, r0, #(0xff << 24)  /* Ignore flags */
-	beq   boot_cpu               /* If all other fields are 0, we win */
+	bics  r12, r0, #(0xff << 24) /* Mask out flags to get CPU ID */
+	beq   boot_cpu               /* If we're CPU 0, boot now */
 
-1:	wfi
-	b     1b
-	
+	/* Non-boot CPUs wait here to be woken up one at a time.
+	 * This is basically an open-coded spin-lock to serialize. */
+	ldr   r0, =boot_gate         /* VA of gate */
+	add   r0, r0, r10            /* PA of gate */
+	mov   r1, #1                 /* (1 == locked) */
+1:	wfe
+	ldrex r2, [r0]               /* Linked read of current value */
+	teq   r2, #0                 /* (0 == unlocked) */
+	strexeq r2, r1, [r0]         /* Matching update -> locked */
+	teq   r2, #0                 /* (0 == succeeded) */
+	bne   1b
+
 boot_cpu:
 #ifdef EARLY_UART_ADDRESS
-	/* Say hello */
 	ldr   r11, =EARLY_UART_ADDRESS  /* r11 := UART base address */
-	bl    init_uart
+	teq   r12, #0                   /* CPU 0 sets up the UART too */
+	bleq  init_uart
+	PRINT("- CPU ")
+	mov   r0, r12
+	bl    putn
+	PRINT(" booting -\r\n")
 #endif
 
 	/* Check that this CPU has Hyp mode */
@@ -85,7 +99,6 @@
 	and   r0, r0, #0xf000        /* Bits 12-15 define virt extensions */
 	teq   r0, #0x1000            /* Must == 0x1 or may be incompatible */
 	beq   1f
-	bl    putn
 	PRINT("- CPU doesn't support the virtualization extensions -\r\n")
 	b     fail
 1:
@@ -185,6 +198,10 @@
 	mov   r5, #0                 /* r4:r5 is paddr (xen_pagetable) */
 	mcrr  CP64(r4, r5, HTTBR)
 
+	/* Non-boot CPUs don't need to rebuild the pagetable */
+	teq   r12, #0
+	bne   pt_ready
+	
 	/* Build the baseline idle pagetable's first-level entries */
 	ldr   r1, =xen_second
 	add   r1, r1, r10            /* r1 := paddr (xen_second) */
@@ -226,6 +243,7 @@
 	add   r4, r4, #8
 	strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */
 
+pt_ready:
 	PRINT("- Turning on paging -\r\n")
 
 	ldr   r1, =paging            /* Explicit vaddr, not RIP-relative */
@@ -238,7 +256,7 @@
 paging:
 
 #ifdef EARLY_UART_ADDRESS
-	/* Recover the UART address in the new address space */
+	/* Recover the UART address in the new address space. */
 	lsl   r11, #11
 	lsr   r11, #11               /* UART base's offset from 2MB base */
 	adr   r0, start
@@ -246,15 +264,66 @@
 	add   r11, r11, r0           /* r11 := vaddr (UART base address) */
 #endif
 
-	PRINT("- Entering C -\r\n")
+	PRINT("- Ready -\r\n")
 
-	ldr   sp, =init_stack        /* Supply a stack */
+	/* The boot CPU should go straight into C now */
+	teq   r12, #0
+	beq   launch
+
+	/* Signal the next non-boot CPU to come and join us here */
+	ldr   r0, =boot_gate         /* VA of gate */
+	add   r0, r0, r10            /* PA of gate */
+	mov   r1, #0                 /* (0 == unlocked) */
+	str   r1, [r0]
+	dsb
+	isb
+	sev
+
+	/* Move on to the relocated pagetables */
+	mov   r0, #0
+	ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
+	add   r4, r4, r10            /* PA of it */
+	ldrd  r4, r5, [r4]           /* Actual value */
+	mcrr  CP64(r4, r5, HTTBR)
+	mcr   CP32(r0, TLBIALLH)     /* Flush hypervisor TLB */
+	mcr   CP32(r0, BPIALL)       /* Flush branch predictor */
+	dsb                          /* Ensure completion of TLB+BP flush */
+	isb
+ 	/* Now, the UART is in its proper fixmap address */
+	ldrne r11, =FIXMAP_ADDR(FIXMAP_CONSOLE)
+
+	/* Non-boot CPUs report that they've got this far */
+	ldr   r0, =ready_cpus
+1:	ldrex r1, [r0]               /*            { read # of ready CPUs } */
+	add   r1, r1, #1             /* Atomically { ++                   } */
+	strex r2, r1, [r0]           /*            { writeback            } */
+	teq   r2, #0
+	bne   1b
+	dsb
+
+	/* Here, the non-boot CPUs must wait again -- they're now running on
+	 * the boot CPU's pagetables so it's safe for the boot CPU to
+	 * overwrite the non-relocated copy of Xen.  Once it's done that,
+	 * and brought up the memory allocator, non-boot CPUs can get their
+	 * own stacks and enter C. */
+1:	wfe
+	dsb
+	ldr   r0, =smp_up_cpu
+	ldr   r1, [r0]               /* Which CPU is being booted? */
+	teq   r1, r12                /* Is it us? */
+	bne   1b
+
+launch:	
+	ldr   r0, =init_stack        /* Find the boot-time stack */
+	ldr   sp, [r0]
 	add   sp, #STACK_SIZE        /* (which grows down from the top). */
 	sub   sp, #CPUINFO_sizeof    /* Make room for CPU save record */
 	mov   r0, r10                /* Marshal args: - phys_offset */
 	mov   r1, r7                 /*               - machine type */
 	mov   r2, r8                 /*               - ATAG address */
-	b     start_xen              /* and disappear into the land of C */
+	movs  r3, r12                /*               - CPU ID */
+	beq   start_xen              /* and disappear into the land of C */
+	b     start_secondary        /* (to the appropriate entry point) */
 
 /* Fail-stop
  * r0: string explaining why */
@@ -288,7 +357,7 @@
 	tst   r2, #0x8               /* Check BUSY bit */
 	bne   puts                   /* Wait for the UART to be ready */
 	ldrb  r2, [r0], #1           /* Load next char */
-	teq   r2, #0                 /* Exit on nul*/
+	teq   r2, #0                 /* Exit on nul */
 	moveq pc, lr
 	str   r2, [r11]              /* -> UARTDR (Data Register) */
 	b     puts
@@ -308,10 +377,8 @@
 	lsl   r0, #4                 /* Roll it through one nybble at a time */
 	subs  r3, r3, #1
 	bne   1b
-	adr   r0, crlf               /* Finish with a newline */
-	b     puts
+	mov   pc, lr
 
-crlf:	.asciz "\r\n"
 hex:	.ascii "0123456789abcdef"
 	.align 2
 
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/mm.c	Tue Mar 13 15:28:41 2012 +0000
@@ -36,6 +36,9 @@
 static lpae_t xen_fixmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 static lpae_t xen_xenmap[LPAE_ENTRIES] __attribute__((__aligned__(4096)));
 
+/* Non-boot CPUs use this to find the correct pagetables. */
+uint64_t boot_httbr;
+
 /* Limits of the Xen heap */
 unsigned long xenheap_mfn_start, xenheap_mfn_end;
 unsigned long xenheap_virt_end;
@@ -45,6 +48,8 @@
 
 unsigned long max_page;
 
+extern char __init_begin[], __init_end[];
+
 /* Map a 4k page in a fixmap entry */
 void set_fixmap(unsigned map, unsigned long mfn, unsigned attributes)
 {
@@ -156,14 +161,6 @@
     lpae_t pte, *p;
     int i;
 
-    if ( boot_phys_offset != 0 )
-    {
-        /* Remove the old identity mapping of the boot paddr */
-        pte.bits = 0;
-        dest_va = (unsigned long)_start + boot_phys_offset;
-        write_pte(xen_second + second_linear_offset(dest_va), pte);
-    }
-
     xen_paddr = device_tree_get_xen_paddr();
 
     /* Map the destination in the boot misc area. */
@@ -186,11 +183,18 @@
     for ( i = 0; i < 4; i++)
         p[i].pt.base += (phys_offset - boot_phys_offset) >> PAGE_SHIFT;
     p = (void *) xen_second + dest_va - (unsigned long) _start;
+    if ( boot_phys_offset != 0 )
+    {
+        /* Remove the old identity mapping of the boot paddr */
+        unsigned long va = (unsigned long)_start + boot_phys_offset;
+        p[second_linear_offset(va)].bits = 0;
+    }
     for ( i = 0; i < 4 * LPAE_ENTRIES; i++)
         if ( p[i].pt.valid )
                 p[i].pt.base += (phys_offset - boot_phys_offset) >> PAGE_SHIFT;
 
     /* Change pagetables to the copy in the relocated Xen */
+    boot_httbr = (unsigned long) xen_pgtable + phys_offset;
     asm volatile (
         STORE_CP64(0, HTTBR)          /* Change translation base */
         "dsb;"                        /* Ensure visibility of HTTBR update */
@@ -198,22 +202,12 @@
         STORE_CP32(0, BPIALL)         /* Flush branch predictor */
         "dsb;"                        /* Ensure completion of TLB+BP flush */
         "isb;"
-        : : "r" ((unsigned long) xen_pgtable + phys_offset) : "memory");
+        : : "r" (boot_httbr) : "memory");
 
     /* Undo the temporary map */
     pte.bits = 0;
     write_pte(xen_second + second_table_offset(dest_va), pte);
-    /*
-     * Have removed a mapping previously used for .text. Flush everything
-     * for safety.
-     */
-    asm volatile (
-        "dsb;"                        /* Ensure visibility of PTE write */
-        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
-        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
-        "dsb;"                        /* Ensure completion of TLB+BP flush */
-        "isb;"
-        : : "r" (i /*dummy*/) : "memory");
+    flush_xen_text_tlb();
 
     /* Link in the fixmap pagetable */
     pte = mfn_to_xen_entry((((unsigned long) xen_fixmap) + phys_offset)
@@ -249,18 +243,19 @@
     pte.pt.table = 1;
     write_pte(xen_second + second_linear_offset(XEN_VIRT_START), pte);
     /* Have changed a mapping used for .text. Flush everything for safety. */
-    asm volatile (
-        "dsb;"                        /* Ensure visibility of PTE write */
-        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
-        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
-        "dsb;"                        /* Ensure completion of TLB+BP flush */
-        "isb;"
-        : : "r" (i /*dummy*/) : "memory");
+    flush_xen_text_tlb();
 
     /* From now on, no mapping may be both writable and executable. */
     WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
 }
 
+/* MMU setup for secondary CPUS (which already have paging enabled) */
+void __cpuinit mmu_init_secondary_cpu(void)
+{
+    /* From now on, no mapping may be both writable and executable. */
+    WRITE_CP32(READ_CP32(HSCTLR) | SCTLR_WXN, HSCTLR);
+}
+
 /* Create Xen's mappings of memory.
  * Base and virt must be 32MB aligned and size a multiple of 32MB. */
 static void __init create_mappings(unsigned long virt,
@@ -319,6 +314,64 @@
     frametable_virt_end = FRAMETABLE_VIRT_START + (nr_pages * sizeof(struct page_info));
 }
 
+enum mg { mg_clear, mg_ro, mg_rw, mg_rx };
+static void set_pte_flags_on_range(const char *p, unsigned long l, enum mg mg)
+{
+    lpae_t pte;
+    int i;
+
+    ASSERT(is_kernel(p) && is_kernel(p + l));
+
+    /* Can only guard in page granularity */
+    ASSERT(!((unsigned long) p & ~PAGE_MASK));
+    ASSERT(!(l & ~PAGE_MASK));
+
+    for ( i = (p - _start) / PAGE_SIZE; 
+          i < (p + l - _start) / PAGE_SIZE; 
+          i++ )
+    {
+        pte = xen_xenmap[i];
+        switch ( mg )
+        {
+        case mg_clear:
+            pte.pt.valid = 0;
+            break;
+        case mg_ro:
+            pte.pt.valid = 1;
+            pte.pt.pxn = 1;
+            pte.pt.xn = 1;
+            pte.pt.ro = 1;
+            break;
+        case mg_rw:
+            pte.pt.valid = 1;
+            pte.pt.pxn = 1;
+            pte.pt.xn = 1;
+            pte.pt.ro = 0;
+            break;
+        case mg_rx:
+            pte.pt.valid = 1;
+            pte.pt.pxn = 0;
+            pte.pt.xn = 0;
+            pte.pt.ro = 1;
+            break;
+        }
+        write_pte(xen_xenmap + i, pte);
+    }
+    flush_xen_text_tlb();
+}
+
+/* Release all __init and __initdata ranges to be reused */
+void free_init_memory(void)
+{
+    paddr_t pa = virt_to_maddr(__init_begin);
+    unsigned long len = __init_end - __init_begin;
+    set_pte_flags_on_range(__init_begin, len, mg_rw);
+    memset(__init_begin, 0xcc, len);
+    set_pte_flags_on_range(__init_begin, len, mg_clear);
+    init_domheap_pages(pa, pa + len);
+    printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
+}
+
 void arch_dump_shared_mem_info(void)
 {
 }
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/percpu.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/percpu.c	Tue Mar 13 15:28:41 2012 +0000
@@ -0,0 +1,85 @@
+#include <xen/config.h>
+#include <xen/percpu.h>
+#include <xen/cpu.h>
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/rcupdate.h>
+
+unsigned long __per_cpu_offset[NR_CPUS];
+#define INVALID_PERCPU_AREA (-(long)__per_cpu_start)
+#define PERCPU_ORDER (get_order_from_bytes(__per_cpu_data_end-__per_cpu_start))
+
+void __init percpu_init_areas(void)
+{
+    unsigned int cpu;
+    for ( cpu = 1; cpu < NR_CPUS; cpu++ )
+        __per_cpu_offset[cpu] = INVALID_PERCPU_AREA;
+}
+
+static int init_percpu_area(unsigned int cpu)
+{
+    char *p;
+    if ( __per_cpu_offset[cpu] != INVALID_PERCPU_AREA )
+        return -EBUSY;
+    if ( (p = alloc_xenheap_pages(PERCPU_ORDER, 0)) == NULL )
+        return -ENOMEM;
+    memset(p, 0, __per_cpu_data_end - __per_cpu_start);
+    __per_cpu_offset[cpu] = p - __per_cpu_start;
+    return 0;
+}
+
+struct free_info {
+    unsigned int cpu;
+    struct rcu_head rcu;
+};
+static DEFINE_PER_CPU(struct free_info, free_info);
+
+static void _free_percpu_area(struct rcu_head *head)
+{
+    struct free_info *info = container_of(head, struct free_info, rcu);
+    unsigned int cpu = info->cpu;
+    char *p = __per_cpu_start + __per_cpu_offset[cpu];
+    free_xenheap_pages(p, PERCPU_ORDER);
+    __per_cpu_offset[cpu] = INVALID_PERCPU_AREA;
+}
+
+static void free_percpu_area(unsigned int cpu)
+{
+    struct free_info *info = &per_cpu(free_info, cpu);
+    info->cpu = cpu;
+    call_rcu(&info->rcu, _free_percpu_area);
+}
+
+static int cpu_percpu_callback(
+    struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
+    unsigned int cpu = (unsigned long)hcpu;
+    int rc = 0;
+
+    switch ( action )
+    {
+    case CPU_UP_PREPARE:
+        rc = init_percpu_area(cpu);
+        break;
+    case CPU_UP_CANCELED:
+    case CPU_DEAD:
+        free_percpu_area(cpu);
+        break;
+    default:
+        break;
+    }
+
+    return !rc ? NOTIFY_DONE : notifier_from_errno(rc);
+}
+
+static struct notifier_block cpu_percpu_nfb = {
+    .notifier_call = cpu_percpu_callback,
+    .priority = 100 /* highest priority */
+};
+
+static int __init percpu_presmp_init(void)
+{
+    register_cpu_notifier(&cpu_percpu_nfb);
+    return 0;
+}
+presmp_initcall(percpu_presmp_init);
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/setup.c	Tue Mar 13 15:28:41 2012 +0000
@@ -38,22 +38,14 @@
 #include <asm/setup.h>
 #include "gic.h"
 
-/* maxcpus: maximum number of CPUs to activate. */
-static unsigned int __initdata max_cpus = NR_CPUS;
-
-/* Xen stack for bringing up the first CPU. */
-unsigned char __initdata init_stack[STACK_SIZE] __attribute__((__aligned__(STACK_SIZE)));
-
-extern char __init_begin[], __init_end[], __bss_start[];
+/* Spinlock for serializing CPU bringup */
+unsigned long __initdata boot_gate = 1;
+/* Number of non-boot CPUs ready to enter C */
+unsigned long __initdata ready_cpus = 0;
 
 static __attribute_used__ void init_done(void)
 {
-    /* TODO: free (or page-protect) the init areas.
-       memset(__init_begin, 0xcc, __init_end - __init_begin);
-       free_xen_data(__init_begin, __init_end);
-    */
-    printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
-
+    free_init_memory();
     startup_cpu_idle_loop();
 }
 
@@ -151,14 +143,17 @@
     end_boot_allocator();
 }
 
+/* C entry point for boot CPU */
 void __init start_xen(unsigned long boot_phys_offset,
                       unsigned long arm_type,
-                      unsigned long atag_paddr)
-
+                      unsigned long atag_paddr,
+                      unsigned long cpuid)
 {
     void *fdt;
     size_t fdt_size;
-    int i;
+    int cpus, i;
+    paddr_t gate_pa;
+    unsigned long *gate;
 
     fdt = (void *)BOOT_MISC_VIRT_START
         + (atag_paddr & ((1 << SECOND_SHIFT) - 1));
@@ -174,15 +169,29 @@
     console_init_preirq();
 #endif
 
+    percpu_init_areas();
+    set_processor_id(0); /* needed early, for smp_processor_id() */
+
+    cpus = gic_init();
+
+    printk("Waiting for %i other CPUs to be ready\n", cpus - 1);
+    /* Bring the other CPUs up to paging before the original
+     * copy of .text gets overwritten.  We need to use the unrelocated
+     * copy of boot_gate as that's the one the others can see. */ 
+    gate_pa = ((unsigned long) &boot_gate) + boot_phys_offset;
+    gate = map_domain_page(gate_pa >> PAGE_SHIFT) + (gate_pa & ~PAGE_MASK); 
+    *gate = 0;
+    unmap_domain_page(gate);
+    /* Now send an event to wake the first non-boot CPU */
+    asm volatile("dsb; isb; sev");
+    /* And wait for them all to be ready. */
+    while ( ready_cpus + 1 < cpus )
+        smp_rmb();
+
     __set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
-    set_processor_id(0); /* needed early, for smp_processor_id() */
 
-    /* TODO: smp_prepare_boot_cpu(void) */
-    cpumask_set_cpu(smp_processor_id(), &cpu_online_map);
-    cpumask_set_cpu(smp_processor_id(), &cpu_present_map);
-
-    smp_prepare_cpus(max_cpus);
+    smp_prepare_cpus(cpus);
 
     init_xen_time();
 
@@ -208,8 +217,6 @@
 
     init_IRQ();
 
-    gic_init();
-
     gic_route_irqs();
 
     init_maintenance_interrupt();
@@ -231,7 +238,7 @@
 
     for_each_present_cpu ( i )
     {
-        if ( (num_online_cpus() < max_cpus) && !cpu_online(i) )
+        if ( (num_online_cpus() < cpus) && !cpu_online(i) )
         {
             int ret = cpu_up(i);
             if ( ret != 0 )
@@ -269,7 +276,11 @@
 
     domain_unpause_by_systemcontroller(dom0);
 
-    reset_stack_and_jump(init_done);
+    /* Switch on to the dynamically allocated stack for the idle vcpu
+     * since the static one we're running on is about to be freed. */
+    memcpy(idle_vcpu[0]->arch.cpu_info, get_cpu_info(), 
+           sizeof(struct cpu_info));
+    switch_stack_and_jump(idle_vcpu[0]->arch.cpu_info, init_done);
 }
 
 void arch_get_xen_caps(xen_capabilities_info_t *info)
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/shutdown.c
--- a/xen/arch/arm/shutdown.c	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/shutdown.c	Tue Mar 13 15:28:41 2012 +0000
@@ -1,18 +1,64 @@
 #include <xen/config.h>
+#include <xen/console.h>
+#include <xen/cpu.h>
+#include <xen/delay.h>
 #include <xen/lib.h>
+#include <xen/mm.h>
+#include <xen/smp.h>
+
+static void raw_machine_reset(void)
+{
+    /* XXX get this from device tree */
+#ifdef SP810_ADDRESS
+    /* Use the SP810 system controller to force a reset */
+    volatile uint32_t *sp810;
+    set_fixmap(FIXMAP_MISC, SP810_ADDRESS >> PAGE_SHIFT, DEV_SHARED);
+    sp810 = ((uint32_t *)
+             (FIXMAP_ADDR(FIXMAP_MISC) + (SP810_ADDRESS & ~PAGE_MASK)));
+    sp810[0] = 0x3; /* switch to slow mode */
+    dsb(); isb();
+    sp810[1] = 0x1; /* writing any value to SCSYSSTAT reg will reset system */
+    dsb(); isb();
+    clear_fixmap(FIXMAP_MISC);
+#endif
+}
+
+static void halt_this_cpu(void *arg)
+{
+    __cpu_disable();
+    stop_cpu();
+}
 
 void machine_halt(void)
 {
-        /* TODO: halt */
-        while(1) ;
+    watchdog_disable();
+    console_start_sync();
+    local_irq_enable();
+    smp_call_function(halt_this_cpu, NULL, 0);
+    halt_this_cpu(NULL);
 }
 
 void machine_restart(unsigned int delay_millisecs)
 {
-        /* TODO: restart */
-        printk("Cannot restart yet\n");
-        while(1);
+    int timeout = 10;
+
+    local_irq_enable();
+    smp_call_function(halt_this_cpu, NULL, 0);
+    local_irq_disable();
+
+    mdelay(delay_millisecs);
+
+    /* Wait at most another 10ms for all other CPUs to go offline. */
+    while ( (num_online_cpus() > 1) && (timeout-- > 0) )
+        mdelay(1);
+
+    while ( 1 )
+    {
+        raw_machine_reset();
+        mdelay(100);
+    }
 }
+
 /*
  * Local variables:
  * mode: C
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Tue Mar 13 15:28:41 2012 +0000
@@ -16,9 +16,16 @@
  * GNU General Public License for more details.
  */
 
+#include <xen/cpu.h>
 #include <xen/cpumask.h>
+#include <xen/delay.h>
+#include <xen/errno.h>
+#include <xen/init.h>
+#include <xen/mm.h>
+#include <xen/sched.h>
 #include <xen/smp.h>
-#include <xen/init.h>
+#include <xen/softirq.h>
+#include "gic.h"
 
 cpumask_t cpu_online_map;
 EXPORT_SYMBOL(cpu_online_map);
@@ -27,19 +34,142 @@
 cpumask_t cpu_possible_map;
 EXPORT_SYMBOL(cpu_possible_map);
 
+/* Xen stack for bringing up the first CPU. */
+static unsigned char __initdata cpu0_boot_stack[STACK_SIZE]
+       __attribute__((__aligned__(STACK_SIZE)));
+
+/* Pointer to the stack, used by head.S when entering C */
+unsigned char *init_stack = cpu0_boot_stack;
+
 void __init
 smp_prepare_cpus (unsigned int max_cpus)
 {
-        set_processor_id(0); /* needed early, for smp_processor_id() */
+    int i;
+    set_processor_id(0); /* needed early, for smp_processor_id() */
 
-        cpumask_clear(&cpu_online_map);
-        cpumask_clear(&cpu_present_map);
-        cpumask_clear(&cpu_possible_map);
-        cpumask_set_cpu(0, &cpu_online_map);
-        cpumask_set_cpu(0, &cpu_present_map);
-        cpumask_set_cpu(0, &cpu_possible_map);
-        return;
+    cpumask_clear(&cpu_online_map);
+    cpumask_set_cpu(0, &cpu_online_map);
+
+    cpumask_clear(&cpu_possible_map);
+    for ( i = 0; i < max_cpus; i++ )
+        cpumask_set_cpu(i, &cpu_possible_map);
+    cpumask_copy(&cpu_present_map, &cpu_possible_map);
 }
+
+/* Shared state for coordinating CPU bringup */
+unsigned long smp_up_cpu = 0;
+static bool_t cpu_is_dead = 0;
+
+/* Boot the current CPU */
+void __cpuinit start_secondary(unsigned long boot_phys_offset,
+                               unsigned long arm_type,
+                               unsigned long atag_paddr,
+                               unsigned long cpuid)
+{
+    memset(get_cpu_info(), 0, sizeof (struct cpu_info));
+
+    /* TODO: handle boards where CPUIDs are not contiguous */
+    set_processor_id(cpuid);
+
+    /* Setup Hyp vector base */
+    WRITE_CP32((uint32_t) hyp_traps_vector, HVBAR);
+
+    dprintk(XENLOG_DEBUG, "CPU %li awake.\n", cpuid);
+
+    mmu_init_secondary_cpu();
+    gic_init_secondary_cpu();
+
+    set_current(idle_vcpu[cpuid]);
+    this_cpu(curr_vcpu) = current;
+
+    /* Run local notifiers */
+    notify_cpu_starting(cpuid);
+    wmb();
+
+    /* Now report this CPU is up */
+    cpumask_set_cpu(cpuid, &cpu_online_map);
+    wmb();
+
+    local_irq_enable();
+
+    dprintk(XENLOG_DEBUG, "CPU %li booted.\n", cpuid);
+
+    startup_cpu_idle_loop();
+}
+
+/* Shut down the current CPU */
+void __cpu_disable(void)
+{
+    unsigned int cpu = get_processor_id();
+
+    local_irq_disable();
+    gic_disable_cpu();
+    /* Allow any queued timer interrupts to get serviced */
+    local_irq_enable();
+    mdelay(1);
+    local_irq_disable();
+
+    /* It's now safe to remove this processor from the online map */
+    cpumask_clear_cpu(cpu, &cpu_online_map);
+
+    if ( cpu_disable_scheduler(cpu) )
+        BUG();
+    mb();
+
+    /* Return to caller; eventually the IPI mechanism will unwind and the 
+     * scheduler will drop to the idle loop, which will call stop_cpu(). */
+}
+
+void stop_cpu(void)
+{
+    local_irq_disable();
+    cpu_is_dead = 1;
+    /* Make sure the write happens before we sleep forever */
+    dsb();
+    isb();
+    while ( 1 ) 
+        asm volatile("wfi");
+}
+
+/* Bring up a remote CPU */
+int __cpu_up(unsigned int cpu)
+{
+    /* Tell the remote CPU which stack to boot on. */
+    init_stack = idle_vcpu[cpu]->arch.stack;
+
+    /* Unblock the CPU.  It should be waiting in the loop in head.S
+     * for an event to arrive when smp_up_cpu matches its cpuid. */
+    smp_up_cpu = cpu;
+    asm volatile("dsb; isb; sev");
+
+    while ( !cpu_online(cpu) )
+    {
+        cpu_relax();
+        process_pending_softirqs();
+    }
+
+    return 0;
+}
+
+/* Wait for a remote CPU to die */
+void __cpu_die(unsigned int cpu)
+{
+    unsigned int i = 0;
+
+    while ( !cpu_is_dead )
+    {
+        mdelay(100);
+        cpu_relax();
+        process_pending_softirqs();
+        if ( (++i % 10) == 0 )
+            printk(KERN_ERR "CPU %u still not dead...\n", cpu);
+        mb();
+    }
+    cpu_is_dead = 0;
+    mb();
+}
+
+
 /*
  * Local variables:
  * mode: C
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/arch/arm/time.c
--- a/xen/arch/arm/time.c	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/arch/arm/time.c	Tue Mar 13 15:28:41 2012 +0000
@@ -171,6 +171,16 @@
     request_irq(30, timer_interrupt, 0, "phytimer", NULL);
 }
 
+/* Wait a set number of microseconds */
+void udelay(unsigned long usecs)
+{
+    s_time_t deadline = get_s_time() + 1000 * (s_time_t) usecs;
+    while ( get_s_time() - deadline < 0 )
+        ;
+    dsb();
+    isb();
+}
+
 /*
  * Local variables:
  * mode: C
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/include/asm-arm/config.h
--- a/xen/include/asm-arm/config.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/include/asm-arm/config.h	Tue Mar 13 15:28:41 2012 +0000
@@ -119,6 +119,9 @@
 #define GIC_CR_OFFSET 0x2000
 #define GIC_HR_OFFSET 0x4000 /* Guess work http://lists.infradead.org/pipermail/linux-arm-kernel/2011-September/064219.html */
 #define GIC_VR_OFFSET 0x6000 /* Virtual Machine CPU interface) */
+/* Board-specific: base address of system controller */
+#define SP810_ADDRESS 0x1C020000
+
 
 #endif /* __ARM_CONFIG_H__ */
 /*
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/include/asm-arm/current.h
--- a/xen/include/asm-arm/current.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/include/asm-arm/current.h	Tue Mar 13 15:28:41 2012 +0000
@@ -40,17 +40,19 @@
 #define get_current()         (this_cpu(curr_vcpu))
 #define __set_current(vcpu)   (this_cpu(curr_vcpu) = (vcpu))
 #define set_current(vcpu)     do {                                      \
-    vcpu->arch.cpu_info->processor_id = get_processor_id();             \
+    int cpu = get_processor_id();                                       \
+    vcpu->arch.cpu_info->processor_id = cpu;                            \
+    vcpu->arch.cpu_info->per_cpu_offset = __per_cpu_offset[cpu];        \
     __set_current(vcpu);                                                \
 } while (0)
 #define current               (get_current())
 
 #define guest_cpu_user_regs() (&get_cpu_info()->guest_cpu_user_regs)
 
-#define reset_stack_and_jump(__fn)              \
-    __asm__ __volatile__ (                      \
-        "mov sp,%0; b "STR(__fn)      \
-        : : "r" (guest_cpu_user_regs()) : "memory" )
+#define switch_stack_and_jump(stack, fn)                                \
+    asm volatile ("mov sp,%0; b " STR(fn) : : "r" (stack) : "memory" )
+
+#define reset_stack_and_jump(fn) switch_stack_and_jump(get_cpu_info(), fn)
 
 #endif
 
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/include/asm-arm/delay.h
--- a/xen/include/asm-arm/delay.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/include/asm-arm/delay.h	Tue Mar 13 15:28:41 2012 +0000
@@ -1,8 +1,7 @@
 #ifndef _ARM_DELAY_H
 #define _ARM_DELAY_H
 
-extern void __udelay(unsigned long usecs);
-#define udelay(n) __udelay(n)
+extern void udelay(unsigned long usecs);
 
 #endif /* defined(_ARM_DELAY_H) */
 /*
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/include/asm-arm/mm.h
--- a/xen/include/asm-arm/mm.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/include/asm-arm/mm.h	Tue Mar 13 15:28:41 2012 +0000
@@ -136,6 +136,8 @@
 
 /* Boot-time pagetable setup */
 extern void setup_pagetables(unsigned long boot_phys_offset);
+/* 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.
  * Base must be 32MB aligned and size a multiple of 32MB. */
 extern void setup_xenheap_mappings(unsigned long base_mfn, unsigned long nr_mfns);
@@ -276,6 +278,10 @@
 #define memguard_guard_stack(_p)       ((void)0)
 #define memguard_guard_range(_p,_l)    ((void)0)
 #define memguard_unguard_range(_p,_l)  ((void)0)
+
+/* Release all __init and __initdata ranges to be reused */
+void free_init_memory(void);
+
 int guest_physmap_mark_populate_on_demand(struct domain *d, unsigned long gfn,
                                           unsigned int order);
 
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/include/asm-arm/page.h
--- a/xen/include/asm-arm/page.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/include/asm-arm/page.h	Tue Mar 13 15:28:41 2012 +0000
@@ -203,6 +203,22 @@
 }
 
 /*
+ * Flush all hypervisor mappings from the TLB and branch predictor.
+ * This is needed after changing Xen code mappings. 
+ */
+static inline void flush_xen_text_tlb(void)
+{
+    register unsigned long r0 asm ("r0");
+    asm volatile (
+        "dsb;"                        /* Ensure visibility of PTE writes */
+        STORE_CP32(0, TLBIALLH)       /* Flush hypervisor TLB */
+        STORE_CP32(0, BPIALL)         /* Flush branch predictor */
+        "dsb;"                        /* Ensure completion of TLB+BP flush */
+        "isb;"
+        : : "r" (r0) /*dummy*/ : "memory");
+}
+
+/*
  * Flush all hypervisor mappings from the data TLB. This is not
  * sufficient when changing code mappings or for self modifying code.
  */
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/include/asm-arm/percpu.h
--- a/xen/include/asm-arm/percpu.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/include/asm-arm/percpu.h	Tue Mar 13 15:28:41 2012 +0000
@@ -12,8 +12,11 @@
     __attribute__((__section__(".bss.percpu" #suffix)))         \
     __typeof__(type) per_cpu_##name
 
-#define per_cpu(var, cpu) ((&per_cpu__##var)[cpu?0:0])
-#define __get_cpu_var(var) per_cpu__##var
+
+#define per_cpu(var, cpu)  \
+    (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu]))
+#define __get_cpu_var(var) \
+    (*RELOC_HIDE(&per_cpu__##var, get_cpu_info()->per_cpu_offset))
 
 #define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
 
diff -r 703a339e11ab -r d54cf3fa7ee6 xen/include/asm-arm/smp.h
--- a/xen/include/asm-arm/smp.h	Tue Mar 13 15:23:35 2012 +0000
+++ b/xen/include/asm-arm/smp.h	Tue Mar 13 15:28:41 2012 +0000
@@ -14,6 +14,8 @@
 
 #define raw_smp_processor_id() (get_processor_id())
 
+extern void stop_cpu(void);
+
 #endif
 /*
  * Local variables:

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOL-0001p4-Tu; Wed, 14 Mar 2012 12:33: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 1S7nOK-0001gV-QV
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Received: from [85.158.143.35:13699] by server-1.bemta-4.messagelabs.com id
	A7/26-20925-010906F4; Wed, 14 Mar 2012 12:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1331728398!5042387!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25576 invoked from network); 14 Mar 2012 12:33:19 -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;
	14 Mar 2012 12:33: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 1S7nOI-0007UE-GK
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOI-0008MQ-F0
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:18 +0000
Message-Id: <E1S7nOI-0008MQ-F0@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenstat: Use local domain names
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331653242 0
# Node ID e0d02f48a6123a137b8d9c91bbaa3d1963064b7f
# Parent  83ae523c96b45f6a6a32c518b2f320563dc17ea1
xenstat: Use local domain names

The domain name stored in /local/domain/$domid/name is simpler to
access and is the only domain name modified by "xl rename". Use this
domain name in libxenstat's reporting.

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


diff -r 83ae523c96b4 -r e0d02f48a612 tools/xenstat/libxenstat/src/xenstat.c
--- a/tools/xenstat/libxenstat/src/xenstat.c	Tue Mar 13 15:36:58 2012 +0000
+++ b/tools/xenstat/libxenstat/src/xenstat.c	Tue Mar 13 15:40:42 2012 +0000
@@ -739,17 +739,9 @@
 
 static char *xenstat_get_domain_name(xenstat_handle *handle, unsigned int domain_id)
 {
-	char path[80], *vmpath;
+	char path[80];
 
-	snprintf(path, sizeof(path),"/local/domain/%i/vm", domain_id);
-
-	vmpath = xs_read(handle->xshandle, XBT_NULL, path, NULL);
-
-	if (vmpath == NULL)
-		return NULL;
-
-	snprintf(path, sizeof(path),"%s/name", vmpath);
-	free(vmpath);
+	snprintf(path, sizeof(path),"/local/domain/%i/name", domain_id);
 
 	return xs_read(handle->xshandle, XBT_NULL, path, NULL);
 }

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOL-0001p4-Tu; Wed, 14 Mar 2012 12:33: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 1S7nOK-0001gV-QV
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Received: from [85.158.143.35:13699] by server-1.bemta-4.messagelabs.com id
	A7/26-20925-010906F4; Wed, 14 Mar 2012 12:33:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1331728398!5042387!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25576 invoked from network); 14 Mar 2012 12:33:19 -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;
	14 Mar 2012 12:33: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 1S7nOI-0007UE-GK
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOI-0008MQ-F0
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:18 +0000
Message-Id: <E1S7nOI-0008MQ-F0@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xenstat: Use local domain names
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331653242 0
# Node ID e0d02f48a6123a137b8d9c91bbaa3d1963064b7f
# Parent  83ae523c96b45f6a6a32c518b2f320563dc17ea1
xenstat: Use local domain names

The domain name stored in /local/domain/$domid/name is simpler to
access and is the only domain name modified by "xl rename". Use this
domain name in libxenstat's reporting.

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


diff -r 83ae523c96b4 -r e0d02f48a612 tools/xenstat/libxenstat/src/xenstat.c
--- a/tools/xenstat/libxenstat/src/xenstat.c	Tue Mar 13 15:36:58 2012 +0000
+++ b/tools/xenstat/libxenstat/src/xenstat.c	Tue Mar 13 15:40:42 2012 +0000
@@ -739,17 +739,9 @@
 
 static char *xenstat_get_domain_name(xenstat_handle *handle, unsigned int domain_id)
 {
-	char path[80], *vmpath;
+	char path[80];
 
-	snprintf(path, sizeof(path),"/local/domain/%i/vm", domain_id);
-
-	vmpath = xs_read(handle->xshandle, XBT_NULL, path, NULL);
-
-	if (vmpath == NULL)
-		return NULL;
-
-	snprintf(path, sizeof(path),"%s/name", vmpath);
-	free(vmpath);
+	snprintf(path, sizeof(path),"/local/domain/%i/name", domain_id);
 
 	return xs_read(handle->xshandle, XBT_NULL, path, NULL);
 }

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOO-0001sh-6g; Wed, 14 Mar 2012 12:33: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 1S7nOM-0001oM-1Q
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:22 +0000
Received: from [85.158.138.51:43474] by server-5.bemta-3.messagelabs.com id
	F6/61-09139-110906F4; Wed, 14 Mar 2012 12:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1331728399!17594340!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19977 invoked from network); 14 Mar 2012 12:33:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Mar 2012 12:33: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 1S7nOJ-0007UH-1c
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOJ-0008Mu-04
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:19 +0000
Message-Id: <E1S7nOJ-0008Mu-04@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Merge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331654870 0
# Node ID 6ba199b5fd7f591dc6db3060e281986326d0d6da
# Parent  e0d02f48a6123a137b8d9c91bbaa3d1963064b7f
# Parent  b8a5e8100c5d5d4e162a99f4582186fa77080391
Merge
---


diff -r e0d02f48a612 -r 6ba199b5fd7f xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c	Tue Mar 13 15:40:42 2012 +0000
+++ b/xen/arch/arm/traps.c	Tue Mar 13 16:07:50 2012 +0000
@@ -367,7 +367,6 @@
 }
 
 typedef unsigned long arm_hypercall_t(
-    unsigned int, unsigned int, unsigned int, unsigned int, unsigned int,
     unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
 
 #define HYPERCALL(x)                                        \
@@ -407,18 +406,30 @@
 
 static void do_trap_hypercall(struct cpu_user_regs *regs, unsigned long iss)
 {
+    arm_hypercall_t *call = NULL;
     local_irq_enable();
 
-    regs->r0 = arm_hypercall_table[iss](regs->r0,
-                             regs->r1,
-                             regs->r2,
-                             regs->r3,
-                             regs->r4,
-                             regs->r5,
-                             regs->r6,
-                             regs->r7,
-                             regs->r8,
-                             regs->r9);
+    if ( iss != XEN_HYPERCALL_TAG )
+    {
+        printk("%s %d: received an alien hypercall iss=%lx\n", __func__ ,
+                __LINE__ , iss);
+        regs->r0 = -EINVAL;
+        return;
+    }
+
+    call = arm_hypercall_table[regs->r12];
+    if ( call == NULL )
+    {
+        regs->r0 = -ENOSYS;
+        return;
+    }
+
+    regs->r0 = call(regs->r0, regs->r1, regs->r2, regs->r3, regs->r4);
+
+#ifndef NDEBUG
+    /* clobber registers */
+    regs->r1 = regs->r2 = regs->r3 = regs->r4 = regs->r12 = 0xDEADBEEF;
+#endif
 }
 
 static void do_cp15_32(struct cpu_user_regs *regs,
diff -r e0d02f48a612 -r 6ba199b5fd7f xen/include/public/arch-arm.h
--- a/xen/include/public/arch-arm.h	Tue Mar 13 15:40:42 2012 +0000
+++ b/xen/include/public/arch-arm.h	Tue Mar 13 16:07:50 2012 +0000
@@ -27,6 +27,29 @@
 #ifndef __XEN_PUBLIC_ARCH_ARM_H__
 #define __XEN_PUBLIC_ARCH_ARM_H__
 
+/* hypercall calling convention
+ * ----------------------------
+ *
+ * A hypercall is issued using the ARM HVC instruction.
+ *
+ * A hypercall can take up to 5 arguments. These are passed in
+ * registers, the first argument in r0, the second argument in r1, the
+ * third in r2, the forth in r3 and the fifth in r4.
+ *
+ * The hypercall number is passed in r12.
+ *
+ * The HVC ISS must contain a Xen specific TAG: XEN_HYPERCALL_TAG.
+ *
+ * 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.
+ *
+ */
+
+#define XEN_HYPERCALL_TAG   0XEA1
+
+
 #ifndef __ASSEMBLY__
 #define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
     typedef struct { type *p; } __guest_handle_ ## name

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOO-0001sx-Bl; Wed, 14 Mar 2012 12:33: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 1S7nOM-0001q9-U4
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:23 +0000
Received: from [85.158.139.83:11150] by server-1.bemta-5.messagelabs.com id
	1F/26-28458-210906F4; Wed, 14 Mar 2012 12:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1331728399!15387323!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25605 invoked from network); 14 Mar 2012 12:33: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;
	14 Mar 2012 12:33: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 1S7nOJ-0007UK-Hw
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOJ-0008NM-Gl
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:19 +0000
Message-Id: <E1S7nOJ-0008NM-Gl@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools,
	build: Fix libaio Makefile to put files in $(DESTDIR)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331655980 0
# Node ID 8a81f2bfd7cc35e26709591df380f358faae1fbc
# Parent  6ba199b5fd7f591dc6db3060e281986326d0d6da
tools, build: Fix libaio Makefile to put files in $(DESTDIR)

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


diff -r 6ba199b5fd7f -r 8a81f2bfd7cc tools/libaio/src/Makefile
--- a/tools/libaio/src/Makefile	Tue Mar 13 16:07:50 2012 +0000
+++ b/tools/libaio/src/Makefile	Tue Mar 13 16:26:20 2012 +0000
@@ -54,11 +54,11 @@
 	$(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)
 
 install: $(all_targets)
-	install -D -m 644 libaio.h $(includedir)/libaio.h
-	install -D -m 644 libaio.a $(libdir)/libaio.a
-	install -D -m 755 $(libname) $(libdir)/$(libname)
-	ln -sf $(libname) $(libdir)/$(soname)
-	ln -sf $(libname) $(libdir)/libaio.so
+	install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h
+	install -D -m 644 libaio.a $(DESTDIR)$(libdir)/libaio.a
+	install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname)
+	ln -sf $(libname) $(DESTDIR)$(libdir)/$(soname)
+	ln -sf $(libname) $(DESTDIR)$(libdir)/libaio.so
 
 $(libaio_objs): libaio.h
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOO-0001sh-6g; Wed, 14 Mar 2012 12:33: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 1S7nOM-0001oM-1Q
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:22 +0000
Received: from [85.158.138.51:43474] by server-5.bemta-3.messagelabs.com id
	F6/61-09139-110906F4; Wed, 14 Mar 2012 12:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1331728399!17594340!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19977 invoked from network); 14 Mar 2012 12:33:20 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Mar 2012 12:33: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 1S7nOJ-0007UH-1c
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOJ-0008Mu-04
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:19 +0000
Message-Id: <E1S7nOJ-0008Mu-04@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Merge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331654870 0
# Node ID 6ba199b5fd7f591dc6db3060e281986326d0d6da
# Parent  e0d02f48a6123a137b8d9c91bbaa3d1963064b7f
# Parent  b8a5e8100c5d5d4e162a99f4582186fa77080391
Merge
---


diff -r e0d02f48a612 -r 6ba199b5fd7f xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c	Tue Mar 13 15:40:42 2012 +0000
+++ b/xen/arch/arm/traps.c	Tue Mar 13 16:07:50 2012 +0000
@@ -367,7 +367,6 @@
 }
 
 typedef unsigned long arm_hypercall_t(
-    unsigned int, unsigned int, unsigned int, unsigned int, unsigned int,
     unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
 
 #define HYPERCALL(x)                                        \
@@ -407,18 +406,30 @@
 
 static void do_trap_hypercall(struct cpu_user_regs *regs, unsigned long iss)
 {
+    arm_hypercall_t *call = NULL;
     local_irq_enable();
 
-    regs->r0 = arm_hypercall_table[iss](regs->r0,
-                             regs->r1,
-                             regs->r2,
-                             regs->r3,
-                             regs->r4,
-                             regs->r5,
-                             regs->r6,
-                             regs->r7,
-                             regs->r8,
-                             regs->r9);
+    if ( iss != XEN_HYPERCALL_TAG )
+    {
+        printk("%s %d: received an alien hypercall iss=%lx\n", __func__ ,
+                __LINE__ , iss);
+        regs->r0 = -EINVAL;
+        return;
+    }
+
+    call = arm_hypercall_table[regs->r12];
+    if ( call == NULL )
+    {
+        regs->r0 = -ENOSYS;
+        return;
+    }
+
+    regs->r0 = call(regs->r0, regs->r1, regs->r2, regs->r3, regs->r4);
+
+#ifndef NDEBUG
+    /* clobber registers */
+    regs->r1 = regs->r2 = regs->r3 = regs->r4 = regs->r12 = 0xDEADBEEF;
+#endif
 }
 
 static void do_cp15_32(struct cpu_user_regs *regs,
diff -r e0d02f48a612 -r 6ba199b5fd7f xen/include/public/arch-arm.h
--- a/xen/include/public/arch-arm.h	Tue Mar 13 15:40:42 2012 +0000
+++ b/xen/include/public/arch-arm.h	Tue Mar 13 16:07:50 2012 +0000
@@ -27,6 +27,29 @@
 #ifndef __XEN_PUBLIC_ARCH_ARM_H__
 #define __XEN_PUBLIC_ARCH_ARM_H__
 
+/* hypercall calling convention
+ * ----------------------------
+ *
+ * A hypercall is issued using the ARM HVC instruction.
+ *
+ * A hypercall can take up to 5 arguments. These are passed in
+ * registers, the first argument in r0, the second argument in r1, the
+ * third in r2, the forth in r3 and the fifth in r4.
+ *
+ * The hypercall number is passed in r12.
+ *
+ * The HVC ISS must contain a Xen specific TAG: XEN_HYPERCALL_TAG.
+ *
+ * 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.
+ *
+ */
+
+#define XEN_HYPERCALL_TAG   0XEA1
+
+
 #ifndef __ASSEMBLY__
 #define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
     typedef struct { type *p; } __guest_handle_ ## name

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOO-0001sx-Bl; Wed, 14 Mar 2012 12:33: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 1S7nOM-0001q9-U4
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:23 +0000
Received: from [85.158.139.83:11150] by server-1.bemta-5.messagelabs.com id
	1F/26-28458-210906F4; Wed, 14 Mar 2012 12:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1331728399!15387323!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25605 invoked from network); 14 Mar 2012 12:33: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;
	14 Mar 2012 12:33: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 1S7nOJ-0007UK-Hw
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOJ-0008NM-Gl
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:19 +0000
Message-Id: <E1S7nOJ-0008NM-Gl@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools,
	build: Fix libaio Makefile to put files in $(DESTDIR)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331655980 0
# Node ID 8a81f2bfd7cc35e26709591df380f358faae1fbc
# Parent  6ba199b5fd7f591dc6db3060e281986326d0d6da
tools, build: Fix libaio Makefile to put files in $(DESTDIR)

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


diff -r 6ba199b5fd7f -r 8a81f2bfd7cc tools/libaio/src/Makefile
--- a/tools/libaio/src/Makefile	Tue Mar 13 16:07:50 2012 +0000
+++ b/tools/libaio/src/Makefile	Tue Mar 13 16:26:20 2012 +0000
@@ -54,11 +54,11 @@
 	$(CC) $(SO_CFLAGS) -Wl,--version-script=libaio.map -Wl,-soname=$(soname) -o $@ $(libaio_sobjs) $(LINK_FLAGS)
 
 install: $(all_targets)
-	install -D -m 644 libaio.h $(includedir)/libaio.h
-	install -D -m 644 libaio.a $(libdir)/libaio.a
-	install -D -m 755 $(libname) $(libdir)/$(libname)
-	ln -sf $(libname) $(libdir)/$(soname)
-	ln -sf $(libname) $(libdir)/libaio.so
+	install -D -m 644 libaio.h $(DESTDIR)$(includedir)/libaio.h
+	install -D -m 644 libaio.a $(DESTDIR)$(libdir)/libaio.a
+	install -D -m 755 $(libname) $(DESTDIR)$(libdir)/$(libname)
+	ln -sf $(libname) $(DESTDIR)$(libdir)/$(soname)
+	ln -sf $(libname) $(DESTDIR)$(libdir)/libaio.so
 
 $(libaio_objs): libaio.h
 

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOO-0001tG-H2; Wed, 14 Mar 2012 12:33: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 1S7nON-0001rW-Tx
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:24 +0000
Received: from [85.158.138.51:43656] by server-8.bemta-3.messagelabs.com id
	8B/C4-13762-210906F4; Wed, 14 Mar 2012 12:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1331728401!17454620!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12624 invoked from network); 14 Mar 2012 12:33: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;
	14 Mar 2012 12:33: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 1S7nOL-0007UZ-5s
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOL-0008Om-4i
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:21 +0000
Message-Id: <E1S7nOL-0008Om-4i@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/python: Py_INCREF(Py_None)
	when returing Py_None
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Marek Marczykowski <marmarek@invisiblethingslab.com>
# Date 1331659187 0
# Node ID 6ced0ed954d60345c6e8e7ba330a305a2c750444
# Parent  6459346c03f54e101f5f9002d9058a95cc8a90d5
tools/python: Py_INCREF(Py_None) when returing Py_None

Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 6459346c03f5 -r 6ced0ed954d6 tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c	Tue Mar 13 17:11:09 2012 +0000
+++ b/tools/python/xen/lowlevel/xl/xl.c	Tue Mar 13 17:19:47 2012 +0000
@@ -408,6 +408,8 @@
     domname = libxl_domid_to_name(self->ctx, domid);
     if (domname)
         ret = PyString_FromString(domname);
+	else
+		Py_INCREF(Py_None);
     free(domname);
 
     return ret;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOO-0001tG-H2; Wed, 14 Mar 2012 12:33: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 1S7nON-0001rW-Tx
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:24 +0000
Received: from [85.158.138.51:43656] by server-8.bemta-3.messagelabs.com id
	8B/C4-13762-210906F4; Wed, 14 Mar 2012 12:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1331728401!17454620!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12624 invoked from network); 14 Mar 2012 12:33: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;
	14 Mar 2012 12:33: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 1S7nOL-0007UZ-5s
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOL-0008Om-4i
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:21 +0000
Message-Id: <E1S7nOL-0008Om-4i@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/python: Py_INCREF(Py_None)
	when returing Py_None
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Marek Marczykowski <marmarek@invisiblethingslab.com>
# Date 1331659187 0
# Node ID 6ced0ed954d60345c6e8e7ba330a305a2c750444
# Parent  6459346c03f54e101f5f9002d9058a95cc8a90d5
tools/python: Py_INCREF(Py_None) when returing Py_None

Signed-off-by: Marek Marczykowski <marmarek@invisiblethingslab.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 6459346c03f5 -r 6ced0ed954d6 tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c	Tue Mar 13 17:11:09 2012 +0000
+++ b/tools/python/xen/lowlevel/xl/xl.c	Tue Mar 13 17:19:47 2012 +0000
@@ -408,6 +408,8 @@
     domname = libxl_domid_to_name(self->ctx, domid);
     if (domname)
         ret = PyString_FromString(domname);
+	else
+		Py_INCREF(Py_None);
     free(domname);
 
     return ret;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOO-0001t7-EK; Wed, 14 Mar 2012 12:33: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 1S7nON-0001q9-BR
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:23 +0000
Received: from [85.158.139.83:14680] by server-1.bemta-5.messagelabs.com id
	03/36-28458-210906F4; Wed, 14 Mar 2012 12:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1331728400!18427296!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25761 invoked from network); 14 Mar 2012 12:33:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Mar 2012 12:33: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 1S7nOK-0007UN-2w
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOK-0008Np-1h
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Message-Id: <E1S7nOK-0008Np-1h@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: always set a default value
	for VFB.opengl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331658396 0
# Node ID 02f4bbd949caa4b1d71cb9469b4ef0d6cd119c6d
# Parent  8a81f2bfd7cc35e26709591df380f358faae1fbc
libxl: always set a default value for VFB.opengl

Fixes an assertion failure.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reported-by: Fantu <fantonifabio@tiscali.it>
Tested-by: Fantu <fantonifabio@tiscali.it>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 8a81f2bfd7cc -r 02f4bbd949ca tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Tue Mar 13 16:26:20 2012 +0000
+++ b/tools/libxl/libxl.c	Tue Mar 13 17:06:36 2012 +0000
@@ -2256,9 +2256,7 @@
     }
 
     libxl_defbool_setdefault(&vfb->sdl.enable, false);
-    if (libxl_defbool_val(vfb->sdl.enable)) {
-        libxl_defbool_setdefault(&vfb->sdl.opengl, false);
-    }
+    libxl_defbool_setdefault(&vfb->sdl.opengl, false);
 
     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 Mar 14 12:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOO-0001t7-EK; Wed, 14 Mar 2012 12:33: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 1S7nON-0001q9-BR
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:23 +0000
Received: from [85.158.139.83:14680] by server-1.bemta-5.messagelabs.com id
	03/36-28458-210906F4; Wed, 14 Mar 2012 12:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1331728400!18427296!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25761 invoked from network); 14 Mar 2012 12:33:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Mar 2012 12:33: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 1S7nOK-0007UN-2w
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOK-0008Np-1h
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Message-Id: <E1S7nOK-0008Np-1h@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libxl: always set a default value
	for VFB.opengl
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331658396 0
# Node ID 02f4bbd949caa4b1d71cb9469b4ef0d6cd119c6d
# Parent  8a81f2bfd7cc35e26709591df380f358faae1fbc
libxl: always set a default value for VFB.opengl

Fixes an assertion failure.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Reported-by: Fantu <fantonifabio@tiscali.it>
Tested-by: Fantu <fantonifabio@tiscali.it>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 8a81f2bfd7cc -r 02f4bbd949ca tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Tue Mar 13 16:26:20 2012 +0000
+++ b/tools/libxl/libxl.c	Tue Mar 13 17:06:36 2012 +0000
@@ -2256,9 +2256,7 @@
     }
 
     libxl_defbool_setdefault(&vfb->sdl.enable, false);
-    if (libxl_defbool_val(vfb->sdl.enable)) {
-        libxl_defbool_setdefault(&vfb->sdl.opengl, false);
-    }
+    libxl_defbool_setdefault(&vfb->sdl.opengl, false);
 
     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 Mar 14 12:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOP-0001vb-LZ; Wed, 14 Mar 2012 12:33:25 +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 1S7nOO-0001sm-Os
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:24 +0000
Received: from [85.158.138.51:45731] by server-2.bemta-3.messagelabs.com id
	7D/23-28206-310906F4; Wed, 14 Mar 2012 12:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1331728402!17626451!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32235 invoked from network); 14 Mar 2012 12:33:23 -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;
	14 Mar 2012 12:33: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 1S7nOM-0007Up-8F
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOM-0008Pf-6l
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:22 +0000
Message-Id: <E1S7nOM-0008Pf-6l@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/hotplug/Linux/init.d/: create
	/var/run/xen if not exists
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Fabio Fantoni <fabio.fantoni@heliman.it>
# Date 1331659850 0
# Node ID 64f5cd4aa2a273d4b84c382b8ef484eab7905631
# Parent  fb31e2b69cd5f98d6c06e8528a750f005e303706
tools/hotplug/Linux/init.d/: create /var/run/xen if not exists

Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r fb31e2b69cd5 -r 64f5cd4aa2a2 tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons	Tue Mar 13 17:21:37 2012 +0000
+++ b/tools/hotplug/Linux/init.d/xencommons	Tue Mar 13 17:30:50 2012 +0000
@@ -58,6 +58,7 @@
 	modprobe xen-gntdev 2>/dev/null
 	modprobe evtchn 2>/dev/null
 	modprobe gntdev 2>/dev/null
+	mkdir -p /var/run/xen
 
 	if ! `xenstore-read -s / >/dev/null 2>&1`
 	then

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOP-0001vb-LZ; Wed, 14 Mar 2012 12:33:25 +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 1S7nOO-0001sm-Os
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:24 +0000
Received: from [85.158.138.51:45731] by server-2.bemta-3.messagelabs.com id
	7D/23-28206-310906F4; Wed, 14 Mar 2012 12:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-174.messagelabs.com!1331728402!17626451!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32235 invoked from network); 14 Mar 2012 12:33:23 -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;
	14 Mar 2012 12:33: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 1S7nOM-0007Up-8F
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOM-0008Pf-6l
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:22 +0000
Message-Id: <E1S7nOM-0008Pf-6l@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/hotplug/Linux/init.d/: create
	/var/run/xen if not exists
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Fabio Fantoni <fabio.fantoni@heliman.it>
# Date 1331659850 0
# Node ID 64f5cd4aa2a273d4b84c382b8ef484eab7905631
# Parent  fb31e2b69cd5f98d6c06e8528a750f005e303706
tools/hotplug/Linux/init.d/: create /var/run/xen if not exists

Signed-off-by: Fabio Fantoni <fabio.fantoni@heliman.it>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r fb31e2b69cd5 -r 64f5cd4aa2a2 tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons	Tue Mar 13 17:21:37 2012 +0000
+++ b/tools/hotplug/Linux/init.d/xencommons	Tue Mar 13 17:30:50 2012 +0000
@@ -58,6 +58,7 @@
 	modprobe xen-gntdev 2>/dev/null
 	modprobe evtchn 2>/dev/null
 	modprobe gntdev 2>/dev/null
+	mkdir -p /var/run/xen
 
 	if ! `xenstore-read -s / >/dev/null 2>&1`
 	then

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOS-000209-Qf; Wed, 14 Mar 2012 12:33: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 1S7nOR-0001t4-4e
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:27 +0000
Received: from [85.158.139.83:14823] by server-6.bemta-5.messagelabs.com id
	44/FC-13222-410906F4; Wed, 14 Mar 2012 12:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1331728402!18427300!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25856 invoked from network); 14 Mar 2012 12:33:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Mar 2012 12:33: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 1S7nOL-0007Ue-N9
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOL-0008PE-Lr
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:21 +0000
Message-Id: <E1S7nOL-0008PE-Lr@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/python: Fix indenting in
	25030:6ced0ed954d6
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331659297 0
# Node ID fb31e2b69cd5f98d6c06e8528a750f005e303706
# Parent  6ced0ed954d60345c6e8e7ba330a305a2c750444
tools/python: Fix indenting in 25030:6ced0ed954d6

Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 6ced0ed954d6 -r fb31e2b69cd5 tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c	Tue Mar 13 17:19:47 2012 +0000
+++ b/tools/python/xen/lowlevel/xl/xl.c	Tue Mar 13 17:21:37 2012 +0000
@@ -408,8 +408,8 @@
     domname = libxl_domid_to_name(self->ctx, domid);
     if (domname)
         ret = PyString_FromString(domname);
-	else
-		Py_INCREF(Py_None);
+    else
+        Py_INCREF(Py_None);
     free(domname);
 
     return ret;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOS-000209-Qf; Wed, 14 Mar 2012 12:33: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 1S7nOR-0001t4-4e
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:27 +0000
Received: from [85.158.139.83:14823] by server-6.bemta-5.messagelabs.com id
	44/FC-13222-410906F4; Wed, 14 Mar 2012 12:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1331728402!18427300!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25856 invoked from network); 14 Mar 2012 12:33:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	14 Mar 2012 12:33: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 1S7nOL-0007Ue-N9
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOL-0008PE-Lr
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:21 +0000
Message-Id: <E1S7nOL-0008PE-Lr@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools/python: Fix indenting in
	25030:6ced0ed954d6
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331659297 0
# Node ID fb31e2b69cd5f98d6c06e8528a750f005e303706
# Parent  6ced0ed954d60345c6e8e7ba330a305a2c750444
tools/python: Fix indenting in 25030:6ced0ed954d6

Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 6ced0ed954d6 -r fb31e2b69cd5 tools/python/xen/lowlevel/xl/xl.c
--- a/tools/python/xen/lowlevel/xl/xl.c	Tue Mar 13 17:19:47 2012 +0000
+++ b/tools/python/xen/lowlevel/xl/xl.c	Tue Mar 13 17:21:37 2012 +0000
@@ -408,8 +408,8 @@
     domname = libxl_domid_to_name(self->ctx, domid);
     if (domname)
         ret = PyString_FromString(domname);
-	else
-		Py_INCREF(Py_None);
+    else
+        Py_INCREF(Py_None);
     free(domname);
 
     return ret;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 14 12:33:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOU-00022d-Tw; Wed, 14 Mar 2012 12:33: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 1S7nOT-00020S-Fo
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:29 +0000
Received: from [85.158.143.35:16296] by server-2.bemta-4.messagelabs.com id
	36/9A-17550-810906F4; Wed, 14 Mar 2012 12:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1331728400!5121318!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29913 invoked from network); 14 Mar 2012 12:33:27 -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;
	14 Mar 2012 12:33: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 1S7nOK-0007UR-LM
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOK-0008OJ-KA
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Message-Id: <E1S7nOK-0008OJ-KA@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl block-detach: allow other than
	numeric-decimal specification of the disk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331658669 0
# Node ID 6459346c03f54e101f5f9002d9058a95cc8a90d5
# Parent  02f4bbd949caa4b1d71cb9469b4ef0d6cd119c6d
xl block-detach: allow other than numeric-decimal specification of the disk

... to be in sync with block-attach.  And rename the function.

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


diff -r 02f4bbd949ca -r 6459346c03f5 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Tue Mar 13 17:06:36 2012 +0000
+++ b/tools/libxl/libxl.c	Tue Mar 13 17:11:09 2012 +0000
@@ -1476,13 +1476,17 @@
     disk->format = LIBXL_DISK_FORMAT_UNKNOWN;
 }
 
-int libxl_devid_to_device_disk(libxl_ctx *ctx, uint32_t domid,
-                               int devid, libxl_device_disk *disk)
+int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid,
+                              const char *vdev, libxl_device_disk *disk)
 {
     GC_INIT(ctx);
     char *dompath, *path;
+    int devid = libxl__device_disk_dev_number(vdev, NULL, NULL);
     int rc = ERROR_FAIL;
 
+    if (devid < 0)
+        return ERROR_INVAL;
+
     libxl_device_disk_init(disk);
 
     dompath = libxl__xs_get_dompath(gc, domid);
diff -r 02f4bbd949ca -r 6459346c03f5 tools/libxl/libxl_utils.h
--- a/tools/libxl/libxl_utils.h	Tue Mar 13 17:06:36 2012 +0000
+++ b/tools/libxl/libxl_utils.h	Tue Mar 13 17:11:09 2012 +0000
@@ -61,7 +61,7 @@
 int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid, int devid,
                               libxl_device_nic *nic);
 
-int libxl_devid_to_device_disk(libxl_ctx *ctx, uint32_t domid, int devid,
+int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid, const char *vdev,
                                libxl_device_disk *disk);
 
 int libxl_cpumap_alloc(libxl_ctx *ctx, libxl_cpumap *cpumap);
diff -r 02f4bbd949ca -r 6459346c03f5 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Mar 13 17:06:36 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Mar 13 17:11:09 2012 +0000
@@ -4804,7 +4804,7 @@
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
         return 1;
     }
-    if (libxl_devid_to_device_disk(ctx, domid, atoi(argv[optind+1]), &disk)) {
+    if (libxl_vdev_to_device_disk(ctx, domid, argv[optind+1], &disk)) {
         fprintf(stderr, "Error: Device %s not connected.\n", argv[optind+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 Mar 14 12:33:31 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 14 Mar 2012 12:33:31 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S7nOU-00022d-Tw; Wed, 14 Mar 2012 12:33: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 1S7nOT-00020S-Fo
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:29 +0000
Received: from [85.158.143.35:16296] by server-2.bemta-4.messagelabs.com id
	36/9A-17550-810906F4; Wed, 14 Mar 2012 12:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1331728400!5121318!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29913 invoked from network); 14 Mar 2012 12:33:27 -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;
	14 Mar 2012 12:33: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 1S7nOK-0007UR-LM
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7nOK-0008OJ-KA
	for xen-changelog@lists.xensource.com; Wed, 14 Mar 2012 12:33:20 +0000
Message-Id: <E1S7nOK-0008OJ-KA@xenbits.xen.org>
Date: Wed, 14 Mar 2012 12:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl block-detach: allow other than
	numeric-decimal specification of the disk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331658669 0
# Node ID 6459346c03f54e101f5f9002d9058a95cc8a90d5
# Parent  02f4bbd949caa4b1d71cb9469b4ef0d6cd119c6d
xl block-detach: allow other than numeric-decimal specification of the disk

... to be in sync with block-attach.  And rename the function.

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


diff -r 02f4bbd949ca -r 6459346c03f5 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c	Tue Mar 13 17:06:36 2012 +0000
+++ b/tools/libxl/libxl.c	Tue Mar 13 17:11:09 2012 +0000
@@ -1476,13 +1476,17 @@
     disk->format = LIBXL_DISK_FORMAT_UNKNOWN;
 }
 
-int libxl_devid_to_device_disk(libxl_ctx *ctx, uint32_t domid,
-                               int devid, libxl_device_disk *disk)
+int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid,
+                              const char *vdev, libxl_device_disk *disk)
 {
     GC_INIT(ctx);
     char *dompath, *path;
+    int devid = libxl__device_disk_dev_number(vdev, NULL, NULL);
     int rc = ERROR_FAIL;
 
+    if (devid < 0)
+        return ERROR_INVAL;
+
     libxl_device_disk_init(disk);
 
     dompath = libxl__xs_get_dompath(gc, domid);
diff -r 02f4bbd949ca -r 6459346c03f5 tools/libxl/libxl_utils.h
--- a/tools/libxl/libxl_utils.h	Tue Mar 13 17:06:36 2012 +0000
+++ b/tools/libxl/libxl_utils.h	Tue Mar 13 17:11:09 2012 +0000
@@ -61,7 +61,7 @@
 int libxl_devid_to_device_nic(libxl_ctx *ctx, uint32_t domid, int devid,
                               libxl_device_nic *nic);
 
-int libxl_devid_to_device_disk(libxl_ctx *ctx, uint32_t domid, int devid,
+int libxl_vdev_to_device_disk(libxl_ctx *ctx, uint32_t domid, const char *vdev,
                                libxl_device_disk *disk);
 
 int libxl_cpumap_alloc(libxl_ctx *ctx, libxl_cpumap *cpumap);
diff -r 02f4bbd949ca -r 6459346c03f5 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Tue Mar 13 17:06:36 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Tue Mar 13 17:11:09 2012 +0000
@@ -4804,7 +4804,7 @@
         fprintf(stderr, "%s is an invalid domain identifier\n", argv[optind]);
         return 1;
     }
-    if (libxl_devid_to_device_disk(ctx, domid, atoi(argv[optind+1]), &disk)) {
+    if (libxl_vdev_to_device_disk(ctx, domid, argv[optind+1], &disk)) {
         fprintf(stderr, "Error: Device %s not connected.\n", argv[optind+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 Thu Mar 15 00:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Mar 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 1S7yyN-0001Rd-Ev; Thu, 15 Mar 2012 00: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 1S7yyL-0001RK-OW
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 00:55:17 +0000
Received: from [85.158.143.99:64013] by server-1.bemta-4.messagelabs.com id
	2E/89-20925-4FD316F4; Thu, 15 Mar 2012 00:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1331772914!13497898!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7264 invoked from network); 15 Mar 2012 00:55:16 -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;
	15 Mar 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 1S7yyI-0000FV-46
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 00:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7yyH-0003Oo-VJ
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 00:55:13 +0000
Message-Id: <E1S7yyH-0003Oo-VJ@xenbits.xen.org>
Date: Thu, 15 Mar 2012 00: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] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331726522 0
# Node ID 14416d8215d455302d637ed801b0de0ec72645f5
# Parent  93fc9441e90c679ca9edc6655b13acf174e28d2a
QEMU_TAG update
---


diff -r 93fc9441e90c -r 14416d8215d4 Config.mk
--- a/Config.mk	Wed Mar 14 10:03:07 2012 +0000
+++ b/Config.mk	Wed Mar 14 12:02:02 2012 +0000
@@ -179,9 +179,9 @@
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 3cf61880403b4e484539596a95937cc066243388
-# Thu Feb 2 13:47:06 2012 +0000
-# e1000: bounds packet size against buffer size
+QEMU_TAG ?= 06d2e688405932841e9a1c27e2eaaef315298a66
+# Thu Mar 1 18:58:27 2012 +0000
+# qemu-xen: ignore console disconnect events for console/0
 
 # Optional components
 XENSTAT_XENTOP     ?= y

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

From xen-changelog-bounces@lists.xen.org Thu Mar 15 00:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Mar 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 1S7yyN-0001Rd-Ev; Thu, 15 Mar 2012 00: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 1S7yyL-0001RK-OW
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 00:55:17 +0000
Received: from [85.158.143.99:64013] by server-1.bemta-4.messagelabs.com id
	2E/89-20925-4FD316F4; Thu, 15 Mar 2012 00:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1331772914!13497898!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7264 invoked from network); 15 Mar 2012 00:55:16 -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;
	15 Mar 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 1S7yyI-0000FV-46
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 00:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7yyH-0003Oo-VJ
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 00:55:13 +0000
Message-Id: <E1S7yyH-0003Oo-VJ@xenbits.xen.org>
Date: Thu, 15 Mar 2012 00: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] QEMU_TAG update
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331726522 0
# Node ID 14416d8215d455302d637ed801b0de0ec72645f5
# Parent  93fc9441e90c679ca9edc6655b13acf174e28d2a
QEMU_TAG update
---


diff -r 93fc9441e90c -r 14416d8215d4 Config.mk
--- a/Config.mk	Wed Mar 14 10:03:07 2012 +0000
+++ b/Config.mk	Wed Mar 14 12:02:02 2012 +0000
@@ -179,9 +179,9 @@
 # CONFIG_QEMU ?= `pwd`/$(XEN_ROOT)/../qemu-xen.git
 CONFIG_QEMU ?= $(QEMU_REMOTE)
 
-QEMU_TAG ?= 3cf61880403b4e484539596a95937cc066243388
-# Thu Feb 2 13:47:06 2012 +0000
-# e1000: bounds packet size against buffer size
+QEMU_TAG ?= 06d2e688405932841e9a1c27e2eaaef315298a66
+# Thu Mar 1 18:58:27 2012 +0000
+# qemu-xen: ignore console disconnect events for console/0
 
 # Optional components
 XENSTAT_XENTOP     ?= y

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

From xen-changelog-bounces@lists.xen.org Thu Mar 15 00:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Mar 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 1S7yyN-0001RY-Ce; Thu, 15 Mar 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 1S7yyL-0001RI-Go
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 00:55:17 +0000
Received: from [85.158.139.83:20780] by server-11.bemta-5.messagelabs.com id
	2F/8D-12959-4FD316F4; Thu, 15 Mar 2012 00:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1331772914!19335504!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20779 invoked from network); 15 Mar 2012 00:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Mar 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 1S7yyI-0000FU-2n
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 00:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7yyH-0003OC-Cm
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 00:55:13 +0000
Message-Id: <E1S7yyH-0003OC-Cm@xenbits.xen.org>
Date: Thu, 15 Mar 2012 00: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] tools: xencommons init script:
	Fix setting XENSTORED_ROOTDIR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jim Fehlig <jfehlig@suse.com>
# Date 1331719387 0
# Node ID 93fc9441e90c679ca9edc6655b13acf174e28d2a
# Parent  0f19588760900e3428b7fec8b97b7736d71285b4
tools: xencommons init script: Fix setting XENSTORED_ROOTDIR

Due to a logic bug, XENSTORED_ROOTDIR was not being set to
default value when zero length.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-unstable changeset: 24593:e2722b24dc09
Backport-requested-by: Teck Choon Giam <giamteckchoon@gmail.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 0f1958876090 -r 93fc9441e90c tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons	Tue Mar 13 16:49:03 2012 +0000
+++ b/tools/hotplug/Linux/init.d/xencommons	Wed Mar 14 10:03:07 2012 +0000
@@ -61,7 +61,7 @@
 
 	if ! `xenstore-read -s / >/dev/null 2>&1`
 	then
-		test -z "$XENSTORED_ROOTDIR" || XENSTORED_ROOTDIR="/var/lib/xenstored"
+		test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="/var/lib/xenstored"
 		rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
 		test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log"
 

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

From xen-changelog-bounces@lists.xen.org Thu Mar 15 00:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Mar 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 1S7yyN-0001RY-Ce; Thu, 15 Mar 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 1S7yyL-0001RI-Go
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 00:55:17 +0000
Received: from [85.158.139.83:20780] by server-11.bemta-5.messagelabs.com id
	2F/8D-12959-4FD316F4; Thu, 15 Mar 2012 00:55:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1331772914!19335504!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20779 invoked from network); 15 Mar 2012 00:55:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Mar 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 1S7yyI-0000FU-2n
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 00:55:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S7yyH-0003OC-Cm
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 00:55:13 +0000
Message-Id: <E1S7yyH-0003OC-Cm@xenbits.xen.org>
Date: Thu, 15 Mar 2012 00: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] tools: xencommons init script:
	Fix setting XENSTORED_ROOTDIR
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Jim Fehlig <jfehlig@suse.com>
# Date 1331719387 0
# Node ID 93fc9441e90c679ca9edc6655b13acf174e28d2a
# Parent  0f19588760900e3428b7fec8b97b7736d71285b4
tools: xencommons init script: Fix setting XENSTORED_ROOTDIR

Due to a logic bug, XENSTORED_ROOTDIR was not being set to
default value when zero length.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>

xen-unstable changeset: 24593:e2722b24dc09
Backport-requested-by: Teck Choon Giam <giamteckchoon@gmail.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 0f1958876090 -r 93fc9441e90c tools/hotplug/Linux/init.d/xencommons
--- a/tools/hotplug/Linux/init.d/xencommons	Tue Mar 13 16:49:03 2012 +0000
+++ b/tools/hotplug/Linux/init.d/xencommons	Wed Mar 14 10:03:07 2012 +0000
@@ -61,7 +61,7 @@
 
 	if ! `xenstore-read -s / >/dev/null 2>&1`
 	then
-		test -z "$XENSTORED_ROOTDIR" || XENSTORED_ROOTDIR="/var/lib/xenstored"
+		test -z "$XENSTORED_ROOTDIR" && XENSTORED_ROOTDIR="/var/lib/xenstored"
 		rm -f "$XENSTORED_ROOTDIR"/tdb* &>/dev/null
 		test -z "$XENSTORED_TRACE" || XENSTORED_ARGS=" -T /var/log/xen/xenstored-trace.log"
 

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

From xen-changelog-bounces@lists.xen.org Thu Mar 15 12:44:14 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Mar 2012 12: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 1S8A2K-0001KF-US; Thu, 15 Mar 2012 12:44:08 +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 1S8A2J-0001K2-HR
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 12:44:07 +0000
Received: from [85.158.139.83:23986] by server-12.bemta-5.messagelabs.com id
	E2/08-05587-614E16F4; Thu, 15 Mar 2012 12:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1331815444!19423426!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7918 invoked from network); 15 Mar 2012 12:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Mar 2012 12: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 1S8A2G-00017O-Lv
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 12:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8A2G-0005NI-Am
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 12:44:04 +0000
Message-Id: <E1S8A2G-0005NI-Am@xenbits.xen.org>
Date: Thu, 15 Mar 2012 12: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] blkback: failure to write
	"feature-barrier" node is non-fatal
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331815135 -3600
# Node ID 484947c99e63975cd812738ff02b0d237fc45095
# Parent  e0596f39eaefb9962a934aae45e1fffabb925e78
blkback: failure to write "feature-barrier" node is non-fatal

This is an extension, and whether its presence is a requirement should
be decided by the frontend.

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


diff -r e0596f39eaef -r 484947c99e63 drivers/xen/blkback/common.h
--- a/drivers/xen/blkback/common.h	Mon Mar 12 12:28:56 2012 +0100
+++ b/drivers/xen/blkback/common.h	Thu Mar 15 13:38:55 2012 +0100
@@ -138,7 +138,7 @@
 irqreturn_t blkif_be_int(int irq, void *dev_id, struct pt_regs *regs);
 int blkif_schedule(void *arg);
 
-int blkback_barrier(struct xenbus_transaction xbt,
-		    struct backend_info *be, int state);
+void blkback_barrier(struct xenbus_transaction, struct backend_info *,
+		     int state);
 
 #endif /* __BLKIF__BACKEND__COMMON_H__ */
diff -r e0596f39eaef -r 484947c99e63 drivers/xen/blkback/xenbus.c
--- a/drivers/xen/blkback/xenbus.c	Mon Mar 12 12:28:56 2012 +0100
+++ b/drivers/xen/blkback/xenbus.c	Thu Mar 15 13:38:55 2012 +0100
@@ -204,18 +204,15 @@
 	return 0;
 }
 
-int blkback_barrier(struct xenbus_transaction xbt,
-		    struct backend_info *be, int state)
+void blkback_barrier(struct xenbus_transaction xbt,
+		     struct backend_info *be, int state)
 {
 	struct xenbus_device *dev = be->dev;
-	int err;
+	int err = xenbus_printf(xbt, dev->nodename, "feature-barrier",
+				"%d", state);
 
-	err = xenbus_printf(xbt, dev->nodename, "feature-barrier",
-			    "%d", state);
 	if (err)
-		xenbus_dev_fatal(dev, err, "writing feature-barrier");
-
-	return err;
+		xenbus_dev_error(dev, err, "writing feature-barrier");
 }
 
 /**
@@ -435,9 +432,7 @@
 		return;
 	}
 
-	err = blkback_barrier(xbt, be, 1);
-	if (err)
-		goto abort;
+	blkback_barrier(xbt, be, 1);
 
 	err = xenbus_printf(xbt, dev->nodename, "sectors", "%llu",
 			    vbd_size(&be->blkif->vbd));

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

From xen-changelog-bounces@lists.xen.org Thu Mar 15 12:44:14 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Mar 2012 12: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 1S8A2K-0001KF-US; Thu, 15 Mar 2012 12:44:08 +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 1S8A2J-0001K2-HR
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 12:44:07 +0000
Received: from [85.158.139.83:23986] by server-12.bemta-5.messagelabs.com id
	E2/08-05587-614E16F4; Thu, 15 Mar 2012 12:44:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1331815444!19423426!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7918 invoked from network); 15 Mar 2012 12:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	15 Mar 2012 12: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 1S8A2G-00017O-Lv
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 12:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8A2G-0005NI-Am
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 12:44:04 +0000
Message-Id: <E1S8A2G-0005NI-Am@xenbits.xen.org>
Date: Thu, 15 Mar 2012 12: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] blkback: failure to write
	"feature-barrier" node is non-fatal
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331815135 -3600
# Node ID 484947c99e63975cd812738ff02b0d237fc45095
# Parent  e0596f39eaefb9962a934aae45e1fffabb925e78
blkback: failure to write "feature-barrier" node is non-fatal

This is an extension, and whether its presence is a requirement should
be decided by the frontend.

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


diff -r e0596f39eaef -r 484947c99e63 drivers/xen/blkback/common.h
--- a/drivers/xen/blkback/common.h	Mon Mar 12 12:28:56 2012 +0100
+++ b/drivers/xen/blkback/common.h	Thu Mar 15 13:38:55 2012 +0100
@@ -138,7 +138,7 @@
 irqreturn_t blkif_be_int(int irq, void *dev_id, struct pt_regs *regs);
 int blkif_schedule(void *arg);
 
-int blkback_barrier(struct xenbus_transaction xbt,
-		    struct backend_info *be, int state);
+void blkback_barrier(struct xenbus_transaction, struct backend_info *,
+		     int state);
 
 #endif /* __BLKIF__BACKEND__COMMON_H__ */
diff -r e0596f39eaef -r 484947c99e63 drivers/xen/blkback/xenbus.c
--- a/drivers/xen/blkback/xenbus.c	Mon Mar 12 12:28:56 2012 +0100
+++ b/drivers/xen/blkback/xenbus.c	Thu Mar 15 13:38:55 2012 +0100
@@ -204,18 +204,15 @@
 	return 0;
 }
 
-int blkback_barrier(struct xenbus_transaction xbt,
-		    struct backend_info *be, int state)
+void blkback_barrier(struct xenbus_transaction xbt,
+		     struct backend_info *be, int state)
 {
 	struct xenbus_device *dev = be->dev;
-	int err;
+	int err = xenbus_printf(xbt, dev->nodename, "feature-barrier",
+				"%d", state);
 
-	err = xenbus_printf(xbt, dev->nodename, "feature-barrier",
-			    "%d", state);
 	if (err)
-		xenbus_dev_fatal(dev, err, "writing feature-barrier");
-
-	return err;
+		xenbus_dev_error(dev, err, "writing feature-barrier");
 }
 
 /**
@@ -435,9 +432,7 @@
 		return;
 	}
 
-	err = blkback_barrier(xbt, be, 1);
-	if (err)
-		goto abort;
+	blkback_barrier(xbt, be, 1);
 
 	err = xenbus_printf(xbt, dev->nodename, "sectors", "%llu",
 			    vbd_size(&be->blkif->vbd));

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

From xen-changelog-bounces@lists.xen.org Thu Mar 15 12:44:14 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Mar 2012 12: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 1S8A2M-0001KQ-10; Thu, 15 Mar 2012 12:44:10 +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 1S8A2K-0001K3-0i
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 12:44:08 +0000
Received: from [85.158.143.99:24998] by server-2.bemta-4.messagelabs.com id
	40/C1-17550-714E16F4; Thu, 15 Mar 2012 12:44:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1331815445!15944611!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10404 invoked from network); 15 Mar 2012 12:44:06 -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;
	15 Mar 2012 12: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 1S8A2H-00017R-0u
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 12:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8A2G-0005Nd-OU
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 12:44:04 +0000
Message-Id: <E1S8A2G-0005Nd-OU@xenbits.xen.org>
Date: Thu, 15 Mar 2012 12:44: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] xencons: cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331815220 -3600
# Node ID 80ed6519816209ea16ab606a58f868eb8b90e909
# Parent  484947c99e63975cd812738ff02b0d237fc45095
xencons: cleanup

- move private declarations into a separate (private) header
- don't include unneeded headers
- declare xprintk()
- move resume-only code from xencons_ring_init() into xencons_resume()

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


diff -r 484947c99e63 -r 80ed65198162 drivers/xen/console/console.c
--- a/drivers/xen/console/console.c	Thu Mar 15 13:38:55 2012 +0100
+++ b/drivers/xen/console/console.c	Thu Mar 15 13:40:20 2012 +0100
@@ -30,7 +30,6 @@
  * IN THE SOFTWARE.
  */
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
@@ -40,7 +39,6 @@
 #include <linux/tty_flip.h>
 #include <linux/serial.h>
 #include <linux/major.h>
-#include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
@@ -50,15 +48,9 @@
 #include <linux/sysrq.h>
 #include <linux/screen_info.h>
 #include <linux/vt.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/uaccess.h>
 #include <xen/interface/xen.h>
 #include <xen/interface/event_channel.h>
-#include <asm/hypervisor.h>
-#include <xen/evtchn.h>
-#include <xen/xenbus.h>
-#include <xen/xencons.h>
+#include "xencons.h"
 
 /*
  * Modes:
@@ -252,7 +244,7 @@
 console_initcall(xen_console_init);
 
 /*** Useful function for console debugging -- goes straight to Xen. ***/
-asmlinkage int xprintk(const char *fmt, ...)
+int xprintk(const char *fmt, ...)
 {
 	va_list args;
 	int printk_len;
diff -r 484947c99e63 -r 80ed65198162 drivers/xen/console/xencons.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/drivers/xen/console/xencons.h	Thu Mar 15 13:40:20 2012 +0100
@@ -0,0 +1,12 @@
+#include <xen/evtchn.h>
+#include <xen/xencons.h>
+
+void xencons_force_flush(void);
+
+/* Interrupt work hooks. Receive data, or kick data out. */
+struct pt_regs;
+void xencons_rx(char *buf, unsigned len, struct pt_regs *);
+void xencons_tx(void);
+
+int xencons_ring_init(void);
+int xencons_ring_send(const char *data, unsigned len);
diff -r 484947c99e63 -r 80ed65198162 drivers/xen/console/xencons_ring.c
--- a/drivers/xen/console/xencons_ring.c	Thu Mar 15 13:38:55 2012 +0100
+++ b/drivers/xen/console/xencons_ring.c	Thu Mar 15 13:40:20 2012 +0100
@@ -24,29 +24,10 @@
  * IN THE SOFTWARE.
  */
 
-#include <linux/version.h>
-#include <linux/module.h>
 #include <linux/errno.h>
-#include <linux/signal.h>
-#include <linux/sched.h>
 #include <linux/interrupt.h>
-#include <linux/tty.h>
-#include <linux/tty_flip.h>
-#include <linux/serial.h>
-#include <linux/major.h>
-#include <linux/ptrace.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/slab.h>
-
-#include <asm/hypervisor.h>
-#include <xen/evtchn.h>
-#include <xen/xencons.h>
-#include <linux/wait.h>
-#include <linux/interrupt.h>
-#include <linux/sched.h>
-#include <linux/err.h>
 #include <xen/interface/io/console.h>
+#include "xencons.h"
 
 static int xencons_irq;
 
@@ -112,13 +93,7 @@
 {
 	int irq;
 
-	if (xencons_irq)
-		unbind_from_irqhandler(xencons_irq, NULL);
-	xencons_irq = 0;
-
-	if (!is_running_on_xen() ||
-	    is_initial_xendomain() ||
-	    !xen_start_info->console.domU.evtchn)
+	if (!xen_start_info->console.domU.evtchn)
 		return -ENODEV;
 
 	irq = bind_caller_port_to_irqhandler(
@@ -131,13 +106,18 @@
 
 	xencons_irq = irq;
 
-	/* In case we have in-flight data after save/restore... */
-	notify_daemon();
-
 	return 0;
 }
 
 void xencons_resume(void)
 {
-	(void)xencons_ring_init();
+	if (xencons_irq)
+		unbind_from_irqhandler(xencons_irq, NULL);
+	xencons_irq = 0;
+
+	if (is_running_on_xen() && !is_initial_xendomain())
+		xencons_ring_init();
+
+	/* In case we have in-flight data after save/restore... */
+	notify_daemon();
 }
diff -r 484947c99e63 -r 80ed65198162 include/xen/xencons.h
--- a/include/xen/xencons.h	Thu Mar 15 13:38:55 2012 +0100
+++ b/include/xen/xencons.h	Thu Mar 15 13:40:20 2012 +0100
@@ -1,17 +1,12 @@
 #ifndef __ASM_XENCONS_H__
 #define __ASM_XENCONS_H__
 
+int xprintk(const char *, ...) __attribute__ ((__format__(__printf__, 1, 2)));
+
 struct dom0_vga_console_info;
 void dom0_init_screen_info(const struct dom0_vga_console_info *, size_t);
 
 void xencons_force_flush(void);
 void xencons_resume(void);
 
-/* Interrupt work hooks. Receive data, or kick data out. */
-void xencons_rx(char *buf, unsigned len, struct pt_regs *regs);
-void xencons_tx(void);
-
-int xencons_ring_init(void);
-int xencons_ring_send(const char *data, unsigned len);
-
 #endif /* __ASM_XENCONS_H__ */

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

From xen-changelog-bounces@lists.xen.org Thu Mar 15 12:44:14 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 15 Mar 2012 12: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 1S8A2M-0001KQ-10; Thu, 15 Mar 2012 12:44:10 +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 1S8A2K-0001K3-0i
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 12:44:08 +0000
Received: from [85.158.143.99:24998] by server-2.bemta-4.messagelabs.com id
	40/C1-17550-714E16F4; Thu, 15 Mar 2012 12:44:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1331815445!15944611!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10404 invoked from network); 15 Mar 2012 12:44:06 -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;
	15 Mar 2012 12: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 1S8A2H-00017R-0u
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 12:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8A2G-0005Nd-OU
	for xen-changelog@lists.xensource.com; Thu, 15 Mar 2012 12:44:04 +0000
Message-Id: <E1S8A2G-0005Nd-OU@xenbits.xen.org>
Date: Thu, 15 Mar 2012 12:44: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] xencons: cleanup
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331815220 -3600
# Node ID 80ed6519816209ea16ab606a58f868eb8b90e909
# Parent  484947c99e63975cd812738ff02b0d237fc45095
xencons: cleanup

- move private declarations into a separate (private) header
- don't include unneeded headers
- declare xprintk()
- move resume-only code from xencons_ring_init() into xencons_resume()

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


diff -r 484947c99e63 -r 80ed65198162 drivers/xen/console/console.c
--- a/drivers/xen/console/console.c	Thu Mar 15 13:38:55 2012 +0100
+++ b/drivers/xen/console/console.c	Thu Mar 15 13:40:20 2012 +0100
@@ -30,7 +30,6 @@
  * IN THE SOFTWARE.
  */
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/signal.h>
@@ -40,7 +39,6 @@
 #include <linux/tty_flip.h>
 #include <linux/serial.h>
 #include <linux/major.h>
-#include <linux/ptrace.h>
 #include <linux/ioport.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
@@ -50,15 +48,9 @@
 #include <linux/sysrq.h>
 #include <linux/screen_info.h>
 #include <linux/vt.h>
-#include <asm/io.h>
-#include <asm/irq.h>
-#include <asm/uaccess.h>
 #include <xen/interface/xen.h>
 #include <xen/interface/event_channel.h>
-#include <asm/hypervisor.h>
-#include <xen/evtchn.h>
-#include <xen/xenbus.h>
-#include <xen/xencons.h>
+#include "xencons.h"
 
 /*
  * Modes:
@@ -252,7 +244,7 @@
 console_initcall(xen_console_init);
 
 /*** Useful function for console debugging -- goes straight to Xen. ***/
-asmlinkage int xprintk(const char *fmt, ...)
+int xprintk(const char *fmt, ...)
 {
 	va_list args;
 	int printk_len;
diff -r 484947c99e63 -r 80ed65198162 drivers/xen/console/xencons.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/drivers/xen/console/xencons.h	Thu Mar 15 13:40:20 2012 +0100
@@ -0,0 +1,12 @@
+#include <xen/evtchn.h>
+#include <xen/xencons.h>
+
+void xencons_force_flush(void);
+
+/* Interrupt work hooks. Receive data, or kick data out. */
+struct pt_regs;
+void xencons_rx(char *buf, unsigned len, struct pt_regs *);
+void xencons_tx(void);
+
+int xencons_ring_init(void);
+int xencons_ring_send(const char *data, unsigned len);
diff -r 484947c99e63 -r 80ed65198162 drivers/xen/console/xencons_ring.c
--- a/drivers/xen/console/xencons_ring.c	Thu Mar 15 13:38:55 2012 +0100
+++ b/drivers/xen/console/xencons_ring.c	Thu Mar 15 13:40:20 2012 +0100
@@ -24,29 +24,10 @@
  * IN THE SOFTWARE.
  */
 
-#include <linux/version.h>
-#include <linux/module.h>
 #include <linux/errno.h>
-#include <linux/signal.h>
-#include <linux/sched.h>
 #include <linux/interrupt.h>
-#include <linux/tty.h>
-#include <linux/tty_flip.h>
-#include <linux/serial.h>
-#include <linux/major.h>
-#include <linux/ptrace.h>
-#include <linux/ioport.h>
-#include <linux/mm.h>
-#include <linux/slab.h>
-
-#include <asm/hypervisor.h>
-#include <xen/evtchn.h>
-#include <xen/xencons.h>
-#include <linux/wait.h>
-#include <linux/interrupt.h>
-#include <linux/sched.h>
-#include <linux/err.h>
 #include <xen/interface/io/console.h>
+#include "xencons.h"
 
 static int xencons_irq;
 
@@ -112,13 +93,7 @@
 {
 	int irq;
 
-	if (xencons_irq)
-		unbind_from_irqhandler(xencons_irq, NULL);
-	xencons_irq = 0;
-
-	if (!is_running_on_xen() ||
-	    is_initial_xendomain() ||
-	    !xen_start_info->console.domU.evtchn)
+	if (!xen_start_info->console.domU.evtchn)
 		return -ENODEV;
 
 	irq = bind_caller_port_to_irqhandler(
@@ -131,13 +106,18 @@
 
 	xencons_irq = irq;
 
-	/* In case we have in-flight data after save/restore... */
-	notify_daemon();
-
 	return 0;
 }
 
 void xencons_resume(void)
 {
-	(void)xencons_ring_init();
+	if (xencons_irq)
+		unbind_from_irqhandler(xencons_irq, NULL);
+	xencons_irq = 0;
+
+	if (is_running_on_xen() && !is_initial_xendomain())
+		xencons_ring_init();
+
+	/* In case we have in-flight data after save/restore... */
+	notify_daemon();
 }
diff -r 484947c99e63 -r 80ed65198162 include/xen/xencons.h
--- a/include/xen/xencons.h	Thu Mar 15 13:38:55 2012 +0100
+++ b/include/xen/xencons.h	Thu Mar 15 13:40:20 2012 +0100
@@ -1,17 +1,12 @@
 #ifndef __ASM_XENCONS_H__
 #define __ASM_XENCONS_H__
 
+int xprintk(const char *, ...) __attribute__ ((__format__(__printf__, 1, 2)));
+
 struct dom0_vga_console_info;
 void dom0_init_screen_info(const struct dom0_vga_console_info *, size_t);
 
 void xencons_force_flush(void);
 void xencons_resume(void);
 
-/* Interrupt work hooks. Receive data, or kick data out. */
-void xencons_rx(char *buf, unsigned len, struct pt_regs *regs);
-void xencons_tx(void);
-
-int xencons_ring_init(void);
-int xencons_ring_send(const char *data, unsigned len);
-
 #endif /* __ASM_XENCONS_H__ */

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqp-00045g-Lr; Fri, 16 Mar 2012 04:33:15 +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 1S8Oqo-000453-0r
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:14 +0000
Received: from [193.109.254.147:26253] by server-2.bemta-14.messagelabs.com id
	5C/2E-19409-982C26F4; Fri, 16 Mar 2012 04:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1331872391!765984!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28999 invoked from network); 16 Mar 2012 04:33:12 -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;
	16 Mar 2012 04:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oql-0005JX-B9
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oql-0002HF-8U
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:11 +0000
Message-Id: <E1S8Oql-0002HF-8U@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: add generated files to
	.gitignore and .hgignore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331719958 0
# Node ID e0704f25593110469d08346e85804ae89ecd909e
# Parent  dc89ff7bad060c12edf8017a62eb6980b09569a8
arm: add generated files to .gitignore and .hgignore

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r dc89ff7bad06 -r e0704f255931 .gitignore
--- a/.gitignore	Wed Mar 14 09:47:05 2012 +0000
+++ b/.gitignore	Wed Mar 14 10:12:38 2012 +0000
@@ -285,6 +285,8 @@
 xen/.banner*
 xen/BLOG
 xen/System.map
+xen/arch/arm/asm-offsets.s
+xen/arch/arm/xen.lds
 xen/arch/x86/asm-offsets.s
 xen/arch/x86/boot/mkelf32
 xen/arch/x86/xen.lds
diff -r dc89ff7bad06 -r e0704f255931 .hgignore
--- a/.hgignore	Wed Mar 14 09:47:05 2012 +0000
+++ b/.hgignore	Wed Mar 14 10:12:38 2012 +0000
@@ -314,6 +314,8 @@
 ^xen/\.banner.*$
 ^xen/BLOG$
 ^xen/System.map$
+^xen/arch/arm/asm-offsets\.s$
+^xen/arch/arm/xen\.lds$
 ^xen/arch/x86/asm-offsets\.s$
 ^xen/arch/x86/boot/mkelf32$
 ^xen/arch/x86/xen\.lds$

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqp-00045g-Lr; Fri, 16 Mar 2012 04:33:15 +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 1S8Oqo-000453-0r
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:14 +0000
Received: from [193.109.254.147:26253] by server-2.bemta-14.messagelabs.com id
	5C/2E-19409-982C26F4; Fri, 16 Mar 2012 04:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-27.messagelabs.com!1331872391!765984!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28999 invoked from network); 16 Mar 2012 04:33:12 -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;
	16 Mar 2012 04:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oql-0005JX-B9
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oql-0002HF-8U
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:11 +0000
Message-Id: <E1S8Oql-0002HF-8U@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: add generated files to
	.gitignore and .hgignore
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331719958 0
# Node ID e0704f25593110469d08346e85804ae89ecd909e
# Parent  dc89ff7bad060c12edf8017a62eb6980b09569a8
arm: add generated files to .gitignore and .hgignore

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r dc89ff7bad06 -r e0704f255931 .gitignore
--- a/.gitignore	Wed Mar 14 09:47:05 2012 +0000
+++ b/.gitignore	Wed Mar 14 10:12:38 2012 +0000
@@ -285,6 +285,8 @@
 xen/.banner*
 xen/BLOG
 xen/System.map
+xen/arch/arm/asm-offsets.s
+xen/arch/arm/xen.lds
 xen/arch/x86/asm-offsets.s
 xen/arch/x86/boot/mkelf32
 xen/arch/x86/xen.lds
diff -r dc89ff7bad06 -r e0704f255931 .hgignore
--- a/.hgignore	Wed Mar 14 09:47:05 2012 +0000
+++ b/.hgignore	Wed Mar 14 10:12:38 2012 +0000
@@ -314,6 +314,8 @@
 ^xen/\.banner.*$
 ^xen/BLOG$
 ^xen/System.map$
+^xen/arch/arm/asm-offsets\.s$
+^xen/arch/arm/xen\.lds$
 ^xen/arch/x86/asm-offsets\.s$
 ^xen/arch/x86/boot/mkelf32$
 ^xen/arch/x86/xen\.lds$

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqn-00044z-EI; Fri, 16 Mar 2012 04: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 1S8Oqm-00044p-AN
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:12 +0000
Received: from [85.158.143.99:50165] by server-1.bemta-4.messagelabs.com id
	C8/57-20925-782C26F4; Fri, 16 Mar 2012 04:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1331872390!15448688!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23333 invoked from network); 16 Mar 2012 04:33:11 -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;
	16 Mar 2012 04:33: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 1S8Oqj-0005JO-O0
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqj-0002Fn-Ku
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:09 +0000
Message-Id: <E1S8Oqj-0002Fn-Ku@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: fix inflight_irqs list priority
	ordering
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331718423 0
# Node ID e1578914bfd6d4a01276786396b7d0faf4fd3153
# Parent  48923471a385268217cc2116234945d0d3ab8efd
arm: fix inflight_irqs list priority ordering

Lower priority integers mean higher priority.
Also when we are about to insert the lowest priority IRQ so far, add it
at the end.

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


diff -r 48923471a385 -r e1578914bfd6 xen/arch/arm/vgic.c
--- a/xen/arch/arm/vgic.c	Wed Mar 14 09:47:02 2012 +0000
+++ b/xen/arch/arm/vgic.c	Wed Mar 14 09:47:03 2012 +0000
@@ -567,14 +567,14 @@
     spin_lock(&v->arch.vgic.lock);
     list_for_each_entry ( iter, &v->arch.vgic.inflight_irqs, inflight )
     {
-        if ( iter->priority < priority )
+        if ( iter->priority > priority )
         {
             list_add_tail(&n->inflight, &iter->inflight);
             spin_unlock(&v->arch.vgic.lock);
             return;
         }
     }
-    list_add(&n->inflight, &v->arch.vgic.inflight_irqs);
+    list_add_tail(&n->inflight, &v->arch.vgic.inflight_irqs);
     spin_unlock(&v->arch.vgic.lock);
     /* we have a new higher priority irq, inject it into the guest */
     cpu_raise_softirq(v->processor, VGIC_SOFTIRQ);

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqn-00044z-EI; Fri, 16 Mar 2012 04: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 1S8Oqm-00044p-AN
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:12 +0000
Received: from [85.158.143.99:50165] by server-1.bemta-4.messagelabs.com id
	C8/57-20925-782C26F4; Fri, 16 Mar 2012 04:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1331872390!15448688!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=2.0 required=7.0 tests=SUBJECT_RANDOMQ
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23333 invoked from network); 16 Mar 2012 04:33:11 -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;
	16 Mar 2012 04:33: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 1S8Oqj-0005JO-O0
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqj-0002Fn-Ku
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:09 +0000
Message-Id: <E1S8Oqj-0002Fn-Ku@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: fix inflight_irqs list priority
	ordering
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331718423 0
# Node ID e1578914bfd6d4a01276786396b7d0faf4fd3153
# Parent  48923471a385268217cc2116234945d0d3ab8efd
arm: fix inflight_irqs list priority ordering

Lower priority integers mean higher priority.
Also when we are about to insert the lowest priority IRQ so far, add it
at the end.

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


diff -r 48923471a385 -r e1578914bfd6 xen/arch/arm/vgic.c
--- a/xen/arch/arm/vgic.c	Wed Mar 14 09:47:02 2012 +0000
+++ b/xen/arch/arm/vgic.c	Wed Mar 14 09:47:03 2012 +0000
@@ -567,14 +567,14 @@
     spin_lock(&v->arch.vgic.lock);
     list_for_each_entry ( iter, &v->arch.vgic.inflight_irqs, inflight )
     {
-        if ( iter->priority < priority )
+        if ( iter->priority > priority )
         {
             list_add_tail(&n->inflight, &iter->inflight);
             spin_unlock(&v->arch.vgic.lock);
             return;
         }
     }
-    list_add(&n->inflight, &v->arch.vgic.inflight_irqs);
+    list_add_tail(&n->inflight, &v->arch.vgic.inflight_irqs);
     spin_unlock(&v->arch.vgic.lock);
     /* we have a new higher priority irq, inject it into the guest */
     cpu_raise_softirq(v->processor, VGIC_SOFTIRQ);

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqo-00045H-Gy; Fri, 16 Mar 2012 04:33: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 1S8Oqn-00044u-42
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:13 +0000
Received: from [85.158.138.51:51024] by server-2.bemta-3.messagelabs.com id
	36/3C-15460-882C26F4; Fri, 16 Mar 2012 04:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1331872390!17881295!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10190 invoked from network); 16 Mar 2012 04:33: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;
	16 Mar 2012 04:33: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 1S8Oqj-0005JM-Hd
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqj-0002FI-0A
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:09 +0000
Message-Id: <E1S8Oqj-0002FI-0A@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: rename link to inflight
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331718422 0
# Node ID 48923471a385268217cc2116234945d0d3ab8efd
# Parent  64f5cd4aa2a273d4b84c382b8ef484eab7905631
arm: rename link to inflight

The link field in pending_irq has a confusing name so rename it to
inflight and comment its behaviour.

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


diff -r 64f5cd4aa2a2 -r 48923471a385 xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Mar 13 17:30:50 2012 +0000
+++ b/xen/arch/arm/gic.c	Wed Mar 14 09:47:02 2012 +0000
@@ -481,8 +481,8 @@
                 GICC[GICC_DIR] = virq;
             }
             gic_inject_irq_stop();
-            list_del(&p->link);
-            INIT_LIST_HEAD(&p->link);
+            list_del(&p->inflight);
+            INIT_LIST_HEAD(&p->inflight);
             cpu_raise_softirq(current->processor, VGIC_SOFTIRQ);
             spin_unlock(&current->arch.vgic.lock);
         }
diff -r 64f5cd4aa2a2 -r 48923471a385 xen/arch/arm/vgic.c
--- a/xen/arch/arm/vgic.c	Tue Mar 13 17:30:50 2012 +0000
+++ b/xen/arch/arm/vgic.c	Wed Mar 14 09:47:02 2012 +0000
@@ -85,7 +85,7 @@
         xmalloc_array(struct pending_irq,
                 d->arch.vgic.nr_lines + (32 * d->max_vcpus));
     for (i=0; i<d->arch.vgic.nr_lines + (32 * d->max_vcpus); i++)
-        INIT_LIST_HEAD(&d->arch.vgic.pending_irqs[i].link);
+        INIT_LIST_HEAD(&d->arch.vgic.pending_irqs[i].inflight);
     for (i=0; i<DOMAIN_NR_RANKS(d); i++)
         spin_lock_init(&d->arch.vgic.shared_irqs[i].lock);
     return 0;
@@ -550,7 +550,7 @@
     struct pending_irq *iter, *n = irq_to_pending(v, irq);
 
     /* irq still pending */
-    if (!list_empty(&n->link))
+    if (!list_empty(&n->inflight))
         return;
 
     priority = byte_read(rank->ipriority[REG_RANK_INDEX(8, idx)], 0, byte);
@@ -565,16 +565,16 @@
     gic_set_guest_irq(irq, GICH_LR_PENDING, priority);
 
     spin_lock(&v->arch.vgic.lock);
-    list_for_each_entry ( iter, &v->arch.vgic.inflight_irqs, link )
+    list_for_each_entry ( iter, &v->arch.vgic.inflight_irqs, inflight )
     {
         if ( iter->priority < priority )
         {
-            list_add_tail(&n->link, &iter->link);
+            list_add_tail(&n->inflight, &iter->inflight);
             spin_unlock(&v->arch.vgic.lock);
             return;
         }
     }
-    list_add(&n->link, &v->arch.vgic.inflight_irqs);
+    list_add(&n->inflight, &v->arch.vgic.inflight_irqs);
     spin_unlock(&v->arch.vgic.lock);
     /* we have a new higher priority irq, inject it into the guest */
     cpu_raise_softirq(v->processor, VGIC_SOFTIRQ);
diff -r 64f5cd4aa2a2 -r 48923471a385 xen/include/asm-arm/domain.h
--- a/xen/include/asm-arm/domain.h	Tue Mar 13 17:30:50 2012 +0000
+++ b/xen/include/asm-arm/domain.h	Wed Mar 14 09:47:02 2012 +0000
@@ -20,7 +20,9 @@
     int irq;
     struct irq_desc *desc; /* only set it the irq corresponds to a physical irq */
     uint8_t priority;
-    struct list_head link;
+    /* inflight is used to append instances of pending_irq to
+     * vgic.inflight_irqs */
+    struct list_head inflight;
 };
 
 struct arch_domain

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqo-00045H-Gy; Fri, 16 Mar 2012 04:33: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 1S8Oqn-00044u-42
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:13 +0000
Received: from [85.158.138.51:51024] by server-2.bemta-3.messagelabs.com id
	36/3C-15460-882C26F4; Fri, 16 Mar 2012 04:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-174.messagelabs.com!1331872390!17881295!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.5; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10190 invoked from network); 16 Mar 2012 04:33: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;
	16 Mar 2012 04:33: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 1S8Oqj-0005JM-Hd
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqj-0002FI-0A
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:09 +0000
Message-Id: <E1S8Oqj-0002FI-0A@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: rename link to inflight
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331718422 0
# Node ID 48923471a385268217cc2116234945d0d3ab8efd
# Parent  64f5cd4aa2a273d4b84c382b8ef484eab7905631
arm: rename link to inflight

The link field in pending_irq has a confusing name so rename it to
inflight and comment its behaviour.

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


diff -r 64f5cd4aa2a2 -r 48923471a385 xen/arch/arm/gic.c
--- a/xen/arch/arm/gic.c	Tue Mar 13 17:30:50 2012 +0000
+++ b/xen/arch/arm/gic.c	Wed Mar 14 09:47:02 2012 +0000
@@ -481,8 +481,8 @@
                 GICC[GICC_DIR] = virq;
             }
             gic_inject_irq_stop();
-            list_del(&p->link);
-            INIT_LIST_HEAD(&p->link);
+            list_del(&p->inflight);
+            INIT_LIST_HEAD(&p->inflight);
             cpu_raise_softirq(current->processor, VGIC_SOFTIRQ);
             spin_unlock(&current->arch.vgic.lock);
         }
diff -r 64f5cd4aa2a2 -r 48923471a385 xen/arch/arm/vgic.c
--- a/xen/arch/arm/vgic.c	Tue Mar 13 17:30:50 2012 +0000
+++ b/xen/arch/arm/vgic.c	Wed Mar 14 09:47:02 2012 +0000
@@ -85,7 +85,7 @@
         xmalloc_array(struct pending_irq,
                 d->arch.vgic.nr_lines + (32 * d->max_vcpus));
     for (i=0; i<d->arch.vgic.nr_lines + (32 * d->max_vcpus); i++)
-        INIT_LIST_HEAD(&d->arch.vgic.pending_irqs[i].link);
+        INIT_LIST_HEAD(&d->arch.vgic.pending_irqs[i].inflight);
     for (i=0; i<DOMAIN_NR_RANKS(d); i++)
         spin_lock_init(&d->arch.vgic.shared_irqs[i].lock);
     return 0;
@@ -550,7 +550,7 @@
     struct pending_irq *iter, *n = irq_to_pending(v, irq);
 
     /* irq still pending */
-    if (!list_empty(&n->link))
+    if (!list_empty(&n->inflight))
         return;
 
     priority = byte_read(rank->ipriority[REG_RANK_INDEX(8, idx)], 0, byte);
@@ -565,16 +565,16 @@
     gic_set_guest_irq(irq, GICH_LR_PENDING, priority);
 
     spin_lock(&v->arch.vgic.lock);
-    list_for_each_entry ( iter, &v->arch.vgic.inflight_irqs, link )
+    list_for_each_entry ( iter, &v->arch.vgic.inflight_irqs, inflight )
     {
         if ( iter->priority < priority )
         {
-            list_add_tail(&n->link, &iter->link);
+            list_add_tail(&n->inflight, &iter->inflight);
             spin_unlock(&v->arch.vgic.lock);
             return;
         }
     }
-    list_add(&n->link, &v->arch.vgic.inflight_irqs);
+    list_add(&n->inflight, &v->arch.vgic.inflight_irqs);
     spin_unlock(&v->arch.vgic.lock);
     /* we have a new higher priority irq, inject it into the guest */
     cpu_raise_softirq(v->processor, VGIC_SOFTIRQ);
diff -r 64f5cd4aa2a2 -r 48923471a385 xen/include/asm-arm/domain.h
--- a/xen/include/asm-arm/domain.h	Tue Mar 13 17:30:50 2012 +0000
+++ b/xen/include/asm-arm/domain.h	Wed Mar 14 09:47:02 2012 +0000
@@ -20,7 +20,9 @@
     int irq;
     struct irq_desc *desc; /* only set it the irq corresponds to a physical irq */
     uint8_t priority;
-    struct list_head link;
+    /* inflight is used to append instances of pending_irq to
+     * vgic.inflight_irqs */
+    struct list_head inflight;
 };
 
 struct arch_domain

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqq-000465-TL; Fri, 16 Mar 2012 04:33: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 1S8Oqp-000456-0v
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:15 +0000
Received: from [85.158.143.35:54765] by server-2.bemta-4.messagelabs.com id
	C3/C6-17550-A82C26F4; Fri, 16 Mar 2012 04:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1331872392!4532833!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19094 invoked from network); 16 Mar 2012 04:33: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;
	16 Mar 2012 04:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oql-0005Jb-QO
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oql-0002Hg-PF
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:11 +0000
Message-Id: <E1S8Oql-0002Hg-PF@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] gitignore: Add cscope 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331722993 0
# Node ID 21376d9d27df8c50d56d7f8111a5e8136f569f2d
# Parent  dc89ff7bad060c12edf8017a62eb6980b09569a8
gitignore: Add cscope files

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


diff -r dc89ff7bad06 -r 21376d9d27df .gitignore
--- a/.gitignore	Wed Mar 14 09:47:05 2012 +0000
+++ b/.gitignore	Wed Mar 14 11:03:13 2012 +0000
@@ -12,6 +12,10 @@
 *.bak
 *.tmp
 TAGS
+cscope.files
+cscope.in.out
+cscope.out
+cscope.po.out
 .config
 
 dist

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqq-000465-TL; Fri, 16 Mar 2012 04:33: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 1S8Oqp-000456-0v
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:15 +0000
Received: from [85.158.143.35:54765] by server-2.bemta-4.messagelabs.com id
	C3/C6-17550-A82C26F4; Fri, 16 Mar 2012 04:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1331872392!4532833!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19094 invoked from network); 16 Mar 2012 04:33: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;
	16 Mar 2012 04:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oql-0005Jb-QO
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oql-0002Hg-PF
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:11 +0000
Message-Id: <E1S8Oql-0002Hg-PF@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] gitignore: Add cscope 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331722993 0
# Node ID 21376d9d27df8c50d56d7f8111a5e8136f569f2d
# Parent  dc89ff7bad060c12edf8017a62eb6980b09569a8
gitignore: Add cscope files

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


diff -r dc89ff7bad06 -r 21376d9d27df .gitignore
--- a/.gitignore	Wed Mar 14 09:47:05 2012 +0000
+++ b/.gitignore	Wed Mar 14 11:03:13 2012 +0000
@@ -12,6 +12,10 @@
 *.bak
 *.tmp
 TAGS
+cscope.files
+cscope.in.out
+cscope.out
+cscope.po.out
 .config
 
 dist

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqt-00047V-AK; Fri, 16 Mar 2012 04:33: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 1S8Oqs-00046I-3O
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Received: from [85.158.139.83:14847] by server-3.bemta-5.messagelabs.com id
	20/BB-25237-C82C26F4; Fri, 16 Mar 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1331872394!18939233!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4681 invoked from network); 16 Mar 2012 04:33:15 -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;
	16 Mar 2012 04:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqo-0005Jn-66
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqn-0002Jd-VL
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:13 +0000
Message-Id: <E1S8Oqn-0002Jd-VL@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Refactor sched_domain_output to
	have a callback for pool information
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331733898 0
# Node ID 847f05b8d3001303485d53de24ce40b8eb905920
# Parent  20c8a7db63d160e95fcf5c8e2f9d31923d336316
xl: Refactor sched_domain_output to have a callback for pool information

Allow a scheduler to provide a callback to display pool-wide information,
providing a default.  This is in preparation for displaying pool-wide
scheduler parameters on this line.

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


diff -r 20c8a7db63d1 -r 847f05b8d300 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Mar 14 11:40:44 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Wed Mar 14 14:04:58 2012 +0000
@@ -4056,13 +4056,23 @@
     return 0;
 }
 
-static int sched_domain_output(
-    libxl_scheduler sched, int (*output)(int), const char *cpupool)
+static int sched_default_pool_output(uint32_t poolid)
+{
+    char *poolname;
+
+    poolname = libxl_cpupoolid_to_name(ctx, poolid);
+    printf("Cpupool %s:\n",
+           poolname);
+    free(poolname);
+    return 0;
+}
+
+static int sched_domain_output(libxl_scheduler sched, int (*output)(int),
+                               int (*pooloutput)(uint32_t), const char *cpupool)
 {
     libxl_dominfo *info;
     libxl_cpupoolinfo *poolinfo = NULL;
     uint32_t poolid;
-    char *poolname;
     int nb_domain, n_pools = 0, i, p;
     int rc = 0;
 
@@ -4090,9 +4100,7 @@
             (cpupool && (poolid != poolinfo[p].poolid)))
             continue;
 
-        poolname = libxl_cpupoolid_to_name(ctx, poolinfo[p].poolid);
-        printf("Cpupool %s:\n", poolname);
-        free(poolname);
+        pooloutput(poolinfo[p].poolid);
 
         output(-1);
         for (i = 0; i < nb_domain; i++) {
@@ -4168,7 +4176,9 @@
 
     if (!dom) { /* list all domain's credit scheduler info */
         return -sched_domain_output(LIBXL_SCHEDULER_CREDIT,
-                                    sched_credit_domain_output, cpupool);
+                                    sched_credit_domain_output,
+                                    sched_default_pool_output,
+                                    cpupool);
     } else {
         find_domain(dom);
 
@@ -4245,7 +4255,9 @@
 
     if (!dom) { /* list all domain's credit scheduler info */
         return -sched_domain_output(LIBXL_SCHEDULER_CREDIT2,
-                                    sched_credit2_domain_output, cpupool);
+                                    sched_credit2_domain_output,
+                                    sched_default_pool_output,
+                                    cpupool);
     } else {
         find_domain(dom);
 
@@ -4348,7 +4360,9 @@
 
     if (!dom) { /* list all domain's credit scheduler info */
         return -sched_domain_output(LIBXL_SCHEDULER_SEDF,
-                                    sched_sedf_domain_output, cpupool);
+                                    sched_sedf_domain_output,
+                                    sched_default_pool_output,
+                                    cpupool);
     } else {
         find_domain(dom);
 

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqt-00047V-AK; Fri, 16 Mar 2012 04:33: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 1S8Oqs-00046I-3O
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Received: from [85.158.139.83:14847] by server-3.bemta-5.messagelabs.com id
	20/BB-25237-C82C26F4; Fri, 16 Mar 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1331872394!18939233!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4681 invoked from network); 16 Mar 2012 04:33:15 -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;
	16 Mar 2012 04:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqo-0005Jn-66
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqn-0002Jd-VL
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:13 +0000
Message-Id: <E1S8Oqn-0002Jd-VL@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Refactor sched_domain_output to
	have a callback for pool information
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331733898 0
# Node ID 847f05b8d3001303485d53de24ce40b8eb905920
# Parent  20c8a7db63d160e95fcf5c8e2f9d31923d336316
xl: Refactor sched_domain_output to have a callback for pool information

Allow a scheduler to provide a callback to display pool-wide information,
providing a default.  This is in preparation for displaying pool-wide
scheduler parameters on this line.

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


diff -r 20c8a7db63d1 -r 847f05b8d300 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Mar 14 11:40:44 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Wed Mar 14 14:04:58 2012 +0000
@@ -4056,13 +4056,23 @@
     return 0;
 }
 
-static int sched_domain_output(
-    libxl_scheduler sched, int (*output)(int), const char *cpupool)
+static int sched_default_pool_output(uint32_t poolid)
+{
+    char *poolname;
+
+    poolname = libxl_cpupoolid_to_name(ctx, poolid);
+    printf("Cpupool %s:\n",
+           poolname);
+    free(poolname);
+    return 0;
+}
+
+static int sched_domain_output(libxl_scheduler sched, int (*output)(int),
+                               int (*pooloutput)(uint32_t), const char *cpupool)
 {
     libxl_dominfo *info;
     libxl_cpupoolinfo *poolinfo = NULL;
     uint32_t poolid;
-    char *poolname;
     int nb_domain, n_pools = 0, i, p;
     int rc = 0;
 
@@ -4090,9 +4100,7 @@
             (cpupool && (poolid != poolinfo[p].poolid)))
             continue;
 
-        poolname = libxl_cpupoolid_to_name(ctx, poolinfo[p].poolid);
-        printf("Cpupool %s:\n", poolname);
-        free(poolname);
+        pooloutput(poolinfo[p].poolid);
 
         output(-1);
         for (i = 0; i < nb_domain; i++) {
@@ -4168,7 +4176,9 @@
 
     if (!dom) { /* list all domain's credit scheduler info */
         return -sched_domain_output(LIBXL_SCHEDULER_CREDIT,
-                                    sched_credit_domain_output, cpupool);
+                                    sched_credit_domain_output,
+                                    sched_default_pool_output,
+                                    cpupool);
     } else {
         find_domain(dom);
 
@@ -4245,7 +4255,9 @@
 
     if (!dom) { /* list all domain's credit scheduler info */
         return -sched_domain_output(LIBXL_SCHEDULER_CREDIT2,
-                                    sched_credit2_domain_output, cpupool);
+                                    sched_credit2_domain_output,
+                                    sched_default_pool_output,
+                                    cpupool);
     } else {
         find_domain(dom);
 
@@ -4348,7 +4360,9 @@
 
     if (!dom) { /* list all domain's credit scheduler info */
         return -sched_domain_output(LIBXL_SCHEDULER_SEDF,
-                                    sched_sedf_domain_output, cpupool);
+                                    sched_sedf_domain_output,
+                                    sched_default_pool_output,
+                                    cpupool);
     } else {
         find_domain(dom);
 

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqt-00046w-1w; Fri, 16 Mar 2012 04:33: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 1S8Oqr-000463-4M
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:17 +0000
Received: from [85.158.139.83:14815] by server-9.bemta-5.messagelabs.com id
	A6/42-09826-C82C26F4; Fri, 16 Mar 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1331872394!18706219!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32540 invoked from network); 16 Mar 2012 04:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqm-0005Jh-TR
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqm-0002Ig-SH
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:12 +0000
Message-Id: <E1S8Oqm-0002Ig-SH@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: display max_cpu_ids for xl 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331723420 0
# Node ID e8660d8cf4be332e53cf6e2765f21804e3bfe28e
# Parent  d7e4b0725e978368253ab2ae42a0d13b3ab8d9f1
xl: display max_cpu_ids for xl info

Expose `max_cpu_id' in stdout from `xl info'

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r d7e4b0725e97 -r e8660d8cf4be tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Mar 14 11:03:37 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Wed Mar 14 11:10:20 2012 +0000
@@ -3734,6 +3734,7 @@
     }
 
     printf("nr_cpus                : %d\n", info.nr_cpus);
+    printf("max_cpu_id             : %d\n", info.max_cpu_id);
     printf("nr_nodes               : %d\n", info.nr_nodes);
     printf("cores_per_socket       : %d\n", info.cores_per_socket);
     printf("threads_per_core       : %d\n", info.threads_per_core);

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqt-00046w-1w; Fri, 16 Mar 2012 04:33: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 1S8Oqr-000463-4M
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:17 +0000
Received: from [85.158.139.83:14815] by server-9.bemta-5.messagelabs.com id
	A6/42-09826-C82C26F4; Fri, 16 Mar 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-182.messagelabs.com!1331872394!18706219!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32540 invoked from network); 16 Mar 2012 04:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqm-0005Jh-TR
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqm-0002Ig-SH
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:12 +0000
Message-Id: <E1S8Oqm-0002Ig-SH@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: display max_cpu_ids for xl 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331723420 0
# Node ID e8660d8cf4be332e53cf6e2765f21804e3bfe28e
# Parent  d7e4b0725e978368253ab2ae42a0d13b3ab8d9f1
xl: display max_cpu_ids for xl info

Expose `max_cpu_id' in stdout from `xl info'

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r d7e4b0725e97 -r e8660d8cf4be tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Mar 14 11:03:37 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Wed Mar 14 11:10:20 2012 +0000
@@ -3734,6 +3734,7 @@
     }
 
     printf("nr_cpus                : %d\n", info.nr_cpus);
+    printf("max_cpu_id             : %d\n", info.max_cpu_id);
     printf("nr_nodes               : %d\n", info.nr_nodes);
     printf("cores_per_socket       : %d\n", info.cores_per_socket);
     printf("threads_per_core       : %d\n", info.threads_per_core);

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqt-00047b-D5; Fri, 16 Mar 2012 04:33: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 1S8Oqs-000456-Nv
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Received: from [85.158.143.35:54920] by server-2.bemta-4.messagelabs.com id
	49/C6-17550-E82C26F4; Fri, 16 Mar 2012 04:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1331872396!12154087!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14773 invoked from network); 16 Mar 2012 04:33:17 -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;
	16 Mar 2012 04:33: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 1S8Oqp-0005Jw-Ui
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqp-0002L2-Jn
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:15 +0000
Message-Id: <E1S8Oqp-0002L2-Jn@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: Add explicit clean rule for
	SeaBIOS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331734217 0
# Node ID f5fbbb2918c6739b2eeb82297417ee4829b8eed8
# Parent  6868b2ca35a0e2a06f6f486142735062e1c1527f
tools: Add explicit clean rule for SeaBIOS

Since seabios-dir is cloned during build we need to check that it exists before
recursing into it for clean, following the pattern used for qemu-*-dir etc.

Also remove usage of "buildmakevars2shellvars" except when used to poopulate
the environment for qemu-xen-traditional's xen-setup script, which is the only
user.

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 6868b2ca35a0 -r f5fbbb2918c6 tools/Makefile
--- a/tools/Makefile	Wed Mar 14 14:08:04 2012 +0000
+++ b/tools/Makefile	Wed Mar 14 14:10:17 2012 +0000
@@ -127,7 +127,6 @@
 
 subdir-clean-qemu-xen-traditional-dir:
 	set -e; if test -d qemu-xen-traditional-dir/.; then \
-		$(buildmakevars2shellvars); \
 		$(MAKE) -C qemu-xen-traditional-dir clean; \
 	fi
 
@@ -162,7 +161,6 @@
 
 subdir-clean-qemu-xen-dir:
 	set -e; if test -d qemu-xen-dir/.; then \
-		$(buildmakevars2shellvars); \
 		$(MAKE) -C qemu-xen-dir clean; \
 	fi
 
diff -r 6868b2ca35a0 -r f5fbbb2918c6 tools/firmware/Makefile
--- a/tools/firmware/Makefile	Wed Mar 14 14:08:04 2012 +0000
+++ b/tools/firmware/Makefile	Wed Mar 14 14:10:17 2012 +0000
@@ -55,3 +55,8 @@
 		$(GIT) fetch origin; \
 		$(GIT) reset --hard $(SEABIOS_UPSTREAM_TAG); \
 	fi
+
+subdir-clean-seabios-dir:
+	set -e; if test -d seabios-dir/.; then \
+		$(MAKE) -C seabios-dir clean; \
+	fi

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqt-00047b-D5; Fri, 16 Mar 2012 04:33: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 1S8Oqs-000456-Nv
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Received: from [85.158.143.35:54920] by server-2.bemta-4.messagelabs.com id
	49/C6-17550-E82C26F4; Fri, 16 Mar 2012 04:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1331872396!12154087!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14773 invoked from network); 16 Mar 2012 04:33:17 -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;
	16 Mar 2012 04:33: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 1S8Oqp-0005Jw-Ui
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqp-0002L2-Jn
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:15 +0000
Message-Id: <E1S8Oqp-0002L2-Jn@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tools: Add explicit clean rule for
	SeaBIOS
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331734217 0
# Node ID f5fbbb2918c6739b2eeb82297417ee4829b8eed8
# Parent  6868b2ca35a0e2a06f6f486142735062e1c1527f
tools: Add explicit clean rule for SeaBIOS

Since seabios-dir is cloned during build we need to check that it exists before
recursing into it for clean, following the pattern used for qemu-*-dir etc.

Also remove usage of "buildmakevars2shellvars" except when used to poopulate
the environment for qemu-xen-traditional's xen-setup script, which is the only
user.

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 6868b2ca35a0 -r f5fbbb2918c6 tools/Makefile
--- a/tools/Makefile	Wed Mar 14 14:08:04 2012 +0000
+++ b/tools/Makefile	Wed Mar 14 14:10:17 2012 +0000
@@ -127,7 +127,6 @@
 
 subdir-clean-qemu-xen-traditional-dir:
 	set -e; if test -d qemu-xen-traditional-dir/.; then \
-		$(buildmakevars2shellvars); \
 		$(MAKE) -C qemu-xen-traditional-dir clean; \
 	fi
 
@@ -162,7 +161,6 @@
 
 subdir-clean-qemu-xen-dir:
 	set -e; if test -d qemu-xen-dir/.; then \
-		$(buildmakevars2shellvars); \
 		$(MAKE) -C qemu-xen-dir clean; \
 	fi
 
diff -r 6868b2ca35a0 -r f5fbbb2918c6 tools/firmware/Makefile
--- a/tools/firmware/Makefile	Wed Mar 14 14:08:04 2012 +0000
+++ b/tools/firmware/Makefile	Wed Mar 14 14:10:17 2012 +0000
@@ -55,3 +55,8 @@
 		$(GIT) fetch origin; \
 		$(GIT) reset --hard $(SEABIOS_UPSTREAM_TAG); \
 	fi
+
+subdir-clean-seabios-dir:
+	set -e; if test -d seabios-dir/.; then \
+		$(MAKE) -C seabios-dir clean; \
+	fi

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqt-000474-4H; Fri, 16 Mar 2012 04:33: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 1S8Oqr-00046I-MW
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:17 +0000
Received: from [85.158.139.83:14840] by server-3.bemta-5.messagelabs.com id
	AF/AB-25237-C82C26F4; Fri, 16 Mar 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1331872394!19525437!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23006 invoked from network); 16 Mar 2012 04:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqn-0005Jk-ER
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqn-0002JA-DS
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:13 +0000
Message-Id: <E1S8Oqn-0002JA-DS@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tapdisk2: initialize 'name'
	parameter of BLKTAP2_IOCTL_CREATE_DEVICE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331725244 0
# Node ID 20c8a7db63d160e95fcf5c8e2f9d31923d336316
# Parent  e8660d8cf4be332e53cf6e2765f21804e3bfe28e
tapdisk2: initialize 'name' parameter of BLKTAP2_IOCTL_CREATE_DEVICE

This keeps the kernel driver from printing garbage.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r e8660d8cf4be -r 20c8a7db63d1 tools/blktap2/drivers/tapdisk-control.c
--- a/tools/blktap2/drivers/tapdisk-control.c	Wed Mar 14 11:10:20 2012 +0000
+++ b/tools/blktap2/drivers/tapdisk-control.c	Wed Mar 14 11:40:44 2012 +0000
@@ -462,6 +462,7 @@
 
 	params.capacity = image.size;
 	params.sector_size = image.secsize;
+	strncpy(params.name, vbd->name, BLKTAP2_MAX_MESSAGE_LEN);
 
 	err = ioctl(vbd->ring.fd, BLKTAP2_IOCTL_CREATE_DEVICE, &params);
 	if (err && errno != EEXIST) {

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqt-000474-4H; Fri, 16 Mar 2012 04:33: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 1S8Oqr-00046I-MW
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:17 +0000
Received: from [85.158.139.83:14840] by server-3.bemta-5.messagelabs.com id
	AF/AB-25237-C82C26F4; Fri, 16 Mar 2012 04:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1331872394!19525437!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23006 invoked from network); 16 Mar 2012 04:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqn-0005Jk-ER
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqn-0002JA-DS
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:13 +0000
Message-Id: <E1S8Oqn-0002JA-DS@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] tapdisk2: initialize 'name'
	parameter of BLKTAP2_IOCTL_CREATE_DEVICE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331725244 0
# Node ID 20c8a7db63d160e95fcf5c8e2f9d31923d336316
# Parent  e8660d8cf4be332e53cf6e2765f21804e3bfe28e
tapdisk2: initialize 'name' parameter of BLKTAP2_IOCTL_CREATE_DEVICE

This keeps the kernel driver from printing garbage.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r e8660d8cf4be -r 20c8a7db63d1 tools/blktap2/drivers/tapdisk-control.c
--- a/tools/blktap2/drivers/tapdisk-control.c	Wed Mar 14 11:10:20 2012 +0000
+++ b/tools/blktap2/drivers/tapdisk-control.c	Wed Mar 14 11:40:44 2012 +0000
@@ -462,6 +462,7 @@
 
 	params.capacity = image.size;
 	params.sector_size = image.secsize;
+	strncpy(params.name, vbd->name, BLKTAP2_MAX_MESSAGE_LEN);
 
 	err = ioctl(vbd->ring.fd, BLKTAP2_IOCTL_CREATE_DEVICE, &params);
 	if (err && errno != EEXIST) {

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqt-00047h-GJ; Fri, 16 Mar 2012 04:33: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 1S8Oqs-00046I-MV
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Received: from [85.158.139.83:10811] by server-3.bemta-5.messagelabs.com id
	72/BB-25237-D82C26F4; Fri, 16 Mar 2012 04:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1331872395!19605011!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24807 invoked from network); 16 Mar 2012 04:33:16 -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;
	16 Mar 2012 04:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqo-0005Jq-LA
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqo-0002K6-Gj
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:14 +0000
Message-Id: <E1S8Oqo-0002K6-Gj@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Implement sched-credit schedule
	parameter command-line interface
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331733964 0
# Node ID efc9ce8e4d95f5b7e42a3e29f342795d2b566300
# Parent  847f05b8d3001303485d53de24ce40b8eb905920
xl: Implement sched-credit schedule parameter command-line interface

Add features to the sched-credit interface to allow querying and
displaying scheduler parameters.

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


diff -r 847f05b8d300 -r efc9ce8e4d95 docs/man/xl.pod.1
--- a/docs/man/xl.pod.1	Wed Mar 14 14:04:58 2012 +0000
+++ b/docs/man/xl.pod.1	Wed Mar 14 14:06:04 2012 +0000
@@ -714,6 +714,53 @@
 
 Restrict output to domains in the specified cpupool.
 
+=item B<-s>, B<--schedparam>
+
+Specify to list or set pool-wide scheduler parameters.
+
+=item B<-t TSLICE>, B<--tslice_ms=TSLICE>
+
+Timeslice tells the scheduler how long to allow VMs to run before
+pre-empting.  The default is 30ms.  Valid ranges are 1ms to 1000ms.
+The length of the timeslice (in ms) must be higher than the length of
+the ratelimit (see below).
+
+=item B<-r RLIMIT>, B<--ratelimit_us=RLIMIT>
+
+Ratelimit attempts to limit the number of schedules per second.  It
+sets a minimum amount of time (in microseconds) a VM must run before
+we will allow a higher-prioirty VM to pre-empt it.  The default value
+is 1000 microseconds (1ms).  Valid range is 100 to 500000 (500ms).
+The ratelimit length must be lower than the timeslice length.
+
+=back
+
+B<COMBINATION>
+
+The following is the effect of combining the above options:
+
+=over 4
+
+=item B<E<lt>nothingE<gt>>             : List all domain params and sched params from all pools
+
+=item B<-d [domid]>            : List domain params for domain [domid]
+
+=item B<-d [domid] [params]>   : Set domain params for domain [domid]
+
+=item B<-p [pool]>             : list all domains and sched params for [pool]
+
+=item B<-s>                    : List sched params for poolid 0
+
+=item B<-s [params]>           : Set sched params for poolid 0
+
+=item B<-p [pool] -s>          : List sched params for [pool]
+
+=item B<-p [pool] -s [params]> : Set sched params for [pool]
+
+=item B<-p [pool] -d>...       : Illegal
+
+=item
+
 =back
 
 =item B<sched-credit2> [I<OPTIONS>]
diff -r 847f05b8d300 -r efc9ce8e4d95 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Mar 14 14:04:58 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Wed Mar 14 14:06:04 2012 +0000
@@ -3906,8 +3906,7 @@
     return 0;
 }
 
-static int sched_credit_domain_get(
-    int domid, libxl_sched_credit_domain *scinfo)
+static int sched_credit_domain_get(int domid, libxl_sched_credit_domain *scinfo)
 {
     int rc;
 
@@ -3918,8 +3917,7 @@
     return rc;
 }
 
-static int sched_credit_domain_set(
-    int domid, libxl_sched_credit_domain *scinfo)
+static int sched_credit_domain_set(int domid, libxl_sched_credit_domain *scinfo)
 {
     int rc;
 
@@ -3931,8 +3929,29 @@
     return rc;
 }
 
-static int sched_credit_domain_output(
-    int domid)
+static int sched_credit_params_set(int poolid, libxl_sched_credit_params *scinfo)
+{
+    int rc;
+
+    rc = libxl_sched_credit_params_set(ctx, poolid, scinfo);
+    if (rc)
+        fprintf(stderr, "libxl_sched_credit_params_set failed.\n");
+
+    return rc;
+}
+
+static int sched_credit_params_get(int poolid, libxl_sched_credit_params *scinfo)
+{
+    int rc;
+
+    rc = libxl_sched_credit_params_get(ctx, poolid, scinfo);
+    if (rc)
+        fprintf(stderr, "libxl_sched_credit_params_get failed.\n");
+
+    return rc;
+}
+
+static int sched_credit_domain_output(int domid)
 {
     char *domname;
     libxl_sched_credit_domain scinfo;
@@ -3956,6 +3975,27 @@
     return 0;
 }
 
+static int sched_credit_pool_output(uint32_t poolid)
+{
+    libxl_sched_credit_params scparam;
+    char *poolname;
+    int rc;
+
+    poolname = libxl_cpupoolid_to_name(ctx, poolid);
+    rc = sched_credit_params_get(poolid, &scparam);
+    if (rc) {
+        printf("Cpupool %s: [sched params unavailable]\n",
+               poolname);
+    } else {
+        printf("Cpupool %s: tslice=%dms ratelimit=%dus\n",
+               poolname,
+               scparam.tslice_ms,
+               scparam.ratelimit_us);
+    }
+    free(poolname);
+    return 0;
+}
+
 static int sched_credit2_domain_get(
     int domid, libxl_sched_credit2_domain *scinfo)
 {
@@ -4119,25 +4159,41 @@
     return 0;
 }
 
+/* 
+ * <nothing>             : List all domain params and sched params from all pools
+ * -d [domid]            : List domain params for domain
+ * -d [domid] [params]   : Set domain params for domain
+ * -p [pool]             : list all domains and sched params for pool
+ * -s                    : List sched params for poolid 0
+ * -s [params]           : Set sched params for poolid 0
+ * -p [pool] -s          : List sched params for pool
+ * -p [pool] -s [params] : Set sched params for pool
+ * -p [pool] -d...       : Illegal
+ */
 int main_sched_credit(int argc, char **argv)
 {
     libxl_sched_credit_domain scinfo;
     const char *dom = NULL;
     const char *cpupool = NULL;
     int weight = 256, cap = 0, opt_w = 0, opt_c = 0;
+    int opt_s = 0;
+    int tslice = 0, opt_t = 0, ratelimit = 0, opt_r = 0;
     int opt, rc;
     int option_index = 0;
     static struct option long_options[] = {
         {"domain", 1, 0, 'd'},
         {"weight", 1, 0, 'w'},
         {"cap", 1, 0, 'c'},
+        {"schedparam", 0, 0, 's'},
+        {"tslice_ms", 1, 0, 't'},
+        {"ratelimit_us", 1, 0, 'r'},
         {"cpupool", 1, 0, 'p'},
         {"help", 0, 0, 'h'},
         {0, 0, 0, 0}
     };
 
     while (1) {
-        opt = getopt_long(argc, argv, "d:w:c:p:h", long_options,
+        opt = getopt_long(argc, argv, "d:w:c:p:t:r:hs", long_options,
                           &option_index);
         if (opt == -1)
             break;
@@ -4155,6 +4211,17 @@
             cap = strtol(optarg, NULL, 10);
             opt_c = 1;
             break;
+        case 't':
+            tslice = strtol(optarg, NULL, 10);
+            opt_t = 1;
+            break;
+        case 'r':
+            ratelimit = strtol(optarg, NULL, 10);
+            opt_r = 1;
+            break;
+        case 's':
+            opt_s = 1;
+            break;
         case 'p':
             cpupool = optarg;
             break;
@@ -4164,20 +4231,54 @@
         }
     }
 
-    if (cpupool && (dom || opt_w || opt_c)) {
-        fprintf(stderr, "Specifying a cpupool is not allowed with other "
-                "options.\n");
+    if ((cpupool || opt_s) && (dom || opt_w || opt_c)) {
+        fprintf(stderr, "Specifying a cpupool or schedparam is not "
+                "allowed with domain options.\n");
         return 1;
     }
     if (!dom && (opt_w || opt_c)) {
         fprintf(stderr, "Must specify a domain.\n");
         return 1;
     }
-
-    if (!dom) { /* list all domain's credit scheduler info */
+    if (!opt_s && (opt_t || opt_r)) {
+        fprintf(stderr, "Must specify schedparam to set schedule "
+                "parameter values.\n");
+        return 1;
+    }
+
+    if (opt_s) {
+        libxl_sched_credit_params  scparam;
+        uint32_t poolid = 0;
+
+        if (cpupool) {
+            if (cpupool_qualifier_to_cpupoolid(cpupool, &poolid, NULL) ||
+                !libxl_cpupoolid_to_name(ctx, poolid)) {
+                fprintf(stderr, "unknown cpupool \'%s\'\n", cpupool);
+                return -ERROR_FAIL;
+            }
+        }
+
+        if (!opt_t && !opt_r) { /* Output scheduling parameters */
+            return -sched_credit_pool_output(poolid);
+        } else { /* Set scheduling parameters*/
+            rc = sched_credit_params_get(poolid, &scparam);
+            if (rc)
+                return -rc;
+
+            if (opt_t)
+                scparam.tslice_ms = tslice;
+
+            if (opt_r)
+                scparam.ratelimit_us = ratelimit;
+
+            rc = sched_credit_params_set(poolid, &scparam);
+            if (rc)
+                return -rc;
+        }
+    } else if (!dom) { /* list all domain's credit scheduler info */
         return -sched_domain_output(LIBXL_SCHEDULER_CREDIT,
                                     sched_credit_domain_output,
-                                    sched_default_pool_output,
+                                    sched_credit_pool_output,
                                     cpupool);
     } else {
         find_domain(dom);
diff -r 847f05b8d300 -r efc9ce8e4d95 tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c	Wed Mar 14 14:04:58 2012 +0000
+++ b/tools/libxl/xl_cmdtable.c	Wed Mar 14 14:06:04 2012 +0000
@@ -204,11 +204,14 @@
     { "sched-credit",
       &main_sched_credit, 0,
       "Get/set credit scheduler parameters",
-      "[-d <Domain> [-w[=WEIGHT]|-c[=CAP]]] [-p CPUPOOL]",
-      "-d DOMAIN, --domain=DOMAIN     Domain to modify\n"
-      "-w WEIGHT, --weight=WEIGHT     Weight (int)\n"
-      "-c CAP, --cap=CAP              Cap (int)\n"
-      "-p CPUPOOL, --cpupool=CPUPOOL  Restrict output to CPUPOOL"
+      "[-d <Domain> [-w[=WEIGHT]|-c[=CAP]]] [-s [-t TSLICE] [-r RATELIMIT]] [-p CPUPOOL]",
+      "-d DOMAIN, --domain=DOMAIN        Domain to modify\n"
+      "-w WEIGHT, --weight=WEIGHT        Weight (int)\n"
+      "-c CAP, --cap=CAP                 Cap (int)\n"
+      "-s         --schedparam           Query / modify scheduler parameters\n"
+      "-t TSLICE, --tslice_ms=TSLICE     Set the timeslice, in milliseconds\n"
+      "-r RLIMIT, --ratelimit_us=RLIMIT  Set the scheduling rate limit, in microseconds\n"
+      "-p CPUPOOL, --cpupool=CPUPOOL     Restrict output to CPUPOOL"
     },
     { "sched-credit2",
       &main_sched_credit2, 0,

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqp-00045l-Ok; Fri, 16 Mar 2012 04:33: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 1S8Oqo-000456-HL
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:14 +0000
Received: from [85.158.143.35:32575] by server-2.bemta-4.messagelabs.com id
	13/C6-17550-982C26F4; Fri, 16 Mar 2012 04:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1331872391!13564376!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17044 invoked from network); 16 Mar 2012 04:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oql-0005JV-20
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqk-0002Gm-Nb
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:10 +0000
Message-Id: <E1S8Oqk-0002Gm-Nb@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: introduce more hypercalls
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331718425 0
# Node ID dc89ff7bad060c12edf8017a62eb6980b09569a8
# Parent  f01efbb36d1288d21fc512a52746eac28865f03b
arm: introduce more hypercalls

Implement xen_version, event_channel_op, memory_op sysctl and physdev_op
hypercalls.

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


diff -r f01efbb36d12 -r dc89ff7bad06 xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Wed Mar 14 09:47:04 2012 +0000
+++ b/xen/arch/arm/Makefile	Wed Mar 14 09:47:05 2012 +0000
@@ -15,6 +15,7 @@
 obj-y += p2m.o
 obj-y += percpu.o
 obj-y += guestcopy.o
+obj-y += physdev.o
 obj-y += setup.o
 obj-y += time.o
 obj-y += smpboot.o
diff -r f01efbb36d12 -r dc89ff7bad06 xen/arch/arm/physdev.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/physdev.c	Wed Mar 14 09:47:05 2012 +0000
@@ -0,0 +1,27 @@
+/******************************************************************************
+ * Arch-specific physdev.c
+ *
+ * Copyright (c) 2012, Citrix Systems
+ */
+
+#include <xen/config.h>
+#include <xen/types.h>
+#include <xen/lib.h>
+#include <xen/errno.h>
+#include <asm/hypercall.h>
+
+
+int do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+{
+    printk("%s %d cmd=%d: not implemented yet\n", __func__, __LINE__, cmd);
+    return -ENOSYS;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r f01efbb36d12 -r dc89ff7bad06 xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c	Wed Mar 14 09:47:04 2012 +0000
+++ b/xen/arch/arm/traps.c	Wed Mar 14 09:47:05 2012 +0000
@@ -376,6 +376,11 @@
     HYPERCALL(arch_0),
     HYPERCALL(sched_op),
     HYPERCALL(console_io),
+    HYPERCALL(xen_version),
+    HYPERCALL(event_channel_op),
+    HYPERCALL(memory_op),
+    HYPERCALL(physdev_op),
+    HYPERCALL(sysctl),
 };
 
 static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)
diff -r f01efbb36d12 -r dc89ff7bad06 xen/include/asm-arm/hypercall.h
--- a/xen/include/asm-arm/hypercall.h	Wed Mar 14 09:47:04 2012 +0000
+++ b/xen/include/asm-arm/hypercall.h	Wed Mar 14 09:47:05 2012 +0000
@@ -2,6 +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);
 
 #endif /* __ASM_ARM_HYPERCALL_H__ */
 /*

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqt-00047J-7M; Fri, 16 Mar 2012 04:33: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 1S8Oqr-000455-RR
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Received: from [85.158.143.35:54883] by server-3.bemta-4.messagelabs.com id
	87/6D-05853-D82C26F4; Fri, 16 Mar 2012 04:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1331872395!4532834!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19164 invoked from network); 16 Mar 2012 04:33:16 -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;
	16 Mar 2012 04:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqp-0005Jt-3q
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqp-0002KZ-2W
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:15 +0000
Message-Id: <E1S8Oqp-0002KZ-2W@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] autoconf: check for Python.h header
	and -lpython* lib
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1331734084 0
# Node ID 6868b2ca35a0e2a06f6f486142735062e1c1527f
# Parent  efc9ce8e4d95f5b7e42a3e29f342795d2b566300
autoconf: check for Python.h header and -lpython* lib

Check that the package usually called python-dev is present.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r efc9ce8e4d95 -r 6868b2ca35a0 tools/configure
--- a/tools/configure	Wed Mar 14 14:06:04 2012 +0000
+++ b/tools/configure	Wed Mar 14 14:08:04 2012 +0000
@@ -6141,26 +6141,88 @@
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python devel" >&5
-$as_echo_n "checking for python devel... " >&6; }
-
-`$PYTHON -c '
-import os.path, sys
-for p in sys.path:
-    if os.path.exists(p + "/config/Makefile"):
-        sys.exit(0)
-sys.exit(1)
-' > /dev/null 2>&1`
-
-if test "$?" != "0"
-then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    as_fn_error $? "Python devel package not found" "$LINENO" 5
-else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
+
+ac_previous_cppflags=$CPPFLAGS
+CPPFLAGS="$CFLAGS `$PYTHON-config --includes`"
+ac_previous_ldflags=$LDFLAGS
+for flag in `$PYTHON-config --ldflags`
+do
+    case $flag in
+    -L*)
+        LDFLAGS="$LDLFAGS $flag"
+        ;;
+    -lpython*)
+        python_lib=`echo $flag | sed 's/^-l//'`
+        ;;
+    -l*)
+        # Ignore other libraries, we are only interested in testing python-dev
+        ;;
+    *)
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Strange ldflag found in $PYTHON-config output: $flag" >&5
+$as_echo "$as_me: WARNING: Strange ldflag found in $PYTHON-config output: $flag" >&2;}
+        ;;
+    esac
+done
+ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
+if test "x$ac_cv_header_Python_h" = x""yes; then :
+
+else
+  as_fn_error $? "Unable to find Python development headers" "$LINENO" 5
+fi
+
+
+as_ac_Lib=`$as_echo "ac_cv_lib_$python_lib''_PyArg_ParseTuple" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PyArg_ParseTuple in -l$python_lib" >&5
+$as_echo_n "checking for PyArg_ParseTuple in -l$python_lib... " >&6; }
+if eval "test \"\${$as_ac_Lib+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$python_lib  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char PyArg_ParseTuple ();
+int
+main ()
+{
+return PyArg_ParseTuple ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_LIB$python_lib" | $as_tr_cpp` 1
+_ACEOF
+
+  LIBS="-l$python_lib $LIBS"
+
+else
+  as_fn_error $? "Unable to find a suitable python development library" "$LINENO" 5
+fi
+
+CPPFLAGS=$ac_previous_cppflags
+LDLFAGS=$ac_previous_ldflags
+
 
 fi
 # Extract the first word of "xgettext", so it can be a program name with args.
diff -r efc9ce8e4d95 -r 6868b2ca35a0 tools/m4/python_devel.m4
--- a/tools/m4/python_devel.m4	Wed Mar 14 14:06:04 2012 +0000
+++ b/tools/m4/python_devel.m4	Wed Mar 14 14:08:04 2012 +0000
@@ -1,18 +1,28 @@
-AC_DEFUN([AX_CHECK_PYTHON_DEVEL],
-[AC_MSG_CHECKING([for python devel])
-
-`$PYTHON -c '
-import os.path, sys
-for p in sys.path:
-    if os.path.exists(p + "/config/Makefile"):
-        sys.exit(0)
-sys.exit(1)
-' > /dev/null 2>&1`
-
-if test "$?" != "0"
-then
-    AC_MSG_RESULT([no])
-    AC_MSG_ERROR([Python devel package not found])
-else
-    AC_MSG_RESULT([yes])
-fi])
+AC_DEFUN([AX_CHECK_PYTHON_DEVEL], [
+ac_previous_cppflags=$CPPFLAGS
+CPPFLAGS="$CFLAGS `$PYTHON-config --includes`"
+ac_previous_ldflags=$LDFLAGS
+for flag in `$PYTHON-config --ldflags`
+do
+    case $flag in
+    -L*)
+        LDFLAGS="$LDLFAGS $flag"
+        ;;
+    -lpython*)
+        python_lib=`echo $flag | sed 's/^-l//'`
+        ;;
+    -l*)
+        # Ignore other libraries, we are only interested in testing python-dev
+        ;;
+    *)
+        AC_MSG_WARN([Strange ldflag found in $PYTHON-config output: $flag])
+        ;;
+    esac
+done
+AC_CHECK_HEADER([Python.h], [],
+    [AC_MSG_ERROR([Unable to find Python development headers])],)
+AC_CHECK_LIB($python_lib, PyArg_ParseTuple, [],
+    [AC_MSG_ERROR([Unable to find a suitable python development library])])
+CPPFLAGS=$ac_previous_cppflags
+LDLFAGS=$ac_previous_ldflags
+])

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqq-00046C-VY; Fri, 16 Mar 2012 04:33: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 1S8Oqp-000455-Ak
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:15 +0000
Received: from [85.158.143.35:54789] by server-3.bemta-4.messagelabs.com id
	45/6D-05853-A82C26F4; Fri, 16 Mar 2012 04:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1331872392!12085442!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17625 invoked from network); 16 Mar 2012 04:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqm-0005Je-EC
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqm-0002I9-9n
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:12 +0000
Message-Id: <E1S8Oqm-0002I9-9n@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Merge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331723017 0
# Node ID d7e4b0725e978368253ab2ae42a0d13b3ab8d9f1
# Parent  21376d9d27df8c50d56d7f8111a5e8136f569f2d
# Parent  e0704f25593110469d08346e85804ae89ecd909e
Merge
---


diff -r 21376d9d27df -r d7e4b0725e97 .gitignore
--- a/.gitignore	Wed Mar 14 11:03:13 2012 +0000
+++ b/.gitignore	Wed Mar 14 11:03:37 2012 +0000
@@ -289,6 +289,8 @@
 xen/.banner*
 xen/BLOG
 xen/System.map
+xen/arch/arm/asm-offsets.s
+xen/arch/arm/xen.lds
 xen/arch/x86/asm-offsets.s
 xen/arch/x86/boot/mkelf32
 xen/arch/x86/xen.lds
diff -r 21376d9d27df -r d7e4b0725e97 .hgignore
--- a/.hgignore	Wed Mar 14 11:03:13 2012 +0000
+++ b/.hgignore	Wed Mar 14 11:03:37 2012 +0000
@@ -314,6 +314,8 @@
 ^xen/\.banner.*$
 ^xen/BLOG$
 ^xen/System.map$
+^xen/arch/arm/asm-offsets\.s$
+^xen/arch/arm/xen\.lds$
 ^xen/arch/x86/asm-offsets\.s$
 ^xen/arch/x86/boot/mkelf32$
 ^xen/arch/x86/xen\.lds$

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqu-00048x-LM; Fri, 16 Mar 2012 04:33: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 1S8Oqt-000456-HK
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:19 +0000
Received: from [85.158.143.99:51899] by server-2.bemta-4.messagelabs.com id
	B9/C6-17550-F82C26F4; Fri, 16 Mar 2012 04:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331872397!14146859!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20609 invoked from network); 16 Mar 2012 04:33: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;
	16 Mar 2012 04:33: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 1S8Oqr-0005K5-CH
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqr-0002MT-BF
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:17 +0000
Message-Id: <E1S8Oqr-0002MT-BF@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Fix deadlock between p2m and
	event channel locks.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331737660 14400
# Node ID 4dbbc69ebece6376775e3ab9db4aa3e69c0f6fcf
# Parent  c25ec9e9a8126d562d2a72620aea8ee6b104f89e
x86/mm: Fix deadlock between p2m and event channel locks.

The hvm io emulation code holds the p2m lock for the duration of the
emulation, which may include sending an event to qemu. On a separate path,
map_domain_pirq grabs the event channel and p2m locks in opposite order.

Fix this by ensuring liveness of the ram_gfn used by io emulation, with a
page ref.

Reported-by: "Hao, Xudong" <xudong.hao@intel.com>
Signed-off-by: "Hao, Xudong" <xudong.hao@intel.com>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r c25ec9e9a812 -r 4dbbc69ebece xen/arch/x86/hvm/emulate.c
--- a/xen/arch/x86/hvm/emulate.c	Wed Mar 14 14:20:58 2012 +0000
+++ b/xen/arch/x86/hvm/emulate.c	Wed Mar 14 11:07:40 2012 -0400
@@ -77,6 +77,17 @@
         return X86EMUL_RETRY;
     }
 
+    /* Maintain a ref on the mfn to ensure liveness. Put the gfn
+     * to avoid potential deadlock wrt event channel lock, later. */
+    if ( mfn_valid(mfn_x(ram_mfn)) )
+        if ( !get_page(mfn_to_page(mfn_x(ram_mfn)),
+             curr->domain) )
+        {
+            put_gfn(curr->domain, ram_gfn);
+            return X86EMUL_RETRY;
+        }
+    put_gfn(curr->domain, ram_gfn);
+
     /*
      * Weird-sized accesses have undefined behaviour: we discard writes
      * and read all-ones.
@@ -87,7 +98,8 @@
         ASSERT(p_data != NULL); /* cannot happen with a REP prefix */
         if ( dir == IOREQ_READ )
             memset(p_data, ~0, size);
-        put_gfn(curr->domain, ram_gfn); 
+        if ( mfn_valid(mfn_x(ram_mfn)) )
+            put_page(mfn_to_page(mfn_x(ram_mfn)));
         return X86EMUL_UNHANDLEABLE;
     }
 
@@ -108,7 +120,8 @@
             unsigned int bytes = vio->mmio_large_write_bytes;
             if ( (addr >= pa) && ((addr + size) <= (pa + bytes)) )
             {
-                put_gfn(curr->domain, ram_gfn); 
+                if ( mfn_valid(mfn_x(ram_mfn)) )
+                    put_page(mfn_to_page(mfn_x(ram_mfn)));
                 return X86EMUL_OKAY;
             }
         }
@@ -120,7 +133,8 @@
             {
                 memcpy(p_data, &vio->mmio_large_read[addr - pa],
                        size);
-                put_gfn(curr->domain, ram_gfn); 
+                if ( mfn_valid(mfn_x(ram_mfn)) )
+                    put_page(mfn_to_page(mfn_x(ram_mfn)));
                 return X86EMUL_OKAY;
             }
         }
@@ -134,7 +148,8 @@
         vio->io_state = HVMIO_none;
         if ( p_data == NULL )
         {
-            put_gfn(curr->domain, ram_gfn);
+            if ( mfn_valid(mfn_x(ram_mfn)) )
+                put_page(mfn_to_page(mfn_x(ram_mfn)));
             return X86EMUL_UNHANDLEABLE;
         }
         goto finish_access;
@@ -144,11 +159,13 @@
              (addr == (vio->mmio_large_write_pa +
                        vio->mmio_large_write_bytes)) )
         {
-            put_gfn(curr->domain, ram_gfn);
+            if ( mfn_valid(mfn_x(ram_mfn)) )
+                put_page(mfn_to_page(mfn_x(ram_mfn)));
             return X86EMUL_RETRY;
         }
     default:
-        put_gfn(curr->domain, ram_gfn);
+        if ( mfn_valid(mfn_x(ram_mfn)) )
+            put_page(mfn_to_page(mfn_x(ram_mfn)));
         return X86EMUL_UNHANDLEABLE;
     }
 
@@ -156,7 +173,8 @@
     {
         gdprintk(XENLOG_WARNING, "WARNING: io already pending (%d)?\n",
                  p->state);
-        put_gfn(curr->domain, ram_gfn); 
+        if ( mfn_valid(mfn_x(ram_mfn)) )
+            put_page(mfn_to_page(mfn_x(ram_mfn)));
         return X86EMUL_UNHANDLEABLE;
     }
 
@@ -208,7 +226,8 @@
 
     if ( rc != X86EMUL_OKAY )
     {
-        put_gfn(curr->domain, ram_gfn); 
+        if ( mfn_valid(mfn_x(ram_mfn)) )
+            put_page(mfn_to_page(mfn_x(ram_mfn)));
         return rc;
     }
 
@@ -244,7 +263,8 @@
         }
     }
 
-    put_gfn(curr->domain, ram_gfn); 
+    if ( mfn_valid(mfn_x(ram_mfn)) )
+        put_page(mfn_to_page(mfn_x(ram_mfn)));
     return X86EMUL_OKAY;
 }
 

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqt-00047J-7M; Fri, 16 Mar 2012 04:33: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 1S8Oqr-000455-RR
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Received: from [85.158.143.35:54883] by server-3.bemta-4.messagelabs.com id
	87/6D-05853-D82C26F4; Fri, 16 Mar 2012 04:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1331872395!4532834!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19164 invoked from network); 16 Mar 2012 04:33:16 -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;
	16 Mar 2012 04:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqp-0005Jt-3q
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqp-0002KZ-2W
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:15 +0000
Message-Id: <E1S8Oqp-0002KZ-2W@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] autoconf: check for Python.h header
	and -lpython* lib
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1331734084 0
# Node ID 6868b2ca35a0e2a06f6f486142735062e1c1527f
# Parent  efc9ce8e4d95f5b7e42a3e29f342795d2b566300
autoconf: check for Python.h header and -lpython* lib

Check that the package usually called python-dev is present.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r efc9ce8e4d95 -r 6868b2ca35a0 tools/configure
--- a/tools/configure	Wed Mar 14 14:06:04 2012 +0000
+++ b/tools/configure	Wed Mar 14 14:08:04 2012 +0000
@@ -6141,26 +6141,88 @@
     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python devel" >&5
-$as_echo_n "checking for python devel... " >&6; }
-
-`$PYTHON -c '
-import os.path, sys
-for p in sys.path:
-    if os.path.exists(p + "/config/Makefile"):
-        sys.exit(0)
-sys.exit(1)
-' > /dev/null 2>&1`
-
-if test "$?" != "0"
-then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-    as_fn_error $? "Python devel package not found" "$LINENO" 5
-else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
+
+ac_previous_cppflags=$CPPFLAGS
+CPPFLAGS="$CFLAGS `$PYTHON-config --includes`"
+ac_previous_ldflags=$LDFLAGS
+for flag in `$PYTHON-config --ldflags`
+do
+    case $flag in
+    -L*)
+        LDFLAGS="$LDLFAGS $flag"
+        ;;
+    -lpython*)
+        python_lib=`echo $flag | sed 's/^-l//'`
+        ;;
+    -l*)
+        # Ignore other libraries, we are only interested in testing python-dev
+        ;;
+    *)
+        { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Strange ldflag found in $PYTHON-config output: $flag" >&5
+$as_echo "$as_me: WARNING: Strange ldflag found in $PYTHON-config output: $flag" >&2;}
+        ;;
+    esac
+done
+ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
+if test "x$ac_cv_header_Python_h" = x""yes; then :
+
+else
+  as_fn_error $? "Unable to find Python development headers" "$LINENO" 5
+fi
+
+
+as_ac_Lib=`$as_echo "ac_cv_lib_$python_lib''_PyArg_ParseTuple" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for PyArg_ParseTuple in -l$python_lib" >&5
+$as_echo_n "checking for PyArg_ParseTuple in -l$python_lib... " >&6; }
+if eval "test \"\${$as_ac_Lib+set}\"" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$python_lib  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char PyArg_ParseTuple ();
+int
+main ()
+{
+return PyArg_ParseTuple ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$as_ac_Lib=yes"
+else
+  eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+eval ac_res=\$$as_ac_Lib
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_LIB$python_lib" | $as_tr_cpp` 1
+_ACEOF
+
+  LIBS="-l$python_lib $LIBS"
+
+else
+  as_fn_error $? "Unable to find a suitable python development library" "$LINENO" 5
+fi
+
+CPPFLAGS=$ac_previous_cppflags
+LDLFAGS=$ac_previous_ldflags
+
 
 fi
 # Extract the first word of "xgettext", so it can be a program name with args.
diff -r efc9ce8e4d95 -r 6868b2ca35a0 tools/m4/python_devel.m4
--- a/tools/m4/python_devel.m4	Wed Mar 14 14:06:04 2012 +0000
+++ b/tools/m4/python_devel.m4	Wed Mar 14 14:08:04 2012 +0000
@@ -1,18 +1,28 @@
-AC_DEFUN([AX_CHECK_PYTHON_DEVEL],
-[AC_MSG_CHECKING([for python devel])
-
-`$PYTHON -c '
-import os.path, sys
-for p in sys.path:
-    if os.path.exists(p + "/config/Makefile"):
-        sys.exit(0)
-sys.exit(1)
-' > /dev/null 2>&1`
-
-if test "$?" != "0"
-then
-    AC_MSG_RESULT([no])
-    AC_MSG_ERROR([Python devel package not found])
-else
-    AC_MSG_RESULT([yes])
-fi])
+AC_DEFUN([AX_CHECK_PYTHON_DEVEL], [
+ac_previous_cppflags=$CPPFLAGS
+CPPFLAGS="$CFLAGS `$PYTHON-config --includes`"
+ac_previous_ldflags=$LDFLAGS
+for flag in `$PYTHON-config --ldflags`
+do
+    case $flag in
+    -L*)
+        LDFLAGS="$LDLFAGS $flag"
+        ;;
+    -lpython*)
+        python_lib=`echo $flag | sed 's/^-l//'`
+        ;;
+    -l*)
+        # Ignore other libraries, we are only interested in testing python-dev
+        ;;
+    *)
+        AC_MSG_WARN([Strange ldflag found in $PYTHON-config output: $flag])
+        ;;
+    esac
+done
+AC_CHECK_HEADER([Python.h], [],
+    [AC_MSG_ERROR([Unable to find Python development headers])],)
+AC_CHECK_LIB($python_lib, PyArg_ParseTuple, [],
+    [AC_MSG_ERROR([Unable to find a suitable python development library])])
+CPPFLAGS=$ac_previous_cppflags
+LDLFAGS=$ac_previous_ldflags
+])

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqp-00045b-Jb; Fri, 16 Mar 2012 04:33: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 1S8Oqn-000455-Vx
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:14 +0000
Received: from [85.158.143.35:32565] by server-3.bemta-4.messagelabs.com id
	B3/6D-05853-982C26F4; Fri, 16 Mar 2012 04:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1331872391!14064746!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24295 invoked from network); 16 Mar 2012 04:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqk-0005JS-Dy
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqk-0002GI-6S
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:10 +0000
Message-Id: <E1S8Oqk-0002GI-6S@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: handle dom0_max_vcpus=0 case
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331718424 0
# Node ID f01efbb36d1288d21fc512a52746eac28865f03b
# Parent  e1578914bfd6d4a01276786396b7d0faf4fd3153
arm: handle dom0_max_vcpus=0 case properly

Also use xzalloc_array.

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 e1578914bfd6 -r f01efbb36d12 xen/arch/arm/domain_build.c
--- a/xen/arch/arm/domain_build.c	Wed Mar 14 09:47:03 2012 +0000
+++ b/xen/arch/arm/domain_build.c	Wed Mar 14 09:47:04 2012 +0000
@@ -15,13 +15,14 @@
 
 struct vcpu *__init alloc_dom0_vcpu0(void)
 {
-    dom0->vcpu = xmalloc_array(struct vcpu *, opt_dom0_max_vcpus);
+    if ( opt_dom0_max_vcpus == 0 )
+        opt_dom0_max_vcpus = num_online_cpus();
+    if ( opt_dom0_max_vcpus > MAX_VIRT_CPUS )
+        opt_dom0_max_vcpus = MAX_VIRT_CPUS;
+
+    dom0->vcpu = xzalloc_array(struct vcpu *, opt_dom0_max_vcpus);
     if ( !dom0->vcpu )
-    {
-            printk("failed to alloc dom0->vccpu\n");
         return NULL;
-    }
-    memset(dom0->vcpu, 0, opt_dom0_max_vcpus * sizeof(*dom0->vcpu));
     dom0->max_vcpus = opt_dom0_max_vcpus;
 
     return alloc_vcpu(dom0, 0, 0);

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqq-00046C-VY; Fri, 16 Mar 2012 04:33: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 1S8Oqp-000455-Ak
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:15 +0000
Received: from [85.158.143.35:54789] by server-3.bemta-4.messagelabs.com id
	45/6D-05853-A82C26F4; Fri, 16 Mar 2012 04:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1331872392!12085442!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17625 invoked from network); 16 Mar 2012 04:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqm-0005Je-EC
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqm-0002I9-9n
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:12 +0000
Message-Id: <E1S8Oqm-0002I9-9n@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Merge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331723017 0
# Node ID d7e4b0725e978368253ab2ae42a0d13b3ab8d9f1
# Parent  21376d9d27df8c50d56d7f8111a5e8136f569f2d
# Parent  e0704f25593110469d08346e85804ae89ecd909e
Merge
---


diff -r 21376d9d27df -r d7e4b0725e97 .gitignore
--- a/.gitignore	Wed Mar 14 11:03:13 2012 +0000
+++ b/.gitignore	Wed Mar 14 11:03:37 2012 +0000
@@ -289,6 +289,8 @@
 xen/.banner*
 xen/BLOG
 xen/System.map
+xen/arch/arm/asm-offsets.s
+xen/arch/arm/xen.lds
 xen/arch/x86/asm-offsets.s
 xen/arch/x86/boot/mkelf32
 xen/arch/x86/xen.lds
diff -r 21376d9d27df -r d7e4b0725e97 .hgignore
--- a/.hgignore	Wed Mar 14 11:03:13 2012 +0000
+++ b/.hgignore	Wed Mar 14 11:03:37 2012 +0000
@@ -314,6 +314,8 @@
 ^xen/\.banner.*$
 ^xen/BLOG$
 ^xen/System.map$
+^xen/arch/arm/asm-offsets\.s$
+^xen/arch/arm/xen\.lds$
 ^xen/arch/x86/asm-offsets\.s$
 ^xen/arch/x86/boot/mkelf32$
 ^xen/arch/x86/xen\.lds$

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqp-00045l-Ok; Fri, 16 Mar 2012 04:33: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 1S8Oqo-000456-HL
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:14 +0000
Received: from [85.158.143.35:32575] by server-2.bemta-4.messagelabs.com id
	13/C6-17550-982C26F4; Fri, 16 Mar 2012 04:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-21.messagelabs.com!1331872391!13564376!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17044 invoked from network); 16 Mar 2012 04:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oql-0005JV-20
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqk-0002Gm-Nb
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:10 +0000
Message-Id: <E1S8Oqk-0002Gm-Nb@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: introduce more hypercalls
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331718425 0
# Node ID dc89ff7bad060c12edf8017a62eb6980b09569a8
# Parent  f01efbb36d1288d21fc512a52746eac28865f03b
arm: introduce more hypercalls

Implement xen_version, event_channel_op, memory_op sysctl and physdev_op
hypercalls.

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


diff -r f01efbb36d12 -r dc89ff7bad06 xen/arch/arm/Makefile
--- a/xen/arch/arm/Makefile	Wed Mar 14 09:47:04 2012 +0000
+++ b/xen/arch/arm/Makefile	Wed Mar 14 09:47:05 2012 +0000
@@ -15,6 +15,7 @@
 obj-y += p2m.o
 obj-y += percpu.o
 obj-y += guestcopy.o
+obj-y += physdev.o
 obj-y += setup.o
 obj-y += time.o
 obj-y += smpboot.o
diff -r f01efbb36d12 -r dc89ff7bad06 xen/arch/arm/physdev.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/arch/arm/physdev.c	Wed Mar 14 09:47:05 2012 +0000
@@ -0,0 +1,27 @@
+/******************************************************************************
+ * Arch-specific physdev.c
+ *
+ * Copyright (c) 2012, Citrix Systems
+ */
+
+#include <xen/config.h>
+#include <xen/types.h>
+#include <xen/lib.h>
+#include <xen/errno.h>
+#include <asm/hypercall.h>
+
+
+int do_physdev_op(int cmd, XEN_GUEST_HANDLE(void) arg)
+{
+    printk("%s %d cmd=%d: not implemented yet\n", __func__, __LINE__, cmd);
+    return -ENOSYS;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r f01efbb36d12 -r dc89ff7bad06 xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c	Wed Mar 14 09:47:04 2012 +0000
+++ b/xen/arch/arm/traps.c	Wed Mar 14 09:47:05 2012 +0000
@@ -376,6 +376,11 @@
     HYPERCALL(arch_0),
     HYPERCALL(sched_op),
     HYPERCALL(console_io),
+    HYPERCALL(xen_version),
+    HYPERCALL(event_channel_op),
+    HYPERCALL(memory_op),
+    HYPERCALL(physdev_op),
+    HYPERCALL(sysctl),
 };
 
 static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)
diff -r f01efbb36d12 -r dc89ff7bad06 xen/include/asm-arm/hypercall.h
--- a/xen/include/asm-arm/hypercall.h	Wed Mar 14 09:47:04 2012 +0000
+++ b/xen/include/asm-arm/hypercall.h	Wed Mar 14 09:47:05 2012 +0000
@@ -2,6 +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);
 
 #endif /* __ASM_ARM_HYPERCALL_H__ */
 /*

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqt-00047h-GJ; Fri, 16 Mar 2012 04:33: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 1S8Oqs-00046I-MV
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Received: from [85.158.139.83:10811] by server-3.bemta-5.messagelabs.com id
	72/BB-25237-D82C26F4; Fri, 16 Mar 2012 04:33:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-182.messagelabs.com!1331872395!19605011!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24807 invoked from network); 16 Mar 2012 04:33:16 -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;
	16 Mar 2012 04:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqo-0005Jq-LA
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqo-0002K6-Gj
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:14 +0000
Message-Id: <E1S8Oqo-0002K6-Gj@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] xl: Implement sched-credit schedule
	parameter command-line interface
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331733964 0
# Node ID efc9ce8e4d95f5b7e42a3e29f342795d2b566300
# Parent  847f05b8d3001303485d53de24ce40b8eb905920
xl: Implement sched-credit schedule parameter command-line interface

Add features to the sched-credit interface to allow querying and
displaying scheduler parameters.

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


diff -r 847f05b8d300 -r efc9ce8e4d95 docs/man/xl.pod.1
--- a/docs/man/xl.pod.1	Wed Mar 14 14:04:58 2012 +0000
+++ b/docs/man/xl.pod.1	Wed Mar 14 14:06:04 2012 +0000
@@ -714,6 +714,53 @@
 
 Restrict output to domains in the specified cpupool.
 
+=item B<-s>, B<--schedparam>
+
+Specify to list or set pool-wide scheduler parameters.
+
+=item B<-t TSLICE>, B<--tslice_ms=TSLICE>
+
+Timeslice tells the scheduler how long to allow VMs to run before
+pre-empting.  The default is 30ms.  Valid ranges are 1ms to 1000ms.
+The length of the timeslice (in ms) must be higher than the length of
+the ratelimit (see below).
+
+=item B<-r RLIMIT>, B<--ratelimit_us=RLIMIT>
+
+Ratelimit attempts to limit the number of schedules per second.  It
+sets a minimum amount of time (in microseconds) a VM must run before
+we will allow a higher-prioirty VM to pre-empt it.  The default value
+is 1000 microseconds (1ms).  Valid range is 100 to 500000 (500ms).
+The ratelimit length must be lower than the timeslice length.
+
+=back
+
+B<COMBINATION>
+
+The following is the effect of combining the above options:
+
+=over 4
+
+=item B<E<lt>nothingE<gt>>             : List all domain params and sched params from all pools
+
+=item B<-d [domid]>            : List domain params for domain [domid]
+
+=item B<-d [domid] [params]>   : Set domain params for domain [domid]
+
+=item B<-p [pool]>             : list all domains and sched params for [pool]
+
+=item B<-s>                    : List sched params for poolid 0
+
+=item B<-s [params]>           : Set sched params for poolid 0
+
+=item B<-p [pool] -s>          : List sched params for [pool]
+
+=item B<-p [pool] -s [params]> : Set sched params for [pool]
+
+=item B<-p [pool] -d>...       : Illegal
+
+=item
+
 =back
 
 =item B<sched-credit2> [I<OPTIONS>]
diff -r 847f05b8d300 -r efc9ce8e4d95 tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c	Wed Mar 14 14:04:58 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c	Wed Mar 14 14:06:04 2012 +0000
@@ -3906,8 +3906,7 @@
     return 0;
 }
 
-static int sched_credit_domain_get(
-    int domid, libxl_sched_credit_domain *scinfo)
+static int sched_credit_domain_get(int domid, libxl_sched_credit_domain *scinfo)
 {
     int rc;
 
@@ -3918,8 +3917,7 @@
     return rc;
 }
 
-static int sched_credit_domain_set(
-    int domid, libxl_sched_credit_domain *scinfo)
+static int sched_credit_domain_set(int domid, libxl_sched_credit_domain *scinfo)
 {
     int rc;
 
@@ -3931,8 +3929,29 @@
     return rc;
 }
 
-static int sched_credit_domain_output(
-    int domid)
+static int sched_credit_params_set(int poolid, libxl_sched_credit_params *scinfo)
+{
+    int rc;
+
+    rc = libxl_sched_credit_params_set(ctx, poolid, scinfo);
+    if (rc)
+        fprintf(stderr, "libxl_sched_credit_params_set failed.\n");
+
+    return rc;
+}
+
+static int sched_credit_params_get(int poolid, libxl_sched_credit_params *scinfo)
+{
+    int rc;
+
+    rc = libxl_sched_credit_params_get(ctx, poolid, scinfo);
+    if (rc)
+        fprintf(stderr, "libxl_sched_credit_params_get failed.\n");
+
+    return rc;
+}
+
+static int sched_credit_domain_output(int domid)
 {
     char *domname;
     libxl_sched_credit_domain scinfo;
@@ -3956,6 +3975,27 @@
     return 0;
 }
 
+static int sched_credit_pool_output(uint32_t poolid)
+{
+    libxl_sched_credit_params scparam;
+    char *poolname;
+    int rc;
+
+    poolname = libxl_cpupoolid_to_name(ctx, poolid);
+    rc = sched_credit_params_get(poolid, &scparam);
+    if (rc) {
+        printf("Cpupool %s: [sched params unavailable]\n",
+               poolname);
+    } else {
+        printf("Cpupool %s: tslice=%dms ratelimit=%dus\n",
+               poolname,
+               scparam.tslice_ms,
+               scparam.ratelimit_us);
+    }
+    free(poolname);
+    return 0;
+}
+
 static int sched_credit2_domain_get(
     int domid, libxl_sched_credit2_domain *scinfo)
 {
@@ -4119,25 +4159,41 @@
     return 0;
 }
 
+/* 
+ * <nothing>             : List all domain params and sched params from all pools
+ * -d [domid]            : List domain params for domain
+ * -d [domid] [params]   : Set domain params for domain
+ * -p [pool]             : list all domains and sched params for pool
+ * -s                    : List sched params for poolid 0
+ * -s [params]           : Set sched params for poolid 0
+ * -p [pool] -s          : List sched params for pool
+ * -p [pool] -s [params] : Set sched params for pool
+ * -p [pool] -d...       : Illegal
+ */
 int main_sched_credit(int argc, char **argv)
 {
     libxl_sched_credit_domain scinfo;
     const char *dom = NULL;
     const char *cpupool = NULL;
     int weight = 256, cap = 0, opt_w = 0, opt_c = 0;
+    int opt_s = 0;
+    int tslice = 0, opt_t = 0, ratelimit = 0, opt_r = 0;
     int opt, rc;
     int option_index = 0;
     static struct option long_options[] = {
         {"domain", 1, 0, 'd'},
         {"weight", 1, 0, 'w'},
         {"cap", 1, 0, 'c'},
+        {"schedparam", 0, 0, 's'},
+        {"tslice_ms", 1, 0, 't'},
+        {"ratelimit_us", 1, 0, 'r'},
         {"cpupool", 1, 0, 'p'},
         {"help", 0, 0, 'h'},
         {0, 0, 0, 0}
     };
 
     while (1) {
-        opt = getopt_long(argc, argv, "d:w:c:p:h", long_options,
+        opt = getopt_long(argc, argv, "d:w:c:p:t:r:hs", long_options,
                           &option_index);
         if (opt == -1)
             break;
@@ -4155,6 +4211,17 @@
             cap = strtol(optarg, NULL, 10);
             opt_c = 1;
             break;
+        case 't':
+            tslice = strtol(optarg, NULL, 10);
+            opt_t = 1;
+            break;
+        case 'r':
+            ratelimit = strtol(optarg, NULL, 10);
+            opt_r = 1;
+            break;
+        case 's':
+            opt_s = 1;
+            break;
         case 'p':
             cpupool = optarg;
             break;
@@ -4164,20 +4231,54 @@
         }
     }
 
-    if (cpupool && (dom || opt_w || opt_c)) {
-        fprintf(stderr, "Specifying a cpupool is not allowed with other "
-                "options.\n");
+    if ((cpupool || opt_s) && (dom || opt_w || opt_c)) {
+        fprintf(stderr, "Specifying a cpupool or schedparam is not "
+                "allowed with domain options.\n");
         return 1;
     }
     if (!dom && (opt_w || opt_c)) {
         fprintf(stderr, "Must specify a domain.\n");
         return 1;
     }
-
-    if (!dom) { /* list all domain's credit scheduler info */
+    if (!opt_s && (opt_t || opt_r)) {
+        fprintf(stderr, "Must specify schedparam to set schedule "
+                "parameter values.\n");
+        return 1;
+    }
+
+    if (opt_s) {
+        libxl_sched_credit_params  scparam;
+        uint32_t poolid = 0;
+
+        if (cpupool) {
+            if (cpupool_qualifier_to_cpupoolid(cpupool, &poolid, NULL) ||
+                !libxl_cpupoolid_to_name(ctx, poolid)) {
+                fprintf(stderr, "unknown cpupool \'%s\'\n", cpupool);
+                return -ERROR_FAIL;
+            }
+        }
+
+        if (!opt_t && !opt_r) { /* Output scheduling parameters */
+            return -sched_credit_pool_output(poolid);
+        } else { /* Set scheduling parameters*/
+            rc = sched_credit_params_get(poolid, &scparam);
+            if (rc)
+                return -rc;
+
+            if (opt_t)
+                scparam.tslice_ms = tslice;
+
+            if (opt_r)
+                scparam.ratelimit_us = ratelimit;
+
+            rc = sched_credit_params_set(poolid, &scparam);
+            if (rc)
+                return -rc;
+        }
+    } else if (!dom) { /* list all domain's credit scheduler info */
         return -sched_domain_output(LIBXL_SCHEDULER_CREDIT,
                                     sched_credit_domain_output,
-                                    sched_default_pool_output,
+                                    sched_credit_pool_output,
                                     cpupool);
     } else {
         find_domain(dom);
diff -r 847f05b8d300 -r efc9ce8e4d95 tools/libxl/xl_cmdtable.c
--- a/tools/libxl/xl_cmdtable.c	Wed Mar 14 14:04:58 2012 +0000
+++ b/tools/libxl/xl_cmdtable.c	Wed Mar 14 14:06:04 2012 +0000
@@ -204,11 +204,14 @@
     { "sched-credit",
       &main_sched_credit, 0,
       "Get/set credit scheduler parameters",
-      "[-d <Domain> [-w[=WEIGHT]|-c[=CAP]]] [-p CPUPOOL]",
-      "-d DOMAIN, --domain=DOMAIN     Domain to modify\n"
-      "-w WEIGHT, --weight=WEIGHT     Weight (int)\n"
-      "-c CAP, --cap=CAP              Cap (int)\n"
-      "-p CPUPOOL, --cpupool=CPUPOOL  Restrict output to CPUPOOL"
+      "[-d <Domain> [-w[=WEIGHT]|-c[=CAP]]] [-s [-t TSLICE] [-r RATELIMIT]] [-p CPUPOOL]",
+      "-d DOMAIN, --domain=DOMAIN        Domain to modify\n"
+      "-w WEIGHT, --weight=WEIGHT        Weight (int)\n"
+      "-c CAP, --cap=CAP                 Cap (int)\n"
+      "-s         --schedparam           Query / modify scheduler parameters\n"
+      "-t TSLICE, --tslice_ms=TSLICE     Set the timeslice, in milliseconds\n"
+      "-r RLIMIT, --ratelimit_us=RLIMIT  Set the scheduling rate limit, in microseconds\n"
+      "-p CPUPOOL, --cpupool=CPUPOOL     Restrict output to CPUPOOL"
     },
     { "sched-credit2",
       &main_sched_credit2, 0,

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqu-00048x-LM; Fri, 16 Mar 2012 04:33: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 1S8Oqt-000456-HK
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:19 +0000
Received: from [85.158.143.99:51899] by server-2.bemta-4.messagelabs.com id
	B9/C6-17550-F82C26F4; Fri, 16 Mar 2012 04:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331872397!14146859!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20609 invoked from network); 16 Mar 2012 04:33: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;
	16 Mar 2012 04:33: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 1S8Oqr-0005K5-CH
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqr-0002MT-BF
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:17 +0000
Message-Id: <E1S8Oqr-0002MT-BF@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Fix deadlock between p2m and
	event channel locks.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331737660 14400
# Node ID 4dbbc69ebece6376775e3ab9db4aa3e69c0f6fcf
# Parent  c25ec9e9a8126d562d2a72620aea8ee6b104f89e
x86/mm: Fix deadlock between p2m and event channel locks.

The hvm io emulation code holds the p2m lock for the duration of the
emulation, which may include sending an event to qemu. On a separate path,
map_domain_pirq grabs the event channel and p2m locks in opposite order.

Fix this by ensuring liveness of the ram_gfn used by io emulation, with a
page ref.

Reported-by: "Hao, Xudong" <xudong.hao@intel.com>
Signed-off-by: "Hao, Xudong" <xudong.hao@intel.com>
Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r c25ec9e9a812 -r 4dbbc69ebece xen/arch/x86/hvm/emulate.c
--- a/xen/arch/x86/hvm/emulate.c	Wed Mar 14 14:20:58 2012 +0000
+++ b/xen/arch/x86/hvm/emulate.c	Wed Mar 14 11:07:40 2012 -0400
@@ -77,6 +77,17 @@
         return X86EMUL_RETRY;
     }
 
+    /* Maintain a ref on the mfn to ensure liveness. Put the gfn
+     * to avoid potential deadlock wrt event channel lock, later. */
+    if ( mfn_valid(mfn_x(ram_mfn)) )
+        if ( !get_page(mfn_to_page(mfn_x(ram_mfn)),
+             curr->domain) )
+        {
+            put_gfn(curr->domain, ram_gfn);
+            return X86EMUL_RETRY;
+        }
+    put_gfn(curr->domain, ram_gfn);
+
     /*
      * Weird-sized accesses have undefined behaviour: we discard writes
      * and read all-ones.
@@ -87,7 +98,8 @@
         ASSERT(p_data != NULL); /* cannot happen with a REP prefix */
         if ( dir == IOREQ_READ )
             memset(p_data, ~0, size);
-        put_gfn(curr->domain, ram_gfn); 
+        if ( mfn_valid(mfn_x(ram_mfn)) )
+            put_page(mfn_to_page(mfn_x(ram_mfn)));
         return X86EMUL_UNHANDLEABLE;
     }
 
@@ -108,7 +120,8 @@
             unsigned int bytes = vio->mmio_large_write_bytes;
             if ( (addr >= pa) && ((addr + size) <= (pa + bytes)) )
             {
-                put_gfn(curr->domain, ram_gfn); 
+                if ( mfn_valid(mfn_x(ram_mfn)) )
+                    put_page(mfn_to_page(mfn_x(ram_mfn)));
                 return X86EMUL_OKAY;
             }
         }
@@ -120,7 +133,8 @@
             {
                 memcpy(p_data, &vio->mmio_large_read[addr - pa],
                        size);
-                put_gfn(curr->domain, ram_gfn); 
+                if ( mfn_valid(mfn_x(ram_mfn)) )
+                    put_page(mfn_to_page(mfn_x(ram_mfn)));
                 return X86EMUL_OKAY;
             }
         }
@@ -134,7 +148,8 @@
         vio->io_state = HVMIO_none;
         if ( p_data == NULL )
         {
-            put_gfn(curr->domain, ram_gfn);
+            if ( mfn_valid(mfn_x(ram_mfn)) )
+                put_page(mfn_to_page(mfn_x(ram_mfn)));
             return X86EMUL_UNHANDLEABLE;
         }
         goto finish_access;
@@ -144,11 +159,13 @@
              (addr == (vio->mmio_large_write_pa +
                        vio->mmio_large_write_bytes)) )
         {
-            put_gfn(curr->domain, ram_gfn);
+            if ( mfn_valid(mfn_x(ram_mfn)) )
+                put_page(mfn_to_page(mfn_x(ram_mfn)));
             return X86EMUL_RETRY;
         }
     default:
-        put_gfn(curr->domain, ram_gfn);
+        if ( mfn_valid(mfn_x(ram_mfn)) )
+            put_page(mfn_to_page(mfn_x(ram_mfn)));
         return X86EMUL_UNHANDLEABLE;
     }
 
@@ -156,7 +173,8 @@
     {
         gdprintk(XENLOG_WARNING, "WARNING: io already pending (%d)?\n",
                  p->state);
-        put_gfn(curr->domain, ram_gfn); 
+        if ( mfn_valid(mfn_x(ram_mfn)) )
+            put_page(mfn_to_page(mfn_x(ram_mfn)));
         return X86EMUL_UNHANDLEABLE;
     }
 
@@ -208,7 +226,8 @@
 
     if ( rc != X86EMUL_OKAY )
     {
-        put_gfn(curr->domain, ram_gfn); 
+        if ( mfn_valid(mfn_x(ram_mfn)) )
+            put_page(mfn_to_page(mfn_x(ram_mfn)));
         return rc;
     }
 
@@ -244,7 +263,8 @@
         }
     }
 
-    put_gfn(curr->domain, ram_gfn); 
+    if ( mfn_valid(mfn_x(ram_mfn)) )
+        put_page(mfn_to_page(mfn_x(ram_mfn)));
     return X86EMUL_OKAY;
 }
 

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqp-00045b-Jb; Fri, 16 Mar 2012 04:33: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 1S8Oqn-000455-Vx
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:14 +0000
Received: from [85.158.143.35:32565] by server-3.bemta-4.messagelabs.com id
	B3/6D-05853-982C26F4; Fri, 16 Mar 2012 04:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1331872391!14064746!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24295 invoked from network); 16 Mar 2012 04:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqk-0005JS-Dy
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqk-0002GI-6S
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:10 +0000
Message-Id: <E1S8Oqk-0002GI-6S@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: handle dom0_max_vcpus=0 case
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331718424 0
# Node ID f01efbb36d1288d21fc512a52746eac28865f03b
# Parent  e1578914bfd6d4a01276786396b7d0faf4fd3153
arm: handle dom0_max_vcpus=0 case properly

Also use xzalloc_array.

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 e1578914bfd6 -r f01efbb36d12 xen/arch/arm/domain_build.c
--- a/xen/arch/arm/domain_build.c	Wed Mar 14 09:47:03 2012 +0000
+++ b/xen/arch/arm/domain_build.c	Wed Mar 14 09:47:04 2012 +0000
@@ -15,13 +15,14 @@
 
 struct vcpu *__init alloc_dom0_vcpu0(void)
 {
-    dom0->vcpu = xmalloc_array(struct vcpu *, opt_dom0_max_vcpus);
+    if ( opt_dom0_max_vcpus == 0 )
+        opt_dom0_max_vcpus = num_online_cpus();
+    if ( opt_dom0_max_vcpus > MAX_VIRT_CPUS )
+        opt_dom0_max_vcpus = MAX_VIRT_CPUS;
+
+    dom0->vcpu = xzalloc_array(struct vcpu *, opt_dom0_max_vcpus);
     if ( !dom0->vcpu )
-    {
-            printk("failed to alloc dom0->vccpu\n");
         return NULL;
-    }
-    memset(dom0->vcpu, 0, opt_dom0_max_vcpus * sizeof(*dom0->vcpu));
     dom0->max_vcpus = opt_dom0_max_vcpus;
 
     return alloc_vcpu(dom0, 0, 0);

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqw-0004CD-3j; Fri, 16 Mar 2012 04:33:22 +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 1S8Oqu-00048P-Gx
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:20 +0000
Received: from [85.158.143.99:51936] by server-1.bemta-4.messagelabs.com id
	3F/57-20925-F82C26F4; Fri, 16 Mar 2012 04:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1331872398!18517035!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25905 invoked from network); 16 Mar 2012 04:33:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33: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 1S8Oqr-0005K8-Tx
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqr-0002Mw-Su
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:17 +0000
Message-Id: <E1S8Oqr-0002Mw-Su@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] vmx: Make it clear that the VMEXIT
	reason is in hex.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331806143 0
# Node ID 17dd1004c4b99176a1ee190fd33b051fb5df38f8
# Parent  4dbbc69ebece6376775e3ab9db4aa3e69c0f6fcf
vmx: Make it clear that the VMEXIT reason is in hex.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 4dbbc69ebece -r 17dd1004c4b9 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Wed Mar 14 11:07:40 2012 -0400
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Thu Mar 15 10:09:03 2012 +0000
@@ -2720,7 +2720,7 @@
     /* fall through */
     default:
     exit_and_crash:
-        gdprintk(XENLOG_ERR, "Bad vmexit (reason %x)\n", exit_reason);
+        gdprintk(XENLOG_ERR, "Bad vmexit (reason %#x)\n", exit_reason);
         domain_crash(v->domain);
         break;
     }

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqw-0004CD-3j; Fri, 16 Mar 2012 04:33:22 +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 1S8Oqu-00048P-Gx
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:20 +0000
Received: from [85.158.143.99:51936] by server-1.bemta-4.messagelabs.com id
	3F/57-20925-F82C26F4; Fri, 16 Mar 2012 04:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1331872398!18517035!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25905 invoked from network); 16 Mar 2012 04:33:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33: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 1S8Oqr-0005K8-Tx
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqr-0002Mw-Su
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:17 +0000
Message-Id: <E1S8Oqr-0002Mw-Su@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] vmx: Make it clear that the VMEXIT
	reason is in hex.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331806143 0
# Node ID 17dd1004c4b99176a1ee190fd33b051fb5df38f8
# Parent  4dbbc69ebece6376775e3ab9db4aa3e69c0f6fcf
vmx: Make it clear that the VMEXIT reason is in hex.

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 4dbbc69ebece -r 17dd1004c4b9 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Wed Mar 14 11:07:40 2012 -0400
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Thu Mar 15 10:09:03 2012 +0000
@@ -2720,7 +2720,7 @@
     /* fall through */
     default:
     exit_and_crash:
-        gdprintk(XENLOG_ERR, "Bad vmexit (reason %x)\n", exit_reason);
+        gdprintk(XENLOG_ERR, "Bad vmexit (reason %#x)\n", exit_reason);
         domain_crash(v->domain);
         break;
     }

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqw-0004CV-Dc; Fri, 16 Mar 2012 04:33: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 1S8Oqu-00048R-Q4
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:21 +0000
Received: from [85.158.139.83:14928] by server-6.bemta-5.messagelabs.com id
	A1/B6-13222-F82C26F4; Fri, 16 Mar 2012 04:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1331872397!15665784!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12568 invoked from network); 16 Mar 2012 04:33:18 -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;
	16 Mar 2012 04:33: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 1S8Oqq-0005K2-RE
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqq-0002M0-QB
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:16 +0000
Message-Id: <E1S8Oqq-0002M0-QB@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] autoconf: add missing compression
	checks for libxc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1331734858 0
# Node ID c25ec9e9a8126d562d2a72620aea8ee6b104f89e
# Parent  165082fcba8d2dc35b726e316497fde64c430a25
autoconf: add missing compression checks for libxc

Move missing checks from tools/libxc/Makefile to configure script.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 165082fcba8d -r c25ec9e9a812 config/Tools.mk.in
--- a/config/Tools.mk.in	Wed Mar 14 14:19:42 2012 +0000
+++ b/config/Tools.mk.in	Wed Mar 14 14:20:58 2012 +0000
@@ -40,6 +40,7 @@
 
 #System options
 CONFIG_SYSTEM_LIBAIO:= @system_aio@
+ZLIB                := @zlib@
 CONFIG_LIBICONV     := @libiconv@
 CONFIG_GCRYPT       := @libgcrypt@
 CONFIG_EXT2FS       := @libext2fs@
diff -r 165082fcba8d -r c25ec9e9a812 tools/configure
--- a/tools/configure	Wed Mar 14 14:19:42 2012 +0000
+++ b/tools/configure	Wed Mar 14 14:20:58 2012 +0000
@@ -605,6 +605,7 @@
 libgcrypt
 libext2fs
 system_aio
+zlib
 LIB_PATH
 glib_LIBS
 glib_CFLAGS
@@ -6691,6 +6692,148 @@
 
 
 # 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 :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompressInit in -lbz2" >&5
+$as_echo_n "checking for BZ2_bzDecompressInit in -lbz2... " >&6; }
+if test "${ac_cv_lib_bz2_BZ2_bzDecompressInit+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbz2  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char BZ2_bzDecompressInit ();
+int
+main ()
+{
+return BZ2_bzDecompressInit ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_bz2_BZ2_bzDecompressInit=yes
+else
+  ac_cv_lib_bz2_BZ2_bzDecompressInit=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzDecompressInit" >&5
+$as_echo "$ac_cv_lib_bz2_BZ2_bzDecompressInit" >&6; }
+if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = x""yes; then :
+  zlib="$zlib -DHAVE_BZLIB -lbz2"
+fi
+
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default"
+if test "x$ac_cv_header_lzma_h" = x""yes; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_stream_decoder in -llzma" >&5
+$as_echo_n "checking for lzma_stream_decoder in -llzma... " >&6; }
+if test "${ac_cv_lib_lzma_lzma_stream_decoder+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-llzma  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lzma_stream_decoder ();
+int
+main ()
+{
+return lzma_stream_decoder ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_lzma_lzma_stream_decoder=yes
+else
+  ac_cv_lib_lzma_lzma_stream_decoder=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_stream_decoder" >&5
+$as_echo "$ac_cv_lib_lzma_lzma_stream_decoder" >&6; }
+if test "x$ac_cv_lib_lzma_lzma_stream_decoder" = x""yes; then :
+  zlib="$zlib -DHAVE_LZMA -llzma"
+fi
+
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "lzo/lzo1x.h" "ac_cv_header_lzo_lzo1x_h" "$ac_includes_default"
+if test "x$ac_cv_header_lzo_lzo1x_h" = x""yes; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo1x_decompress in -llzo2" >&5
+$as_echo_n "checking for lzo1x_decompress in -llzo2... " >&6; }
+if test "${ac_cv_lib_lzo2_lzo1x_decompress+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-llzo2  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lzo1x_decompress ();
+int
+main ()
+{
+return lzo1x_decompress ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_lzo2_lzo1x_decompress=yes
+else
+  ac_cv_lib_lzo2_lzo1x_decompress=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzo2_lzo1x_decompress" >&5
+$as_echo "$ac_cv_lib_lzo2_lzo1x_decompress" >&6; }
+if test "x$ac_cv_lib_lzo2_lzo1x_decompress" = x""yes; then :
+  zlib="$zlib -DHAVE_LZO1X -llzo2"
+fi
+
+
+fi
+
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_setup in -laio" >&5
 $as_echo_n "checking for io_setup in -laio... " >&6; }
 if test "${ac_cv_lib_aio_io_setup+set}" = set; then :
diff -r 165082fcba8d -r c25ec9e9a812 tools/configure.ac
--- a/tools/configure.ac	Wed Mar 14 14:19:42 2012 +0000
+++ b/tools/configure.ac	Wed Mar 14 14:20:58 2012 +0000
@@ -106,6 +106,16 @@
 AX_DEFAULT_LIB
 
 # Checks for libraries.
+AC_CHECK_HEADER([bzlib.h], [
+AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit], [zlib="$zlib -DHAVE_BZLIB -lbz2"])
+])
+AC_CHECK_HEADER([lzma.h], [
+AC_CHECK_LIB([lzma], [lzma_stream_decoder], [zlib="$zlib -DHAVE_LZMA -llzma"])
+])
+AC_CHECK_HEADER([lzo/lzo1x.h], [
+AC_CHECK_LIB([lzo2], [lzo1x_decompress], [zlib="$zlib -DHAVE_LZO1X -llzo2"])
+])
+AC_SUBST(zlib)
 AC_CHECK_LIB([aio], [io_setup], [system_aio="y"], [system_aio="n"])
 AC_SUBST(system_aio)
 AC_CHECK_LIB([crypto], [MD5], [], [AC_MSG_ERROR([Could not find libcrypto])])
diff -r 165082fcba8d -r c25ec9e9a812 tools/libxc/Makefile
--- a/tools/libxc/Makefile	Wed Mar 14 14:19:42 2012 +0000
+++ b/tools/libxc/Makefile	Wed Mar 14 14:20:58 2012 +0000
@@ -172,20 +172,7 @@
 ifeq ($(CONFIG_MiniOS),y)
 zlib-options =
 else
-zlib-options = $(shell					\
-	(. ../check/funcs.sh;				\
-	 if has_header bzlib.h; then			\
-           echo "-DHAVE_BZLIB";				\
-	   echo "-lbz2";				\
-	 fi;						\
-	 if has_header lzma.h; then			\
-	   echo "-DHAVE_LZMA";				\
-	   echo "-llzma";				\
-	 fi;						\
-	 if has_header lzo/lzo1x.h; then		\
-	   echo "-DHAVE_LZO1X";				\
-	   echo "-llzo2";				\
-	 fi) | grep $(1))
+zlib-options = $(ZLIB)
 endif
 
 xc_dom_bzimageloader.o: CFLAGS += $(call zlib-options,D)

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqw-0004CV-Dc; Fri, 16 Mar 2012 04:33: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 1S8Oqu-00048R-Q4
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:21 +0000
Received: from [85.158.139.83:14928] by server-6.bemta-5.messagelabs.com id
	A1/B6-13222-F82C26F4; Fri, 16 Mar 2012 04:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1331872397!15665784!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12568 invoked from network); 16 Mar 2012 04:33:18 -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;
	16 Mar 2012 04:33: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 1S8Oqq-0005K2-RE
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqq-0002M0-QB
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:16 +0000
Message-Id: <E1S8Oqq-0002M0-QB@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] autoconf: add missing compression
	checks for libxc
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1331734858 0
# Node ID c25ec9e9a8126d562d2a72620aea8ee6b104f89e
# Parent  165082fcba8d2dc35b726e316497fde64c430a25
autoconf: add missing compression checks for libxc

Move missing checks from tools/libxc/Makefile to configure script.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Jan Beulich <JBeulich@suse.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r 165082fcba8d -r c25ec9e9a812 config/Tools.mk.in
--- a/config/Tools.mk.in	Wed Mar 14 14:19:42 2012 +0000
+++ b/config/Tools.mk.in	Wed Mar 14 14:20:58 2012 +0000
@@ -40,6 +40,7 @@
 
 #System options
 CONFIG_SYSTEM_LIBAIO:= @system_aio@
+ZLIB                := @zlib@
 CONFIG_LIBICONV     := @libiconv@
 CONFIG_GCRYPT       := @libgcrypt@
 CONFIG_EXT2FS       := @libext2fs@
diff -r 165082fcba8d -r c25ec9e9a812 tools/configure
--- a/tools/configure	Wed Mar 14 14:19:42 2012 +0000
+++ b/tools/configure	Wed Mar 14 14:20:58 2012 +0000
@@ -605,6 +605,7 @@
 libgcrypt
 libext2fs
 system_aio
+zlib
 LIB_PATH
 glib_LIBS
 glib_CFLAGS
@@ -6691,6 +6692,148 @@
 
 
 # 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 :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompressInit in -lbz2" >&5
+$as_echo_n "checking for BZ2_bzDecompressInit in -lbz2... " >&6; }
+if test "${ac_cv_lib_bz2_BZ2_bzDecompressInit+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lbz2  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char BZ2_bzDecompressInit ();
+int
+main ()
+{
+return BZ2_bzDecompressInit ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_bz2_BZ2_bzDecompressInit=yes
+else
+  ac_cv_lib_bz2_BZ2_bzDecompressInit=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bz2_BZ2_bzDecompressInit" >&5
+$as_echo "$ac_cv_lib_bz2_BZ2_bzDecompressInit" >&6; }
+if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = x""yes; then :
+  zlib="$zlib -DHAVE_BZLIB -lbz2"
+fi
+
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "lzma.h" "ac_cv_header_lzma_h" "$ac_includes_default"
+if test "x$ac_cv_header_lzma_h" = x""yes; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_stream_decoder in -llzma" >&5
+$as_echo_n "checking for lzma_stream_decoder in -llzma... " >&6; }
+if test "${ac_cv_lib_lzma_lzma_stream_decoder+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-llzma  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lzma_stream_decoder ();
+int
+main ()
+{
+return lzma_stream_decoder ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_lzma_lzma_stream_decoder=yes
+else
+  ac_cv_lib_lzma_lzma_stream_decoder=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzma_lzma_stream_decoder" >&5
+$as_echo "$ac_cv_lib_lzma_lzma_stream_decoder" >&6; }
+if test "x$ac_cv_lib_lzma_lzma_stream_decoder" = x""yes; then :
+  zlib="$zlib -DHAVE_LZMA -llzma"
+fi
+
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "lzo/lzo1x.h" "ac_cv_header_lzo_lzo1x_h" "$ac_includes_default"
+if test "x$ac_cv_header_lzo_lzo1x_h" = x""yes; then :
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzo1x_decompress in -llzo2" >&5
+$as_echo_n "checking for lzo1x_decompress in -llzo2... " >&6; }
+if test "${ac_cv_lib_lzo2_lzo1x_decompress+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-llzo2  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char lzo1x_decompress ();
+int
+main ()
+{
+return lzo1x_decompress ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_lzo2_lzo1x_decompress=yes
+else
+  ac_cv_lib_lzo2_lzo1x_decompress=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzo2_lzo1x_decompress" >&5
+$as_echo "$ac_cv_lib_lzo2_lzo1x_decompress" >&6; }
+if test "x$ac_cv_lib_lzo2_lzo1x_decompress" = x""yes; then :
+  zlib="$zlib -DHAVE_LZO1X -llzo2"
+fi
+
+
+fi
+
+
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_setup in -laio" >&5
 $as_echo_n "checking for io_setup in -laio... " >&6; }
 if test "${ac_cv_lib_aio_io_setup+set}" = set; then :
diff -r 165082fcba8d -r c25ec9e9a812 tools/configure.ac
--- a/tools/configure.ac	Wed Mar 14 14:19:42 2012 +0000
+++ b/tools/configure.ac	Wed Mar 14 14:20:58 2012 +0000
@@ -106,6 +106,16 @@
 AX_DEFAULT_LIB
 
 # Checks for libraries.
+AC_CHECK_HEADER([bzlib.h], [
+AC_CHECK_LIB([bz2], [BZ2_bzDecompressInit], [zlib="$zlib -DHAVE_BZLIB -lbz2"])
+])
+AC_CHECK_HEADER([lzma.h], [
+AC_CHECK_LIB([lzma], [lzma_stream_decoder], [zlib="$zlib -DHAVE_LZMA -llzma"])
+])
+AC_CHECK_HEADER([lzo/lzo1x.h], [
+AC_CHECK_LIB([lzo2], [lzo1x_decompress], [zlib="$zlib -DHAVE_LZO1X -llzo2"])
+])
+AC_SUBST(zlib)
 AC_CHECK_LIB([aio], [io_setup], [system_aio="y"], [system_aio="n"])
 AC_SUBST(system_aio)
 AC_CHECK_LIB([crypto], [MD5], [], [AC_MSG_ERROR([Could not find libcrypto])])
diff -r 165082fcba8d -r c25ec9e9a812 tools/libxc/Makefile
--- a/tools/libxc/Makefile	Wed Mar 14 14:19:42 2012 +0000
+++ b/tools/libxc/Makefile	Wed Mar 14 14:20:58 2012 +0000
@@ -172,20 +172,7 @@
 ifeq ($(CONFIG_MiniOS),y)
 zlib-options =
 else
-zlib-options = $(shell					\
-	(. ../check/funcs.sh;				\
-	 if has_header bzlib.h; then			\
-           echo "-DHAVE_BZLIB";				\
-	   echo "-lbz2";				\
-	 fi;						\
-	 if has_header lzma.h; then			\
-	   echo "-DHAVE_LZMA";				\
-	   echo "-llzma";				\
-	 fi;						\
-	 if has_header lzo/lzo1x.h; then		\
-	   echo "-DHAVE_LZO1X";				\
-	   echo "-llzo2";				\
-	 fi) | grep $(1))
+zlib-options = $(ZLIB)
 endif
 
 xc_dom_bzimageloader.o: CFLAGS += $(call zlib-options,D)

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqv-0004B5-UW; Fri, 16 Mar 2012 04:33: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 1S8Oqu-000488-BL
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:20 +0000
Received: from [85.158.139.83:10856] by server-8.bemta-5.messagelabs.com id
	08/91-26964-F82C26F4; Fri, 16 Mar 2012 04:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1331872396!19616408!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20919 invoked from network); 16 Mar 2012 04:33:18 -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;
	16 Mar 2012 04:33: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 1S8Oqq-0005Jz-D2
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqq-0002LX-8h
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:16 +0000
Message-Id: <E1S8Oqq-0002LX-8h@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] autoconf: check for uuid.h or
	uuid/uuid.h with -luuid
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1331734782 0
# Node ID 165082fcba8d2dc35b726e316497fde64c430a25
# Parent  f5fbbb2918c6739b2eeb82297417ee4829b8eed8
autoconf: check for uuid.h or uuid/uuid.h with -luuid

Check for uuid/uuid.h and if found check for -luuid usability (Linux
case), if not, check for uuid (NetBSD). One of this tests has to
succeed to be able to build Xen tools.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r f5fbbb2918c6 -r 165082fcba8d tools/configure
--- a/tools/configure	Wed Mar 14 14:10:17 2012 +0000
+++ b/tools/configure	Wed Mar 14 14:19:42 2012 +0000
@@ -6270,24 +6270,63 @@
 then
     as_fn_error $? "Unable to find xgettext, please install xgettext" "$LINENO" 5
 fi
-if test "x$host_os" == "xlinux-gnu"
-then
-    ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
+
+ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
 if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then :
 
-else
-  as_fn_error $? "cannot find uuid headers" "$LINENO" 5
-fi
-
-
-else
-    ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5
+$as_echo_n "checking for uuid_clear in -luuid... " >&6; }
+if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-luuid  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uuid_clear ();
+int
+main ()
+{
+return uuid_clear ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_uuid_uuid_clear=yes
+else
+  ac_cv_lib_uuid_uuid_clear=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5
+$as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; }
+if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then :
+  libuuid="y"
+fi
+
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
 if test "x$ac_cv_header_uuid_h" = x""yes; then :
-
-else
-  as_fn_error $? "cannot find uuid headers" "$LINENO" 5
-fi
-
+  libuuid="y"
+fi
+
+
+if test "$libuuid" != "y"; then :
+
+    as_fn_error $? "cannot find a valid uuid library" "$LINENO" 5
 
 fi
 
@@ -6915,53 +6954,6 @@
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5
-$as_echo_n "checking for uuid_clear in -luuid... " >&6; }
-if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-luuid  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char uuid_clear ();
-int
-main ()
-{
-return uuid_clear ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_uuid_uuid_clear=yes
-else
-  ac_cv_lib_uuid_uuid_clear=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5
-$as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBUUID 1
-_ACEOF
-
-  LIBS="-luuid $LIBS"
-
-else
-  as_fn_error $? "Could not find libuuid" "$LINENO" 5
-fi
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
 $as_echo_n "checking for yajl_alloc in -lyajl... " >&6; }
 if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then :
diff -r f5fbbb2918c6 -r 165082fcba8d tools/configure.ac
--- a/tools/configure.ac	Wed Mar 14 14:10:17 2012 +0000
+++ b/tools/configure.ac	Wed Mar 14 14:19:42 2012 +0000
@@ -116,8 +116,6 @@
 AC_CHECK_LIB([pthread], [pthread_create], [] ,
     [AC_MSG_ERROR([Could not find libpthread])])
 AC_CHECK_LIB([rt], [clock_gettime])
-AC_CHECK_LIB([uuid], [uuid_clear], [],
-    [AC_MSG_ERROR([Could not find libuuid])])
 AC_CHECK_LIB([yajl], [yajl_alloc], [],
     [AC_MSG_ERROR([Could not find yajl])])
 AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])])
diff -r f5fbbb2918c6 -r 165082fcba8d tools/m4/uuid.m4
--- a/tools/m4/uuid.m4	Wed Mar 14 14:10:17 2012 +0000
+++ b/tools/m4/uuid.m4	Wed Mar 14 14:19:42 2012 +0000
@@ -1,10 +1,9 @@
-AC_DEFUN([AX_CHECK_UUID],
-[if test "x$host_os" == "xlinux-gnu"
-then
-    AC_CHECK_HEADER([uuid/uuid.h],,
-	    [AC_MSG_ERROR([cannot find uuid headers])])
-else
-    AC_CHECK_HEADER([uuid.h],,
-	    [AC_MSG_ERROR([cannot find uuid headers])])
-fi
+AC_DEFUN([AX_CHECK_UUID], [
+AC_CHECK_HEADER([uuid/uuid.h],[
+    AC_CHECK_LIB([uuid], [uuid_clear], [libuuid="y"])
 ])
+AC_CHECK_HEADER([uuid.h],[libuuid="y"])
+AS_IF([test "$libuuid" != "y"], [
+    AC_MSG_ERROR([cannot find a valid uuid library])
+])
+])

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqv-0004B5-UW; Fri, 16 Mar 2012 04:33: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 1S8Oqu-000488-BL
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:20 +0000
Received: from [85.158.139.83:10856] by server-8.bemta-5.messagelabs.com id
	08/91-26964-F82C26F4; Fri, 16 Mar 2012 04:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1331872396!19616408!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20919 invoked from network); 16 Mar 2012 04:33:18 -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;
	16 Mar 2012 04:33: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 1S8Oqq-0005Jz-D2
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqq-0002LX-8h
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:16 +0000
Message-Id: <E1S8Oqq-0002LX-8h@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] autoconf: check for uuid.h or
	uuid/uuid.h with -luuid
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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@entel.upc.edu>
# Date 1331734782 0
# Node ID 165082fcba8d2dc35b726e316497fde64c430a25
# Parent  f5fbbb2918c6739b2eeb82297417ee4829b8eed8
autoconf: check for uuid.h or uuid/uuid.h with -luuid

Check for uuid/uuid.h and if found check for -luuid usability (Linux
case), if not, check for uuid (NetBSD). One of this tests has to
succeed to be able to build Xen tools.

Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
---


diff -r f5fbbb2918c6 -r 165082fcba8d tools/configure
--- a/tools/configure	Wed Mar 14 14:10:17 2012 +0000
+++ b/tools/configure	Wed Mar 14 14:19:42 2012 +0000
@@ -6270,24 +6270,63 @@
 then
     as_fn_error $? "Unable to find xgettext, please install xgettext" "$LINENO" 5
 fi
-if test "x$host_os" == "xlinux-gnu"
-then
-    ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
+
+ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
 if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then :
 
-else
-  as_fn_error $? "cannot find uuid headers" "$LINENO" 5
-fi
-
-
-else
-    ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5
+$as_echo_n "checking for uuid_clear in -luuid... " >&6; }
+if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-luuid  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uuid_clear ();
+int
+main ()
+{
+return uuid_clear ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_uuid_uuid_clear=yes
+else
+  ac_cv_lib_uuid_uuid_clear=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5
+$as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; }
+if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then :
+  libuuid="y"
+fi
+
+
+fi
+
+
+ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default"
 if test "x$ac_cv_header_uuid_h" = x""yes; then :
-
-else
-  as_fn_error $? "cannot find uuid headers" "$LINENO" 5
-fi
-
+  libuuid="y"
+fi
+
+
+if test "$libuuid" != "y"; then :
+
+    as_fn_error $? "cannot find a valid uuid library" "$LINENO" 5
 
 fi
 
@@ -6915,53 +6954,6 @@
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5
-$as_echo_n "checking for uuid_clear in -luuid... " >&6; }
-if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-luuid  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char uuid_clear ();
-int
-main ()
-{
-return uuid_clear ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_uuid_uuid_clear=yes
-else
-  ac_cv_lib_uuid_uuid_clear=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5
-$as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; }
-if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBUUID 1
-_ACEOF
-
-  LIBS="-luuid $LIBS"
-
-else
-  as_fn_error $? "Could not find libuuid" "$LINENO" 5
-fi
-
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5
 $as_echo_n "checking for yajl_alloc in -lyajl... " >&6; }
 if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then :
diff -r f5fbbb2918c6 -r 165082fcba8d tools/configure.ac
--- a/tools/configure.ac	Wed Mar 14 14:10:17 2012 +0000
+++ b/tools/configure.ac	Wed Mar 14 14:19:42 2012 +0000
@@ -116,8 +116,6 @@
 AC_CHECK_LIB([pthread], [pthread_create], [] ,
     [AC_MSG_ERROR([Could not find libpthread])])
 AC_CHECK_LIB([rt], [clock_gettime])
-AC_CHECK_LIB([uuid], [uuid_clear], [],
-    [AC_MSG_ERROR([Could not find libuuid])])
 AC_CHECK_LIB([yajl], [yajl_alloc], [],
     [AC_MSG_ERROR([Could not find yajl])])
 AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])])
diff -r f5fbbb2918c6 -r 165082fcba8d tools/m4/uuid.m4
--- a/tools/m4/uuid.m4	Wed Mar 14 14:10:17 2012 +0000
+++ b/tools/m4/uuid.m4	Wed Mar 14 14:19:42 2012 +0000
@@ -1,10 +1,9 @@
-AC_DEFUN([AX_CHECK_UUID],
-[if test "x$host_os" == "xlinux-gnu"
-then
-    AC_CHECK_HEADER([uuid/uuid.h],,
-	    [AC_MSG_ERROR([cannot find uuid headers])])
-else
-    AC_CHECK_HEADER([uuid.h],,
-	    [AC_MSG_ERROR([cannot find uuid headers])])
-fi
+AC_DEFUN([AX_CHECK_UUID], [
+AC_CHECK_HEADER([uuid/uuid.h],[
+    AC_CHECK_LIB([uuid], [uuid_clear], [libuuid="y"])
 ])
+AC_CHECK_HEADER([uuid.h],[libuuid="y"])
+AS_IF([test "$libuuid" != "y"], [
+    AC_MSG_ERROR([cannot find a valid uuid library])
+])
+])

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqx-0004EP-O7; Fri, 16 Mar 2012 04:33: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 1S8Oqw-0004A2-0N
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:22 +0000
Received: from [85.158.139.83:10890] by server-5.bemta-5.messagelabs.com id
	E1/BB-13566-192C26F4; Fri, 16 Mar 2012 04:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1331872398!19616411!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20950 invoked from network); 16 Mar 2012 04:33:20 -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;
	16 Mar 2012 04:33: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 1S8Oqs-0005KB-Ea
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqs-0002NP-Di
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Message-Id: <E1S8Oqs-0002NP-Di@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Mem event: don't leave zombie
	domains if there are wait-queued vcpus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331809964 0
# Node ID 2144deeb3da12aa85169ac4b1a445343418ac799
# Parent  17dd1004c4b99176a1ee190fd33b051fb5df38f8
Mem event: don't leave zombie domains if there are wait-queued vcpus

Vcpus in wait queues retain a domain reference. Upon domain destruction, we
were not taking care of draining the wait queues.

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


diff -r 17dd1004c4b9 -r 2144deeb3da1 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 15 10:09:03 2012 +0000
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 15 11:12:44 2012 +0000
@@ -489,12 +489,25 @@
 /* Clean up on domain destruction */
 void mem_event_cleanup(struct domain *d)
 {
-    if ( d->mem_event->paging.ring_page )
+    if ( d->mem_event->paging.ring_page ) {
+        /* Destroying the wait queue head means waking up all
+         * queued vcpus. This will drain the list, allowing
+         * the disable routine to complete. It will also drop
+         * all domain refs the wait-queued vcpus are holding.
+         * Finally, because this code path involves previously
+         * pausing the domain (domain_kill), unpausing the 
+         * vcpus causes no harm. */
+        destroy_waitqueue_head(&d->mem_event->paging.wq);
         (void)mem_event_disable(d, &d->mem_event->paging);
-    if ( d->mem_event->access.ring_page )
+    }
+    if ( d->mem_event->access.ring_page ) {
+        destroy_waitqueue_head(&d->mem_event->access.wq);
         (void)mem_event_disable(d, &d->mem_event->access);
-    if ( d->mem_event->share.ring_page )
+    }
+    if ( d->mem_event->share.ring_page ) {
+        destroy_waitqueue_head(&d->mem_event->share.wq);
         (void)mem_event_disable(d, &d->mem_event->share);
+    }
 }
 
 int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqx-0004EP-O7; Fri, 16 Mar 2012 04:33: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 1S8Oqw-0004A2-0N
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:22 +0000
Received: from [85.158.139.83:10890] by server-5.bemta-5.messagelabs.com id
	E1/BB-13566-192C26F4; Fri, 16 Mar 2012 04:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1331872398!19616411!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20950 invoked from network); 16 Mar 2012 04:33:20 -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;
	16 Mar 2012 04:33: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 1S8Oqs-0005KB-Ea
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqs-0002NP-Di
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Message-Id: <E1S8Oqs-0002NP-Di@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Mem event: don't leave zombie
	domains if there are wait-queued vcpus
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331809964 0
# Node ID 2144deeb3da12aa85169ac4b1a445343418ac799
# Parent  17dd1004c4b99176a1ee190fd33b051fb5df38f8
Mem event: don't leave zombie domains if there are wait-queued vcpus

Vcpus in wait queues retain a domain reference. Upon domain destruction, we
were not taking care of draining the wait queues.

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


diff -r 17dd1004c4b9 -r 2144deeb3da1 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 15 10:09:03 2012 +0000
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 15 11:12:44 2012 +0000
@@ -489,12 +489,25 @@
 /* Clean up on domain destruction */
 void mem_event_cleanup(struct domain *d)
 {
-    if ( d->mem_event->paging.ring_page )
+    if ( d->mem_event->paging.ring_page ) {
+        /* Destroying the wait queue head means waking up all
+         * queued vcpus. This will drain the list, allowing
+         * the disable routine to complete. It will also drop
+         * all domain refs the wait-queued vcpus are holding.
+         * Finally, because this code path involves previously
+         * pausing the domain (domain_kill), unpausing the 
+         * vcpus causes no harm. */
+        destroy_waitqueue_head(&d->mem_event->paging.wq);
         (void)mem_event_disable(d, &d->mem_event->paging);
-    if ( d->mem_event->access.ring_page )
+    }
+    if ( d->mem_event->access.ring_page ) {
+        destroy_waitqueue_head(&d->mem_event->access.wq);
         (void)mem_event_disable(d, &d->mem_event->access);
-    if ( d->mem_event->share.ring_page )
+    }
+    if ( d->mem_event->share.ring_page ) {
+        destroy_waitqueue_head(&d->mem_event->share.wq);
         (void)mem_event_disable(d, &d->mem_event->share);
+    }
 }
 
 int mem_event_domctl(struct domain *d, xen_domctl_mem_event_op_t *mec,

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqx-0004EH-Lp; Fri, 16 Mar 2012 04:33: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 1S8Oqw-00048P-17
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:22 +0000
Received: from [85.158.143.35:32821] by server-1.bemta-4.messagelabs.com id
	C0/67-20925-192C26F4; Fri, 16 Mar 2012 04:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1331872399!5345127!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8442 invoked from network); 16 Mar 2012 04:33:20 -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;
	16 Mar 2012 04:33: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 1S8Oqs-0005KE-V5
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqs-0002Nr-U2
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Message-Id: <E1S8Oqs-0002Nr-U2@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Allow to not sleep on mem
	event 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331809964 0
# Node ID 5541e32f2b6e7e2ff63331ff96fc1b837ddffaf0
# Parent  2144deeb3da12aa85169ac4b1a445343418ac799
x86/mm: Allow to not sleep on mem event ring

Under extreme congestion conditions, generating a mem event may put the vcpu to
sleep on a wait queue if the ring is full. This is generally desirable, although
fairly convoluted to work with, since sleeping on a wait queue requires a
non-atomic context (i.e. no locks held).

Introduce an allow_sleep flag to make this optional. The default API remains
such that all current callers set allow_sleep to true and thus will sleep if
necessary.

The end-use is for cases in which loss of guest mem events is tolerable. One
such consumer to be added later is the unsharing code under ENOMEM conditions.

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


diff -r 2144deeb3da1 -r 5541e32f2b6e xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 15 11:12:44 2012 +0000
@@ -409,9 +409,10 @@
  *               0: a spot has been reserved
  *
  */
-int mem_event_claim_slot(struct domain *d, struct mem_event_domain *med)
+int __mem_event_claim_slot(struct domain *d, struct mem_event_domain *med,
+                            bool_t allow_sleep)
 {
-    if ( current->domain == d )
+    if ( (current->domain == d) && allow_sleep )
         return mem_event_wait_slot(med);
     else
         return mem_event_grab_slot(med, 1);
diff -r 2144deeb3da1 -r 5541e32f2b6e xen/include/asm-x86/mem_event.h
--- a/xen/include/asm-x86/mem_event.h	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/include/asm-x86/mem_event.h	Thu Mar 15 11:12:44 2012 +0000
@@ -28,11 +28,31 @@
 bool_t mem_event_check_ring(struct mem_event_domain *med);
 
 /* Returns 0 on success, -ENOSYS if there is no ring, -EBUSY if there is no
- * available space. For success or -EBUSY, the vCPU may be left blocked
- * temporarily to ensure that the ring does not lose future events.  In
- * general, you must follow a claim_slot() call with either put_request() or
- * cancel_slot(), both of which are guaranteed to succeed. */
-int mem_event_claim_slot(struct domain *d, struct mem_event_domain *med);
+ * available space and the caller is a foreign domain. If the guest itself
+ * is the caller, -EBUSY is avoided by sleeping on a wait queue to ensure
+ * that the ring does not lose future events. 
+ *
+ * However, the allow_sleep flag can be set to false in cases in which it is ok
+ * to lose future events, and thus -EBUSY can be returned to guest vcpus
+ * (handle with care!). 
+ *
+ * In general, you must follow a claim_slot() call with either put_request() or
+ * cancel_slot(), both of which are guaranteed to
+ * succeed. 
+ */
+int __mem_event_claim_slot(struct domain *d, struct mem_event_domain *med,
+                            bool_t allow_sleep);
+static inline int mem_event_claim_slot(struct domain *d, 
+                                        struct mem_event_domain *med)
+{
+    return __mem_event_claim_slot(d, med, 1);
+}
+
+static inline int mem_event_claim_slot_nosleep(struct domain *d,
+                                        struct mem_event_domain *med)
+{
+    return __mem_event_claim_slot(d, med, 0);
+}
 
 void mem_event_cancel_slot(struct domain *d, struct mem_event_domain *med);
 

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqx-0004EH-Lp; Fri, 16 Mar 2012 04:33: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 1S8Oqw-00048P-17
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:22 +0000
Received: from [85.158.143.35:32821] by server-1.bemta-4.messagelabs.com id
	C0/67-20925-192C26F4; Fri, 16 Mar 2012 04:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1331872399!5345127!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8442 invoked from network); 16 Mar 2012 04:33:20 -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;
	16 Mar 2012 04:33: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 1S8Oqs-0005KE-V5
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqs-0002Nr-U2
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:18 +0000
Message-Id: <E1S8Oqs-0002Nr-U2@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Allow to not sleep on mem
	event 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331809964 0
# Node ID 5541e32f2b6e7e2ff63331ff96fc1b837ddffaf0
# Parent  2144deeb3da12aa85169ac4b1a445343418ac799
x86/mm: Allow to not sleep on mem event ring

Under extreme congestion conditions, generating a mem event may put the vcpu to
sleep on a wait queue if the ring is full. This is generally desirable, although
fairly convoluted to work with, since sleeping on a wait queue requires a
non-atomic context (i.e. no locks held).

Introduce an allow_sleep flag to make this optional. The default API remains
such that all current callers set allow_sleep to true and thus will sleep if
necessary.

The end-use is for cases in which loss of guest mem events is tolerable. One
such consumer to be added later is the unsharing code under ENOMEM conditions.

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


diff -r 2144deeb3da1 -r 5541e32f2b6e xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 15 11:12:44 2012 +0000
@@ -409,9 +409,10 @@
  *               0: a spot has been reserved
  *
  */
-int mem_event_claim_slot(struct domain *d, struct mem_event_domain *med)
+int __mem_event_claim_slot(struct domain *d, struct mem_event_domain *med,
+                            bool_t allow_sleep)
 {
-    if ( current->domain == d )
+    if ( (current->domain == d) && allow_sleep )
         return mem_event_wait_slot(med);
     else
         return mem_event_grab_slot(med, 1);
diff -r 2144deeb3da1 -r 5541e32f2b6e xen/include/asm-x86/mem_event.h
--- a/xen/include/asm-x86/mem_event.h	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/include/asm-x86/mem_event.h	Thu Mar 15 11:12:44 2012 +0000
@@ -28,11 +28,31 @@
 bool_t mem_event_check_ring(struct mem_event_domain *med);
 
 /* Returns 0 on success, -ENOSYS if there is no ring, -EBUSY if there is no
- * available space. For success or -EBUSY, the vCPU may be left blocked
- * temporarily to ensure that the ring does not lose future events.  In
- * general, you must follow a claim_slot() call with either put_request() or
- * cancel_slot(), both of which are guaranteed to succeed. */
-int mem_event_claim_slot(struct domain *d, struct mem_event_domain *med);
+ * available space and the caller is a foreign domain. If the guest itself
+ * is the caller, -EBUSY is avoided by sleeping on a wait queue to ensure
+ * that the ring does not lose future events. 
+ *
+ * However, the allow_sleep flag can be set to false in cases in which it is ok
+ * to lose future events, and thus -EBUSY can be returned to guest vcpus
+ * (handle with care!). 
+ *
+ * In general, you must follow a claim_slot() call with either put_request() or
+ * cancel_slot(), both of which are guaranteed to
+ * succeed. 
+ */
+int __mem_event_claim_slot(struct domain *d, struct mem_event_domain *med,
+                            bool_t allow_sleep);
+static inline int mem_event_claim_slot(struct domain *d, 
+                                        struct mem_event_domain *med)
+{
+    return __mem_event_claim_slot(d, med, 1);
+}
+
+static inline int mem_event_claim_slot_nosleep(struct domain *d,
+                                        struct mem_event_domain *med)
+{
+    return __mem_event_claim_slot(d, med, 0);
+}
 
 void mem_event_cancel_slot(struct domain *d, struct mem_event_domain *med);
 

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqx-0004EU-QS; Fri, 16 Mar 2012 04:33: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 1S8Oqw-00048P-Ts
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:23 +0000
Received: from [85.158.143.35:55095] by server-1.bemta-4.messagelabs.com id
	E1/67-20925-292C26F4; Fri, 16 Mar 2012 04:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1331872399!11855011!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23846 invoked from network); 16 Mar 2012 04:33:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33: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 1S8Oqt-0005KH-Hm
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqt-0002OL-Gk
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:19 +0000
Message-Id: <E1S8Oqt-0002OL-Gk@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Memory sharing: better handling of
	ENOMEM while unsharing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331809964 0
# Node ID 1bff003ba64bd8c17eed61baebd689951cef8844
# Parent  5541e32f2b6e7e2ff63331ff96fc1b837ddffaf0
Memory sharing: better handling of ENOMEM while unsharing

If unsharing fails with ENOMEM, we were:
 - leaving the list of gfns backed by the shared page in an inconsistent state
 - cycling forever on the hap page fault handler.
 - Attempting to produce a mem event (which could sleep on a wait queue)
   while holding locks.
 - Not checking, for all callers, that unshare could have indeed failed.

Fix bugs above, and sanitize callers to place a ring event in an unlocked
context, or without requiring to go to sleep on a wait queue.

A note on the rationale for unshare error handling:
 1. Unshare can only fail with ENOMEM. Any other error conditions BUG_ON()
 2. We notify a potential dom0 helper through a mem_event ring. But we
    allow the notification to not go to sleep. If the event ring is full
    of ENOMEM warnings, then the helper will already have been kicked enough.
 3. We cannot "just" go to sleep until the unshare is resolved, because we
    might be buried deep into locks (e.g. something -> copy_to_user ->
    __hvm_copy)
 4. So, we make sure we:
    4.1. return an error
    4.2. do not corrupt memory shared with other guests
    4.3. do not corrupt memory private to the current guest
    4.4. do not corrupt the hypervisor memory sharing meta data
    4.5. let the guest deal with the error, if propagation will reach that far

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


diff -r 5541e32f2b6e -r 1bff003ba64b xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Mar 15 11:12:44 2012 +0000
@@ -1231,6 +1231,9 @@
     struct vcpu *v = current;
     struct p2m_domain *p2m;
     int rc, fall_through = 0, paged = 0;
+#ifdef __x86_64__
+    int sharing_enomem = 0;
+#endif
     mem_event_request_t *req_ptr = NULL;
 
     /* On Nested Virtualization, walk the guest page table.
@@ -1340,7 +1343,8 @@
     if ( access_w && (p2mt == p2m_ram_shared) )
     {
         ASSERT(!p2m_is_nestedp2m(p2m));
-        mem_sharing_unshare_page(p2m->domain, gfn, 0);
+        sharing_enomem = 
+            (mem_sharing_unshare_page(p2m->domain, gfn, 0) < 0);
         rc = 1;
         goto out_put_gfn;
     }
@@ -1381,8 +1385,25 @@
 out_put_gfn:
     put_gfn(p2m->domain, gfn);
 out:
+    /* All of these are delayed until we exit, since we might 
+     * sleep on event ring wait queues, and we must not hold
+     * locks in such circumstance */
     if ( paged )
         p2m_mem_paging_populate(v->domain, gfn);
+#ifdef __x86_64__
+    if ( sharing_enomem )
+    {
+        int rv;
+        if ( (rv = mem_sharing_notify_enomem(v->domain, gfn, 1)) < 0 )
+        {
+            gdprintk(XENLOG_ERR, "Domain %hu attempt to unshare "
+                     "gfn %lx, ENOMEM and no helper (rc %d)\n",
+                        v->domain->domain_id, gfn, rv);
+            /* Crash the domain */
+            rc = 0;
+        }
+    }
+#endif
     if ( req_ptr )
     {
         mem_access_send_req(v->domain, req_ptr);
diff -r 5541e32f2b6e -r 1bff003ba64b xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Mar 15 11:12:44 2012 +0000
@@ -3597,12 +3597,14 @@
                         /* Unshare the page for RW foreign mappings */
                         if ( l1e_get_flags(l1e) & _PAGE_RW )
                         {
-                            rc = mem_sharing_unshare_page(pg_owner, 
-                                                          l1e_get_pfn(l1e), 
-                                                          0);
+                            unsigned long gfn = l1e_get_pfn(l1e);
+                            rc = mem_sharing_unshare_page(pg_owner, gfn, 0); 
                             if ( rc )
                             {
                                 put_gfn(pg_owner, l1egfn);
+                                /* Notify helper, don't care about errors, will not
+                                 * sleep on wq, since we're a foreign domain. */
+                                (void)mem_sharing_notify_enomem(pg_owner, gfn, 0);
                                 break; 
                             }
                         }
diff -r 5541e32f2b6e -r 1bff003ba64b xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Mar 15 11:12:44 2012 +0000
@@ -344,34 +344,29 @@
 #endif
 
 
-static void mem_sharing_notify_helper(struct domain *d, unsigned long gfn)
+int mem_sharing_notify_enomem(struct domain *d, unsigned long gfn,
+                                bool_t allow_sleep) 
 {
     struct vcpu *v = current;
+    int rc;
     mem_event_request_t req = { .gfn = gfn };
 
-    if ( v->domain != d )
+    if ( (rc = __mem_event_claim_slot(d, 
+                        &d->mem_event->share, allow_sleep)) < 0 )
+        return rc;
+
+    if ( v->domain == d )
     {
-        /* XXX This path needs some attention.  For now, just fail foreign 
-         * XXX requests to unshare if there's no memory.  This replaces 
-         * XXX old code that BUG()ed here; the callers now BUG()
-         * XXX elewhere. */
-        gdprintk(XENLOG_ERR, 
-                 "Failed alloc on unshare path for foreign (%d) lookup\n",
-                 d->domain_id);
-        return;
+        req.flags = MEM_EVENT_FLAG_VCPU_PAUSED;
+        vcpu_pause_nosync(v);
     }
 
-    if (mem_event_claim_slot(d, &d->mem_event->share) < 0)
-    {
-        return;
-    }
-
-    req.flags = MEM_EVENT_FLAG_VCPU_PAUSED;
-    vcpu_pause_nosync(v);
-
     req.p2mt = p2m_ram_shared;
     req.vcpu_id = v->vcpu_id;
+
     mem_event_put_request(d, &d->mem_event->share, &req);
+
+    return 0;
 }
 
 unsigned int mem_sharing_get_nr_saved_mfns(void)
@@ -903,7 +898,21 @@
     return ret;
 }
 
-int mem_sharing_unshare_page(struct domain *d,
+
+/* A note on the rationale for unshare error handling:
+ *  1. Unshare can only fail with ENOMEM. Any other error conditions BUG_ON()'s
+ *  2. We notify a potential dom0 helper through a mem_event ring. But we
+ *     allow the notification to not go to sleep. If the event ring is full 
+ *     of ENOMEM warnings, then it's on the ball.
+ *  3. We cannot go to sleep until the unshare is resolved, because we might
+ *     be buried deep into locks (e.g. something -> copy_to_user -> __hvm_copy) 
+ *  4. So, we make sure we:
+ *     4.1. return an error
+ *     4.2. do not corrupt shared memory
+ *     4.3. do not corrupt guest memory
+ *     4.4. let the guest deal with it if the error propagation will reach it
+ */
+int __mem_sharing_unshare_page(struct domain *d,
                              unsigned long gfn, 
                              uint16_t flags)
 {
@@ -945,7 +954,6 @@
     /* Do the accounting first. If anything fails below, we have bigger
      * bigger fish to fry. First, remove the gfn from the list. */ 
     last_gfn = list_has_one_entry(&page->sharing->gfns);
-    mem_sharing_gfn_destroy(d, gfn_info);
     if ( last_gfn )
     {
         /* Clean up shared state */
@@ -959,6 +967,7 @@
      * (possibly freeing the page), and exit early */
     if ( flags & MEM_SHARING_DESTROY_GFN )
     {
+        mem_sharing_gfn_destroy(d, gfn_info);
         put_page_and_type(page);
         mem_sharing_page_unlock(page);
         if ( last_gfn && 
@@ -971,6 +980,7 @@
  
     if ( last_gfn )
     {
+        mem_sharing_gfn_destroy(d, gfn_info);
         /* Making a page private atomically unlocks it */
         BUG_ON(page_make_private(d, page) != 0);
         goto private_page_found;
@@ -982,7 +992,8 @@
     {
         mem_sharing_page_unlock(old_page);
         put_gfn(d, gfn);
-        mem_sharing_notify_helper(d, gfn);
+        /* Caller is responsible for placing an event
+         * in the ring */
         return -ENOMEM;
     }
 
@@ -993,6 +1004,7 @@
     unmap_domain_page(t);
 
     BUG_ON(set_shared_p2m_entry(d, gfn, page_to_mfn(page)) == 0);
+    mem_sharing_gfn_destroy(d, gfn_info);
     mem_sharing_page_unlock(old_page);
     put_page_and_type(old_page);
 
diff -r 5541e32f2b6e -r 1bff003ba64b xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:12:44 2012 +0000
@@ -170,7 +170,10 @@
     if ( q == p2m_unshare && p2m_is_shared(*t) )
     {
         ASSERT(!p2m_is_nestedp2m(p2m));
-        mem_sharing_unshare_page(p2m->domain, gfn, 0);
+        /* Try to unshare. If we fail, communicate ENOMEM without
+         * sleeping. */
+        if ( mem_sharing_unshare_page(p2m->domain, gfn, 0) < 0 )
+            (void)mem_sharing_notify_enomem(p2m->domain, gfn, 0);
         mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order);
     }
 #endif
@@ -371,6 +374,7 @@
         if ( mfn_valid(mfn) && (t == p2m_ram_shared) )
         {
             ASSERT(!p2m_is_nestedp2m(p2m));
+            /* Does not fail with ENOMEM given the DESTROY flag */
             BUG_ON(mem_sharing_unshare_page(d, gfn, MEM_SHARING_DESTROY_GFN));
         }
     }
@@ -510,6 +514,18 @@
             if ( rc )
             {
                 p2m_unlock(p2m);
+                /* NOTE: Should a guest domain bring this upon itself,
+                 * there is not a whole lot we can do. We are buried
+                 * deep in locks from most code paths by now. So, fail
+                 * the call and don't try to sleep on a wait queue
+                 * while placing the mem event.
+                 *
+                 * However, all current (changeset 3432abcf9380) code
+                 * paths avoid this unsavoury situation. For now.
+                 *
+                 * Foreign domains are okay to place an event as they 
+                 * won't go to sleep. */
+                (void)mem_sharing_notify_enomem(p2m->domain, gfn + i, 0);
                 return rc;
             }
             omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, p2m_query, NULL);
diff -r 5541e32f2b6e -r 1bff003ba64b xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/common/grant_table.c	Thu Mar 15 11:12:44 2012 +0000
@@ -112,8 +112,7 @@
     p2m_type_t __p2mt;                                      \
     unsigned long __x;                                      \
     __x = mfn_x(get_gfn_unshare((_d), (_gfn), &__p2mt));    \
-    BUG_ON(p2m_is_shared(__p2mt)); /* XXX fixme */          \
-    if ( !p2m_is_valid(__p2mt) )                            \
+    if ( p2m_is_shared(__p2mt) || !p2m_is_valid(__p2mt) )   \
         __x = INVALID_MFN;                                  \
     __x; })
 #else
@@ -155,9 +154,11 @@
     else
     {
         mfn = get_gfn_unshare(rd, gfn, &p2mt);
-        BUG_ON(p2m_is_shared(p2mt));
-        /* XXX Here, and above in gfn_to_mfn_private, need to handle
-         * XXX failure to unshare. */
+        if ( p2m_is_shared(p2mt) )
+        {
+            put_gfn(rd, gfn);
+            return GNTST_eagain;
+        }
     }
 
     if ( p2m_is_valid(p2mt) ) {
diff -r 5541e32f2b6e -r 1bff003ba64b xen/common/memory.c
--- a/xen/common/memory.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/common/memory.c	Thu Mar 15 11:12:44 2012 +0000
@@ -200,6 +200,7 @@
         if ( mem_sharing_unshare_page(d, gmfn, 0) )
         {
             put_gfn(d, gmfn);
+            (void)mem_sharing_notify_enomem(d, gmfn, 0);
             return 0;
         }
         /* Maybe the mfn changed */
diff -r 5541e32f2b6e -r 1bff003ba64b xen/include/asm-x86/mem_sharing.h
--- a/xen/include/asm-x86/mem_sharing.h	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/include/asm-x86/mem_sharing.h	Thu Mar 15 11:12:44 2012 +0000
@@ -52,10 +52,35 @@
                               unsigned long gfn,
                               int expected_refcnt,
                               shr_handle_t *phandle);
+
 #define MEM_SHARING_DESTROY_GFN       (1<<1)
-int mem_sharing_unshare_page(struct domain *d, 
+/* Only fails with -ENOMEM. Enforce it with a BUG_ON wrapper. */
+int __mem_sharing_unshare_page(struct domain *d,
                              unsigned long gfn, 
                              uint16_t flags);
+static inline int mem_sharing_unshare_page(struct domain *d,
+                                           unsigned long gfn,
+                                           uint16_t flags)
+{
+    int rc = __mem_sharing_unshare_page(d, gfn, flags);
+    BUG_ON( rc && (rc != -ENOMEM) );
+    return rc;
+}
+
+/* If called by a foreign domain, possible errors are
+ *   -EBUSY -> ring full
+ *   -ENOSYS -> no ring to begin with
+ * and the foreign mapper is responsible for retrying.
+ *
+ * If called by the guest vcpu itself and allow_sleep is set, may 
+ * sleep on a wait queue, so the caller is responsible for not 
+ * holding locks on entry. It may only fail with ENOSYS 
+ *
+ * If called by the guest vcpu itself and allow_sleep is not set,
+ * then it's the same as a foreign domain.
+ */
+int mem_sharing_notify_enomem(struct domain *d, unsigned long gfn,
+                                bool_t allow_sleep);
 int mem_sharing_sharing_resume(struct domain *d);
 int mem_sharing_memop(struct domain *d, 
                        xen_mem_sharing_op_t *mec);

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqx-0004EU-QS; Fri, 16 Mar 2012 04:33: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 1S8Oqw-00048P-Ts
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:23 +0000
Received: from [85.158.143.35:55095] by server-1.bemta-4.messagelabs.com id
	E1/67-20925-292C26F4; Fri, 16 Mar 2012 04:33:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1331872399!11855011!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23846 invoked from network); 16 Mar 2012 04:33:21 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33: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 1S8Oqt-0005KH-Hm
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:19 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqt-0002OL-Gk
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:19 +0000
Message-Id: <E1S8Oqt-0002OL-Gk@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Memory sharing: better handling of
	ENOMEM while unsharing
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331809964 0
# Node ID 1bff003ba64bd8c17eed61baebd689951cef8844
# Parent  5541e32f2b6e7e2ff63331ff96fc1b837ddffaf0
Memory sharing: better handling of ENOMEM while unsharing

If unsharing fails with ENOMEM, we were:
 - leaving the list of gfns backed by the shared page in an inconsistent state
 - cycling forever on the hap page fault handler.
 - Attempting to produce a mem event (which could sleep on a wait queue)
   while holding locks.
 - Not checking, for all callers, that unshare could have indeed failed.

Fix bugs above, and sanitize callers to place a ring event in an unlocked
context, or without requiring to go to sleep on a wait queue.

A note on the rationale for unshare error handling:
 1. Unshare can only fail with ENOMEM. Any other error conditions BUG_ON()
 2. We notify a potential dom0 helper through a mem_event ring. But we
    allow the notification to not go to sleep. If the event ring is full
    of ENOMEM warnings, then the helper will already have been kicked enough.
 3. We cannot "just" go to sleep until the unshare is resolved, because we
    might be buried deep into locks (e.g. something -> copy_to_user ->
    __hvm_copy)
 4. So, we make sure we:
    4.1. return an error
    4.2. do not corrupt memory shared with other guests
    4.3. do not corrupt memory private to the current guest
    4.4. do not corrupt the hypervisor memory sharing meta data
    4.5. let the guest deal with the error, if propagation will reach that far

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


diff -r 5541e32f2b6e -r 1bff003ba64b xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Mar 15 11:12:44 2012 +0000
@@ -1231,6 +1231,9 @@
     struct vcpu *v = current;
     struct p2m_domain *p2m;
     int rc, fall_through = 0, paged = 0;
+#ifdef __x86_64__
+    int sharing_enomem = 0;
+#endif
     mem_event_request_t *req_ptr = NULL;
 
     /* On Nested Virtualization, walk the guest page table.
@@ -1340,7 +1343,8 @@
     if ( access_w && (p2mt == p2m_ram_shared) )
     {
         ASSERT(!p2m_is_nestedp2m(p2m));
-        mem_sharing_unshare_page(p2m->domain, gfn, 0);
+        sharing_enomem = 
+            (mem_sharing_unshare_page(p2m->domain, gfn, 0) < 0);
         rc = 1;
         goto out_put_gfn;
     }
@@ -1381,8 +1385,25 @@
 out_put_gfn:
     put_gfn(p2m->domain, gfn);
 out:
+    /* All of these are delayed until we exit, since we might 
+     * sleep on event ring wait queues, and we must not hold
+     * locks in such circumstance */
     if ( paged )
         p2m_mem_paging_populate(v->domain, gfn);
+#ifdef __x86_64__
+    if ( sharing_enomem )
+    {
+        int rv;
+        if ( (rv = mem_sharing_notify_enomem(v->domain, gfn, 1)) < 0 )
+        {
+            gdprintk(XENLOG_ERR, "Domain %hu attempt to unshare "
+                     "gfn %lx, ENOMEM and no helper (rc %d)\n",
+                        v->domain->domain_id, gfn, rv);
+            /* Crash the domain */
+            rc = 0;
+        }
+    }
+#endif
     if ( req_ptr )
     {
         mem_access_send_req(v->domain, req_ptr);
diff -r 5541e32f2b6e -r 1bff003ba64b xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Mar 15 11:12:44 2012 +0000
@@ -3597,12 +3597,14 @@
                         /* Unshare the page for RW foreign mappings */
                         if ( l1e_get_flags(l1e) & _PAGE_RW )
                         {
-                            rc = mem_sharing_unshare_page(pg_owner, 
-                                                          l1e_get_pfn(l1e), 
-                                                          0);
+                            unsigned long gfn = l1e_get_pfn(l1e);
+                            rc = mem_sharing_unshare_page(pg_owner, gfn, 0); 
                             if ( rc )
                             {
                                 put_gfn(pg_owner, l1egfn);
+                                /* Notify helper, don't care about errors, will not
+                                 * sleep on wq, since we're a foreign domain. */
+                                (void)mem_sharing_notify_enomem(pg_owner, gfn, 0);
                                 break; 
                             }
                         }
diff -r 5541e32f2b6e -r 1bff003ba64b xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Mar 15 11:12:44 2012 +0000
@@ -344,34 +344,29 @@
 #endif
 
 
-static void mem_sharing_notify_helper(struct domain *d, unsigned long gfn)
+int mem_sharing_notify_enomem(struct domain *d, unsigned long gfn,
+                                bool_t allow_sleep) 
 {
     struct vcpu *v = current;
+    int rc;
     mem_event_request_t req = { .gfn = gfn };
 
-    if ( v->domain != d )
+    if ( (rc = __mem_event_claim_slot(d, 
+                        &d->mem_event->share, allow_sleep)) < 0 )
+        return rc;
+
+    if ( v->domain == d )
     {
-        /* XXX This path needs some attention.  For now, just fail foreign 
-         * XXX requests to unshare if there's no memory.  This replaces 
-         * XXX old code that BUG()ed here; the callers now BUG()
-         * XXX elewhere. */
-        gdprintk(XENLOG_ERR, 
-                 "Failed alloc on unshare path for foreign (%d) lookup\n",
-                 d->domain_id);
-        return;
+        req.flags = MEM_EVENT_FLAG_VCPU_PAUSED;
+        vcpu_pause_nosync(v);
     }
 
-    if (mem_event_claim_slot(d, &d->mem_event->share) < 0)
-    {
-        return;
-    }
-
-    req.flags = MEM_EVENT_FLAG_VCPU_PAUSED;
-    vcpu_pause_nosync(v);
-
     req.p2mt = p2m_ram_shared;
     req.vcpu_id = v->vcpu_id;
+
     mem_event_put_request(d, &d->mem_event->share, &req);
+
+    return 0;
 }
 
 unsigned int mem_sharing_get_nr_saved_mfns(void)
@@ -903,7 +898,21 @@
     return ret;
 }
 
-int mem_sharing_unshare_page(struct domain *d,
+
+/* A note on the rationale for unshare error handling:
+ *  1. Unshare can only fail with ENOMEM. Any other error conditions BUG_ON()'s
+ *  2. We notify a potential dom0 helper through a mem_event ring. But we
+ *     allow the notification to not go to sleep. If the event ring is full 
+ *     of ENOMEM warnings, then it's on the ball.
+ *  3. We cannot go to sleep until the unshare is resolved, because we might
+ *     be buried deep into locks (e.g. something -> copy_to_user -> __hvm_copy) 
+ *  4. So, we make sure we:
+ *     4.1. return an error
+ *     4.2. do not corrupt shared memory
+ *     4.3. do not corrupt guest memory
+ *     4.4. let the guest deal with it if the error propagation will reach it
+ */
+int __mem_sharing_unshare_page(struct domain *d,
                              unsigned long gfn, 
                              uint16_t flags)
 {
@@ -945,7 +954,6 @@
     /* Do the accounting first. If anything fails below, we have bigger
      * bigger fish to fry. First, remove the gfn from the list. */ 
     last_gfn = list_has_one_entry(&page->sharing->gfns);
-    mem_sharing_gfn_destroy(d, gfn_info);
     if ( last_gfn )
     {
         /* Clean up shared state */
@@ -959,6 +967,7 @@
      * (possibly freeing the page), and exit early */
     if ( flags & MEM_SHARING_DESTROY_GFN )
     {
+        mem_sharing_gfn_destroy(d, gfn_info);
         put_page_and_type(page);
         mem_sharing_page_unlock(page);
         if ( last_gfn && 
@@ -971,6 +980,7 @@
  
     if ( last_gfn )
     {
+        mem_sharing_gfn_destroy(d, gfn_info);
         /* Making a page private atomically unlocks it */
         BUG_ON(page_make_private(d, page) != 0);
         goto private_page_found;
@@ -982,7 +992,8 @@
     {
         mem_sharing_page_unlock(old_page);
         put_gfn(d, gfn);
-        mem_sharing_notify_helper(d, gfn);
+        /* Caller is responsible for placing an event
+         * in the ring */
         return -ENOMEM;
     }
 
@@ -993,6 +1004,7 @@
     unmap_domain_page(t);
 
     BUG_ON(set_shared_p2m_entry(d, gfn, page_to_mfn(page)) == 0);
+    mem_sharing_gfn_destroy(d, gfn_info);
     mem_sharing_page_unlock(old_page);
     put_page_and_type(old_page);
 
diff -r 5541e32f2b6e -r 1bff003ba64b xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:12:44 2012 +0000
@@ -170,7 +170,10 @@
     if ( q == p2m_unshare && p2m_is_shared(*t) )
     {
         ASSERT(!p2m_is_nestedp2m(p2m));
-        mem_sharing_unshare_page(p2m->domain, gfn, 0);
+        /* Try to unshare. If we fail, communicate ENOMEM without
+         * sleeping. */
+        if ( mem_sharing_unshare_page(p2m->domain, gfn, 0) < 0 )
+            (void)mem_sharing_notify_enomem(p2m->domain, gfn, 0);
         mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order);
     }
 #endif
@@ -371,6 +374,7 @@
         if ( mfn_valid(mfn) && (t == p2m_ram_shared) )
         {
             ASSERT(!p2m_is_nestedp2m(p2m));
+            /* Does not fail with ENOMEM given the DESTROY flag */
             BUG_ON(mem_sharing_unshare_page(d, gfn, MEM_SHARING_DESTROY_GFN));
         }
     }
@@ -510,6 +514,18 @@
             if ( rc )
             {
                 p2m_unlock(p2m);
+                /* NOTE: Should a guest domain bring this upon itself,
+                 * there is not a whole lot we can do. We are buried
+                 * deep in locks from most code paths by now. So, fail
+                 * the call and don't try to sleep on a wait queue
+                 * while placing the mem event.
+                 *
+                 * However, all current (changeset 3432abcf9380) code
+                 * paths avoid this unsavoury situation. For now.
+                 *
+                 * Foreign domains are okay to place an event as they 
+                 * won't go to sleep. */
+                (void)mem_sharing_notify_enomem(p2m->domain, gfn + i, 0);
                 return rc;
             }
             omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, p2m_query, NULL);
diff -r 5541e32f2b6e -r 1bff003ba64b xen/common/grant_table.c
--- a/xen/common/grant_table.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/common/grant_table.c	Thu Mar 15 11:12:44 2012 +0000
@@ -112,8 +112,7 @@
     p2m_type_t __p2mt;                                      \
     unsigned long __x;                                      \
     __x = mfn_x(get_gfn_unshare((_d), (_gfn), &__p2mt));    \
-    BUG_ON(p2m_is_shared(__p2mt)); /* XXX fixme */          \
-    if ( !p2m_is_valid(__p2mt) )                            \
+    if ( p2m_is_shared(__p2mt) || !p2m_is_valid(__p2mt) )   \
         __x = INVALID_MFN;                                  \
     __x; })
 #else
@@ -155,9 +154,11 @@
     else
     {
         mfn = get_gfn_unshare(rd, gfn, &p2mt);
-        BUG_ON(p2m_is_shared(p2mt));
-        /* XXX Here, and above in gfn_to_mfn_private, need to handle
-         * XXX failure to unshare. */
+        if ( p2m_is_shared(p2mt) )
+        {
+            put_gfn(rd, gfn);
+            return GNTST_eagain;
+        }
     }
 
     if ( p2m_is_valid(p2mt) ) {
diff -r 5541e32f2b6e -r 1bff003ba64b xen/common/memory.c
--- a/xen/common/memory.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/common/memory.c	Thu Mar 15 11:12:44 2012 +0000
@@ -200,6 +200,7 @@
         if ( mem_sharing_unshare_page(d, gmfn, 0) )
         {
             put_gfn(d, gmfn);
+            (void)mem_sharing_notify_enomem(d, gmfn, 0);
             return 0;
         }
         /* Maybe the mfn changed */
diff -r 5541e32f2b6e -r 1bff003ba64b xen/include/asm-x86/mem_sharing.h
--- a/xen/include/asm-x86/mem_sharing.h	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/include/asm-x86/mem_sharing.h	Thu Mar 15 11:12:44 2012 +0000
@@ -52,10 +52,35 @@
                               unsigned long gfn,
                               int expected_refcnt,
                               shr_handle_t *phandle);
+
 #define MEM_SHARING_DESTROY_GFN       (1<<1)
-int mem_sharing_unshare_page(struct domain *d, 
+/* Only fails with -ENOMEM. Enforce it with a BUG_ON wrapper. */
+int __mem_sharing_unshare_page(struct domain *d,
                              unsigned long gfn, 
                              uint16_t flags);
+static inline int mem_sharing_unshare_page(struct domain *d,
+                                           unsigned long gfn,
+                                           uint16_t flags)
+{
+    int rc = __mem_sharing_unshare_page(d, gfn, flags);
+    BUG_ON( rc && (rc != -ENOMEM) );
+    return rc;
+}
+
+/* If called by a foreign domain, possible errors are
+ *   -EBUSY -> ring full
+ *   -ENOSYS -> no ring to begin with
+ * and the foreign mapper is responsible for retrying.
+ *
+ * If called by the guest vcpu itself and allow_sleep is set, may 
+ * sleep on a wait queue, so the caller is responsible for not 
+ * holding locks on entry. It may only fail with ENOSYS 
+ *
+ * If called by the guest vcpu itself and allow_sleep is not set,
+ * then it's the same as a foreign domain.
+ */
+int mem_sharing_notify_enomem(struct domain *d, unsigned long gfn,
+                                bool_t allow_sleep);
 int mem_sharing_sharing_resume(struct domain *d);
 int mem_sharing_memop(struct domain *d, 
                        xen_mem_sharing_op_t *mec);

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqx-0004EB-JU; Fri, 16 Mar 2012 04:33: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 1S8Oqw-000456-2R
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:22 +0000
Received: from [85.158.143.99:50453] by server-2.bemta-4.messagelabs.com id
	6C/C6-17550-192C26F4; Fri, 16 Mar 2012 04:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1331872400!13690718!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20653 invoked from network); 16 Mar 2012 04:33:21 -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;
	16 Mar 2012 04:33: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 1S8Oqu-0005KK-2Z
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqu-0002Oo-1S
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:20 +0000
Message-Id: <E1S8Oqu-0002Oo-1S@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm/paging: Prevent the guest
	from faulting on the same gfn when dying
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331809964 0
# Node ID fa7d1e7a5fae658686f041c080b45600be797744
# Parent  1bff003ba64bd8c17eed61baebd689951cef8844
x86/mm/paging: Prevent the guest from faulting on the same gfn when dying

A crashing guest due to paging may hit an "endless" loop faulting repeatedly on
the current paged-out gfn, until the toolstack comes around to killing the
domain.

Unfortunately domain_crash at this point may not pause the vcpu due to the
shutting_down flag, so we pause it explicitly when detecting the condition.

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


diff -r 1bff003ba64b -r fa7d1e7a5fae xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:12:44 2012 +0000
@@ -988,6 +988,9 @@
     {
         gdprintk(XENLOG_ERR, "Domain %hu paging gfn %lx yet no ring "
                              "in place\n", d->domain_id, gfn);
+        /* Prevent the vcpu from faulting repeatedly on the same gfn */
+        if ( v->domain == d )
+            vcpu_pause_nosync(v);
         domain_crash(d);
         return;
     }

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqx-0004EB-JU; Fri, 16 Mar 2012 04:33: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 1S8Oqw-000456-2R
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:22 +0000
Received: from [85.158.143.99:50453] by server-2.bemta-4.messagelabs.com id
	6C/C6-17550-192C26F4; Fri, 16 Mar 2012 04:33:21 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1331872400!13690718!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20653 invoked from network); 16 Mar 2012 04:33:21 -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;
	16 Mar 2012 04:33: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 1S8Oqu-0005KK-2Z
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqu-0002Oo-1S
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:20 +0000
Message-Id: <E1S8Oqu-0002Oo-1S@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:19 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm/paging: Prevent the guest
	from faulting on the same gfn when dying
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331809964 0
# Node ID fa7d1e7a5fae658686f041c080b45600be797744
# Parent  1bff003ba64bd8c17eed61baebd689951cef8844
x86/mm/paging: Prevent the guest from faulting on the same gfn when dying

A crashing guest due to paging may hit an "endless" loop faulting repeatedly on
the current paged-out gfn, until the toolstack comes around to killing the
domain.

Unfortunately domain_crash at this point may not pause the vcpu due to the
shutting_down flag, so we pause it explicitly when detecting the condition.

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


diff -r 1bff003ba64b -r fa7d1e7a5fae xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:12:44 2012 +0000
@@ -988,6 +988,9 @@
     {
         gdprintk(XENLOG_ERR, "Domain %hu paging gfn %lx yet no ring "
                              "in place\n", d->domain_id, gfn);
+        /* Prevent the vcpu from faulting repeatedly on the same gfn */
+        if ( v->domain == d )
+            vcpu_pause_nosync(v);
         domain_crash(d);
         return;
     }

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqy-0004HK-Vq; Fri, 16 Mar 2012 04:33: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 1S8Oqx-0004E1-QF
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:23 +0000
Received: from [85.158.143.35:55113] by server-3.bemta-4.messagelabs.com id
	EC/6D-05853-392C26F4; Fri, 16 Mar 2012 04:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1331872401!5345131!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8467 invoked from network); 16 Mar 2012 04:33:22 -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;
	16 Mar 2012 04:33: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 1S8Oqu-0005KN-Jw
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqu-0002PH-J2
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:20 +0000
Message-Id: <E1S8Oqu-0002PH-J2@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] mm: guest_remove_page() should not
	populate or unshare.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331811651 0
# Node ID da72de35e4a271f1faacd8e712c284ed8cd846a8
# Parent  fa7d1e7a5fae658686f041c080b45600be797744
mm: guest_remove_page() should not populate or unshare.

guest_remove_page() ought to use get_gfn_query() to look up the
current state of the gfn.  Otherwise it might populate or unshare
the gfn just before dropping it.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r fa7d1e7a5fae -r da72de35e4a2 xen/common/memory.c
--- a/xen/common/memory.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/common/memory.c	Thu Mar 15 11:40:51 2012 +0000
@@ -162,7 +162,7 @@
     unsigned long mfn;
 
 #ifdef CONFIG_X86
-    mfn = mfn_x(get_gfn(d, gmfn, &p2mt)); 
+    mfn = mfn_x(get_gfn_query(d, gmfn, &p2mt)); 
     if ( unlikely(p2m_is_paging(p2mt)) )
     {
         guest_physmap_remove_page(d, gmfn, mfn, 0);

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqy-0004HK-Vq; Fri, 16 Mar 2012 04:33: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 1S8Oqx-0004E1-QF
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:23 +0000
Received: from [85.158.143.35:55113] by server-3.bemta-4.messagelabs.com id
	EC/6D-05853-392C26F4; Fri, 16 Mar 2012 04:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1331872401!5345131!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8467 invoked from network); 16 Mar 2012 04:33:22 -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;
	16 Mar 2012 04:33: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 1S8Oqu-0005KN-Jw
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqu-0002PH-J2
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:20 +0000
Message-Id: <E1S8Oqu-0002PH-J2@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] mm: guest_remove_page() should not
	populate or unshare.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331811651 0
# Node ID da72de35e4a271f1faacd8e712c284ed8cd846a8
# Parent  fa7d1e7a5fae658686f041c080b45600be797744
mm: guest_remove_page() should not populate or unshare.

guest_remove_page() ought to use get_gfn_query() to look up the
current state of the gfn.  Otherwise it might populate or unshare
the gfn just before dropping it.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r fa7d1e7a5fae -r da72de35e4a2 xen/common/memory.c
--- a/xen/common/memory.c	Thu Mar 15 11:12:44 2012 +0000
+++ b/xen/common/memory.c	Thu Mar 15 11:40:51 2012 +0000
@@ -162,7 +162,7 @@
     unsigned long mfn;
 
 #ifdef CONFIG_X86
-    mfn = mfn_x(get_gfn(d, gmfn, &p2mt)); 
+    mfn = mfn_x(get_gfn_query(d, gmfn, &p2mt)); 
     if ( unlikely(p2m_is_paging(p2mt)) )
     {
         guest_physmap_remove_page(d, gmfn, mfn, 0);

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqz-0004HU-1r; Fri, 16 Mar 2012 04:33: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 1S8Oqy-000456-15
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:24 +0000
Received: from [85.158.143.35:55141] by server-2.bemta-4.messagelabs.com id
	00/D6-17550-392C26F4; Fri, 16 Mar 2012 04:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1331872401!14064758!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24443 invoked from network); 16 Mar 2012 04:33:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33: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 1S8Oqv-0005KQ-6X
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqv-0002Pl-5a
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:21 +0000
Message-Id: <E1S8Oqv-0002Pl-5a@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: remove 'p2m_guest' lookup
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331811671 0
# Node ID 7a439281b8ee5aef0b495e191fab7c8d0e46e4be
# Parent  da72de35e4a271f1faacd8e712c284ed8cd846a8
x86/mm: remove 'p2m_guest' lookup type.

It was neither consistently used by callers nor correctly handled by the
lookup code.  Instead, treat any lookup that might allocate or unshare
memory as a 'guest' lookup for the purposes of:
 - detecting the highest pod gfn populated; and
 - crashing the guest on access to a broken page
which were the only things this was used for.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r da72de35e4a2 -r 7a439281b8ee xen/arch/x86/hvm/emulate.c
--- a/xen/arch/x86/hvm/emulate.c	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/arch/x86/hvm/emulate.c	Thu Mar 15 11:41:11 2012 +0000
@@ -716,7 +716,7 @@
 
     get_two_gfns(current->domain, sgpa >> PAGE_SHIFT, &sp2mt, NULL, NULL,
                  current->domain, dgpa >> PAGE_SHIFT, &dp2mt, NULL, NULL,
-                 p2m_guest, &tg);
+                 p2m_alloc, &tg);
 
     if ( !p2m_is_ram(sp2mt) && !p2m_is_grant(sp2mt) )
     {
diff -r da72de35e4a2 -r 7a439281b8ee xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Mar 15 11:41:11 2012 +0000
@@ -1269,7 +1269,8 @@
     }
 
     p2m = p2m_get_hostp2m(v->domain);
-    mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, p2m_guest, NULL);
+    mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 
+                              access_w ? p2m_unshare : p2m_alloc, NULL);
 
     /* Check access permissions first, then handle faults */
     if ( mfn_x(mfn) != INVALID_MFN )
diff -r da72de35e4a2 -r 7a439281b8ee xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/arch/x86/hvm/svm/svm.c	Thu Mar 15 11:41:11 2012 +0000
@@ -1287,7 +1287,7 @@
     if ( p2m == NULL )
         p2m = p2m_get_p2m(v);
     /* Everything else is an error. */
-    mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, p2m_guest, NULL);
+    mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, p2m_query, NULL);
     __put_gfn(p2m, gfn);
     gdprintk(XENLOG_ERR,
          "SVM violation gpa %#"PRIpaddr", mfn %#lx, type %i\n",
diff -r da72de35e4a2 -r 7a439281b8ee xen/arch/x86/mm/p2m-pod.c
--- a/xen/arch/x86/mm/p2m-pod.c	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/arch/x86/mm/p2m-pod.c	Thu Mar 15 11:41:11 2012 +0000
@@ -1023,7 +1023,7 @@
     }
 
     /* Keep track of the highest gfn demand-populated by a guest fault */
-    if ( q == p2m_guest && gfn > p2m->pod.max_guest )
+    if ( gfn > p2m->pod.max_guest )
         p2m->pod.max_guest = gfn;
 
     if ( p2m->pod.count == 0 )
diff -r da72de35e4a2 -r 7a439281b8ee xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:41:11 2012 +0000
@@ -183,7 +183,7 @@
     {
         /* Return invalid_mfn to avoid caller's access */
         mfn = _mfn(INVALID_MFN);
-        if (q == p2m_guest)
+        if (q != p2m_query)
             domain_crash(p2m->domain);
     }
 #endif
diff -r da72de35e4a2 -r 7a439281b8ee xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/arch/x86/mm/shadow/multi.c	Thu Mar 15 11:41:11 2012 +0000
@@ -3189,7 +3189,7 @@
 
     /* What mfn is the guest trying to access? */
     gfn = guest_l1e_get_gfn(gw.l1e);
-    gmfn = get_gfn_guest(d, gfn, &p2mt);
+    gmfn = get_gfn(d, gfn, &p2mt);
 
     if ( shadow_mode_refcounts(d) && 
          ((!p2m_is_valid(p2mt) && !p2m_is_grant(p2mt)) ||
@@ -4840,7 +4840,7 @@
 
     /* Translate the GFN to an MFN */
     ASSERT(!paging_locked_by_me(v->domain));
-    mfn = get_gfn_guest(v->domain, _gfn(gfn), &p2mt);
+    mfn = get_gfn(v->domain, _gfn(gfn), &p2mt);
         
     if ( p2m_is_readonly(p2mt) )
     {
diff -r da72de35e4a2 -r 7a439281b8ee xen/arch/x86/mm/shadow/types.h
--- a/xen/arch/x86/mm/shadow/types.h	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/arch/x86/mm/shadow/types.h	Thu Mar 15 11:41:11 2012 +0000
@@ -194,8 +194,6 @@
  /* Override get_gfn to work with gfn_t */
 #undef get_gfn_query
 #define get_gfn_query(d, g, t) get_gfn_type((d), gfn_x(g), (t), p2m_query)
-#undef get_gfn_guest
-#define get_gfn_guest(d, g, t) get_gfn_type((d), gfn_x(g), (t), p2m_guest)
 
 /* The shadow types needed for the various levels. */
 
diff -r da72de35e4a2 -r 7a439281b8ee xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/include/asm-x86/p2m.h	Thu Mar 15 11:41:11 2012 +0000
@@ -116,11 +116,11 @@
     /* NOTE: Assumed to be only 4 bits right now */
 } p2m_access_t;
 
+/* Modifiers to the query */
 typedef enum {
     p2m_query,              /* Do not populate a PoD entries      */
     p2m_alloc,              /* Automatically populate PoD entries */
     p2m_unshare,            /* Break c-o-w sharing; implies alloc */
-    p2m_guest,              /* Guest demand-fault; implies alloc  */
 } p2m_query_t;
 
 /* We use bitmaps and maks to handle groups of types */
@@ -334,7 +334,6 @@
  * lock held. */
 #define get_gfn(d, g, t)         get_gfn_type((d), (g), (t), p2m_alloc)
 #define get_gfn_query(d, g, t)   get_gfn_type((d), (g), (t), p2m_query)
-#define get_gfn_guest(d, g, t)   get_gfn_type((d), (g), (t), p2m_guest)
 #define get_gfn_unshare(d, g, t) get_gfn_type((d), (g), (t), p2m_unshare)
 
 /* Compatibility function exporting the old untyped interface */

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Oqz-0004HU-1r; Fri, 16 Mar 2012 04:33: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 1S8Oqy-000456-15
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:24 +0000
Received: from [85.158.143.35:55141] by server-2.bemta-4.messagelabs.com id
	00/D6-17550-392C26F4; Fri, 16 Mar 2012 04:33:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-21.messagelabs.com!1331872401!14064758!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24443 invoked from network); 16 Mar 2012 04:33:22 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33: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 1S8Oqv-0005KQ-6X
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqv-0002Pl-5a
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:21 +0000
Message-Id: <E1S8Oqv-0002Pl-5a@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: remove 'p2m_guest' lookup
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331811671 0
# Node ID 7a439281b8ee5aef0b495e191fab7c8d0e46e4be
# Parent  da72de35e4a271f1faacd8e712c284ed8cd846a8
x86/mm: remove 'p2m_guest' lookup type.

It was neither consistently used by callers nor correctly handled by the
lookup code.  Instead, treat any lookup that might allocate or unshare
memory as a 'guest' lookup for the purposes of:
 - detecting the highest pod gfn populated; and
 - crashing the guest on access to a broken page
which were the only things this was used for.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r da72de35e4a2 -r 7a439281b8ee xen/arch/x86/hvm/emulate.c
--- a/xen/arch/x86/hvm/emulate.c	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/arch/x86/hvm/emulate.c	Thu Mar 15 11:41:11 2012 +0000
@@ -716,7 +716,7 @@
 
     get_two_gfns(current->domain, sgpa >> PAGE_SHIFT, &sp2mt, NULL, NULL,
                  current->domain, dgpa >> PAGE_SHIFT, &dp2mt, NULL, NULL,
-                 p2m_guest, &tg);
+                 p2m_alloc, &tg);
 
     if ( !p2m_is_ram(sp2mt) && !p2m_is_grant(sp2mt) )
     {
diff -r da72de35e4a2 -r 7a439281b8ee xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Mar 15 11:41:11 2012 +0000
@@ -1269,7 +1269,8 @@
     }
 
     p2m = p2m_get_hostp2m(v->domain);
-    mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, p2m_guest, NULL);
+    mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 
+                              access_w ? p2m_unshare : p2m_alloc, NULL);
 
     /* Check access permissions first, then handle faults */
     if ( mfn_x(mfn) != INVALID_MFN )
diff -r da72de35e4a2 -r 7a439281b8ee xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/arch/x86/hvm/svm/svm.c	Thu Mar 15 11:41:11 2012 +0000
@@ -1287,7 +1287,7 @@
     if ( p2m == NULL )
         p2m = p2m_get_p2m(v);
     /* Everything else is an error. */
-    mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, p2m_guest, NULL);
+    mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, p2m_query, NULL);
     __put_gfn(p2m, gfn);
     gdprintk(XENLOG_ERR,
          "SVM violation gpa %#"PRIpaddr", mfn %#lx, type %i\n",
diff -r da72de35e4a2 -r 7a439281b8ee xen/arch/x86/mm/p2m-pod.c
--- a/xen/arch/x86/mm/p2m-pod.c	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/arch/x86/mm/p2m-pod.c	Thu Mar 15 11:41:11 2012 +0000
@@ -1023,7 +1023,7 @@
     }
 
     /* Keep track of the highest gfn demand-populated by a guest fault */
-    if ( q == p2m_guest && gfn > p2m->pod.max_guest )
+    if ( gfn > p2m->pod.max_guest )
         p2m->pod.max_guest = gfn;
 
     if ( p2m->pod.count == 0 )
diff -r da72de35e4a2 -r 7a439281b8ee xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:41:11 2012 +0000
@@ -183,7 +183,7 @@
     {
         /* Return invalid_mfn to avoid caller's access */
         mfn = _mfn(INVALID_MFN);
-        if (q == p2m_guest)
+        if (q != p2m_query)
             domain_crash(p2m->domain);
     }
 #endif
diff -r da72de35e4a2 -r 7a439281b8ee xen/arch/x86/mm/shadow/multi.c
--- a/xen/arch/x86/mm/shadow/multi.c	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/arch/x86/mm/shadow/multi.c	Thu Mar 15 11:41:11 2012 +0000
@@ -3189,7 +3189,7 @@
 
     /* What mfn is the guest trying to access? */
     gfn = guest_l1e_get_gfn(gw.l1e);
-    gmfn = get_gfn_guest(d, gfn, &p2mt);
+    gmfn = get_gfn(d, gfn, &p2mt);
 
     if ( shadow_mode_refcounts(d) && 
          ((!p2m_is_valid(p2mt) && !p2m_is_grant(p2mt)) ||
@@ -4840,7 +4840,7 @@
 
     /* Translate the GFN to an MFN */
     ASSERT(!paging_locked_by_me(v->domain));
-    mfn = get_gfn_guest(v->domain, _gfn(gfn), &p2mt);
+    mfn = get_gfn(v->domain, _gfn(gfn), &p2mt);
         
     if ( p2m_is_readonly(p2mt) )
     {
diff -r da72de35e4a2 -r 7a439281b8ee xen/arch/x86/mm/shadow/types.h
--- a/xen/arch/x86/mm/shadow/types.h	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/arch/x86/mm/shadow/types.h	Thu Mar 15 11:41:11 2012 +0000
@@ -194,8 +194,6 @@
  /* Override get_gfn to work with gfn_t */
 #undef get_gfn_query
 #define get_gfn_query(d, g, t) get_gfn_type((d), gfn_x(g), (t), p2m_query)
-#undef get_gfn_guest
-#define get_gfn_guest(d, g, t) get_gfn_type((d), gfn_x(g), (t), p2m_guest)
 
 /* The shadow types needed for the various levels. */
 
diff -r da72de35e4a2 -r 7a439281b8ee xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Mar 15 11:40:51 2012 +0000
+++ b/xen/include/asm-x86/p2m.h	Thu Mar 15 11:41:11 2012 +0000
@@ -116,11 +116,11 @@
     /* NOTE: Assumed to be only 4 bits right now */
 } p2m_access_t;
 
+/* Modifiers to the query */
 typedef enum {
     p2m_query,              /* Do not populate a PoD entries      */
     p2m_alloc,              /* Automatically populate PoD entries */
     p2m_unshare,            /* Break c-o-w sharing; implies alloc */
-    p2m_guest,              /* Guest demand-fault; implies alloc  */
 } p2m_query_t;
 
 /* We use bitmaps and maks to handle groups of types */
@@ -334,7 +334,6 @@
  * lock held. */
 #define get_gfn(d, g, t)         get_gfn_type((d), (g), (t), p2m_alloc)
 #define get_gfn_query(d, g, t)   get_gfn_type((d), (g), (t), p2m_query)
-#define get_gfn_guest(d, g, t)   get_gfn_type((d), (g), (t), p2m_guest)
 #define get_gfn_unshare(d, g, t) get_gfn_type((d), (g), (t), p2m_unshare)
 
 /* Compatibility function exporting the old untyped interface */

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Or0-0004Jd-59; Fri, 16 Mar 2012 04:33: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 1S8Oqz-00048P-13
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:25 +0000
Received: from [85.158.143.35:55178] by server-1.bemta-4.messagelabs.com id
	B3/67-20925-492C26F4; Fri, 16 Mar 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1331872402!12154095!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14848 invoked from network); 16 Mar 2012 04:33:23 -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;
	16 Mar 2012 04:33: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 1S8Oqw-0005KW-AH
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqw-0002Qi-9N
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:22 +0000
Message-Id: <E1S8Oqw-0002Qi-9N@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: tidy up get_two_gfns() a
	little
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331812047 0
# Node ID 4da1453ed61c28a366162b49b2f59f62e070a799
# Parent  09ce2e4bcce5e4ffafb412e6fa4413560e89af94
x86/mm: tidy up get_two_gfns() a little

Move some more repeated code into the macro, and delete the macro after
we're done.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 09ce2e4bcce5 -r 4da1453ed61c xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Mar 15 11:46:54 2012 +0000
+++ b/xen/include/asm-x86/p2m.h	Thu Mar 15 11:47:27 2012 +0000
@@ -385,13 +385,6 @@
     unsigned long   second_gfn;
 };
 
-#define assign_pointers(dest, source)                                        \
-do {                                                                         \
-    dest ## _mfn = (source ## mfn) ? (source ## mfn) : &__ ## dest ## _mfn;  \
-    dest ## _a   = (source ## a)   ? (source ## a)   : &__ ## dest ## _a;    \
-    dest ## _t   = (source ## t)   ? (source ## t)   : &__ ## dest ## _t;    \
-} while(0)
-
 /* Returns mfn, type and access for potential caller consumption, but any
  * of those can be NULL */
 static inline void get_two_gfns(struct domain *rd, unsigned long rgfn,
@@ -399,28 +392,32 @@
         unsigned long lgfn, p2m_type_t *lt, p2m_access_t *la, mfn_t *lmfn,
         p2m_query_t q, struct two_gfns *rval)
 {
-    mfn_t           *first_mfn, *second_mfn, __first_mfn, __second_mfn;
-    p2m_access_t    *first_a, *second_a, __first_a, __second_a;
-    p2m_type_t      *first_t, *second_t, __first_t, __second_t;
+    mfn_t           *first_mfn, *second_mfn, scratch_mfn;
+    p2m_access_t    *first_a, *second_a, scratch_a;
+    p2m_type_t      *first_t, *second_t, scratch_t;
 
     /* Sort by domain, if same domain by gfn */
+
+#define assign_pointers(dest, source)                   \
+do {                                                    \
+    rval-> dest ## _domain = source ## d;               \
+    rval-> dest ## _gfn = source ## gfn;                \
+    dest ## _mfn = (source ## mfn) ?: &scratch_mfn;     \
+    dest ## _a   = (source ## a)   ?: &scratch_a;       \
+    dest ## _t   = (source ## t)   ?: &scratch_t;       \
+} while (0)
+
     if ( (rd->domain_id <= ld->domain_id) || ((rd == ld) && (rgfn <= lgfn)) )
     {
-        rval->first_domain  = rd;
-        rval->first_gfn     = rgfn;
-        rval->second_domain = ld;
-        rval->second_gfn    = lgfn;
         assign_pointers(first, r);
         assign_pointers(second, l);
     } else {
-        rval->first_domain  = ld;
-        rval->first_gfn     = lgfn;
-        rval->second_domain = rd;
-        rval->second_gfn    = rgfn;
         assign_pointers(first, l);
         assign_pointers(second, r);
     }
 
+#undef assign_pointers
+
     /* Now do the gets */
     *first_mfn  = get_gfn_type_access(p2m_get_hostp2m(rval->first_domain), 
                                       rval->first_gfn, first_t, first_a, q, NULL);

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Or0-0004Jd-59; Fri, 16 Mar 2012 04:33: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 1S8Oqz-00048P-13
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:25 +0000
Received: from [85.158.143.35:55178] by server-1.bemta-4.messagelabs.com id
	B3/67-20925-492C26F4; Fri, 16 Mar 2012 04:33:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1331872402!12154095!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14848 invoked from network); 16 Mar 2012 04:33:23 -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;
	16 Mar 2012 04:33: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 1S8Oqw-0005KW-AH
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqw-0002Qi-9N
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:22 +0000
Message-Id: <E1S8Oqw-0002Qi-9N@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: tidy up get_two_gfns() a
	little
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331812047 0
# Node ID 4da1453ed61c28a366162b49b2f59f62e070a799
# Parent  09ce2e4bcce5e4ffafb412e6fa4413560e89af94
x86/mm: tidy up get_two_gfns() a little

Move some more repeated code into the macro, and delete the macro after
we're done.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 09ce2e4bcce5 -r 4da1453ed61c xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Mar 15 11:46:54 2012 +0000
+++ b/xen/include/asm-x86/p2m.h	Thu Mar 15 11:47:27 2012 +0000
@@ -385,13 +385,6 @@
     unsigned long   second_gfn;
 };
 
-#define assign_pointers(dest, source)                                        \
-do {                                                                         \
-    dest ## _mfn = (source ## mfn) ? (source ## mfn) : &__ ## dest ## _mfn;  \
-    dest ## _a   = (source ## a)   ? (source ## a)   : &__ ## dest ## _a;    \
-    dest ## _t   = (source ## t)   ? (source ## t)   : &__ ## dest ## _t;    \
-} while(0)
-
 /* Returns mfn, type and access for potential caller consumption, but any
  * of those can be NULL */
 static inline void get_two_gfns(struct domain *rd, unsigned long rgfn,
@@ -399,28 +392,32 @@
         unsigned long lgfn, p2m_type_t *lt, p2m_access_t *la, mfn_t *lmfn,
         p2m_query_t q, struct two_gfns *rval)
 {
-    mfn_t           *first_mfn, *second_mfn, __first_mfn, __second_mfn;
-    p2m_access_t    *first_a, *second_a, __first_a, __second_a;
-    p2m_type_t      *first_t, *second_t, __first_t, __second_t;
+    mfn_t           *first_mfn, *second_mfn, scratch_mfn;
+    p2m_access_t    *first_a, *second_a, scratch_a;
+    p2m_type_t      *first_t, *second_t, scratch_t;
 
     /* Sort by domain, if same domain by gfn */
+
+#define assign_pointers(dest, source)                   \
+do {                                                    \
+    rval-> dest ## _domain = source ## d;               \
+    rval-> dest ## _gfn = source ## gfn;                \
+    dest ## _mfn = (source ## mfn) ?: &scratch_mfn;     \
+    dest ## _a   = (source ## a)   ?: &scratch_a;       \
+    dest ## _t   = (source ## t)   ?: &scratch_t;       \
+} while (0)
+
     if ( (rd->domain_id <= ld->domain_id) || ((rd == ld) && (rgfn <= lgfn)) )
     {
-        rval->first_domain  = rd;
-        rval->first_gfn     = rgfn;
-        rval->second_domain = ld;
-        rval->second_gfn    = lgfn;
         assign_pointers(first, r);
         assign_pointers(second, l);
     } else {
-        rval->first_domain  = ld;
-        rval->first_gfn     = lgfn;
-        rval->second_domain = rd;
-        rval->second_gfn    = rgfn;
         assign_pointers(first, l);
         assign_pointers(second, r);
     }
 
+#undef assign_pointers
+
     /* Now do the gets */
     *first_mfn  = get_gfn_type_access(p2m_get_hostp2m(rval->first_domain), 
                                       rval->first_gfn, first_t, first_a, q, NULL);

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Or1-0004Le-Dv; Fri, 16 Mar 2012 04:33:27 +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 1S8Oqz-000456-EB
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:25 +0000
Received: from [85.158.143.35:55196] by server-2.bemta-4.messagelabs.com id
	71/D6-17550-592C26F4; Fri, 16 Mar 2012 04:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1331872402!11855014!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23863 invoked from network); 16 Mar 2012 04:33:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33: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 1S8Oqv-0005KT-PO
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqv-0002QF-ON
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:21 +0000
Message-Id: <E1S8Oqv-0002QF-ON@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: make 'query type' argument
	to get_gfn into a set of flags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331812014 0
# Node ID 09ce2e4bcce5e4ffafb412e6fa4413560e89af94
# Parent  7a439281b8ee5aef0b495e191fab7c8d0e46e4be
x86/mm: make 'query type' argument to get_gfn into a set of flags

Having an enum for this won't work if we want to add any orthogonal
options to it -- the existing code is only correct (after the removal of
p2m_guest in the previous patch) because there are no tests anywhere for
'== p2m_alloc', only for '!= p2m_query' and '== p2m_unshare'.

Replace it with a set of flags.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/hvm/emulate.c
--- a/xen/arch/x86/hvm/emulate.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/hvm/emulate.c	Thu Mar 15 11:46:54 2012 +0000
@@ -716,7 +716,7 @@
 
     get_two_gfns(current->domain, sgpa >> PAGE_SHIFT, &sp2mt, NULL, NULL,
                  current->domain, dgpa >> PAGE_SHIFT, &dp2mt, NULL, NULL,
-                 p2m_alloc, &tg);
+                 P2M_ALLOC, &tg);
 
     if ( !p2m_is_ram(sp2mt) && !p2m_is_grant(sp2mt) )
     {
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Mar 15 11:46:54 2012 +0000
@@ -1270,7 +1270,7 @@
 
     p2m = p2m_get_hostp2m(v->domain);
     mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 
-                              access_w ? p2m_unshare : p2m_alloc, NULL);
+                              P2M_ALLOC | (access_w ? P2M_UNSHARE : 0), NULL);
 
     /* Check access permissions first, then handle faults */
     if ( mfn_x(mfn) != INVALID_MFN )
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/hvm/svm/svm.c	Thu Mar 15 11:46:54 2012 +0000
@@ -1265,7 +1265,7 @@
         p2m = p2m_get_p2m(v);
         _d.gpa = gpa;
         _d.qualification = 0;
-        mfn = get_gfn_type_access(p2m, gfn, &_d.p2mt, &p2ma, p2m_query, NULL);
+        mfn = get_gfn_type_access(p2m, gfn, &_d.p2mt, &p2ma, 0, NULL);
         __put_gfn(p2m, gfn);
         _d.mfn = mfn_x(mfn);
         
@@ -1287,7 +1287,7 @@
     if ( p2m == NULL )
         p2m = p2m_get_p2m(v);
     /* Everything else is an error. */
-    mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, p2m_query, NULL);
+    mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 0, NULL);
     __put_gfn(p2m, gfn);
     gdprintk(XENLOG_ERR,
          "SVM violation gpa %#"PRIpaddr", mfn %#lx, type %i\n",
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/guest_walk.c
--- a/xen/arch/x86/mm/guest_walk.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/guest_walk.c	Thu Mar 15 11:46:54 2012 +0000
@@ -98,7 +98,8 @@
     void *map;
 
     /* Translate the gfn, unsharing if shared */
-    *mfn = get_gfn_type_access(p2m, gfn_x(gfn), p2mt, &p2ma, p2m_unshare, NULL);
+    *mfn = get_gfn_type_access(p2m, gfn_x(gfn), p2mt, &p2ma, 
+                               P2M_ALLOC | P2M_UNSHARE, NULL);
     if ( p2m_is_paging(*p2mt) )
     {
         ASSERT(!p2m_is_nestedp2m(p2m));
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/hap/guest_walk.c
--- a/xen/arch/x86/mm/hap/guest_walk.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/hap/guest_walk.c	Thu Mar 15 11:46:54 2012 +0000
@@ -60,7 +60,8 @@
 
     /* Get the top-level table's MFN */
     top_gfn = cr3 >> PAGE_SHIFT;
-    top_mfn = get_gfn_type_access(p2m, top_gfn, &p2mt, &p2ma, p2m_unshare, NULL);
+    top_mfn = get_gfn_type_access(p2m, top_gfn, &p2mt, &p2ma, 
+                                  P2M_ALLOC | P2M_UNSHARE, NULL);
     if ( p2m_is_paging(p2mt) )
     {
         ASSERT(!p2m_is_nestedp2m(p2m));
@@ -96,7 +97,8 @@
     if ( missing == 0 )
     {
         gfn_t gfn = guest_l1e_get_gfn(gw.l1e);
-        (void)get_gfn_type_access(p2m, gfn_x(gfn), &p2mt, &p2ma, p2m_unshare, NULL); 
+        (void)get_gfn_type_access(p2m, gfn_x(gfn), &p2mt, &p2ma,
+                                  P2M_ALLOC | P2M_UNSHARE, NULL); 
         if ( p2m_is_paging(p2mt) )
         {
             ASSERT(!p2m_is_nestedp2m(p2m));
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/hap/nested_hap.c
--- a/xen/arch/x86/mm/hap/nested_hap.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/hap/nested_hap.c	Thu Mar 15 11:46:54 2012 +0000
@@ -150,7 +150,7 @@
 
     /* walk L0 P2M table */
     mfn = get_gfn_type_access(p2m, L1_gpa >> PAGE_SHIFT, &p2mt, &p2ma, 
-                              p2m_query, page_order);
+                              0, page_order);
 
     rc = NESTEDHVM_PAGEFAULT_MMIO;
     if ( p2m_is_mmio(p2mt) )
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Mar 15 11:46:54 2012 +0000
@@ -729,7 +729,7 @@
 
     get_two_gfns(sd, sgfn, &smfn_type, NULL, &smfn,
                  cd, cgfn, &cmfn_type, NULL, &cmfn,
-                 p2m_query, &tg);
+                 0, &tg);
 
     /* This tricky business is to avoid two callers deadlocking if 
      * grabbing pages in opposite client/source order */
@@ -844,7 +844,7 @@
 
     get_two_gfns(sd, sgfn, &smfn_type, NULL, &smfn,
                  cd, cgfn, &cmfn_type, &a, &cmfn,
-                 p2m_query, &tg);
+                 0, &tg);
 
     /* Get the source shared page, check and lock */
     ret = XENMEM_SHARING_OP_S_HANDLE_INVALID;
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/p2m-ept.c
--- a/xen/arch/x86/mm/p2m-ept.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/p2m-ept.c	Thu Mar 15 11:46:54 2012 +0000
@@ -514,7 +514,7 @@
             goto out;
         else if ( ret == GUEST_TABLE_POD_PAGE )
         {
-            if ( q == p2m_query )
+            if ( !(q & P2M_ALLOC) )
             {
                 *t = p2m_populate_on_demand;
                 goto out;
@@ -541,7 +541,7 @@
 
     if ( ept_entry->sa_p2mt == p2m_populate_on_demand )
     {
-        if ( q == p2m_query )
+        if ( !(q & P2M_ALLOC) )
         {
             *t = p2m_populate_on_demand;
             goto out;
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/p2m-pod.c
--- a/xen/arch/x86/mm/p2m-pod.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/p2m-pod.c	Thu Mar 15 11:46:54 2012 +0000
@@ -529,7 +529,7 @@
         p2m_access_t a;
         p2m_type_t t;
 
-        (void)p2m->get_entry(p2m, gpfn + i, &t, &a, p2m_query, NULL);
+        (void)p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL);
 
         if ( t == p2m_populate_on_demand )
             pod++;
@@ -570,7 +570,7 @@
         p2m_type_t t;
         p2m_access_t a;
 
-        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, p2m_query, NULL);
+        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL);
         if ( t == p2m_populate_on_demand )
         {
             set_p2m_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid, p2m->default_access);
@@ -656,7 +656,7 @@
     for ( i=0; i<SUPERPAGE_PAGES; i++ )
     {
         p2m_access_t a; 
-        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, p2m_query, NULL);
+        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, NULL);
 
         if ( i == 0 )
         {
@@ -786,7 +786,7 @@
     for ( i=0; i<count; i++ )
     {
         p2m_access_t a;
-        mfns[i] = p2m->get_entry(p2m, gfns[i], types + i, &a, p2m_query, NULL);
+        mfns[i] = p2m->get_entry(p2m, gfns[i], types + i, &a, 0, NULL);
         /* If this is ram, and not a pagetable or from the xen heap, and probably not mapped
            elsewhere, map it; otherwise, skip. */
         if ( p2m_is_ram(types[i])
@@ -932,7 +932,7 @@
     for ( i=p2m->pod.reclaim_single; i > 0 ; i-- )
     {
         p2m_access_t a;
-        (void)p2m->get_entry(p2m, i, &t, &a, p2m_query, NULL);
+        (void)p2m->get_entry(p2m, i, &t, &a, 0, NULL);
         if ( p2m_is_ram(t) )
         {
             gfns[j] = i;
@@ -1130,7 +1130,7 @@
     for ( i = 0; i < (1UL << order); i++ )
     {
         p2m_access_t a;
-        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, p2m_query, NULL);
+        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
         if ( p2m_is_ram(ot) )
         {
             printk("%s: gfn_to_mfn returned type %d!\n",
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/p2m-pt.c	Thu Mar 15 11:46:54 2012 +0000
@@ -513,7 +513,7 @@
              (p2m_flags_to_type(l3e_get_flags(l3e)) == p2m_populate_on_demand) )
         {
             /* The read has succeeded, so we know that mapping exists */
-            if ( q != p2m_query )
+            if ( q & P2M_ALLOC )
             {
                 if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_1G, q) )
                     goto pod_retry_l3;
@@ -565,7 +565,7 @@
         {
             /* The read has succeeded, so we know that the mapping
              * exits at this point.  */
-            if ( q != p2m_query )
+            if ( q & P2M_ALLOC )
             {
                 if ( !p2m_pod_demand_populate(p2m, gfn, 
                                                 PAGE_ORDER_2M, q) )
@@ -623,7 +623,7 @@
         {
             /* The read has succeeded, so we know that the mapping
              * exits at this point.  */
-            if ( q != p2m_query )
+            if ( q & P2M_ALLOC )
             {
                 if ( !p2m_pod_demand_populate(p2m, gfn, 
                                                 PAGE_ORDER_4K, q) )
@@ -714,7 +714,7 @@
         {
             if ( p2m_flags_to_type(l3e_get_flags(*l3e)) == p2m_populate_on_demand )
             {
-                if ( q != p2m_query )
+                if ( q & P2M_ALLOC )
                 {
                     if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_1G, q) )
                         goto pod_retry_l3;
@@ -753,7 +753,7 @@
         /* PoD: Try to populate a 2-meg chunk */
         if ( p2m_flags_to_type(l2e_get_flags(*l2e)) == p2m_populate_on_demand )
         {
-            if ( q != p2m_query ) {
+            if ( q & P2M_ALLOC ) {
                 if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_2M, q) )
                     goto pod_retry_l2;
             } else
@@ -786,7 +786,7 @@
         /* PoD: Try to populate */
         if ( p2m_flags_to_type(l1e_get_flags(*l1e)) == p2m_populate_on_demand )
         {
-            if ( q != p2m_query ) {
+            if ( q & P2M_ALLOC ) {
                 if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_4K, q) )
                     goto pod_retry_l1;
             } else
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:46:54 2012 +0000
@@ -151,6 +151,10 @@
 {
     mfn_t mfn;
 
+    /* Unshare makes no sense withuot populate. */
+    if ( q & P2M_UNSHARE )
+        q |= P2M_ALLOC;
+
     if ( !p2m || !paging_mode_translate(p2m->domain) )
     {
         /* Not necessarily true, but for non-translated guests, we claim
@@ -167,7 +171,7 @@
     mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order);
 
 #ifdef __x86_64__
-    if ( q == p2m_unshare && p2m_is_shared(*t) )
+    if ( (q & P2M_UNSHARE) && p2m_is_shared(*t) )
     {
         ASSERT(!p2m_is_nestedp2m(p2m));
         /* Try to unshare. If we fail, communicate ENOMEM without
@@ -183,7 +187,7 @@
     {
         /* Return invalid_mfn to avoid caller's access */
         mfn = _mfn(INVALID_MFN);
-        if (q != p2m_query)
+        if ( q & P2M_ALLOC )
             domain_crash(p2m->domain);
     }
 #endif
@@ -370,7 +374,7 @@
     for ( gfn=0; gfn < p2m->max_mapped_pfn; gfn++ )
     {
         p2m_access_t a;
-        mfn = p2m->get_entry(p2m, gfn, &t, &a, p2m_query, NULL);
+        mfn = p2m->get_entry(p2m, gfn, &t, &a, 0, NULL);
         if ( mfn_valid(mfn) && (t == p2m_ram_shared) )
         {
             ASSERT(!p2m_is_nestedp2m(p2m));
@@ -441,7 +445,7 @@
     {
         for ( i = 0; i < (1UL << page_order); i++ )
         {
-            mfn_return = p2m->get_entry(p2m, gfn + i, &t, &a, p2m_query, NULL);
+            mfn_return = p2m->get_entry(p2m, gfn + i, &t, &a, 0, NULL);
             if ( !p2m_is_grant(t) && !p2m_is_shared(t) )
                 set_gpfn_from_mfn(mfn+i, INVALID_M2P_ENTRY);
             ASSERT( !p2m_is_valid(t) || mfn + i == mfn_x(mfn_return) );
@@ -503,7 +507,7 @@
     /* First, remove m->p mappings for existing p->m mappings */
     for ( i = 0; i < (1UL << page_order); i++ )
     {
-        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, p2m_query, NULL);
+        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
 #ifdef __x86_64__
         if ( p2m_is_shared(ot) )
         {
@@ -528,7 +532,7 @@
                 (void)mem_sharing_notify_enomem(p2m->domain, gfn + i, 0);
                 return rc;
             }
-            omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, p2m_query, NULL);
+            omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
             ASSERT(!p2m_is_shared(ot));
         }
 #endif /* __x86_64__ */
@@ -577,7 +581,7 @@
              * address */
             P2M_DEBUG("aliased! mfn=%#lx, old gfn=%#lx, new gfn=%#lx\n",
                       mfn + i, ogfn, gfn + i);
-            omfn = p2m->get_entry(p2m, ogfn, &ot, &a, p2m_query, NULL);
+            omfn = p2m->get_entry(p2m, ogfn, &ot, &a, 0, NULL);
             if ( p2m_is_ram(ot) && !p2m_is_paged(ot) )
             {
                 ASSERT(mfn_valid(omfn));
@@ -636,7 +640,7 @@
 
     gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, &pt, &a, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &pt, &a, 0, NULL);
     if ( pt == ot )
         set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, nt, p2m->default_access);
 
@@ -664,7 +668,7 @@
 
     for ( gfn = start; gfn < end; gfn++ )
     {
-        mfn = p2m->get_entry(p2m, gfn, &pt, &a, p2m_query, NULL);
+        mfn = p2m->get_entry(p2m, gfn, &pt, &a, 0, NULL);
         if ( pt == ot )
             set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, nt, p2m->default_access);
     }
@@ -690,7 +694,7 @@
         return 0;
 
     gfn_lock(p2m, gfn, 0);
-    omfn = p2m->get_entry(p2m, gfn, &ot, &a, p2m_query, NULL);
+    omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL);
     if ( p2m_is_grant(ot) )
     {
         p2m_unlock(p2m);
@@ -726,7 +730,7 @@
         return 0;
 
     gfn_lock(p2m, gfn, 0);
-    mfn = p2m->get_entry(p2m, gfn, &t, &a, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &t, &a, 0, NULL);
 
     /* Do not use mfn_valid() here as it will usually fail for MMIO pages. */
     if ( (INVALID_MFN == mfn_x(mfn)) || (t != p2m_mmio_direct) )
@@ -757,7 +761,7 @@
         return 0;
 
     gfn_lock(p2m, gfn, 0);
-    omfn = p2m->get_entry(p2m, gfn, &ot, &a, p2m_query, NULL);
+    omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL);
     /* At the moment we only allow p2m change if gfn has already been made
      * sharable first */
     ASSERT(p2m_is_shared(ot));
@@ -809,7 +813,7 @@
 
     gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
 
     /* Check if mfn is valid */
     if ( !mfn_valid(mfn) )
@@ -872,7 +876,7 @@
     gfn_lock(p2m, gfn, 0);
 
     /* Get mfn */
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
     if ( unlikely(!mfn_valid(mfn)) )
         goto out;
 
@@ -999,7 +1003,7 @@
 
     /* Fix p2m mapping */
     gfn_lock(p2m, gfn, 0);
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
     /* Allow only nominated or evicted pages to enter page-in path */
     if ( p2mt == p2m_ram_paging_out || p2mt == p2m_ram_paged )
     {
@@ -1061,7 +1065,7 @@
 
     gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
 
     ret = -ENOENT;
     /* Allow missing pages */
@@ -1154,7 +1158,7 @@
         if ( !(rsp.flags & MEM_EVENT_FLAG_DROP_PAGE) )
         {
             gfn_lock(p2m, rsp.gfn, 0);
-            mfn = p2m->get_entry(p2m, rsp.gfn, &p2mt, &a, p2m_query, NULL);
+            mfn = p2m->get_entry(p2m, rsp.gfn, &p2mt, &a, 0, NULL);
             /* Allow only pages which were prepared properly, or pages which
              * were nominated but not evicted */
             if ( mfn_valid(mfn) && (p2mt == p2m_ram_paging_in) )
@@ -1187,7 +1191,7 @@
 
     /* First, handle rx2rw conversion automatically */
     gfn_lock(p2m, gfn, 0);
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &p2ma, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &p2ma, 0, NULL);
 
     if ( access_w && p2ma == p2m_access_rx2rw ) 
     {
@@ -1316,7 +1320,7 @@
     p2m_lock(p2m);
     for ( pfn = start_pfn; pfn < start_pfn + nr; pfn++ )
     {
-        mfn = p2m->get_entry(p2m, pfn, &t, &_a, p2m_query, NULL);
+        mfn = p2m->get_entry(p2m, pfn, &t, &_a, 0, NULL);
         if ( p2m->set_entry(p2m, pfn, mfn, PAGE_ORDER_4K, t, a) == 0 )
         {
             rc = -ENOMEM;
@@ -1357,7 +1361,7 @@
     }
 
     gfn_lock(p2m, gfn, 0);
-    mfn = p2m->get_entry(p2m, pfn, &t, &a, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, pfn, &t, &a, 0, NULL);
     gfn_unlock(p2m, gfn, 0);
 
     if ( mfn_x(mfn) == INVALID_MFN )
@@ -1598,7 +1602,7 @@
             continue;
         }
 
-        p2mfn = get_gfn_type_access(p2m, gfn, &type, &p2ma, p2m_query, NULL);
+        p2mfn = get_gfn_type_access(p2m, gfn, &type, &p2ma, 0, NULL);
         if ( mfn_x(p2mfn) != mfn )
         {
             mpbad++;
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/shadow/types.h
--- a/xen/arch/x86/mm/shadow/types.h	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/shadow/types.h	Thu Mar 15 11:46:54 2012 +0000
@@ -193,7 +193,7 @@
 
  /* Override get_gfn to work with gfn_t */
 #undef get_gfn_query
-#define get_gfn_query(d, g, t) get_gfn_type((d), gfn_x(g), (t), p2m_query)
+#define get_gfn_query(d, g, t) get_gfn_type((d), gfn_x(g), (t), 0)
 
 /* The shadow types needed for the various levels. */
 
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/include/asm-x86/guest_pt.h
--- a/xen/include/asm-x86/guest_pt.h	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/include/asm-x86/guest_pt.h	Thu Mar 15 11:46:54 2012 +0000
@@ -53,7 +53,7 @@
 
 /* Override get_gfn to work with gfn_t */
 #undef get_gfn
-#define get_gfn(d, g, t) get_gfn_type((d), gfn_x(g), (t), p2m_alloc)
+#define get_gfn(d, g, t) get_gfn_type((d), gfn_x(g), (t), P2M_ALLOC)
 
 
 /* Types of the guest's page tables and access functions for them */
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/include/asm-x86/p2m.h	Thu Mar 15 11:46:54 2012 +0000
@@ -117,11 +117,9 @@
 } p2m_access_t;
 
 /* Modifiers to the query */
-typedef enum {
-    p2m_query,              /* Do not populate a PoD entries      */
-    p2m_alloc,              /* Automatically populate PoD entries */
-    p2m_unshare,            /* Break c-o-w sharing; implies alloc */
-} p2m_query_t;
+typedef unsigned int p2m_query_t;
+#define P2M_ALLOC    (1u<<0)   /* Populate PoD and paged-out entries */
+#define P2M_UNSHARE  (1u<<1)   /* Break CoW sharing */
 
 /* We use bitmaps and maks to handle groups of types */
 #define p2m_to_mask(_t) (1UL << (_t))
@@ -332,9 +330,10 @@
  * N.B. get_gfn_query() is the _only_ one guaranteed not to take the
  * p2m lock; none of the others can be called with the p2m or paging
  * lock held. */
-#define get_gfn(d, g, t)         get_gfn_type((d), (g), (t), p2m_alloc)
-#define get_gfn_query(d, g, t)   get_gfn_type((d), (g), (t), p2m_query)
-#define get_gfn_unshare(d, g, t) get_gfn_type((d), (g), (t), p2m_unshare)
+#define get_gfn(d, g, t)         get_gfn_type((d), (g), (t), P2M_ALLOC)
+#define get_gfn_query(d, g, t)   get_gfn_type((d), (g), (t), 0)
+#define get_gfn_unshare(d, g, t) get_gfn_type((d), (g), (t), \
+                                              P2M_ALLOC | P2M_UNSHARE)
 
 /* Compatibility function exporting the old untyped interface */
 static inline unsigned long get_gfn_untyped(struct domain *d, unsigned long gpfn)
@@ -366,8 +365,7 @@
                                            p2m_type_t *t)
 {
     p2m_access_t a;
-    return __get_gfn_type_access(p2m_get_hostp2m(d), gfn, t, &a, 
-                                    p2m_query, NULL, 0);
+    return __get_gfn_type_access(p2m_get_hostp2m(d), gfn, t, &a, 0, NULL, 0);
 }
 
 /* General conversion function from mfn to gfn */

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:27 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:27 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Or1-0004Le-Dv; Fri, 16 Mar 2012 04:33:27 +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 1S8Oqz-000456-EB
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:25 +0000
Received: from [85.158.143.35:55196] by server-2.bemta-4.messagelabs.com id
	71/D6-17550-592C26F4; Fri, 16 Mar 2012 04:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1331872402!11855014!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23863 invoked from network); 16 Mar 2012 04:33:23 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33: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 1S8Oqv-0005KT-PO
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqv-0002QF-ON
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:21 +0000
Message-Id: <E1S8Oqv-0002QF-ON@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:21 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: make 'query type' argument
	to get_gfn into a set of flags
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331812014 0
# Node ID 09ce2e4bcce5e4ffafb412e6fa4413560e89af94
# Parent  7a439281b8ee5aef0b495e191fab7c8d0e46e4be
x86/mm: make 'query type' argument to get_gfn into a set of flags

Having an enum for this won't work if we want to add any orthogonal
options to it -- the existing code is only correct (after the removal of
p2m_guest in the previous patch) because there are no tests anywhere for
'== p2m_alloc', only for '!= p2m_query' and '== p2m_unshare'.

Replace it with a set of flags.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/hvm/emulate.c
--- a/xen/arch/x86/hvm/emulate.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/hvm/emulate.c	Thu Mar 15 11:46:54 2012 +0000
@@ -716,7 +716,7 @@
 
     get_two_gfns(current->domain, sgpa >> PAGE_SHIFT, &sp2mt, NULL, NULL,
                  current->domain, dgpa >> PAGE_SHIFT, &dp2mt, NULL, NULL,
-                 p2m_alloc, &tg);
+                 P2M_ALLOC, &tg);
 
     if ( !p2m_is_ram(sp2mt) && !p2m_is_grant(sp2mt) )
     {
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/hvm/hvm.c	Thu Mar 15 11:46:54 2012 +0000
@@ -1270,7 +1270,7 @@
 
     p2m = p2m_get_hostp2m(v->domain);
     mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 
-                              access_w ? p2m_unshare : p2m_alloc, NULL);
+                              P2M_ALLOC | (access_w ? P2M_UNSHARE : 0), NULL);
 
     /* Check access permissions first, then handle faults */
     if ( mfn_x(mfn) != INVALID_MFN )
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/hvm/svm/svm.c	Thu Mar 15 11:46:54 2012 +0000
@@ -1265,7 +1265,7 @@
         p2m = p2m_get_p2m(v);
         _d.gpa = gpa;
         _d.qualification = 0;
-        mfn = get_gfn_type_access(p2m, gfn, &_d.p2mt, &p2ma, p2m_query, NULL);
+        mfn = get_gfn_type_access(p2m, gfn, &_d.p2mt, &p2ma, 0, NULL);
         __put_gfn(p2m, gfn);
         _d.mfn = mfn_x(mfn);
         
@@ -1287,7 +1287,7 @@
     if ( p2m == NULL )
         p2m = p2m_get_p2m(v);
     /* Everything else is an error. */
-    mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, p2m_query, NULL);
+    mfn = get_gfn_type_access(p2m, gfn, &p2mt, &p2ma, 0, NULL);
     __put_gfn(p2m, gfn);
     gdprintk(XENLOG_ERR,
          "SVM violation gpa %#"PRIpaddr", mfn %#lx, type %i\n",
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/guest_walk.c
--- a/xen/arch/x86/mm/guest_walk.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/guest_walk.c	Thu Mar 15 11:46:54 2012 +0000
@@ -98,7 +98,8 @@
     void *map;
 
     /* Translate the gfn, unsharing if shared */
-    *mfn = get_gfn_type_access(p2m, gfn_x(gfn), p2mt, &p2ma, p2m_unshare, NULL);
+    *mfn = get_gfn_type_access(p2m, gfn_x(gfn), p2mt, &p2ma, 
+                               P2M_ALLOC | P2M_UNSHARE, NULL);
     if ( p2m_is_paging(*p2mt) )
     {
         ASSERT(!p2m_is_nestedp2m(p2m));
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/hap/guest_walk.c
--- a/xen/arch/x86/mm/hap/guest_walk.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/hap/guest_walk.c	Thu Mar 15 11:46:54 2012 +0000
@@ -60,7 +60,8 @@
 
     /* Get the top-level table's MFN */
     top_gfn = cr3 >> PAGE_SHIFT;
-    top_mfn = get_gfn_type_access(p2m, top_gfn, &p2mt, &p2ma, p2m_unshare, NULL);
+    top_mfn = get_gfn_type_access(p2m, top_gfn, &p2mt, &p2ma, 
+                                  P2M_ALLOC | P2M_UNSHARE, NULL);
     if ( p2m_is_paging(p2mt) )
     {
         ASSERT(!p2m_is_nestedp2m(p2m));
@@ -96,7 +97,8 @@
     if ( missing == 0 )
     {
         gfn_t gfn = guest_l1e_get_gfn(gw.l1e);
-        (void)get_gfn_type_access(p2m, gfn_x(gfn), &p2mt, &p2ma, p2m_unshare, NULL); 
+        (void)get_gfn_type_access(p2m, gfn_x(gfn), &p2mt, &p2ma,
+                                  P2M_ALLOC | P2M_UNSHARE, NULL); 
         if ( p2m_is_paging(p2mt) )
         {
             ASSERT(!p2m_is_nestedp2m(p2m));
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/hap/nested_hap.c
--- a/xen/arch/x86/mm/hap/nested_hap.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/hap/nested_hap.c	Thu Mar 15 11:46:54 2012 +0000
@@ -150,7 +150,7 @@
 
     /* walk L0 P2M table */
     mfn = get_gfn_type_access(p2m, L1_gpa >> PAGE_SHIFT, &p2mt, &p2ma, 
-                              p2m_query, page_order);
+                              0, page_order);
 
     rc = NESTEDHVM_PAGEFAULT_MMIO;
     if ( p2m_is_mmio(p2mt) )
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Mar 15 11:46:54 2012 +0000
@@ -729,7 +729,7 @@
 
     get_two_gfns(sd, sgfn, &smfn_type, NULL, &smfn,
                  cd, cgfn, &cmfn_type, NULL, &cmfn,
-                 p2m_query, &tg);
+                 0, &tg);
 
     /* This tricky business is to avoid two callers deadlocking if 
      * grabbing pages in opposite client/source order */
@@ -844,7 +844,7 @@
 
     get_two_gfns(sd, sgfn, &smfn_type, NULL, &smfn,
                  cd, cgfn, &cmfn_type, &a, &cmfn,
-                 p2m_query, &tg);
+                 0, &tg);
 
     /* Get the source shared page, check and lock */
     ret = XENMEM_SHARING_OP_S_HANDLE_INVALID;
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/p2m-ept.c
--- a/xen/arch/x86/mm/p2m-ept.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/p2m-ept.c	Thu Mar 15 11:46:54 2012 +0000
@@ -514,7 +514,7 @@
             goto out;
         else if ( ret == GUEST_TABLE_POD_PAGE )
         {
-            if ( q == p2m_query )
+            if ( !(q & P2M_ALLOC) )
             {
                 *t = p2m_populate_on_demand;
                 goto out;
@@ -541,7 +541,7 @@
 
     if ( ept_entry->sa_p2mt == p2m_populate_on_demand )
     {
-        if ( q == p2m_query )
+        if ( !(q & P2M_ALLOC) )
         {
             *t = p2m_populate_on_demand;
             goto out;
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/p2m-pod.c
--- a/xen/arch/x86/mm/p2m-pod.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/p2m-pod.c	Thu Mar 15 11:46:54 2012 +0000
@@ -529,7 +529,7 @@
         p2m_access_t a;
         p2m_type_t t;
 
-        (void)p2m->get_entry(p2m, gpfn + i, &t, &a, p2m_query, NULL);
+        (void)p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL);
 
         if ( t == p2m_populate_on_demand )
             pod++;
@@ -570,7 +570,7 @@
         p2m_type_t t;
         p2m_access_t a;
 
-        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, p2m_query, NULL);
+        mfn = p2m->get_entry(p2m, gpfn + i, &t, &a, 0, NULL);
         if ( t == p2m_populate_on_demand )
         {
             set_p2m_entry(p2m, gpfn + i, _mfn(INVALID_MFN), 0, p2m_invalid, p2m->default_access);
@@ -656,7 +656,7 @@
     for ( i=0; i<SUPERPAGE_PAGES; i++ )
     {
         p2m_access_t a; 
-        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, p2m_query, NULL);
+        mfn = p2m->get_entry(p2m, gfn + i, &type, &a, 0, NULL);
 
         if ( i == 0 )
         {
@@ -786,7 +786,7 @@
     for ( i=0; i<count; i++ )
     {
         p2m_access_t a;
-        mfns[i] = p2m->get_entry(p2m, gfns[i], types + i, &a, p2m_query, NULL);
+        mfns[i] = p2m->get_entry(p2m, gfns[i], types + i, &a, 0, NULL);
         /* If this is ram, and not a pagetable or from the xen heap, and probably not mapped
            elsewhere, map it; otherwise, skip. */
         if ( p2m_is_ram(types[i])
@@ -932,7 +932,7 @@
     for ( i=p2m->pod.reclaim_single; i > 0 ; i-- )
     {
         p2m_access_t a;
-        (void)p2m->get_entry(p2m, i, &t, &a, p2m_query, NULL);
+        (void)p2m->get_entry(p2m, i, &t, &a, 0, NULL);
         if ( p2m_is_ram(t) )
         {
             gfns[j] = i;
@@ -1130,7 +1130,7 @@
     for ( i = 0; i < (1UL << order); i++ )
     {
         p2m_access_t a;
-        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, p2m_query, NULL);
+        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
         if ( p2m_is_ram(ot) )
         {
             printk("%s: gfn_to_mfn returned type %d!\n",
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/p2m-pt.c	Thu Mar 15 11:46:54 2012 +0000
@@ -513,7 +513,7 @@
              (p2m_flags_to_type(l3e_get_flags(l3e)) == p2m_populate_on_demand) )
         {
             /* The read has succeeded, so we know that mapping exists */
-            if ( q != p2m_query )
+            if ( q & P2M_ALLOC )
             {
                 if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_1G, q) )
                     goto pod_retry_l3;
@@ -565,7 +565,7 @@
         {
             /* The read has succeeded, so we know that the mapping
              * exits at this point.  */
-            if ( q != p2m_query )
+            if ( q & P2M_ALLOC )
             {
                 if ( !p2m_pod_demand_populate(p2m, gfn, 
                                                 PAGE_ORDER_2M, q) )
@@ -623,7 +623,7 @@
         {
             /* The read has succeeded, so we know that the mapping
              * exits at this point.  */
-            if ( q != p2m_query )
+            if ( q & P2M_ALLOC )
             {
                 if ( !p2m_pod_demand_populate(p2m, gfn, 
                                                 PAGE_ORDER_4K, q) )
@@ -714,7 +714,7 @@
         {
             if ( p2m_flags_to_type(l3e_get_flags(*l3e)) == p2m_populate_on_demand )
             {
-                if ( q != p2m_query )
+                if ( q & P2M_ALLOC )
                 {
                     if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_1G, q) )
                         goto pod_retry_l3;
@@ -753,7 +753,7 @@
         /* PoD: Try to populate a 2-meg chunk */
         if ( p2m_flags_to_type(l2e_get_flags(*l2e)) == p2m_populate_on_demand )
         {
-            if ( q != p2m_query ) {
+            if ( q & P2M_ALLOC ) {
                 if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_2M, q) )
                     goto pod_retry_l2;
             } else
@@ -786,7 +786,7 @@
         /* PoD: Try to populate */
         if ( p2m_flags_to_type(l1e_get_flags(*l1e)) == p2m_populate_on_demand )
         {
-            if ( q != p2m_query ) {
+            if ( q & P2M_ALLOC ) {
                 if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_4K, q) )
                     goto pod_retry_l1;
             } else
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/p2m.c	Thu Mar 15 11:46:54 2012 +0000
@@ -151,6 +151,10 @@
 {
     mfn_t mfn;
 
+    /* Unshare makes no sense withuot populate. */
+    if ( q & P2M_UNSHARE )
+        q |= P2M_ALLOC;
+
     if ( !p2m || !paging_mode_translate(p2m->domain) )
     {
         /* Not necessarily true, but for non-translated guests, we claim
@@ -167,7 +171,7 @@
     mfn = p2m->get_entry(p2m, gfn, t, a, q, page_order);
 
 #ifdef __x86_64__
-    if ( q == p2m_unshare && p2m_is_shared(*t) )
+    if ( (q & P2M_UNSHARE) && p2m_is_shared(*t) )
     {
         ASSERT(!p2m_is_nestedp2m(p2m));
         /* Try to unshare. If we fail, communicate ENOMEM without
@@ -183,7 +187,7 @@
     {
         /* Return invalid_mfn to avoid caller's access */
         mfn = _mfn(INVALID_MFN);
-        if (q != p2m_query)
+        if ( q & P2M_ALLOC )
             domain_crash(p2m->domain);
     }
 #endif
@@ -370,7 +374,7 @@
     for ( gfn=0; gfn < p2m->max_mapped_pfn; gfn++ )
     {
         p2m_access_t a;
-        mfn = p2m->get_entry(p2m, gfn, &t, &a, p2m_query, NULL);
+        mfn = p2m->get_entry(p2m, gfn, &t, &a, 0, NULL);
         if ( mfn_valid(mfn) && (t == p2m_ram_shared) )
         {
             ASSERT(!p2m_is_nestedp2m(p2m));
@@ -441,7 +445,7 @@
     {
         for ( i = 0; i < (1UL << page_order); i++ )
         {
-            mfn_return = p2m->get_entry(p2m, gfn + i, &t, &a, p2m_query, NULL);
+            mfn_return = p2m->get_entry(p2m, gfn + i, &t, &a, 0, NULL);
             if ( !p2m_is_grant(t) && !p2m_is_shared(t) )
                 set_gpfn_from_mfn(mfn+i, INVALID_M2P_ENTRY);
             ASSERT( !p2m_is_valid(t) || mfn + i == mfn_x(mfn_return) );
@@ -503,7 +507,7 @@
     /* First, remove m->p mappings for existing p->m mappings */
     for ( i = 0; i < (1UL << page_order); i++ )
     {
-        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, p2m_query, NULL);
+        omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
 #ifdef __x86_64__
         if ( p2m_is_shared(ot) )
         {
@@ -528,7 +532,7 @@
                 (void)mem_sharing_notify_enomem(p2m->domain, gfn + i, 0);
                 return rc;
             }
-            omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, p2m_query, NULL);
+            omfn = p2m->get_entry(p2m, gfn + i, &ot, &a, 0, NULL);
             ASSERT(!p2m_is_shared(ot));
         }
 #endif /* __x86_64__ */
@@ -577,7 +581,7 @@
              * address */
             P2M_DEBUG("aliased! mfn=%#lx, old gfn=%#lx, new gfn=%#lx\n",
                       mfn + i, ogfn, gfn + i);
-            omfn = p2m->get_entry(p2m, ogfn, &ot, &a, p2m_query, NULL);
+            omfn = p2m->get_entry(p2m, ogfn, &ot, &a, 0, NULL);
             if ( p2m_is_ram(ot) && !p2m_is_paged(ot) )
             {
                 ASSERT(mfn_valid(omfn));
@@ -636,7 +640,7 @@
 
     gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, &pt, &a, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &pt, &a, 0, NULL);
     if ( pt == ot )
         set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, nt, p2m->default_access);
 
@@ -664,7 +668,7 @@
 
     for ( gfn = start; gfn < end; gfn++ )
     {
-        mfn = p2m->get_entry(p2m, gfn, &pt, &a, p2m_query, NULL);
+        mfn = p2m->get_entry(p2m, gfn, &pt, &a, 0, NULL);
         if ( pt == ot )
             set_p2m_entry(p2m, gfn, mfn, PAGE_ORDER_4K, nt, p2m->default_access);
     }
@@ -690,7 +694,7 @@
         return 0;
 
     gfn_lock(p2m, gfn, 0);
-    omfn = p2m->get_entry(p2m, gfn, &ot, &a, p2m_query, NULL);
+    omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL);
     if ( p2m_is_grant(ot) )
     {
         p2m_unlock(p2m);
@@ -726,7 +730,7 @@
         return 0;
 
     gfn_lock(p2m, gfn, 0);
-    mfn = p2m->get_entry(p2m, gfn, &t, &a, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &t, &a, 0, NULL);
 
     /* Do not use mfn_valid() here as it will usually fail for MMIO pages. */
     if ( (INVALID_MFN == mfn_x(mfn)) || (t != p2m_mmio_direct) )
@@ -757,7 +761,7 @@
         return 0;
 
     gfn_lock(p2m, gfn, 0);
-    omfn = p2m->get_entry(p2m, gfn, &ot, &a, p2m_query, NULL);
+    omfn = p2m->get_entry(p2m, gfn, &ot, &a, 0, NULL);
     /* At the moment we only allow p2m change if gfn has already been made
      * sharable first */
     ASSERT(p2m_is_shared(ot));
@@ -809,7 +813,7 @@
 
     gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
 
     /* Check if mfn is valid */
     if ( !mfn_valid(mfn) )
@@ -872,7 +876,7 @@
     gfn_lock(p2m, gfn, 0);
 
     /* Get mfn */
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
     if ( unlikely(!mfn_valid(mfn)) )
         goto out;
 
@@ -999,7 +1003,7 @@
 
     /* Fix p2m mapping */
     gfn_lock(p2m, gfn, 0);
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
     /* Allow only nominated or evicted pages to enter page-in path */
     if ( p2mt == p2m_ram_paging_out || p2mt == p2m_ram_paged )
     {
@@ -1061,7 +1065,7 @@
 
     gfn_lock(p2m, gfn, 0);
 
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &a, 0, NULL);
 
     ret = -ENOENT;
     /* Allow missing pages */
@@ -1154,7 +1158,7 @@
         if ( !(rsp.flags & MEM_EVENT_FLAG_DROP_PAGE) )
         {
             gfn_lock(p2m, rsp.gfn, 0);
-            mfn = p2m->get_entry(p2m, rsp.gfn, &p2mt, &a, p2m_query, NULL);
+            mfn = p2m->get_entry(p2m, rsp.gfn, &p2mt, &a, 0, NULL);
             /* Allow only pages which were prepared properly, or pages which
              * were nominated but not evicted */
             if ( mfn_valid(mfn) && (p2mt == p2m_ram_paging_in) )
@@ -1187,7 +1191,7 @@
 
     /* First, handle rx2rw conversion automatically */
     gfn_lock(p2m, gfn, 0);
-    mfn = p2m->get_entry(p2m, gfn, &p2mt, &p2ma, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, gfn, &p2mt, &p2ma, 0, NULL);
 
     if ( access_w && p2ma == p2m_access_rx2rw ) 
     {
@@ -1316,7 +1320,7 @@
     p2m_lock(p2m);
     for ( pfn = start_pfn; pfn < start_pfn + nr; pfn++ )
     {
-        mfn = p2m->get_entry(p2m, pfn, &t, &_a, p2m_query, NULL);
+        mfn = p2m->get_entry(p2m, pfn, &t, &_a, 0, NULL);
         if ( p2m->set_entry(p2m, pfn, mfn, PAGE_ORDER_4K, t, a) == 0 )
         {
             rc = -ENOMEM;
@@ -1357,7 +1361,7 @@
     }
 
     gfn_lock(p2m, gfn, 0);
-    mfn = p2m->get_entry(p2m, pfn, &t, &a, p2m_query, NULL);
+    mfn = p2m->get_entry(p2m, pfn, &t, &a, 0, NULL);
     gfn_unlock(p2m, gfn, 0);
 
     if ( mfn_x(mfn) == INVALID_MFN )
@@ -1598,7 +1602,7 @@
             continue;
         }
 
-        p2mfn = get_gfn_type_access(p2m, gfn, &type, &p2ma, p2m_query, NULL);
+        p2mfn = get_gfn_type_access(p2m, gfn, &type, &p2ma, 0, NULL);
         if ( mfn_x(p2mfn) != mfn )
         {
             mpbad++;
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/arch/x86/mm/shadow/types.h
--- a/xen/arch/x86/mm/shadow/types.h	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/arch/x86/mm/shadow/types.h	Thu Mar 15 11:46:54 2012 +0000
@@ -193,7 +193,7 @@
 
  /* Override get_gfn to work with gfn_t */
 #undef get_gfn_query
-#define get_gfn_query(d, g, t) get_gfn_type((d), gfn_x(g), (t), p2m_query)
+#define get_gfn_query(d, g, t) get_gfn_type((d), gfn_x(g), (t), 0)
 
 /* The shadow types needed for the various levels. */
 
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/include/asm-x86/guest_pt.h
--- a/xen/include/asm-x86/guest_pt.h	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/include/asm-x86/guest_pt.h	Thu Mar 15 11:46:54 2012 +0000
@@ -53,7 +53,7 @@
 
 /* Override get_gfn to work with gfn_t */
 #undef get_gfn
-#define get_gfn(d, g, t) get_gfn_type((d), gfn_x(g), (t), p2m_alloc)
+#define get_gfn(d, g, t) get_gfn_type((d), gfn_x(g), (t), P2M_ALLOC)
 
 
 /* Types of the guest's page tables and access functions for them */
diff -r 7a439281b8ee -r 09ce2e4bcce5 xen/include/asm-x86/p2m.h
--- a/xen/include/asm-x86/p2m.h	Thu Mar 15 11:41:11 2012 +0000
+++ b/xen/include/asm-x86/p2m.h	Thu Mar 15 11:46:54 2012 +0000
@@ -117,11 +117,9 @@
 } p2m_access_t;
 
 /* Modifiers to the query */
-typedef enum {
-    p2m_query,              /* Do not populate a PoD entries      */
-    p2m_alloc,              /* Automatically populate PoD entries */
-    p2m_unshare,            /* Break c-o-w sharing; implies alloc */
-} p2m_query_t;
+typedef unsigned int p2m_query_t;
+#define P2M_ALLOC    (1u<<0)   /* Populate PoD and paged-out entries */
+#define P2M_UNSHARE  (1u<<1)   /* Break CoW sharing */
 
 /* We use bitmaps and maks to handle groups of types */
 #define p2m_to_mask(_t) (1UL << (_t))
@@ -332,9 +330,10 @@
  * N.B. get_gfn_query() is the _only_ one guaranteed not to take the
  * p2m lock; none of the others can be called with the p2m or paging
  * lock held. */
-#define get_gfn(d, g, t)         get_gfn_type((d), (g), (t), p2m_alloc)
-#define get_gfn_query(d, g, t)   get_gfn_type((d), (g), (t), p2m_query)
-#define get_gfn_unshare(d, g, t) get_gfn_type((d), (g), (t), p2m_unshare)
+#define get_gfn(d, g, t)         get_gfn_type((d), (g), (t), P2M_ALLOC)
+#define get_gfn_query(d, g, t)   get_gfn_type((d), (g), (t), 0)
+#define get_gfn_unshare(d, g, t) get_gfn_type((d), (g), (t), \
+                                              P2M_ALLOC | P2M_UNSHARE)
 
 /* Compatibility function exporting the old untyped interface */
 static inline unsigned long get_gfn_untyped(struct domain *d, unsigned long gpfn)
@@ -366,8 +365,7 @@
                                            p2m_type_t *t)
 {
     p2m_access_t a;
-    return __get_gfn_type_access(p2m_get_hostp2m(d), gfn, t, &a, 
-                                    p2m_query, NULL, 0);
+    return __get_gfn_type_access(p2m_get_hostp2m(d), gfn, t, &a, 0, NULL, 0);
 }
 
 /* General conversion function from mfn to gfn */

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Or2-0004Nc-HO; Fri, 16 Mar 2012 04:33: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 1S8Or0-0004JQ-GL
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:26 +0000
Received: from [85.158.139.83:15125] by server-11.bemta-5.messagelabs.com id
	13/3C-12959-592C26F4; Fri, 16 Mar 2012 04:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1331872403!19615371!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14363 invoked from network); 16 Mar 2012 04:33:24 -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;
	16 Mar 2012 04:33: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 1S8Oqx-0005Ki-Cs
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqx-0002Re-Bn
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:23 +0000
Message-Id: <E1S8Oqx-0002Re-Bn@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/vpmu: Add a cpuid 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
# Date 1331820690 -3600
# Node ID 28f5f047d060a0c8e831fb4e693a8509a2b62bd8
# Parent  f47d91cb0faac1f8b505bc5f61c9608d39010992
x86/vpmu: Add a cpuid function

Add a new function - do_cpuid - to the vpmu struct arch_vpmu_ops. This
permits the vpmu to set specific bits in the cpuid for the hvm guest.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r f47d91cb0faa -r 28f5f047d060 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Thu Mar 15 15:09:18 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Thu Mar 15 15:11:30 2012 +0100
@@ -1613,6 +1613,8 @@
             break;
     }
 
+    vpmu_do_cpuid(input, eax, ebx, ecx, edx);
+
     HVMTRACE_5D (CPUID, input, *eax, *ebx, *ecx, *edx);
 }
 
diff -r f47d91cb0faa -r 28f5f047d060 xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Thu Mar 15 15:09:18 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Thu Mar 15 15:11:30 2012 +0100
@@ -547,6 +547,12 @@
     return 1;
 }
 
+static void core2_vpmu_do_cpuid(unsigned int input,
+                                unsigned int *eax, unsigned int *ebx,
+                                unsigned int *ecx, unsigned int *edx)
+{
+}
+
 static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
@@ -608,6 +614,7 @@
     .do_wrmsr = core2_vpmu_do_wrmsr,
     .do_rdmsr = core2_vpmu_do_rdmsr,
     .do_interrupt = core2_vpmu_do_interrupt,
+    .do_cpuid = core2_vpmu_do_cpuid,
     .arch_vpmu_destroy = core2_vpmu_destroy,
     .arch_vpmu_save = core2_vpmu_save,
     .arch_vpmu_load = core2_vpmu_load
diff -r f47d91cb0faa -r 28f5f047d060 xen/arch/x86/hvm/vpmu.c
--- a/xen/arch/x86/hvm/vpmu.c	Thu Mar 15 15:09:18 2012 +0100
+++ b/xen/arch/x86/hvm/vpmu.c	Thu Mar 15 15:11:30 2012 +0100
@@ -62,6 +62,16 @@
     return 0;
 }
 
+void vpmu_do_cpuid(unsigned int input,
+                   unsigned int *eax, unsigned int *ebx,
+                   unsigned int *ecx, unsigned int *edx)
+{
+    struct vpmu_struct *vpmu = vcpu_vpmu(current);
+
+    if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->do_cpuid )
+        vpmu->arch_vpmu_ops->do_cpuid(input, eax, ebx, ecx, edx);
+}
+
 void vpmu_save(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
diff -r f47d91cb0faa -r 28f5f047d060 xen/include/asm-x86/hvm/vpmu.h
--- a/xen/include/asm-x86/hvm/vpmu.h	Thu Mar 15 15:09:18 2012 +0100
+++ b/xen/include/asm-x86/hvm/vpmu.h	Thu Mar 15 15:11:30 2012 +0100
@@ -40,6 +40,9 @@
     int (*do_wrmsr)(unsigned int msr, uint64_t msr_content);
     int (*do_rdmsr)(unsigned int msr, uint64_t *msr_content);
     int (*do_interrupt)(struct cpu_user_regs *regs);
+    void (*do_cpuid)(unsigned int input,
+                     unsigned int *eax, unsigned int *ebx,
+                     unsigned int *ecx, unsigned int *edx);
     void (*arch_vpmu_destroy)(struct vcpu *v);
     void (*arch_vpmu_save)(struct vcpu *v);
     void (*arch_vpmu_load)(struct vcpu *v);
@@ -67,6 +70,8 @@
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content);
 int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content);
 int vpmu_do_interrupt(struct cpu_user_regs *regs);
+void vpmu_do_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
+                                       unsigned int *ecx, unsigned int *edx);
 void vpmu_initialise(struct vcpu *v);
 void vpmu_destroy(struct vcpu *v);
 void vpmu_save(struct vcpu *v);

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Or2-0004Nc-HO; Fri, 16 Mar 2012 04:33: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 1S8Or0-0004JQ-GL
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:26 +0000
Received: from [85.158.139.83:15125] by server-11.bemta-5.messagelabs.com id
	13/3C-12959-592C26F4; Fri, 16 Mar 2012 04:33:25 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-182.messagelabs.com!1331872403!19615371!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14363 invoked from network); 16 Mar 2012 04:33:24 -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;
	16 Mar 2012 04:33: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 1S8Oqx-0005Ki-Cs
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqx-0002Re-Bn
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:23 +0000
Message-Id: <E1S8Oqx-0002Re-Bn@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/vpmu: Add a cpuid 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
# Date 1331820690 -3600
# Node ID 28f5f047d060a0c8e831fb4e693a8509a2b62bd8
# Parent  f47d91cb0faac1f8b505bc5f61c9608d39010992
x86/vpmu: Add a cpuid function

Add a new function - do_cpuid - to the vpmu struct arch_vpmu_ops. This
permits the vpmu to set specific bits in the cpuid for the hvm guest.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r f47d91cb0faa -r 28f5f047d060 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Thu Mar 15 15:09:18 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Thu Mar 15 15:11:30 2012 +0100
@@ -1613,6 +1613,8 @@
             break;
     }
 
+    vpmu_do_cpuid(input, eax, ebx, ecx, edx);
+
     HVMTRACE_5D (CPUID, input, *eax, *ebx, *ecx, *edx);
 }
 
diff -r f47d91cb0faa -r 28f5f047d060 xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Thu Mar 15 15:09:18 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Thu Mar 15 15:11:30 2012 +0100
@@ -547,6 +547,12 @@
     return 1;
 }
 
+static void core2_vpmu_do_cpuid(unsigned int input,
+                                unsigned int *eax, unsigned int *ebx,
+                                unsigned int *ecx, unsigned int *edx)
+{
+}
+
 static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
 {
     struct vcpu *v = current;
@@ -608,6 +614,7 @@
     .do_wrmsr = core2_vpmu_do_wrmsr,
     .do_rdmsr = core2_vpmu_do_rdmsr,
     .do_interrupt = core2_vpmu_do_interrupt,
+    .do_cpuid = core2_vpmu_do_cpuid,
     .arch_vpmu_destroy = core2_vpmu_destroy,
     .arch_vpmu_save = core2_vpmu_save,
     .arch_vpmu_load = core2_vpmu_load
diff -r f47d91cb0faa -r 28f5f047d060 xen/arch/x86/hvm/vpmu.c
--- a/xen/arch/x86/hvm/vpmu.c	Thu Mar 15 15:09:18 2012 +0100
+++ b/xen/arch/x86/hvm/vpmu.c	Thu Mar 15 15:11:30 2012 +0100
@@ -62,6 +62,16 @@
     return 0;
 }
 
+void vpmu_do_cpuid(unsigned int input,
+                   unsigned int *eax, unsigned int *ebx,
+                   unsigned int *ecx, unsigned int *edx)
+{
+    struct vpmu_struct *vpmu = vcpu_vpmu(current);
+
+    if ( vpmu->arch_vpmu_ops && vpmu->arch_vpmu_ops->do_cpuid )
+        vpmu->arch_vpmu_ops->do_cpuid(input, eax, ebx, ecx, edx);
+}
+
 void vpmu_save(struct vcpu *v)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
diff -r f47d91cb0faa -r 28f5f047d060 xen/include/asm-x86/hvm/vpmu.h
--- a/xen/include/asm-x86/hvm/vpmu.h	Thu Mar 15 15:09:18 2012 +0100
+++ b/xen/include/asm-x86/hvm/vpmu.h	Thu Mar 15 15:11:30 2012 +0100
@@ -40,6 +40,9 @@
     int (*do_wrmsr)(unsigned int msr, uint64_t msr_content);
     int (*do_rdmsr)(unsigned int msr, uint64_t *msr_content);
     int (*do_interrupt)(struct cpu_user_regs *regs);
+    void (*do_cpuid)(unsigned int input,
+                     unsigned int *eax, unsigned int *ebx,
+                     unsigned int *ecx, unsigned int *edx);
     void (*arch_vpmu_destroy)(struct vcpu *v);
     void (*arch_vpmu_save)(struct vcpu *v);
     void (*arch_vpmu_load)(struct vcpu *v);
@@ -67,6 +70,8 @@
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content);
 int vpmu_do_rdmsr(unsigned int msr, uint64_t *msr_content);
 int vpmu_do_interrupt(struct cpu_user_regs *regs);
+void vpmu_do_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
+                                       unsigned int *ecx, unsigned int *edx);
 void vpmu_initialise(struct vcpu *v);
 void vpmu_destroy(struct vcpu *v);
 void vpmu_save(struct vcpu *v);

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Or2-0004Nr-Kh; Fri, 16 Mar 2012 04:33:28 +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 1S8Or1-00048P-0c
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:27 +0000
Received: from [85.158.143.99:52147] by server-1.bemta-4.messagelabs.com id
	A6/67-20925-692C26F4; Fri, 16 Mar 2012 04:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1331872404!19424106!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16861 invoked from network); 16 Mar 2012 04:33:25 -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;
	16 Mar 2012 04:33: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 1S8Oqx-0005Kn-V4
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqx-0002SA-Tq
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:23 +0000
Message-Id: <E1S8Oqx-0002SA-Tq@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/vpmu: Add the BTS extension
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
# Date 1331820780 -3600
# Node ID bd685bff45b3f973e4ce979a89defdac1961925b
# Parent  28f5f047d060a0c8e831fb4e693a8509a2b62bd8
x86/vpmu: Add the BTS extension

Add the BTS functionality to the existing vpmu implementation for Intel
CPUs.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 28f5f047d060 -r bd685bff45b3 xen/arch/x86/hvm/svm/vpmu.c
--- a/xen/arch/x86/hvm/svm/vpmu.c	Thu Mar 15 15:11:30 2012 +0100
+++ b/xen/arch/x86/hvm/svm/vpmu.c	Thu Mar 15 15:13:00 2012 +0100
@@ -363,10 +363,11 @@
     .arch_vpmu_load = amd_vpmu_restore
 };
 
-int svm_vpmu_initialise(struct vcpu *v)
+int svm_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     uint8_t family = current_cpu_data.x86;
+    int ret = 0;
 
     switch ( family )
     {
@@ -374,8 +375,10 @@
     case 0x12:
     case 0x14:
     case 0x15:
-        vpmu->arch_vpmu_ops = &amd_vpmu_ops;
-        return amd_vpmu_initialise(v);
+        ret = amd_vpmu_initialise(v);
+        if ( !ret )
+            vpmu->arch_vpmu_ops = &amd_vpmu_ops;
+        return ret;
     }
 
     printk("VPMU: Initialization failed. "
diff -r 28f5f047d060 -r bd685bff45b3 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Thu Mar 15 15:11:30 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Thu Mar 15 15:13:00 2012 +0100
@@ -1833,6 +1833,9 @@
         /* Debug Trace Store is not supported. */
         *msr_content |= MSR_IA32_MISC_ENABLE_BTS_UNAVAIL |
                        MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL;
+        /* Perhaps vpmu will change some bits. */
+        if ( vpmu_do_rdmsr(msr, msr_content) )
+            goto done;
         break;
     default:
         if ( vpmu_do_rdmsr(msr, msr_content) )
@@ -1960,9 +1963,14 @@
         int i, rc = 0;
         uint64_t supported = IA32_DEBUGCTLMSR_LBR | IA32_DEBUGCTLMSR_BTF;
 
-        if ( !msr_content || (msr_content & ~supported) )
+        if ( !msr_content )
             break;
-
+        if ( msr_content & ~supported )
+        {
+            /* Perhaps some other bits are supported in vpmu. */
+            if ( !vpmu_do_wrmsr(msr, msr_content) )
+                break;
+        }
         if ( msr_content & IA32_DEBUGCTLMSR_LBR )
         {
             const struct lbr_info *lbr = last_branch_msr_get();
diff -r 28f5f047d060 -r bd685bff45b3 xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Thu Mar 15 15:11:30 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Thu Mar 15 15:13:00 2012 +0100
@@ -406,7 +406,27 @@
     struct core2_vpmu_context *core2_vpmu_cxt = NULL;
 
     if ( !core2_vpmu_msr_common_check(msr, &type, &index) )
+    {
+        /* Special handling for BTS */
+        if ( msr == MSR_IA32_DEBUGCTLMSR )
+        {
+            uint64_t supported = IA32_DEBUGCTLMSR_TR | IA32_DEBUGCTLMSR_BTS |
+                                 IA32_DEBUGCTLMSR_BTINT;
+
+            if ( cpu_has(&current_cpu_data, X86_FEATURE_DSCPL) )
+                supported |= IA32_DEBUGCTLMSR_BTS_OFF_OS |
+                             IA32_DEBUGCTLMSR_BTS_OFF_USR;
+            if ( msr_content & supported )
+            {
+                if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_BTS) )
+                    return 1;
+                gdprintk(XENLOG_WARNING, "Debug Store is not supported on this cpu\n");
+                vmx_inject_hw_exception(TRAP_gp_fault, 0);
+                return 0;
+            }
+        }
         return 0;
+    }
 
     core2_vpmu_cxt = vpmu->context;
     switch ( msr )
@@ -425,6 +445,19 @@
                      "which is not supported.\n");
         return 1;
     case MSR_IA32_DS_AREA:
+        if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) )
+        {
+            if ( !is_canonical_address(msr_content) )
+            {
+                gdprintk(XENLOG_WARNING,
+                         "Illegal address for IA32_DS_AREA: %#" PRIx64 "x\n",
+                         msr_content);
+                vmx_inject_hw_exception(TRAP_gp_fault, 0);
+                return 1;
+            }
+            core2_vpmu_cxt->pmu_enable->ds_area_enable = msr_content ? 1 : 0;
+            break;
+        }
         gdprintk(XENLOG_WARNING, "Guest setting of DTS is ignored.\n");
         return 1;
     case MSR_CORE_PERF_GLOBAL_CTRL:
@@ -471,6 +504,7 @@
         pmu_enable |= core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i];
     for ( i = 0; i < core2_get_pmc_count(); i++ )
         pmu_enable |= core2_vpmu_cxt->pmu_enable->arch_pmc_enable[i];
+    pmu_enable |= core2_vpmu_cxt->pmu_enable->ds_area_enable;
     if ( pmu_enable )
         vpmu_set(vpmu, VPMU_RUNNING);
     else
@@ -496,6 +530,8 @@
                 inject_gp = 1;
             break;
         case MSR_TYPE_CTRL:           /* IA32_FIXED_CTR_CTRL */
+            if  ( msr == MSR_IA32_DS_AREA )
+                break;
             /* 4 bits per counter, currently 3 fixed counters implemented. */
             mask = ~((1ull << (3 * 4)) - 1);
             if (msr_content & mask)
@@ -525,25 +561,35 @@
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct core2_vpmu_context *core2_vpmu_cxt = NULL;
 
-    if ( !core2_vpmu_msr_common_check(msr, &type, &index) )
-        return 0;
-
-    core2_vpmu_cxt = vpmu->context;
-    switch ( msr )
+    if ( core2_vpmu_msr_common_check(msr, &type, &index) )
     {
-    case MSR_CORE_PERF_GLOBAL_OVF_CTRL:
-        *msr_content = 0;
-        break;
-    case MSR_CORE_PERF_GLOBAL_STATUS:
-        *msr_content = core2_vpmu_cxt->global_ovf_status;
-        break;
-    case MSR_CORE_PERF_GLOBAL_CTRL:
-        vmx_read_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, msr_content);
-        break;
-    default:
-        rdmsrl(msr, *msr_content);
+        core2_vpmu_cxt = vpmu->context;
+        switch ( msr )
+        {
+        case MSR_CORE_PERF_GLOBAL_OVF_CTRL:
+            *msr_content = 0;
+            break;
+        case MSR_CORE_PERF_GLOBAL_STATUS:
+            *msr_content = core2_vpmu_cxt->global_ovf_status;
+            break;
+        case MSR_CORE_PERF_GLOBAL_CTRL:
+            vmx_read_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, msr_content);
+            break;
+        default:
+            rdmsrl(msr, *msr_content);
+        }
     }
-
+    else
+    {
+        /* Extension for BTS */
+        if ( msr == MSR_IA32_MISC_ENABLE )
+        {
+            if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_BTS) )
+                *msr_content &= ~MSR_IA32_MISC_ENABLE_BTS_UNAVAIL;
+        }
+        else
+            return 0;
+    }
     return 1;
 }
 
@@ -551,6 +597,16 @@
                                 unsigned int *eax, unsigned int *ebx,
                                 unsigned int *ecx, unsigned int *edx)
 {
+    if (input == 0x1)
+    {
+        struct vpmu_struct *vpmu = vcpu_vpmu(current);
+
+        if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) )
+        {
+            /* Switch on the 'Debug Store' feature in CPUID.EAX[1]:EDX[21] */
+            *edx |= cpufeat_mask(X86_FEATURE_DS);
+        }
+    }
 }
 
 static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
@@ -564,15 +620,21 @@
     struct vlapic *vlapic = vcpu_vlapic(v);
 
     rdmsrl(MSR_CORE_PERF_GLOBAL_STATUS, msr_content);
-    if ( !msr_content )
-        return 0;
-
-    if ( is_pmc_quirk )
-        handle_pmc_quirk(msr_content);
-
-    core2_vpmu_cxt->global_ovf_status |= msr_content;
-    msr_content = 0xC000000700000000 | ((1 << core2_get_pmc_count()) - 1);
-    wrmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, msr_content);
+    if ( msr_content )
+    {
+        if ( is_pmc_quirk )
+            handle_pmc_quirk(msr_content);
+        core2_vpmu_cxt->global_ovf_status |= msr_content;
+        msr_content = 0xC000000700000000 | ((1 << core2_get_pmc_count()) - 1);
+        wrmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, msr_content);
+    }
+    else
+    {
+        /* No PMC overflow but perhaps a Trace Message interrupt. */
+        msr_content = __vmread(GUEST_IA32_DEBUGCTL);
+        if ( !(msr_content & IA32_DEBUGCTLMSR_TR) )
+            return 0;
+    }
 
     apic_write_around(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
 
@@ -589,8 +651,53 @@
     return 1;
 }
 
-static int core2_vpmu_initialise(struct vcpu *v)
+static int core2_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
 {
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    u64 msr_content;
+    struct cpuinfo_x86 *c = &current_cpu_data;
+
+    if ( !(vpmu_flags & VPMU_BOOT_BTS) )
+        goto func_out;
+    /* Check the 'Debug Store' feature in the CPUID.EAX[1]:EDX[21] */
+    if ( cpu_has(c, X86_FEATURE_DS) )
+    {
+#ifdef __x86_64__
+        if ( !cpu_has(c, X86_FEATURE_DTES64) )
+        {
+            printk(XENLOG_G_WARNING "CPU doesn't support 64-bit DS Area"
+                   " - Debug Store disabled for d%d:v%d\n",
+                   v->domain->domain_id, v->vcpu_id);
+            goto func_out;
+        }
+#endif
+        vpmu_set(vpmu, VPMU_CPU_HAS_DS);
+        rdmsrl(MSR_IA32_MISC_ENABLE, msr_content);
+        if ( msr_content & MSR_IA32_MISC_ENABLE_BTS_UNAVAIL )
+        {
+            /* If BTS_UNAVAIL is set reset the DS feature. */
+            vpmu_reset(vpmu, VPMU_CPU_HAS_DS);
+            printk(XENLOG_G_WARNING "CPU has set BTS_UNAVAIL"
+                   " - Debug Store disabled for d%d:v%d\n",
+                   v->domain->domain_id, v->vcpu_id);
+        }
+        else
+        {
+            vpmu_set(vpmu, VPMU_CPU_HAS_BTS);
+            if ( !cpu_has(c, X86_FEATURE_DSCPL) )
+                printk(XENLOG_G_INFO
+                       "vpmu: CPU doesn't support CPL-Qualified BTS\n");
+            printk("******************************************************\n");
+            printk("** WARNING: Emulation of BTS Feature is switched on **\n");
+            printk("** Using this processor feature in a virtualized    **\n");
+            printk("** environment is not 100%% safe.                   **\n");
+            printk("** Setting the DS buffer address with wrong values  **\n");
+            printk("** may lead to hypervisor hangs or crashes.         **\n");
+            printk("** It is NOT recommended for production use!        **\n");
+            printk("******************************************************\n");
+        }
+    }
+func_out:
     check_pmc_quirk();
     return 0;
 }
@@ -620,11 +727,12 @@
     .arch_vpmu_load = core2_vpmu_load
 };
 
-int vmx_vpmu_initialise(struct vcpu *v)
+int vmx_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     uint8_t family = current_cpu_data.x86;
     uint8_t cpu_model = current_cpu_data.x86_model;
+    int ret = 0;
 
     if ( family == 6 )
     {
@@ -639,8 +747,10 @@
         case 46:
         case 47:
         case 58:
-            vpmu->arch_vpmu_ops = &core2_vpmu_ops;
-            return core2_vpmu_initialise(v);
+            ret = core2_vpmu_initialise(v, vpmu_flags);
+            if ( !ret )
+                vpmu->arch_vpmu_ops = &core2_vpmu_ops;
+            return ret;
         }
     }
 
diff -r 28f5f047d060 -r bd685bff45b3 xen/arch/x86/hvm/vpmu.c
--- a/xen/arch/x86/hvm/vpmu.c	Thu Mar 15 15:11:30 2012 +0100
+++ b/xen/arch/x86/hvm/vpmu.c	Thu Mar 15 15:13:00 2012 +0100
@@ -32,8 +32,36 @@
 #include <asm/hvm/svm/svm.h>
 #include <asm/hvm/svm/vmcb.h>
 
-static bool_t __read_mostly opt_vpmu_enabled;
-boolean_param("vpmu", opt_vpmu_enabled);
+
+/*
+ * "vpmu" :     vpmu generally enabled
+ * "vpmu=off" : vpmu generally disabled
+ * "vpmu=bts" : vpmu enabled and Intel BTS feature switched on.
+ */
+static unsigned int __read_mostly opt_vpmu_enabled;
+static void parse_vpmu_param(char *s);
+custom_param("vpmu", parse_vpmu_param);
+
+static void __init parse_vpmu_param(char *s)
+{
+    switch ( parse_bool(s) )
+    {
+    case 0:
+        break;
+    default:
+        if ( !strcmp(s, "bts") )
+            opt_vpmu_enabled |= VPMU_BOOT_BTS;
+        else if ( *s )
+        {
+            printk("VPMU: unknown flag: %s - vpmu disabled!\n", s);
+            break;
+        }
+        /* fall through */
+    case 1:
+        opt_vpmu_enabled |= VPMU_BOOT_ENABLED;
+        break;
+    }
+}
 
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
 {
@@ -104,12 +132,12 @@
     switch ( vendor )
     {
     case X86_VENDOR_AMD:
-        if ( svm_vpmu_initialise(v) != 0 )
+        if ( svm_vpmu_initialise(v, opt_vpmu_enabled) != 0 )
             opt_vpmu_enabled = 0;
         break;
 
     case X86_VENDOR_INTEL:
-        if ( vmx_vpmu_initialise(v) != 0 )
+        if ( vmx_vpmu_initialise(v, opt_vpmu_enabled) != 0 )
             opt_vpmu_enabled = 0;
         break;
 
diff -r 28f5f047d060 -r bd685bff45b3 xen/include/asm-x86/hvm/vmx/vpmu_core2.h
--- a/xen/include/asm-x86/hvm/vmx/vpmu_core2.h	Thu Mar 15 15:11:30 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vpmu_core2.h	Thu Mar 15 15:13:00 2012 +0100
@@ -29,6 +29,7 @@
 };
 
 struct core2_pmu_enable {
+    char ds_area_enable;
     char fixed_ctr_enable[3];
     char arch_pmc_enable[1];
 };
diff -r 28f5f047d060 -r bd685bff45b3 xen/include/asm-x86/hvm/vpmu.h
--- a/xen/include/asm-x86/hvm/vpmu.h	Thu Mar 15 15:11:30 2012 +0100
+++ b/xen/include/asm-x86/hvm/vpmu.h	Thu Mar 15 15:13:00 2012 +0100
@@ -22,6 +22,14 @@
 #ifndef __ASM_X86_HVM_VPMU_H_
 #define __ASM_X86_HVM_VPMU_H_
 
+/*
+ * Flag bits given as a string on the hypervisor boot parameter 'vpmu'.
+ * See arch/x86/hvm/vpmu.c.
+ */
+#define VPMU_BOOT_ENABLED 0x1    /* vpmu generally enabled. */
+#define VPMU_BOOT_BTS     0x2    /* Intel BTS feature wanted. */
+
+
 #define msraddr_to_bitpos(x) (((x)&0xffff) + ((x)>>31)*0x2000)
 #define vcpu_vpmu(vcpu)   (&((vcpu)->arch.hvm_vcpu.vpmu))
 #define vpmu_vcpu(vpmu)   (container_of((vpmu), struct vcpu, \
@@ -48,8 +56,8 @@
     void (*arch_vpmu_load)(struct vcpu *v);
 };
 
-int vmx_vpmu_initialise(struct vcpu *v);
-int svm_vpmu_initialise(struct vcpu *v);
+int vmx_vpmu_initialise(struct vcpu *, unsigned int flags);
+int svm_vpmu_initialise(struct vcpu *, unsigned int flags);
 
 struct vpmu_struct {
     u32 flags;
@@ -61,6 +69,9 @@
 #define VPMU_CONTEXT_LOADED                 0x2
 #define VPMU_RUNNING                        0x4
 #define VPMU_PASSIVE_DOMAIN_ALLOCATED       0x8
+#define VPMU_CPU_HAS_DS                     0x10 /* Has Debug Store */
+#define VPMU_CPU_HAS_BTS                    0x20 /* Has Branch Trace Store */
+
 
 #define vpmu_set(_vpmu, _x)    ((_vpmu)->flags |= (_x))
 #define vpmu_reset(_vpmu, _x)  ((_vpmu)->flags &= ~(_x))
diff -r 28f5f047d060 -r bd685bff45b3 xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Thu Mar 15 15:11:30 2012 +0100
+++ b/xen/include/asm-x86/msr-index.h	Thu Mar 15 15:13:00 2012 +0100
@@ -67,6 +67,11 @@
 #define MSR_IA32_DEBUGCTLMSR		0x000001d9
 #define IA32_DEBUGCTLMSR_LBR		(1<<0) /* Last Branch Record */
 #define IA32_DEBUGCTLMSR_BTF		(1<<1) /* Single Step on Branches */
+#define IA32_DEBUGCTLMSR_TR		(1<<6) /* Trace Message Enable */
+#define IA32_DEBUGCTLMSR_BTS		(1<<7) /* Branch Trace Store */
+#define IA32_DEBUGCTLMSR_BTINT		(1<<8) /* Branch Trace Interrupt */
+#define IA32_DEBUGCTLMSR_BTS_OFF_OS	(1<<9)  /* BTS off if CPL 0 */
+#define IA32_DEBUGCTLMSR_BTS_OFF_USR	(1<<10) /* BTS off if CPL > 0 */
 
 #define MSR_IA32_LASTBRANCHFROMIP	0x000001db
 #define MSR_IA32_LASTBRANCHTOIP		0x000001dc

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:28 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:28 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Or2-0004Nr-Kh; Fri, 16 Mar 2012 04:33:28 +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 1S8Or1-00048P-0c
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:27 +0000
Received: from [85.158.143.99:52147] by server-1.bemta-4.messagelabs.com id
	A6/67-20925-692C26F4; Fri, 16 Mar 2012 04:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1331872404!19424106!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16861 invoked from network); 16 Mar 2012 04:33:25 -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;
	16 Mar 2012 04:33: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 1S8Oqx-0005Kn-V4
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:23 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqx-0002SA-Tq
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:23 +0000
Message-Id: <E1S8Oqx-0002SA-Tq@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/vpmu: Add the BTS extension
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
# Date 1331820780 -3600
# Node ID bd685bff45b3f973e4ce979a89defdac1961925b
# Parent  28f5f047d060a0c8e831fb4e693a8509a2b62bd8
x86/vpmu: Add the BTS extension

Add the BTS functionality to the existing vpmu implementation for Intel
CPUs.

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 28f5f047d060 -r bd685bff45b3 xen/arch/x86/hvm/svm/vpmu.c
--- a/xen/arch/x86/hvm/svm/vpmu.c	Thu Mar 15 15:11:30 2012 +0100
+++ b/xen/arch/x86/hvm/svm/vpmu.c	Thu Mar 15 15:13:00 2012 +0100
@@ -363,10 +363,11 @@
     .arch_vpmu_load = amd_vpmu_restore
 };
 
-int svm_vpmu_initialise(struct vcpu *v)
+int svm_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     uint8_t family = current_cpu_data.x86;
+    int ret = 0;
 
     switch ( family )
     {
@@ -374,8 +375,10 @@
     case 0x12:
     case 0x14:
     case 0x15:
-        vpmu->arch_vpmu_ops = &amd_vpmu_ops;
-        return amd_vpmu_initialise(v);
+        ret = amd_vpmu_initialise(v);
+        if ( !ret )
+            vpmu->arch_vpmu_ops = &amd_vpmu_ops;
+        return ret;
     }
 
     printk("VPMU: Initialization failed. "
diff -r 28f5f047d060 -r bd685bff45b3 xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Thu Mar 15 15:11:30 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Thu Mar 15 15:13:00 2012 +0100
@@ -1833,6 +1833,9 @@
         /* Debug Trace Store is not supported. */
         *msr_content |= MSR_IA32_MISC_ENABLE_BTS_UNAVAIL |
                        MSR_IA32_MISC_ENABLE_PEBS_UNAVAIL;
+        /* Perhaps vpmu will change some bits. */
+        if ( vpmu_do_rdmsr(msr, msr_content) )
+            goto done;
         break;
     default:
         if ( vpmu_do_rdmsr(msr, msr_content) )
@@ -1960,9 +1963,14 @@
         int i, rc = 0;
         uint64_t supported = IA32_DEBUGCTLMSR_LBR | IA32_DEBUGCTLMSR_BTF;
 
-        if ( !msr_content || (msr_content & ~supported) )
+        if ( !msr_content )
             break;
-
+        if ( msr_content & ~supported )
+        {
+            /* Perhaps some other bits are supported in vpmu. */
+            if ( !vpmu_do_wrmsr(msr, msr_content) )
+                break;
+        }
         if ( msr_content & IA32_DEBUGCTLMSR_LBR )
         {
             const struct lbr_info *lbr = last_branch_msr_get();
diff -r 28f5f047d060 -r bd685bff45b3 xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Thu Mar 15 15:11:30 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Thu Mar 15 15:13:00 2012 +0100
@@ -406,7 +406,27 @@
     struct core2_vpmu_context *core2_vpmu_cxt = NULL;
 
     if ( !core2_vpmu_msr_common_check(msr, &type, &index) )
+    {
+        /* Special handling for BTS */
+        if ( msr == MSR_IA32_DEBUGCTLMSR )
+        {
+            uint64_t supported = IA32_DEBUGCTLMSR_TR | IA32_DEBUGCTLMSR_BTS |
+                                 IA32_DEBUGCTLMSR_BTINT;
+
+            if ( cpu_has(&current_cpu_data, X86_FEATURE_DSCPL) )
+                supported |= IA32_DEBUGCTLMSR_BTS_OFF_OS |
+                             IA32_DEBUGCTLMSR_BTS_OFF_USR;
+            if ( msr_content & supported )
+            {
+                if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_BTS) )
+                    return 1;
+                gdprintk(XENLOG_WARNING, "Debug Store is not supported on this cpu\n");
+                vmx_inject_hw_exception(TRAP_gp_fault, 0);
+                return 0;
+            }
+        }
         return 0;
+    }
 
     core2_vpmu_cxt = vpmu->context;
     switch ( msr )
@@ -425,6 +445,19 @@
                      "which is not supported.\n");
         return 1;
     case MSR_IA32_DS_AREA:
+        if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) )
+        {
+            if ( !is_canonical_address(msr_content) )
+            {
+                gdprintk(XENLOG_WARNING,
+                         "Illegal address for IA32_DS_AREA: %#" PRIx64 "x\n",
+                         msr_content);
+                vmx_inject_hw_exception(TRAP_gp_fault, 0);
+                return 1;
+            }
+            core2_vpmu_cxt->pmu_enable->ds_area_enable = msr_content ? 1 : 0;
+            break;
+        }
         gdprintk(XENLOG_WARNING, "Guest setting of DTS is ignored.\n");
         return 1;
     case MSR_CORE_PERF_GLOBAL_CTRL:
@@ -471,6 +504,7 @@
         pmu_enable |= core2_vpmu_cxt->pmu_enable->fixed_ctr_enable[i];
     for ( i = 0; i < core2_get_pmc_count(); i++ )
         pmu_enable |= core2_vpmu_cxt->pmu_enable->arch_pmc_enable[i];
+    pmu_enable |= core2_vpmu_cxt->pmu_enable->ds_area_enable;
     if ( pmu_enable )
         vpmu_set(vpmu, VPMU_RUNNING);
     else
@@ -496,6 +530,8 @@
                 inject_gp = 1;
             break;
         case MSR_TYPE_CTRL:           /* IA32_FIXED_CTR_CTRL */
+            if  ( msr == MSR_IA32_DS_AREA )
+                break;
             /* 4 bits per counter, currently 3 fixed counters implemented. */
             mask = ~((1ull << (3 * 4)) - 1);
             if (msr_content & mask)
@@ -525,25 +561,35 @@
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     struct core2_vpmu_context *core2_vpmu_cxt = NULL;
 
-    if ( !core2_vpmu_msr_common_check(msr, &type, &index) )
-        return 0;
-
-    core2_vpmu_cxt = vpmu->context;
-    switch ( msr )
+    if ( core2_vpmu_msr_common_check(msr, &type, &index) )
     {
-    case MSR_CORE_PERF_GLOBAL_OVF_CTRL:
-        *msr_content = 0;
-        break;
-    case MSR_CORE_PERF_GLOBAL_STATUS:
-        *msr_content = core2_vpmu_cxt->global_ovf_status;
-        break;
-    case MSR_CORE_PERF_GLOBAL_CTRL:
-        vmx_read_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, msr_content);
-        break;
-    default:
-        rdmsrl(msr, *msr_content);
+        core2_vpmu_cxt = vpmu->context;
+        switch ( msr )
+        {
+        case MSR_CORE_PERF_GLOBAL_OVF_CTRL:
+            *msr_content = 0;
+            break;
+        case MSR_CORE_PERF_GLOBAL_STATUS:
+            *msr_content = core2_vpmu_cxt->global_ovf_status;
+            break;
+        case MSR_CORE_PERF_GLOBAL_CTRL:
+            vmx_read_guest_msr(MSR_CORE_PERF_GLOBAL_CTRL, msr_content);
+            break;
+        default:
+            rdmsrl(msr, *msr_content);
+        }
     }
-
+    else
+    {
+        /* Extension for BTS */
+        if ( msr == MSR_IA32_MISC_ENABLE )
+        {
+            if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_BTS) )
+                *msr_content &= ~MSR_IA32_MISC_ENABLE_BTS_UNAVAIL;
+        }
+        else
+            return 0;
+    }
     return 1;
 }
 
@@ -551,6 +597,16 @@
                                 unsigned int *eax, unsigned int *ebx,
                                 unsigned int *ecx, unsigned int *edx)
 {
+    if (input == 0x1)
+    {
+        struct vpmu_struct *vpmu = vcpu_vpmu(current);
+
+        if ( vpmu_is_set(vpmu, VPMU_CPU_HAS_DS) )
+        {
+            /* Switch on the 'Debug Store' feature in CPUID.EAX[1]:EDX[21] */
+            *edx |= cpufeat_mask(X86_FEATURE_DS);
+        }
+    }
 }
 
 static int core2_vpmu_do_interrupt(struct cpu_user_regs *regs)
@@ -564,15 +620,21 @@
     struct vlapic *vlapic = vcpu_vlapic(v);
 
     rdmsrl(MSR_CORE_PERF_GLOBAL_STATUS, msr_content);
-    if ( !msr_content )
-        return 0;
-
-    if ( is_pmc_quirk )
-        handle_pmc_quirk(msr_content);
-
-    core2_vpmu_cxt->global_ovf_status |= msr_content;
-    msr_content = 0xC000000700000000 | ((1 << core2_get_pmc_count()) - 1);
-    wrmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, msr_content);
+    if ( msr_content )
+    {
+        if ( is_pmc_quirk )
+            handle_pmc_quirk(msr_content);
+        core2_vpmu_cxt->global_ovf_status |= msr_content;
+        msr_content = 0xC000000700000000 | ((1 << core2_get_pmc_count()) - 1);
+        wrmsrl(MSR_CORE_PERF_GLOBAL_OVF_CTRL, msr_content);
+    }
+    else
+    {
+        /* No PMC overflow but perhaps a Trace Message interrupt. */
+        msr_content = __vmread(GUEST_IA32_DEBUGCTL);
+        if ( !(msr_content & IA32_DEBUGCTLMSR_TR) )
+            return 0;
+    }
 
     apic_write_around(APIC_LVTPC, apic_read(APIC_LVTPC) & ~APIC_LVT_MASKED);
 
@@ -589,8 +651,53 @@
     return 1;
 }
 
-static int core2_vpmu_initialise(struct vcpu *v)
+static int core2_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
 {
+    struct vpmu_struct *vpmu = vcpu_vpmu(v);
+    u64 msr_content;
+    struct cpuinfo_x86 *c = &current_cpu_data;
+
+    if ( !(vpmu_flags & VPMU_BOOT_BTS) )
+        goto func_out;
+    /* Check the 'Debug Store' feature in the CPUID.EAX[1]:EDX[21] */
+    if ( cpu_has(c, X86_FEATURE_DS) )
+    {
+#ifdef __x86_64__
+        if ( !cpu_has(c, X86_FEATURE_DTES64) )
+        {
+            printk(XENLOG_G_WARNING "CPU doesn't support 64-bit DS Area"
+                   " - Debug Store disabled for d%d:v%d\n",
+                   v->domain->domain_id, v->vcpu_id);
+            goto func_out;
+        }
+#endif
+        vpmu_set(vpmu, VPMU_CPU_HAS_DS);
+        rdmsrl(MSR_IA32_MISC_ENABLE, msr_content);
+        if ( msr_content & MSR_IA32_MISC_ENABLE_BTS_UNAVAIL )
+        {
+            /* If BTS_UNAVAIL is set reset the DS feature. */
+            vpmu_reset(vpmu, VPMU_CPU_HAS_DS);
+            printk(XENLOG_G_WARNING "CPU has set BTS_UNAVAIL"
+                   " - Debug Store disabled for d%d:v%d\n",
+                   v->domain->domain_id, v->vcpu_id);
+        }
+        else
+        {
+            vpmu_set(vpmu, VPMU_CPU_HAS_BTS);
+            if ( !cpu_has(c, X86_FEATURE_DSCPL) )
+                printk(XENLOG_G_INFO
+                       "vpmu: CPU doesn't support CPL-Qualified BTS\n");
+            printk("******************************************************\n");
+            printk("** WARNING: Emulation of BTS Feature is switched on **\n");
+            printk("** Using this processor feature in a virtualized    **\n");
+            printk("** environment is not 100%% safe.                   **\n");
+            printk("** Setting the DS buffer address with wrong values  **\n");
+            printk("** may lead to hypervisor hangs or crashes.         **\n");
+            printk("** It is NOT recommended for production use!        **\n");
+            printk("******************************************************\n");
+        }
+    }
+func_out:
     check_pmc_quirk();
     return 0;
 }
@@ -620,11 +727,12 @@
     .arch_vpmu_load = core2_vpmu_load
 };
 
-int vmx_vpmu_initialise(struct vcpu *v)
+int vmx_vpmu_initialise(struct vcpu *v, unsigned int vpmu_flags)
 {
     struct vpmu_struct *vpmu = vcpu_vpmu(v);
     uint8_t family = current_cpu_data.x86;
     uint8_t cpu_model = current_cpu_data.x86_model;
+    int ret = 0;
 
     if ( family == 6 )
     {
@@ -639,8 +747,10 @@
         case 46:
         case 47:
         case 58:
-            vpmu->arch_vpmu_ops = &core2_vpmu_ops;
-            return core2_vpmu_initialise(v);
+            ret = core2_vpmu_initialise(v, vpmu_flags);
+            if ( !ret )
+                vpmu->arch_vpmu_ops = &core2_vpmu_ops;
+            return ret;
         }
     }
 
diff -r 28f5f047d060 -r bd685bff45b3 xen/arch/x86/hvm/vpmu.c
--- a/xen/arch/x86/hvm/vpmu.c	Thu Mar 15 15:11:30 2012 +0100
+++ b/xen/arch/x86/hvm/vpmu.c	Thu Mar 15 15:13:00 2012 +0100
@@ -32,8 +32,36 @@
 #include <asm/hvm/svm/svm.h>
 #include <asm/hvm/svm/vmcb.h>
 
-static bool_t __read_mostly opt_vpmu_enabled;
-boolean_param("vpmu", opt_vpmu_enabled);
+
+/*
+ * "vpmu" :     vpmu generally enabled
+ * "vpmu=off" : vpmu generally disabled
+ * "vpmu=bts" : vpmu enabled and Intel BTS feature switched on.
+ */
+static unsigned int __read_mostly opt_vpmu_enabled;
+static void parse_vpmu_param(char *s);
+custom_param("vpmu", parse_vpmu_param);
+
+static void __init parse_vpmu_param(char *s)
+{
+    switch ( parse_bool(s) )
+    {
+    case 0:
+        break;
+    default:
+        if ( !strcmp(s, "bts") )
+            opt_vpmu_enabled |= VPMU_BOOT_BTS;
+        else if ( *s )
+        {
+            printk("VPMU: unknown flag: %s - vpmu disabled!\n", s);
+            break;
+        }
+        /* fall through */
+    case 1:
+        opt_vpmu_enabled |= VPMU_BOOT_ENABLED;
+        break;
+    }
+}
 
 int vpmu_do_wrmsr(unsigned int msr, uint64_t msr_content)
 {
@@ -104,12 +132,12 @@
     switch ( vendor )
     {
     case X86_VENDOR_AMD:
-        if ( svm_vpmu_initialise(v) != 0 )
+        if ( svm_vpmu_initialise(v, opt_vpmu_enabled) != 0 )
             opt_vpmu_enabled = 0;
         break;
 
     case X86_VENDOR_INTEL:
-        if ( vmx_vpmu_initialise(v) != 0 )
+        if ( vmx_vpmu_initialise(v, opt_vpmu_enabled) != 0 )
             opt_vpmu_enabled = 0;
         break;
 
diff -r 28f5f047d060 -r bd685bff45b3 xen/include/asm-x86/hvm/vmx/vpmu_core2.h
--- a/xen/include/asm-x86/hvm/vmx/vpmu_core2.h	Thu Mar 15 15:11:30 2012 +0100
+++ b/xen/include/asm-x86/hvm/vmx/vpmu_core2.h	Thu Mar 15 15:13:00 2012 +0100
@@ -29,6 +29,7 @@
 };
 
 struct core2_pmu_enable {
+    char ds_area_enable;
     char fixed_ctr_enable[3];
     char arch_pmc_enable[1];
 };
diff -r 28f5f047d060 -r bd685bff45b3 xen/include/asm-x86/hvm/vpmu.h
--- a/xen/include/asm-x86/hvm/vpmu.h	Thu Mar 15 15:11:30 2012 +0100
+++ b/xen/include/asm-x86/hvm/vpmu.h	Thu Mar 15 15:13:00 2012 +0100
@@ -22,6 +22,14 @@
 #ifndef __ASM_X86_HVM_VPMU_H_
 #define __ASM_X86_HVM_VPMU_H_
 
+/*
+ * Flag bits given as a string on the hypervisor boot parameter 'vpmu'.
+ * See arch/x86/hvm/vpmu.c.
+ */
+#define VPMU_BOOT_ENABLED 0x1    /* vpmu generally enabled. */
+#define VPMU_BOOT_BTS     0x2    /* Intel BTS feature wanted. */
+
+
 #define msraddr_to_bitpos(x) (((x)&0xffff) + ((x)>>31)*0x2000)
 #define vcpu_vpmu(vcpu)   (&((vcpu)->arch.hvm_vcpu.vpmu))
 #define vpmu_vcpu(vpmu)   (container_of((vpmu), struct vcpu, \
@@ -48,8 +56,8 @@
     void (*arch_vpmu_load)(struct vcpu *v);
 };
 
-int vmx_vpmu_initialise(struct vcpu *v);
-int svm_vpmu_initialise(struct vcpu *v);
+int vmx_vpmu_initialise(struct vcpu *, unsigned int flags);
+int svm_vpmu_initialise(struct vcpu *, unsigned int flags);
 
 struct vpmu_struct {
     u32 flags;
@@ -61,6 +69,9 @@
 #define VPMU_CONTEXT_LOADED                 0x2
 #define VPMU_RUNNING                        0x4
 #define VPMU_PASSIVE_DOMAIN_ALLOCATED       0x8
+#define VPMU_CPU_HAS_DS                     0x10 /* Has Debug Store */
+#define VPMU_CPU_HAS_BTS                    0x20 /* Has Branch Trace Store */
+
 
 #define vpmu_set(_vpmu, _x)    ((_vpmu)->flags |= (_x))
 #define vpmu_reset(_vpmu, _x)  ((_vpmu)->flags &= ~(_x))
diff -r 28f5f047d060 -r bd685bff45b3 xen/include/asm-x86/msr-index.h
--- a/xen/include/asm-x86/msr-index.h	Thu Mar 15 15:11:30 2012 +0100
+++ b/xen/include/asm-x86/msr-index.h	Thu Mar 15 15:13:00 2012 +0100
@@ -67,6 +67,11 @@
 #define MSR_IA32_DEBUGCTLMSR		0x000001d9
 #define IA32_DEBUGCTLMSR_LBR		(1<<0) /* Last Branch Record */
 #define IA32_DEBUGCTLMSR_BTF		(1<<1) /* Single Step on Branches */
+#define IA32_DEBUGCTLMSR_TR		(1<<6) /* Trace Message Enable */
+#define IA32_DEBUGCTLMSR_BTS		(1<<7) /* Branch Trace Store */
+#define IA32_DEBUGCTLMSR_BTINT		(1<<8) /* Branch Trace Interrupt */
+#define IA32_DEBUGCTLMSR_BTS_OFF_OS	(1<<9)  /* BTS off if CPL 0 */
+#define IA32_DEBUGCTLMSR_BTS_OFF_USR	(1<<10) /* BTS off if CPL > 0 */
 
 #define MSR_IA32_LASTBRANCHFROMIP	0x000001db
 #define MSR_IA32_LASTBRANCHTOIP		0x000001dc

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Or2-0004O7-Nz; Fri, 16 Mar 2012 04:33:28 +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 1S8Or1-000456-E8
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:27 +0000
Received: from [85.158.143.99:52163] by server-2.bemta-4.messagelabs.com id
	D5/D6-17550-792C26F4; Fri, 16 Mar 2012 04:33:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1331872405!13690721!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20711 invoked from network); 16 Mar 2012 04:33:26 -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;
	16 Mar 2012 04:33: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 1S8Oqy-0005LA-W5
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqy-0002T4-Uf
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:24 +0000
Message-Id: <E1S8Oqy-0002T4-Uf@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: don't use atomic operations to
	gate non-boot 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331824837 0
# Node ID 1b68427875f7ffe3025ea13c7f6e8cf71ce54769
# Parent  18c6237939c39cf50179d458b645814cd588b757
arm: don't use atomic operations to gate non-boot CPUs

Since the cache is not enabled that early, better not to rely on
load-linked/store-conditional.  Instead, have the boot CPU call the
other CPUs by their IDs, just like we do later for proper CPU bringup.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 18c6237939c3 -r 1b68427875f7 xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Thu Mar 15 15:20:37 2012 +0000
+++ b/xen/arch/arm/head.S	Thu Mar 15 15:20:37 2012 +0000
@@ -71,16 +71,13 @@
 	bics  r12, r0, #(0xff << 24) /* Mask out flags to get CPU ID */
 	beq   boot_cpu               /* If we're CPU 0, boot now */
 
-	/* Non-boot CPUs wait here to be woken up one at a time.
-	 * This is basically an open-coded spin-lock to serialize. */
-	ldr   r0, =boot_gate         /* VA of gate */
+	/* Non-boot CPUs wait here to be woken up one at a time. */
+1:	wfe
+	dsb
+	ldr   r0, =smp_up_cpu        /* VA of gate */
 	add   r0, r0, r10            /* PA of gate */
-	mov   r1, #1                 /* (1 == locked) */
-1:	wfe
-	ldrex r2, [r0]               /* Linked read of current value */
-	teq   r2, #0                 /* (0 == unlocked) */
-	strexeq r2, r1, [r0]         /* Matching update -> locked */
-	teq   r2, #0                 /* (0 == succeeded) */
+	ldr   r1, [r0]               /* Which CPU is being booted? */
+	teq   r1, r12                /* Is it us? */
 	bne   1b
 
 boot_cpu:
@@ -270,16 +267,7 @@
 	teq   r12, #0
 	beq   launch
 
-	/* Signal the next non-boot CPU to come and join us here */
-	ldr   r0, =boot_gate         /* VA of gate */
-	add   r0, r0, r10            /* PA of gate */
-	mov   r1, #0                 /* (0 == unlocked) */
-	str   r1, [r0]
-	dsb
-	isb
-	sev
-
-	/* Move on to the relocated pagetables */
+	/* Non-boot CPUs need to move on to the relocated pagetables */
 	mov   r0, #0
 	ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
 	add   r4, r4, r10            /* PA of it */
diff -r 18c6237939c3 -r 1b68427875f7 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Thu Mar 15 15:20:37 2012 +0000
+++ b/xen/arch/arm/setup.c	Thu Mar 15 15:20:37 2012 +0000
@@ -38,11 +38,6 @@
 #include <asm/setup.h>
 #include "gic.h"
 
-/* Spinlock for serializing CPU bringup */
-unsigned long __initdata boot_gate = 1;
-/* Number of non-boot CPUs ready to enter C */
-unsigned long __initdata ready_cpus = 0;
-
 static __attribute_used__ void init_done(void)
 {
     free_init_memory();
@@ -152,8 +147,6 @@
     void *fdt;
     size_t fdt_size;
     int cpus, i;
-    paddr_t gate_pa;
-    unsigned long *gate;
 
     fdt = (void *)BOOT_MISC_VIRT_START
         + (atag_paddr & ((1 << SECOND_SHIFT) - 1));
@@ -169,25 +162,11 @@
     console_init_preirq();
 #endif
 
+    cpus = gic_init();
+    make_cpus_ready(cpus, boot_phys_offset);
+
     percpu_init_areas();
     set_processor_id(0); /* needed early, for smp_processor_id() */
-
-    cpus = gic_init();
-
-    printk("Waiting for %i other CPUs to be ready\n", cpus - 1);
-    /* Bring the other CPUs up to paging before the original
-     * copy of .text gets overwritten.  We need to use the unrelocated
-     * copy of boot_gate as that's the one the others can see. */ 
-    gate_pa = ((unsigned long) &boot_gate) + boot_phys_offset;
-    gate = map_domain_page(gate_pa >> PAGE_SHIFT) + (gate_pa & ~PAGE_MASK); 
-    *gate = 0;
-    unmap_domain_page(gate);
-    /* Now send an event to wake the first non-boot CPU */
-    asm volatile("dsb; isb; sev");
-    /* And wait for them all to be ready. */
-    while ( ready_cpus + 1 < cpus )
-        smp_rmb();
-
     __set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
 
diff -r 18c6237939c3 -r 1b68427875f7 xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Thu Mar 15 15:20:37 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Thu Mar 15 15:20:37 2012 +0000
@@ -19,6 +19,7 @@
 #include <xen/cpu.h>
 #include <xen/cpumask.h>
 #include <xen/delay.h>
+#include <xen/domain_page.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/mm.h>
@@ -41,11 +42,17 @@
 /* Pointer to the stack, used by head.S when entering C */
 unsigned char *init_stack = cpu0_boot_stack;
 
+/* Shared state for coordinating CPU bringup */
+unsigned long smp_up_cpu = 0;
+static bool_t cpu_is_dead = 0;
+
+/* Number of non-boot CPUs ready to enter C */
+unsigned long __initdata ready_cpus = 0;
+
 void __init
 smp_prepare_cpus (unsigned int max_cpus)
 {
     int i;
-    set_processor_id(0); /* needed early, for smp_processor_id() */
 
     cpumask_clear(&cpu_online_map);
     cpumask_set_cpu(0, &cpu_online_map);
@@ -56,9 +63,30 @@
     cpumask_copy(&cpu_present_map, &cpu_possible_map);
 }
 
-/* Shared state for coordinating CPU bringup */
-unsigned long smp_up_cpu = 0;
-static bool_t cpu_is_dead = 0;
+void __init
+make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset)
+{
+    unsigned long *gate;
+    paddr_t gate_pa;
+    int i;
+
+    printk("Waiting for %i other CPUs to be ready\n", max_cpus - 1);
+    /* We use the unrelocated copy of smp_up_cpu as that's the one the
+     * others can see. */ 
+    gate_pa = ((paddr_t) (unsigned long) &smp_up_cpu) + boot_phys_offset;
+    gate = map_domain_page(gate_pa >> PAGE_SHIFT) + (gate_pa & ~PAGE_MASK); 
+    for ( i = 1; i < max_cpus; i++ )
+    {
+        /* Tell the next CPU to get ready */
+        /* TODO: handle boards where CPUIDs are not contiguous */
+        *gate = i;
+        asm volatile("dsb; isb; sev");
+        /* And wait for it to respond */
+        while ( ready_cpus < i )
+            smp_rmb();
+    }
+    unmap_domain_page(gate);
+}
 
 /* Boot the current CPU */
 void __cpuinit start_secondary(unsigned long boot_phys_offset,
diff -r 18c6237939c3 -r 1b68427875f7 xen/include/asm-arm/smp.h
--- a/xen/include/asm-arm/smp.h	Thu Mar 15 15:20:37 2012 +0000
+++ b/xen/include/asm-arm/smp.h	Thu Mar 15 15:20:37 2012 +0000
@@ -16,6 +16,12 @@
 
 extern void stop_cpu(void);
 
+/* Bring the non-boot CPUs up to paging and ready to enter C.  
+ * Must be called after Xen is relocated but before the original copy of
+ * .text gets overwritten. */
+extern void
+make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset);
+
 #endif
 /*
  * Local variables:

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Or2-0004O7-Nz; Fri, 16 Mar 2012 04:33:28 +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 1S8Or1-000456-E8
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:27 +0000
Received: from [85.158.143.99:52163] by server-2.bemta-4.messagelabs.com id
	D5/D6-17550-792C26F4; Fri, 16 Mar 2012 04:33:27 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1331872405!13690721!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20711 invoked from network); 16 Mar 2012 04:33:26 -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;
	16 Mar 2012 04:33: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 1S8Oqy-0005LA-W5
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqy-0002T4-Uf
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:24 +0000
Message-Id: <E1S8Oqy-0002T4-Uf@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:24 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: don't use atomic operations to
	gate non-boot 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331824837 0
# Node ID 1b68427875f7ffe3025ea13c7f6e8cf71ce54769
# Parent  18c6237939c39cf50179d458b645814cd588b757
arm: don't use atomic operations to gate non-boot CPUs

Since the cache is not enabled that early, better not to rely on
load-linked/store-conditional.  Instead, have the boot CPU call the
other CPUs by their IDs, just like we do later for proper CPU bringup.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 18c6237939c3 -r 1b68427875f7 xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Thu Mar 15 15:20:37 2012 +0000
+++ b/xen/arch/arm/head.S	Thu Mar 15 15:20:37 2012 +0000
@@ -71,16 +71,13 @@
 	bics  r12, r0, #(0xff << 24) /* Mask out flags to get CPU ID */
 	beq   boot_cpu               /* If we're CPU 0, boot now */
 
-	/* Non-boot CPUs wait here to be woken up one at a time.
-	 * This is basically an open-coded spin-lock to serialize. */
-	ldr   r0, =boot_gate         /* VA of gate */
+	/* Non-boot CPUs wait here to be woken up one at a time. */
+1:	wfe
+	dsb
+	ldr   r0, =smp_up_cpu        /* VA of gate */
 	add   r0, r0, r10            /* PA of gate */
-	mov   r1, #1                 /* (1 == locked) */
-1:	wfe
-	ldrex r2, [r0]               /* Linked read of current value */
-	teq   r2, #0                 /* (0 == unlocked) */
-	strexeq r2, r1, [r0]         /* Matching update -> locked */
-	teq   r2, #0                 /* (0 == succeeded) */
+	ldr   r1, [r0]               /* Which CPU is being booted? */
+	teq   r1, r12                /* Is it us? */
 	bne   1b
 
 boot_cpu:
@@ -270,16 +267,7 @@
 	teq   r12, #0
 	beq   launch
 
-	/* Signal the next non-boot CPU to come and join us here */
-	ldr   r0, =boot_gate         /* VA of gate */
-	add   r0, r0, r10            /* PA of gate */
-	mov   r1, #0                 /* (0 == unlocked) */
-	str   r1, [r0]
-	dsb
-	isb
-	sev
-
-	/* Move on to the relocated pagetables */
+	/* Non-boot CPUs need to move on to the relocated pagetables */
 	mov   r0, #0
 	ldr   r4, =boot_httbr        /* VA of HTTBR value stashed by CPU 0 */
 	add   r4, r4, r10            /* PA of it */
diff -r 18c6237939c3 -r 1b68427875f7 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Thu Mar 15 15:20:37 2012 +0000
+++ b/xen/arch/arm/setup.c	Thu Mar 15 15:20:37 2012 +0000
@@ -38,11 +38,6 @@
 #include <asm/setup.h>
 #include "gic.h"
 
-/* Spinlock for serializing CPU bringup */
-unsigned long __initdata boot_gate = 1;
-/* Number of non-boot CPUs ready to enter C */
-unsigned long __initdata ready_cpus = 0;
-
 static __attribute_used__ void init_done(void)
 {
     free_init_memory();
@@ -152,8 +147,6 @@
     void *fdt;
     size_t fdt_size;
     int cpus, i;
-    paddr_t gate_pa;
-    unsigned long *gate;
 
     fdt = (void *)BOOT_MISC_VIRT_START
         + (atag_paddr & ((1 << SECOND_SHIFT) - 1));
@@ -169,25 +162,11 @@
     console_init_preirq();
 #endif
 
+    cpus = gic_init();
+    make_cpus_ready(cpus, boot_phys_offset);
+
     percpu_init_areas();
     set_processor_id(0); /* needed early, for smp_processor_id() */
-
-    cpus = gic_init();
-
-    printk("Waiting for %i other CPUs to be ready\n", cpus - 1);
-    /* Bring the other CPUs up to paging before the original
-     * copy of .text gets overwritten.  We need to use the unrelocated
-     * copy of boot_gate as that's the one the others can see. */ 
-    gate_pa = ((unsigned long) &boot_gate) + boot_phys_offset;
-    gate = map_domain_page(gate_pa >> PAGE_SHIFT) + (gate_pa & ~PAGE_MASK); 
-    *gate = 0;
-    unmap_domain_page(gate);
-    /* Now send an event to wake the first non-boot CPU */
-    asm volatile("dsb; isb; sev");
-    /* And wait for them all to be ready. */
-    while ( ready_cpus + 1 < cpus )
-        smp_rmb();
-
     __set_current((struct vcpu *)0xfffff000); /* debug sanity */
     idle_vcpu[0] = current;
 
diff -r 18c6237939c3 -r 1b68427875f7 xen/arch/arm/smpboot.c
--- a/xen/arch/arm/smpboot.c	Thu Mar 15 15:20:37 2012 +0000
+++ b/xen/arch/arm/smpboot.c	Thu Mar 15 15:20:37 2012 +0000
@@ -19,6 +19,7 @@
 #include <xen/cpu.h>
 #include <xen/cpumask.h>
 #include <xen/delay.h>
+#include <xen/domain_page.h>
 #include <xen/errno.h>
 #include <xen/init.h>
 #include <xen/mm.h>
@@ -41,11 +42,17 @@
 /* Pointer to the stack, used by head.S when entering C */
 unsigned char *init_stack = cpu0_boot_stack;
 
+/* Shared state for coordinating CPU bringup */
+unsigned long smp_up_cpu = 0;
+static bool_t cpu_is_dead = 0;
+
+/* Number of non-boot CPUs ready to enter C */
+unsigned long __initdata ready_cpus = 0;
+
 void __init
 smp_prepare_cpus (unsigned int max_cpus)
 {
     int i;
-    set_processor_id(0); /* needed early, for smp_processor_id() */
 
     cpumask_clear(&cpu_online_map);
     cpumask_set_cpu(0, &cpu_online_map);
@@ -56,9 +63,30 @@
     cpumask_copy(&cpu_present_map, &cpu_possible_map);
 }
 
-/* Shared state for coordinating CPU bringup */
-unsigned long smp_up_cpu = 0;
-static bool_t cpu_is_dead = 0;
+void __init
+make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset)
+{
+    unsigned long *gate;
+    paddr_t gate_pa;
+    int i;
+
+    printk("Waiting for %i other CPUs to be ready\n", max_cpus - 1);
+    /* We use the unrelocated copy of smp_up_cpu as that's the one the
+     * others can see. */ 
+    gate_pa = ((paddr_t) (unsigned long) &smp_up_cpu) + boot_phys_offset;
+    gate = map_domain_page(gate_pa >> PAGE_SHIFT) + (gate_pa & ~PAGE_MASK); 
+    for ( i = 1; i < max_cpus; i++ )
+    {
+        /* Tell the next CPU to get ready */
+        /* TODO: handle boards where CPUIDs are not contiguous */
+        *gate = i;
+        asm volatile("dsb; isb; sev");
+        /* And wait for it to respond */
+        while ( ready_cpus < i )
+            smp_rmb();
+    }
+    unmap_domain_page(gate);
+}
 
 /* Boot the current CPU */
 void __cpuinit start_secondary(unsigned long boot_phys_offset,
diff -r 18c6237939c3 -r 1b68427875f7 xen/include/asm-arm/smp.h
--- a/xen/include/asm-arm/smp.h	Thu Mar 15 15:20:37 2012 +0000
+++ b/xen/include/asm-arm/smp.h	Thu Mar 15 15:20:37 2012 +0000
@@ -16,6 +16,12 @@
 
 extern void stop_cpu(void);
 
+/* Bring the non-boot CPUs up to paging and ready to enter C.  
+ * Must be called after Xen is relocated but before the original copy of
+ * .text gets overwritten. */
+extern void
+make_cpus_ready(unsigned int max_cpus, unsigned long boot_phys_offset);
+
 #endif
 /*
  * Local variables:

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Or2-0004Om-TW; Fri, 16 Mar 2012 04:33:28 +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 1S8Or1-00048P-KS
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:27 +0000
Received: from [85.158.143.35:55238] by server-1.bemta-4.messagelabs.com id
	96/67-20925-692C26F4; Fri, 16 Mar 2012 04:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1331872404!12154099!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14905 invoked from network); 16 Mar 2012 04:33:25 -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;
	16 Mar 2012 04:33: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 1S8Oqy-0005L0-FL
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqy-0002Sc-EO
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:24 +0000
Message-Id: <E1S8Oqy-0002Sc-EO@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: map DTB as outer- rather than
	inner-shareable.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331824837 0
# Node ID 18c6237939c39cf50179d458b645814cd588b757
# Parent  bd685bff45b3f973e4ce979a89defdac1961925b
arm: map DTB as outer- rather than inner-shareable.

This is consistent with how we map Xen which is important if they happen to be
in the same 2MB super page (which they generally are)

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r bd685bff45b3 -r 18c6237939c3 xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Thu Mar 15 15:13:00 2012 +0100
+++ b/xen/arch/arm/head.S	Thu Mar 15 15:20:37 2012 +0000
@@ -238,7 +238,7 @@
 	mov   r3, #0x0
 	lsr   r2, r8, #21
 	lsl   r2, r2, #21            /* 2MB-aligned paddr of DTB */
-	orr   r2, r2, #0xf00
+	orr   r2, r2, #0xe00
 	orr   r2, r2, #0x07d         /* r2:r3 := 2MB RAM incl. DTB */
 	add   r4, r4, #8
 	strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Or2-0004Om-TW; Fri, 16 Mar 2012 04:33:28 +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 1S8Or1-00048P-KS
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:27 +0000
Received: from [85.158.143.35:55238] by server-1.bemta-4.messagelabs.com id
	96/67-20925-692C26F4; Fri, 16 Mar 2012 04:33:26 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-21.messagelabs.com!1331872404!12154099!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 14905 invoked from network); 16 Mar 2012 04:33:25 -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;
	16 Mar 2012 04:33: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 1S8Oqy-0005L0-FL
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:24 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqy-0002Sc-EO
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:24 +0000
Message-Id: <E1S8Oqy-0002Sc-EO@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:23 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: map DTB as outer- rather than
	inner-shareable.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331824837 0
# Node ID 18c6237939c39cf50179d458b645814cd588b757
# Parent  bd685bff45b3f973e4ce979a89defdac1961925b
arm: map DTB as outer- rather than inner-shareable.

This is consistent with how we map Xen which is important if they happen to be
in the same 2MB super page (which they generally are)

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r bd685bff45b3 -r 18c6237939c3 xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Thu Mar 15 15:13:00 2012 +0100
+++ b/xen/arch/arm/head.S	Thu Mar 15 15:20:37 2012 +0000
@@ -238,7 +238,7 @@
 	mov   r3, #0x0
 	lsr   r2, r8, #21
 	lsl   r2, r2, #21            /* 2MB-aligned paddr of DTB */
-	orr   r2, r2, #0xf00
+	orr   r2, r2, #0xe00
 	orr   r2, r2, #0x07d         /* r2:r3 := 2MB RAM incl. DTB */
 	add   r4, r4, #8
 	strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Or4-0004Ra-2B; Fri, 16 Mar 2012 04:33:30 +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 1S8Or3-0004OQ-C5
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:29 +0000
Received: from [85.158.139.83:11107] by server-8.bemta-5.messagelabs.com id
	DB/A1-26964-892C26F4; Fri, 16 Mar 2012 04:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1331872403!12258176!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30836 invoked from network); 16 Mar 2012 04:33:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33: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 1S8Oqw-0005Ka-RX
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqw-0002RC-QS
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:22 +0000
Message-Id: <E1S8Oqw-0002RC-QS@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] svm: amend c/s 24990:322300fd2ebd
	(fake BU_CFG MSR on AMD revF)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331820558 -3600
# Node ID f47d91cb0faac1f8b505bc5f61c9608d39010992
# Parent  4da1453ed61c28a366162b49b2f59f62e070a799
svm: amend c/s 24990:322300fd2ebd (fake BU_CFG MSR on AMD revF)

Let's restrict such a hack to the known affected family.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---


diff -r 4da1453ed61c -r f47d91cb0faa xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Thu Mar 15 11:47:27 2012 +0000
+++ b/xen/arch/x86/hvm/svm/svm.c	Thu Mar 15 15:09:18 2012 +0100
@@ -1505,7 +1505,7 @@
         if ( rdmsr_safe(msr, *msr_content) == 0 )
             break;
 
-        if ( msr == MSR_F10_BU_CFG )
+        if ( boot_cpu_data.x86 == 0xf && msr == MSR_F10_BU_CFG )
         {
             /* Win2k8 x64 reads this MSR on revF chips, where it
              * wasn't publically available; it uses a magic constant

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

From xen-changelog-bounces@lists.xen.org Fri Mar 16 04:33:30 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 16 Mar 2012 04:33:30 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8Or4-0004Ra-2B; Fri, 16 Mar 2012 04:33:30 +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 1S8Or3-0004OQ-C5
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:29 +0000
Received: from [85.158.139.83:11107] by server-8.bemta-5.messagelabs.com id
	DB/A1-26964-892C26F4; Fri, 16 Mar 2012 04:33:28 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1331872403!12258176!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30836 invoked from network); 16 Mar 2012 04:33:27 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	16 Mar 2012 04:33: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 1S8Oqw-0005Ka-RX
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:22 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8Oqw-0002RC-QS
	for xen-changelog@lists.xensource.com; Fri, 16 Mar 2012 04:33:22 +0000
Message-Id: <E1S8Oqw-0002RC-QS@xenbits.xen.org>
Date: Fri, 16 Mar 2012 04:33:22 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] svm: amend c/s 24990:322300fd2ebd
	(fake BU_CFG MSR on AMD revF)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331820558 -3600
# Node ID f47d91cb0faac1f8b505bc5f61c9608d39010992
# Parent  4da1453ed61c28a366162b49b2f59f62e070a799
svm: amend c/s 24990:322300fd2ebd (fake BU_CFG MSR on AMD revF)

Let's restrict such a hack to the known affected family.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
---


diff -r 4da1453ed61c -r f47d91cb0faa xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Thu Mar 15 11:47:27 2012 +0000
+++ b/xen/arch/x86/hvm/svm/svm.c	Thu Mar 15 15:09:18 2012 +0100
@@ -1505,7 +1505,7 @@
         if ( rdmsr_safe(msr, *msr_content) == 0 )
             break;
 
-        if ( msr == MSR_F10_BU_CFG )
+        if ( boot_cpu_data.x86 == 0xf && msr == MSR_F10_BU_CFG )
         {
             /* Win2k8 x64 reads this MSR on revF chips, where it
              * wasn't publically available; it uses a magic constant

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8irY-0006cZ-Ih; Sat, 17 Mar 2012 01: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 1S8irX-0006cG-QH
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:19 +0000
Received: from [85.158.143.99:34359] by server-2.bemta-4.messagelabs.com id
	42/94-17550-70FE36F4; Sat, 17 Mar 2012 01:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331949317!14298439!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32636 invoked from network); 17 Mar 2012 01:55: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;
	17 Mar 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 1S8irU-0005bU-Hz
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irU-0005Wv-FL
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:16 +0000
Message-Id: <E1S8irU-0005Wv-FL@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] list maintainers of
	unmodified_drivers/linux-2.6/
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331894002 -3600
# Node ID be9aaa70e513c16547a4984d92f3599e0aada371
# Parent  377c075ec0ecf0364cc0b48862dc9e6a39afe5cf
list maintainers of unmodified_drivers/linux-2.6/

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


diff -r 377c075ec0ec -r be9aaa70e513 MAINTAINERS
--- a/MAINTAINERS	Fri Mar 16 10:30:12 2012 +0000
+++ b/MAINTAINERS	Fri Mar 16 11:33:22 2012 +0100
@@ -228,6 +228,13 @@
 F:	xen/include/xen/tmem*
 F:	docs/misc/tmem*
 
+UNMODIFIED LINUX PV DRIVERS
+M:	Keir Fraser <keir@xen.org>
+M:	Jan Beulich <jbeulich@suse.com>
+S:	Obsolete
+L:	xen-devel@lists.xen.org
+F:	unmodified_drivers/linux-2.6/
+
 USB PV DRIVERS
 M:	Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
 S:	Supported

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8irY-0006cZ-Ih; Sat, 17 Mar 2012 01: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 1S8irX-0006cG-QH
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:19 +0000
Received: from [85.158.143.99:34359] by server-2.bemta-4.messagelabs.com id
	42/94-17550-70FE36F4; Sat, 17 Mar 2012 01:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331949317!14298439!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32636 invoked from network); 17 Mar 2012 01:55: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;
	17 Mar 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 1S8irU-0005bU-Hz
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irU-0005Wv-FL
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:16 +0000
Message-Id: <E1S8irU-0005Wv-FL@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] list maintainers of
	unmodified_drivers/linux-2.6/
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331894002 -3600
# Node ID be9aaa70e513c16547a4984d92f3599e0aada371
# Parent  377c075ec0ecf0364cc0b48862dc9e6a39afe5cf
list maintainers of unmodified_drivers/linux-2.6/

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


diff -r 377c075ec0ec -r be9aaa70e513 MAINTAINERS
--- a/MAINTAINERS	Fri Mar 16 10:30:12 2012 +0000
+++ b/MAINTAINERS	Fri Mar 16 11:33:22 2012 +0100
@@ -228,6 +228,13 @@
 F:	xen/include/xen/tmem*
 F:	docs/misc/tmem*
 
+UNMODIFIED LINUX PV DRIVERS
+M:	Keir Fraser <keir@xen.org>
+M:	Jan Beulich <jbeulich@suse.com>
+S:	Obsolete
+L:	xen-devel@lists.xen.org
+F:	unmodified_drivers/linux-2.6/
+
 USB PV DRIVERS
 M:	Noboru Iwamatsu <n_iwamatsu@jp.fujitsu.com>
 S:	Supported

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8ira-0006dR-0z; Sat, 17 Mar 2012 01:55:22 +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 1S8irZ-0006cD-5g
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:21 +0000
Received: from [193.109.254.147:65102] by server-8.bemta-14.messagelabs.com id
	62/9C-23244-80FE36F4; Sat, 17 Mar 2012 01:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1331949319!909292!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29637 invoked from network); 17 Mar 2012 01:55:20 -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;
	17 Mar 2012 01:55: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 1S8irW-0005bg-Ja
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irW-0005Yh-IC
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:18 +0000
Message-Id: <E1S8irW-0005Yh-IC@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] kexec: Fix printing of paddr_t in
	32bit mode.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331911465 0
# Node ID 4e1d091d10d83130842170cd61f1194e5459f2aa
# Parent  46bf3ab42baf922bdd43d8cbe672ae1b18e31ed9
kexec: Fix printing of paddr_t in 32bit mode.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 46bf3ab42baf -r 4e1d091d10d8 xen/common/kexec.c
--- a/xen/common/kexec.c	Fri Mar 16 11:35:06 2012 +0100
+++ b/xen/common/kexec.c	Fri Mar 16 15:24:25 2012 +0000
@@ -207,8 +207,8 @@
     if ( (addr = parse_size_and_unit(str, NULL)) )
         crashinfo_maxaddr = addr;
     else
-        printk("Unable to parse crashinfo_maxaddr. Defaulting to %p\n",
-               (void*)crashinfo_maxaddr);
+        printk("Unable to parse crashinfo_maxaddr. Defaulting to %"PRIpaddr"\n",
+               crashinfo_maxaddr);
 }
 custom_param("crashinfo_maxaddr", parse_crashinfo_maxaddr);
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8ira-0006dR-0z; Sat, 17 Mar 2012 01:55:22 +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 1S8irZ-0006cD-5g
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:21 +0000
Received: from [193.109.254.147:65102] by server-8.bemta-14.messagelabs.com id
	62/9C-23244-80FE36F4; Sat, 17 Mar 2012 01:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1331949319!909292!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29637 invoked from network); 17 Mar 2012 01:55:20 -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;
	17 Mar 2012 01:55: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 1S8irW-0005bg-Ja
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irW-0005Yh-IC
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:18 +0000
Message-Id: <E1S8irW-0005Yh-IC@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:18 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] kexec: Fix printing of paddr_t in
	32bit mode.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331911465 0
# Node ID 4e1d091d10d83130842170cd61f1194e5459f2aa
# Parent  46bf3ab42baf922bdd43d8cbe672ae1b18e31ed9
kexec: Fix printing of paddr_t in 32bit mode.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 46bf3ab42baf -r 4e1d091d10d8 xen/common/kexec.c
--- a/xen/common/kexec.c	Fri Mar 16 11:35:06 2012 +0100
+++ b/xen/common/kexec.c	Fri Mar 16 15:24:25 2012 +0000
@@ -207,8 +207,8 @@
     if ( (addr = parse_size_and_unit(str, NULL)) )
         crashinfo_maxaddr = addr;
     else
-        printk("Unable to parse crashinfo_maxaddr. Defaulting to %p\n",
-               (void*)crashinfo_maxaddr);
+        printk("Unable to parse crashinfo_maxaddr. Defaulting to %"PRIpaddr"\n",
+               crashinfo_maxaddr);
 }
 custom_param("crashinfo_maxaddr", parse_crashinfo_maxaddr);
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8irZ-0006dH-SR; Sat, 17 Mar 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 1S8irY-0006cP-EY
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:20 +0000
Received: from [85.158.143.99:34368] by server-3.bemta-4.messagelabs.com id
	64/7A-05853-70FE36F4; Sat, 17 Mar 2012 01:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331949317!14298440!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32653 invoked from network); 17 Mar 2012 01:55: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;
	17 Mar 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 1S8irV-0005bX-AP
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irV-0005XN-0D
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:17 +0000
Message-Id: <E1S8irV-0005XN-0D@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] unmodified drivers: hide
	xen_cpuid_base() in version 2.6.38+
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331894054 -3600
# Node ID 05768bd498f24d9c5bba83623a7e74cddbd91b78
# Parent  be9aaa70e513c16547a4984d92f3599e0aada371
unmodified drivers: hide xen_cpuid_base() in version 2.6.38+

Allow compilation of PVonHVM drivers with forward-ported xenlinux
sources in openSuSE 12.1.  xen_cpuid_base() is now in mainline, the copy
in the xen tree leads to a compilation error.  The current state leads
to a compile error:

/usr/src/packages/BUILD/xen-4.2.24547/non-dbg/obj/default/platform-pci/platform-pci.c:121: error: redefinition of 'xen_cpuid_base'
/usr/src/linux-3.0.13-0.11/arch/x86/include/asm/xen/hypervisor.h:43: error: previous definition of 'xen_cpuid_base' was here

The reason is that the kernel sources are searched before the xen
sources for asm/hypervisor.h:

/usr/src/linux-3.0.13-0.11/arch/x86/include/asm/hypervisor.h
/usr/src/packages/BUILD/xen-4.2.24547/non-dbg/obj/default/include/asm/hypervisor.h

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


diff -r be9aaa70e513 -r 05768bd498f2 unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c	Fri Mar 16 11:33:22 2012 +0100
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c	Fri Mar 16 11:34:14 2012 +0100
@@ -118,6 +118,7 @@
 
 #ifndef __ia64__
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
 static uint32_t xen_cpuid_base(void)
 {
 	uint32_t base, eax, ebx, ecx, edx;
@@ -136,6 +137,7 @@
 
 	return 0;
 }
+#endif
 
 static int init_hypercall_stubs(void)
 {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8irZ-0006dH-SR; Sat, 17 Mar 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 1S8irY-0006cP-EY
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:20 +0000
Received: from [85.158.143.99:34368] by server-3.bemta-4.messagelabs.com id
	64/7A-05853-70FE36F4; Sat, 17 Mar 2012 01:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1331949317!14298440!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32653 invoked from network); 17 Mar 2012 01:55: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;
	17 Mar 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 1S8irV-0005bX-AP
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irV-0005XN-0D
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:17 +0000
Message-Id: <E1S8irV-0005XN-0D@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:16 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] unmodified drivers: hide
	xen_cpuid_base() in version 2.6.38+
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331894054 -3600
# Node ID 05768bd498f24d9c5bba83623a7e74cddbd91b78
# Parent  be9aaa70e513c16547a4984d92f3599e0aada371
unmodified drivers: hide xen_cpuid_base() in version 2.6.38+

Allow compilation of PVonHVM drivers with forward-ported xenlinux
sources in openSuSE 12.1.  xen_cpuid_base() is now in mainline, the copy
in the xen tree leads to a compilation error.  The current state leads
to a compile error:

/usr/src/packages/BUILD/xen-4.2.24547/non-dbg/obj/default/platform-pci/platform-pci.c:121: error: redefinition of 'xen_cpuid_base'
/usr/src/linux-3.0.13-0.11/arch/x86/include/asm/xen/hypervisor.h:43: error: previous definition of 'xen_cpuid_base' was here

The reason is that the kernel sources are searched before the xen
sources for asm/hypervisor.h:

/usr/src/linux-3.0.13-0.11/arch/x86/include/asm/hypervisor.h
/usr/src/packages/BUILD/xen-4.2.24547/non-dbg/obj/default/include/asm/hypervisor.h

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


diff -r be9aaa70e513 -r 05768bd498f2 unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c	Fri Mar 16 11:33:22 2012 +0100
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c	Fri Mar 16 11:34:14 2012 +0100
@@ -118,6 +118,7 @@
 
 #ifndef __ia64__
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
 static uint32_t xen_cpuid_base(void)
 {
 	uint32_t base, eax, ebx, ecx, edx;
@@ -136,6 +137,7 @@
 
 	return 0;
 }
+#endif
 
 static int init_hypercall_stubs(void)
 {

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8irY-0006cn-NB; Sat, 17 Mar 2012 01:55:20 +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 1S8irX-0006cD-KD
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:19 +0000
Received: from [193.109.254.147:49789] by server-8.bemta-14.messagelabs.com id
	FF/8C-23244-60FE36F4; Sat, 17 Mar 2012 01:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1331949316!914044!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25213 invoked from network); 17 Mar 2012 01:55:17 -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;
	17 Mar 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 1S8irT-0005bN-HD
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irT-0005Vz-Ch
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:15 +0000
Message-Id: <E1S8irT-0005Vz-Ch@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] KEXEC: Allocate crash notes on boot
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331893760 0
# Node ID 0e3ed266b3bbe8228d08c522508e811a54e891ba
# Parent  9151dfa96c3a5d95f913416673a0106c3b69f514
KEXEC: Allocate crash notes on boot

Currently, the buffers for crash notes are allocated per CPU when a
KEXEC_CMD_kexec_get_range hypercall is made, referencing the CPU in
question.  This has certain problems including not being able to
allocate the crash buffers if the host is out of memory when crashing.

In addition, my forthcoming code to support 32bit kdump kernels on
64bit Xen on large (>64GB) boxes will require some guarentees as to
where the crash note buffers are actually allocated in physical
memory.  This is far easier to sort out at boot time, rather than
after dom0 has been booted and potentially using the physical memory
required.

Therefore, allocate the crash note buffers at boot time.

Changes since v6:
 *  Tweak kexec_init() to use xzmalloc_array(), and to defer
 registering the
    crashdump keyhandler until the crash notes have been successfully
    allocated.

Changes since v5:
 *  Introduce sizeof_cpu_notes to move calculation of note size into a
    separate location.
 *  Tweak sizeof_note() to return size_t rather than int, as it is a
    function based upon sizeof().

Changes since v4:

 *  Replace the current cpu crash note scheme of using void pointers
    and hand calculating the size each time is needed, by a range
    structure containing a pointer and a size.  This removes duplicate
    times where the size is calculated.
 *  Tweak kexec_get_cpu().  Don't fail if a cpu is offline because it
    may already have crash notes, and may be up by the time a crash
    happens.  Split the error conditions up to return ERANGE for an
    out-of-range cpu request rather than EINVAL.  Finally, returning a
    range of zeros is acceptable, so do this in preference to failing.

Changes since v3:

 *  Alter the spinlocks to avoid calling xmalloc/xfree while holding
    the lock.
 *  Tidy up the coding style used.

Changes since v2:

 *  Allocate crash_notes dynamically using nr_cpu_ids at boot time,
    rather than statically using NR_CPUS.
 *  Fix the incorrect use of signed integers for cpu id.
 *  Fix collateral damage to do_crashdump_trigger() and
    crashdump_trigger_handler caused by reordering sizeof_note() and
    setup_note()
 *  Tweak the issue about returing -ENOMEM from kexec_init_cpu_note().
    No functional change.
 *  Change kexec_get_cpu() to attempt to allocate crash note buffers
    in case we have more free memory now than when the pcpu came up.
 *  Now that there are two codepaths possibly allocating crash notes,
    protect the allocation itself with a spinlock.

Changes since v1:

 *  Use cpu hotplug notifiers to handle allocating of the notes
    buffers rather than assuming the boot state of cpus will be the
    same as the crash state.
 *  Move crash_notes from being per_cpu.  This is because the kdump
    kernel elf binary put in the crash area is hard coded to physical
    addresses which the dom0 kernel typically obtains at boot time.
    If a cpu is offlined, its buffer should not be deallocated because
    the kdump kernel would read junk when trying to get the crash
    notes.  Similarly, the same problem would occur if the cpu was
    re-onlined later and its crash notes buffer was allocated
    elsewhere.
 *  Only attempt to allocate buffers if a crash area has been
    specified.  Else, allocating crash note buffers is a waste of
    space.  Along with this, change the test in kexec_get_cpu to
    return -EINVAL if no buffers have been allocated.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 9151dfa96c3a -r 0e3ed266b3bb xen/common/kexec.c
--- a/xen/common/kexec.c	Fri Mar 16 10:14:38 2012 +0100
+++ b/xen/common/kexec.c	Fri Mar 16 10:29:20 2012 +0000
@@ -25,13 +25,19 @@
 #include <xen/kexec.h>
 #include <public/elfnote.h>
 #include <xsm/xsm.h>
+#include <xen/cpu.h>
 #ifdef CONFIG_COMPAT
 #include <compat/kexec.h>
 #endif
 
 bool_t kexecing = FALSE;
 
-static DEFINE_PER_CPU_READ_MOSTLY(void *, crash_notes);
+/* Memory regions to store the per cpu register state etc. on a crash. */
+typedef struct { Elf_Note * start; size_t size; } crash_note_range_t;
+static crash_note_range_t * crash_notes;
+
+/* Lock to prevent race conditions when allocating the crash note buffers. */
+static DEFINE_SPINLOCK(crash_notes_lock);
 
 static Elf_Note *xen_crash_note;
 
@@ -165,13 +171,17 @@
 void kexec_crash_save_cpu(void)
 {
     int cpu = smp_processor_id();
-    Elf_Note *note = per_cpu(crash_notes, cpu);
+    Elf_Note *note;
     ELF_Prstatus *prstatus;
     crash_xen_core_t *xencore;
 
+    BUG_ON ( ! crash_notes );
+
     if ( cpumask_test_and_set_cpu(cpu, &crash_saved_cpus) )
         return;
 
+    note = crash_notes[cpu].start;
+
     prstatus = (ELF_Prstatus *)ELFNOTE_DESC(note);
 
     note = ELFNOTE_NEXT(note);
@@ -257,13 +267,6 @@
     .desc = "trigger a crashdump"
 };
 
-static __init int register_crashdump_trigger(void)
-{
-    register_keyhandler('C', &crashdump_trigger_keyhandler);
-    return 0;
-}
-__initcall(register_crashdump_trigger);
-
 static void setup_note(Elf_Note *n, const char *name, int type, int descsz)
 {
     int l = strlen(name) + 1;
@@ -273,13 +276,142 @@
     n->type = type;
 }
 
-static int sizeof_note(const char *name, int descsz)
+static size_t sizeof_note(const char *name, int descsz)
 {
     return (sizeof(Elf_Note) +
             ELFNOTE_ALIGN(strlen(name)+1) +
             ELFNOTE_ALIGN(descsz));
 }
 
+static size_t sizeof_cpu_notes(const unsigned long cpu)
+{
+    /* All CPUs present a PRSTATUS and crash_xen_core note. */
+    size_t bytes =
+        + sizeof_note("CORE", sizeof(ELF_Prstatus)) +
+        + sizeof_note("Xen", sizeof(crash_xen_core_t));
+
+    /* CPU0 also presents the crash_xen_info note. */
+    if ( ! cpu )
+        bytes = bytes +
+            sizeof_note("Xen", sizeof(crash_xen_info_t));
+
+    return bytes;
+}
+
+/* Allocate a crash note buffer for a newly onlined cpu. */
+static int kexec_init_cpu_notes(const unsigned long cpu)
+{
+    Elf_Note * note = NULL;
+    int ret = 0;
+    int nr_bytes = 0;
+
+    BUG_ON( cpu >= nr_cpu_ids || ! crash_notes );
+
+    /* If already allocated, nothing to do. */
+    if ( crash_notes[cpu].start )
+        return ret;
+
+    nr_bytes = sizeof_cpu_notes(cpu);
+    note = xmalloc_bytes(nr_bytes);
+
+    /* Protect the write into crash_notes[] with a spinlock, as this function
+     * is on a hotplug path and a hypercall path. */
+    spin_lock(&crash_notes_lock);
+
+    /* If we are racing with another CPU and it has beaten us, give up
+     * gracefully. */
+    if ( crash_notes[cpu].start )
+    {
+        spin_unlock(&crash_notes_lock);
+        /* Always return ok, because whether we successfully allocated or not,
+         * another CPU has successfully allocated. */
+        if ( note )
+            xfree(note);
+    }
+    else
+    {
+        crash_notes[cpu].start = note;
+        crash_notes[cpu].size = nr_bytes;
+        spin_unlock(&crash_notes_lock);
+
+        /* If the allocation failed, and another CPU did not beat us, give
+         * up with ENOMEM. */
+        if ( ! note )
+            ret = -ENOMEM;
+        /* else all is good so lets set up the notes. */
+        else
+        {
+            /* Set up CORE note. */
+            setup_note(note, "CORE", NT_PRSTATUS, sizeof(ELF_Prstatus));
+            note = ELFNOTE_NEXT(note);
+
+            /* Set up Xen CORE note. */
+            setup_note(note, "Xen", XEN_ELFNOTE_CRASH_REGS,
+                       sizeof(crash_xen_core_t));
+
+            if ( ! cpu )
+            {
+                /* Set up Xen Crash Info note. */
+                xen_crash_note = note = ELFNOTE_NEXT(note);
+                setup_note(note, "Xen", XEN_ELFNOTE_CRASH_INFO,
+                           sizeof(crash_xen_info_t));
+            }
+        }
+    }
+
+    return ret;
+}
+
+static int cpu_callback(
+    struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
+    unsigned long cpu = (unsigned long)hcpu;
+
+    /* Only hook on CPU_UP_PREPARE because once a crash_note has been reported
+     * to dom0, it must keep it around in case of a crash, as the crash kernel
+     * will be hard coded to the original physical address reported. */
+    switch ( action )
+    {
+    case CPU_UP_PREPARE:
+        /* Ignore return value.  If this boot time, -ENOMEM will cause all
+         * manner of problems elsewhere very soon, and if it is during runtime,
+         * then failing to allocate crash notes is not a good enough reason to
+         * fail the CPU_UP_PREPARE */
+        kexec_init_cpu_notes(cpu);
+        break;
+    default:
+        break;
+    }
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback
+};
+
+static int __init kexec_init(void)
+{
+    void *cpu = (void *)(unsigned long)smp_processor_id();
+
+    /* If no crash area, no need to allocate space for notes. */
+    if ( !kexec_crash_area.size )
+        return 0;
+
+    crash_notes = xzalloc_array(crash_note_range_t, nr_cpu_ids);
+    if ( ! crash_notes )
+        return -ENOMEM;
+
+    register_keyhandler('C', &crashdump_trigger_keyhandler);
+
+    cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
+/* The reason for this to be a presmp_initcall as opposed to a regular
+ * __initcall is to allow the setup of the cpu hotplug handler before APs are
+ * brought up. */
+presmp_initcall(kexec_init);
+
 static int kexec_get_reserve(xen_kexec_range_t *range)
 {
     if ( kexec_crash_area.size > 0 && kexec_crash_area.start > 0) {
@@ -294,44 +426,29 @@
 static int kexec_get_cpu(xen_kexec_range_t *range)
 {
     int nr = range->nr;
-    int nr_bytes = 0;
 
-    if ( nr < 0 || nr >= nr_cpu_ids || !cpu_online(nr) )
+    if ( nr < 0 || nr >= nr_cpu_ids )
+        return -ERANGE;
+
+    if ( ! crash_notes )
         return -EINVAL;
 
-    nr_bytes += sizeof_note("CORE", sizeof(ELF_Prstatus));
-    nr_bytes += sizeof_note("Xen", sizeof(crash_xen_core_t));
+    /* Try once again to allocate room for the crash notes.  It is just possible
+     * that more space has become available since we last tried.  If space has
+     * already been allocated, kexec_init_cpu_notes() will return early with 0.
+     */
+    kexec_init_cpu_notes(nr);
 
-    /* The Xen info note is included in CPU0's range. */
-    if ( nr == 0 )
-        nr_bytes += sizeof_note("Xen", sizeof(crash_xen_info_t));
+    /* In the case of still not having enough memory to allocate buffer room,
+     * returning a range of 0,0 is still valid. */
+    if ( crash_notes[nr].start )
+    {
+        range->start = __pa(crash_notes[nr].start);
+        range->size = crash_notes[nr].size;
+    }
+    else
+        range->start = range->size = 0;
 
-    if ( per_cpu(crash_notes, nr) == NULL )
-    {
-        Elf_Note *note;
-
-        note = per_cpu(crash_notes, nr) = xmalloc_bytes(nr_bytes);
-
-        if ( note == NULL )
-            return -ENOMEM;
-
-        /* Setup CORE note. */
-        setup_note(note, "CORE", NT_PRSTATUS, sizeof(ELF_Prstatus));
-
-        /* Setup Xen CORE note. */
-        note = ELFNOTE_NEXT(note);
-        setup_note(note, "Xen", XEN_ELFNOTE_CRASH_REGS, sizeof(crash_xen_core_t));
-
-        if (nr == 0)
-        {
-            /* Setup system wide Xen info note. */
-            xen_crash_note = note = ELFNOTE_NEXT(note);
-            setup_note(note, "Xen", XEN_ELFNOTE_CRASH_INFO, sizeof(crash_xen_info_t));
-        }
-    }
-
-    range->start = __pa((unsigned long)per_cpu(crash_notes, nr));
-    range->size = nr_bytes;
     return 0;
 }
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8irY-0006cn-NB; Sat, 17 Mar 2012 01:55:20 +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 1S8irX-0006cD-KD
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:19 +0000
Received: from [193.109.254.147:49789] by server-8.bemta-14.messagelabs.com id
	FF/8C-23244-60FE36F4; Sat, 17 Mar 2012 01:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-27.messagelabs.com!1331949316!914044!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25213 invoked from network); 17 Mar 2012 01:55:17 -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;
	17 Mar 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 1S8irT-0005bN-HD
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irT-0005Vz-Ch
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:15 +0000
Message-Id: <E1S8irT-0005Vz-Ch@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] KEXEC: Allocate crash notes on boot
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331893760 0
# Node ID 0e3ed266b3bbe8228d08c522508e811a54e891ba
# Parent  9151dfa96c3a5d95f913416673a0106c3b69f514
KEXEC: Allocate crash notes on boot

Currently, the buffers for crash notes are allocated per CPU when a
KEXEC_CMD_kexec_get_range hypercall is made, referencing the CPU in
question.  This has certain problems including not being able to
allocate the crash buffers if the host is out of memory when crashing.

In addition, my forthcoming code to support 32bit kdump kernels on
64bit Xen on large (>64GB) boxes will require some guarentees as to
where the crash note buffers are actually allocated in physical
memory.  This is far easier to sort out at boot time, rather than
after dom0 has been booted and potentially using the physical memory
required.

Therefore, allocate the crash note buffers at boot time.

Changes since v6:
 *  Tweak kexec_init() to use xzmalloc_array(), and to defer
 registering the
    crashdump keyhandler until the crash notes have been successfully
    allocated.

Changes since v5:
 *  Introduce sizeof_cpu_notes to move calculation of note size into a
    separate location.
 *  Tweak sizeof_note() to return size_t rather than int, as it is a
    function based upon sizeof().

Changes since v4:

 *  Replace the current cpu crash note scheme of using void pointers
    and hand calculating the size each time is needed, by a range
    structure containing a pointer and a size.  This removes duplicate
    times where the size is calculated.
 *  Tweak kexec_get_cpu().  Don't fail if a cpu is offline because it
    may already have crash notes, and may be up by the time a crash
    happens.  Split the error conditions up to return ERANGE for an
    out-of-range cpu request rather than EINVAL.  Finally, returning a
    range of zeros is acceptable, so do this in preference to failing.

Changes since v3:

 *  Alter the spinlocks to avoid calling xmalloc/xfree while holding
    the lock.
 *  Tidy up the coding style used.

Changes since v2:

 *  Allocate crash_notes dynamically using nr_cpu_ids at boot time,
    rather than statically using NR_CPUS.
 *  Fix the incorrect use of signed integers for cpu id.
 *  Fix collateral damage to do_crashdump_trigger() and
    crashdump_trigger_handler caused by reordering sizeof_note() and
    setup_note()
 *  Tweak the issue about returing -ENOMEM from kexec_init_cpu_note().
    No functional change.
 *  Change kexec_get_cpu() to attempt to allocate crash note buffers
    in case we have more free memory now than when the pcpu came up.
 *  Now that there are two codepaths possibly allocating crash notes,
    protect the allocation itself with a spinlock.

Changes since v1:

 *  Use cpu hotplug notifiers to handle allocating of the notes
    buffers rather than assuming the boot state of cpus will be the
    same as the crash state.
 *  Move crash_notes from being per_cpu.  This is because the kdump
    kernel elf binary put in the crash area is hard coded to physical
    addresses which the dom0 kernel typically obtains at boot time.
    If a cpu is offlined, its buffer should not be deallocated because
    the kdump kernel would read junk when trying to get the crash
    notes.  Similarly, the same problem would occur if the cpu was
    re-onlined later and its crash notes buffer was allocated
    elsewhere.
 *  Only attempt to allocate buffers if a crash area has been
    specified.  Else, allocating crash note buffers is a waste of
    space.  Along with this, change the test in kexec_get_cpu to
    return -EINVAL if no buffers have been allocated.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 9151dfa96c3a -r 0e3ed266b3bb xen/common/kexec.c
--- a/xen/common/kexec.c	Fri Mar 16 10:14:38 2012 +0100
+++ b/xen/common/kexec.c	Fri Mar 16 10:29:20 2012 +0000
@@ -25,13 +25,19 @@
 #include <xen/kexec.h>
 #include <public/elfnote.h>
 #include <xsm/xsm.h>
+#include <xen/cpu.h>
 #ifdef CONFIG_COMPAT
 #include <compat/kexec.h>
 #endif
 
 bool_t kexecing = FALSE;
 
-static DEFINE_PER_CPU_READ_MOSTLY(void *, crash_notes);
+/* Memory regions to store the per cpu register state etc. on a crash. */
+typedef struct { Elf_Note * start; size_t size; } crash_note_range_t;
+static crash_note_range_t * crash_notes;
+
+/* Lock to prevent race conditions when allocating the crash note buffers. */
+static DEFINE_SPINLOCK(crash_notes_lock);
 
 static Elf_Note *xen_crash_note;
 
@@ -165,13 +171,17 @@
 void kexec_crash_save_cpu(void)
 {
     int cpu = smp_processor_id();
-    Elf_Note *note = per_cpu(crash_notes, cpu);
+    Elf_Note *note;
     ELF_Prstatus *prstatus;
     crash_xen_core_t *xencore;
 
+    BUG_ON ( ! crash_notes );
+
     if ( cpumask_test_and_set_cpu(cpu, &crash_saved_cpus) )
         return;
 
+    note = crash_notes[cpu].start;
+
     prstatus = (ELF_Prstatus *)ELFNOTE_DESC(note);
 
     note = ELFNOTE_NEXT(note);
@@ -257,13 +267,6 @@
     .desc = "trigger a crashdump"
 };
 
-static __init int register_crashdump_trigger(void)
-{
-    register_keyhandler('C', &crashdump_trigger_keyhandler);
-    return 0;
-}
-__initcall(register_crashdump_trigger);
-
 static void setup_note(Elf_Note *n, const char *name, int type, int descsz)
 {
     int l = strlen(name) + 1;
@@ -273,13 +276,142 @@
     n->type = type;
 }
 
-static int sizeof_note(const char *name, int descsz)
+static size_t sizeof_note(const char *name, int descsz)
 {
     return (sizeof(Elf_Note) +
             ELFNOTE_ALIGN(strlen(name)+1) +
             ELFNOTE_ALIGN(descsz));
 }
 
+static size_t sizeof_cpu_notes(const unsigned long cpu)
+{
+    /* All CPUs present a PRSTATUS and crash_xen_core note. */
+    size_t bytes =
+        + sizeof_note("CORE", sizeof(ELF_Prstatus)) +
+        + sizeof_note("Xen", sizeof(crash_xen_core_t));
+
+    /* CPU0 also presents the crash_xen_info note. */
+    if ( ! cpu )
+        bytes = bytes +
+            sizeof_note("Xen", sizeof(crash_xen_info_t));
+
+    return bytes;
+}
+
+/* Allocate a crash note buffer for a newly onlined cpu. */
+static int kexec_init_cpu_notes(const unsigned long cpu)
+{
+    Elf_Note * note = NULL;
+    int ret = 0;
+    int nr_bytes = 0;
+
+    BUG_ON( cpu >= nr_cpu_ids || ! crash_notes );
+
+    /* If already allocated, nothing to do. */
+    if ( crash_notes[cpu].start )
+        return ret;
+
+    nr_bytes = sizeof_cpu_notes(cpu);
+    note = xmalloc_bytes(nr_bytes);
+
+    /* Protect the write into crash_notes[] with a spinlock, as this function
+     * is on a hotplug path and a hypercall path. */
+    spin_lock(&crash_notes_lock);
+
+    /* If we are racing with another CPU and it has beaten us, give up
+     * gracefully. */
+    if ( crash_notes[cpu].start )
+    {
+        spin_unlock(&crash_notes_lock);
+        /* Always return ok, because whether we successfully allocated or not,
+         * another CPU has successfully allocated. */
+        if ( note )
+            xfree(note);
+    }
+    else
+    {
+        crash_notes[cpu].start = note;
+        crash_notes[cpu].size = nr_bytes;
+        spin_unlock(&crash_notes_lock);
+
+        /* If the allocation failed, and another CPU did not beat us, give
+         * up with ENOMEM. */
+        if ( ! note )
+            ret = -ENOMEM;
+        /* else all is good so lets set up the notes. */
+        else
+        {
+            /* Set up CORE note. */
+            setup_note(note, "CORE", NT_PRSTATUS, sizeof(ELF_Prstatus));
+            note = ELFNOTE_NEXT(note);
+
+            /* Set up Xen CORE note. */
+            setup_note(note, "Xen", XEN_ELFNOTE_CRASH_REGS,
+                       sizeof(crash_xen_core_t));
+
+            if ( ! cpu )
+            {
+                /* Set up Xen Crash Info note. */
+                xen_crash_note = note = ELFNOTE_NEXT(note);
+                setup_note(note, "Xen", XEN_ELFNOTE_CRASH_INFO,
+                           sizeof(crash_xen_info_t));
+            }
+        }
+    }
+
+    return ret;
+}
+
+static int cpu_callback(
+    struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
+    unsigned long cpu = (unsigned long)hcpu;
+
+    /* Only hook on CPU_UP_PREPARE because once a crash_note has been reported
+     * to dom0, it must keep it around in case of a crash, as the crash kernel
+     * will be hard coded to the original physical address reported. */
+    switch ( action )
+    {
+    case CPU_UP_PREPARE:
+        /* Ignore return value.  If this boot time, -ENOMEM will cause all
+         * manner of problems elsewhere very soon, and if it is during runtime,
+         * then failing to allocate crash notes is not a good enough reason to
+         * fail the CPU_UP_PREPARE */
+        kexec_init_cpu_notes(cpu);
+        break;
+    default:
+        break;
+    }
+    return NOTIFY_DONE;
+}
+
+static struct notifier_block cpu_nfb = {
+    .notifier_call = cpu_callback
+};
+
+static int __init kexec_init(void)
+{
+    void *cpu = (void *)(unsigned long)smp_processor_id();
+
+    /* If no crash area, no need to allocate space for notes. */
+    if ( !kexec_crash_area.size )
+        return 0;
+
+    crash_notes = xzalloc_array(crash_note_range_t, nr_cpu_ids);
+    if ( ! crash_notes )
+        return -ENOMEM;
+
+    register_keyhandler('C', &crashdump_trigger_keyhandler);
+
+    cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
+    register_cpu_notifier(&cpu_nfb);
+    return 0;
+}
+/* The reason for this to be a presmp_initcall as opposed to a regular
+ * __initcall is to allow the setup of the cpu hotplug handler before APs are
+ * brought up. */
+presmp_initcall(kexec_init);
+
 static int kexec_get_reserve(xen_kexec_range_t *range)
 {
     if ( kexec_crash_area.size > 0 && kexec_crash_area.start > 0) {
@@ -294,44 +426,29 @@
 static int kexec_get_cpu(xen_kexec_range_t *range)
 {
     int nr = range->nr;
-    int nr_bytes = 0;
 
-    if ( nr < 0 || nr >= nr_cpu_ids || !cpu_online(nr) )
+    if ( nr < 0 || nr >= nr_cpu_ids )
+        return -ERANGE;
+
+    if ( ! crash_notes )
         return -EINVAL;
 
-    nr_bytes += sizeof_note("CORE", sizeof(ELF_Prstatus));
-    nr_bytes += sizeof_note("Xen", sizeof(crash_xen_core_t));
+    /* Try once again to allocate room for the crash notes.  It is just possible
+     * that more space has become available since we last tried.  If space has
+     * already been allocated, kexec_init_cpu_notes() will return early with 0.
+     */
+    kexec_init_cpu_notes(nr);
 
-    /* The Xen info note is included in CPU0's range. */
-    if ( nr == 0 )
-        nr_bytes += sizeof_note("Xen", sizeof(crash_xen_info_t));
+    /* In the case of still not having enough memory to allocate buffer room,
+     * returning a range of 0,0 is still valid. */
+    if ( crash_notes[nr].start )
+    {
+        range->start = __pa(crash_notes[nr].start);
+        range->size = crash_notes[nr].size;
+    }
+    else
+        range->start = range->size = 0;
 
-    if ( per_cpu(crash_notes, nr) == NULL )
-    {
-        Elf_Note *note;
-
-        note = per_cpu(crash_notes, nr) = xmalloc_bytes(nr_bytes);
-
-        if ( note == NULL )
-            return -ENOMEM;
-
-        /* Setup CORE note. */
-        setup_note(note, "CORE", NT_PRSTATUS, sizeof(ELF_Prstatus));
-
-        /* Setup Xen CORE note. */
-        note = ELFNOTE_NEXT(note);
-        setup_note(note, "Xen", XEN_ELFNOTE_CRASH_REGS, sizeof(crash_xen_core_t));
-
-        if (nr == 0)
-        {
-            /* Setup system wide Xen info note. */
-            xen_crash_note = note = ELFNOTE_NEXT(note);
-            setup_note(note, "Xen", XEN_ELFNOTE_CRASH_INFO, sizeof(crash_xen_info_t));
-        }
-    }
-
-    range->start = __pa((unsigned long)per_cpu(crash_notes, nr));
-    range->size = nr_bytes;
     return 0;
 }
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8irZ-0006dM-Ug; Sat, 17 Mar 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 1S8irY-0006cP-Un
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:21 +0000
Received: from [85.158.143.99:34371] by server-3.bemta-4.messagelabs.com id
	84/7A-05853-70FE36F4; Sat, 17 Mar 2012 01:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1331949317!16198877!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4972 invoked from network); 17 Mar 2012 01:55:19 -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;
	17 Mar 2012 01:55: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 1S8irV-0005ba-Ky
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irV-0005Xp-Gu
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:17 +0000
Message-Id: <E1S8irV-0005Xp-Gu@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] unmodified drivers: add pfn_is_ram
	helper for kdump
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331894081 -3600
# Node ID e4460795ee6605fe58ce6d00acc6a747c21429f5
# Parent  05768bd498f24d9c5bba83623a7e74cddbd91b78
unmodified drivers: add pfn_is_ram helper for kdump

Register pfn_is_ram helper speed up reading /proc/vmcore in the kdump
kernel. It is compiled only if the kernel source is recent enough to
have the pfn_is_ram helper (v3.0-rc1, commit
997c136f518c5debd63847e78e2a8694f56dcf90).

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


diff -r 05768bd498f2 -r e4460795ee66 unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c	Fri Mar 16 11:34:14 2012 +0100
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c	Fri Mar 16 11:34:41 2012 +0100
@@ -351,6 +351,32 @@
 	return -ENODEV;
 }
 
+#ifdef HAVE_OLDMEM_PFN_IS_RAM
+static int xen_oldmem_pfn_is_ram(unsigned long pfn)
+{
+	struct xen_hvm_get_mem_type a;
+	int ret;
+
+	a.domid = DOMID_SELF;
+	a.pfn = pfn;
+	if (HYPERVISOR_hvm_op(HVMOP_get_mem_type, &a))
+		return -ENXIO;
+
+	switch (a.mem_type) {
+		case HVMMEM_mmio_dm:
+			ret = 0;
+			break;
+		case HVMMEM_ram_rw:
+		case HVMMEM_ram_ro:
+		default:
+			ret = 1;
+			break;
+	}
+
+	return ret;
+}
+#endif
+
 static int __devinit platform_pci_init(struct pci_dev *pdev,
 				       const struct pci_device_id *ent)
 {
@@ -419,6 +445,9 @@
 	if ((ret = xen_panic_handler_init()))
 		goto out;
 
+#ifdef HAVE_OLDMEM_PFN_IS_RAM
+	register_oldmem_pfn_is_ram(&xen_oldmem_pfn_is_ram);
+#endif
  out:
 	if (ret) {
 		pci_release_region(pdev, 0);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8irZ-0006dM-Ug; Sat, 17 Mar 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 1S8irY-0006cP-Un
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:21 +0000
Received: from [85.158.143.99:34371] by server-3.bemta-4.messagelabs.com id
	84/7A-05853-70FE36F4; Sat, 17 Mar 2012 01:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-216.messagelabs.com!1331949317!16198877!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 4972 invoked from network); 17 Mar 2012 01:55:19 -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;
	17 Mar 2012 01:55: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 1S8irV-0005ba-Ky
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irV-0005Xp-Gu
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:17 +0000
Message-Id: <E1S8irV-0005Xp-Gu@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] unmodified drivers: add pfn_is_ram
	helper for kdump
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331894081 -3600
# Node ID e4460795ee6605fe58ce6d00acc6a747c21429f5
# Parent  05768bd498f24d9c5bba83623a7e74cddbd91b78
unmodified drivers: add pfn_is_ram helper for kdump

Register pfn_is_ram helper speed up reading /proc/vmcore in the kdump
kernel. It is compiled only if the kernel source is recent enough to
have the pfn_is_ram helper (v3.0-rc1, commit
997c136f518c5debd63847e78e2a8694f56dcf90).

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


diff -r 05768bd498f2 -r e4460795ee66 unmodified_drivers/linux-2.6/platform-pci/platform-pci.c
--- a/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c	Fri Mar 16 11:34:14 2012 +0100
+++ b/unmodified_drivers/linux-2.6/platform-pci/platform-pci.c	Fri Mar 16 11:34:41 2012 +0100
@@ -351,6 +351,32 @@
 	return -ENODEV;
 }
 
+#ifdef HAVE_OLDMEM_PFN_IS_RAM
+static int xen_oldmem_pfn_is_ram(unsigned long pfn)
+{
+	struct xen_hvm_get_mem_type a;
+	int ret;
+
+	a.domid = DOMID_SELF;
+	a.pfn = pfn;
+	if (HYPERVISOR_hvm_op(HVMOP_get_mem_type, &a))
+		return -ENXIO;
+
+	switch (a.mem_type) {
+		case HVMMEM_mmio_dm:
+			ret = 0;
+			break;
+		case HVMMEM_ram_rw:
+		case HVMMEM_ram_ro:
+		default:
+			ret = 1;
+			break;
+	}
+
+	return ret;
+}
+#endif
+
 static int __devinit platform_pci_init(struct pci_dev *pdev,
 				       const struct pci_device_id *ent)
 {
@@ -419,6 +445,9 @@
 	if ((ret = xen_panic_handler_init()))
 		goto out;
 
+#ifdef HAVE_OLDMEM_PFN_IS_RAM
+	register_oldmem_pfn_is_ram(&xen_oldmem_pfn_is_ram);
+#endif
  out:
 	if (ret) {
 		pci_release_region(pdev, 0);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8irZ-0006dC-Pg; Sat, 17 Mar 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 1S8irY-0006cG-6p
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:20 +0000
Received: from [85.158.143.35:37904] by server-2.bemta-4.messagelabs.com id
	92/94-17550-70FE36F4; Sat, 17 Mar 2012 01:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1331949316!11620311!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23321 invoked from network); 17 Mar 2012 01:55:17 -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;
	17 Mar 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 1S8irU-0005bR-6F
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irT-0005WT-UI
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:15 +0000
Message-Id: <E1S8irT-0005WT-UI@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] KEXEC: Allocate crash structures in
	low memory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331893812 0
# Node ID 377c075ec0ecf0364cc0b48862dc9e6a39afe5cf
# Parent  0e3ed266b3bbe8228d08c522508e811a54e891ba
KEXEC: Allocate crash structures in low memory

On 64bit Xen with 32bit dom0 and crashkernel, xmalloc'ing items such
as the CPU crash notes will go into the xenheap, which tends to be in
upper memory.  This causes problems on machines with more than 64GB
(or 4GB if no PAE support) of ram as the crashkernel physically cant
access the crash notes.

The solution is to force Xen to allocate certain structures in lower
memory.  This is achieved by introducing two new command line
parameters; low_crashinfo and crashinfo_maxaddr.  Because of the
potential impact on 32bit PV guests, and that this problem does not
exist for 64bit dom0 on 64bit Xen, this new functionality defaults to
the codebase's previous behavior, requiring the user to explicitly
add extra command line parameters to change the behavior.

This patch consists of 3 logically distinct but closely related
changes.
 1) Add the two new command line parameters.
 2) Change crash note allocation to use lower memory when instructed.
 3) Change the conring buffer to use lower memory when instructed.

There result is that the crash notes and console ring will be placed
in lower memory so useful information can be recovered in the case of
a crash.

Changes since v1:
 -  Patch xen-command-line.markdown to document new options

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 0e3ed266b3bb -r 377c075ec0ec docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Fri Mar 16 10:29:20 2012 +0000
+++ b/docs/misc/xen-command-line.markdown	Fri Mar 16 10:30:12 2012 +0000
@@ -188,6 +188,13 @@
 ### cpuid\_mask\_xsave\_eax
 ### cpuidle
 ### cpuinfo
+### crashinfo_maxaddr
+> `= <size>`
+
+> Default: `4G`
+
+Specify the maximum address to allocate certain strucutres, if used in combination with the `low_crashinfo` command line option.
+
 ### crashkernel
 ### credit2\_balance\_over
 ### credit2\_balance\_under
@@ -273,6 +280,13 @@
 
 The optional `<rate-limited level>` options instructs which severities should be rate limited.
 
+### low\_crashinfo
+> `= none | min | all`
+
+> Default: `none` if not specified at all, or to `min` if `low\_crashinfo` is present without qualification.
+
+This option is only useful for hosts with a 32bit dom0 kernel, wishing to use kexec functionality in the case of a crash.  It represents which data structures should be deliberatly allocated in low memory, so the crash kernel may find find them.  Should be used in combination with `crashinfo_maxaddr`.
+
 ### max\_cstate
 ### max\_gsi\_irqs
 ### maxcpus
diff -r 0e3ed266b3bb -r 377c075ec0ec xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Fri Mar 16 10:29:20 2012 +0000
+++ b/xen/arch/x86/setup.c	Fri Mar 16 10:30:12 2012 +0000
@@ -583,6 +583,10 @@
     }
     cmdline_parse(cmdline);
 
+    /* Must be after command line argument parsing and before
+     * allocing any xenheap structures wanted in lower memory. */
+    kexec_early_calculations();
+
     parse_video_info();
 
     set_current((struct vcpu *)0xfffff000); /* debug sanity */
diff -r 0e3ed266b3bb -r 377c075ec0ec xen/common/kexec.c
--- a/xen/common/kexec.c	Fri Mar 16 10:29:20 2012 +0000
+++ b/xen/common/kexec.c	Fri Mar 16 10:30:12 2012 +0000
@@ -36,7 +36,9 @@
 typedef struct { Elf_Note * start; size_t size; } crash_note_range_t;
 static crash_note_range_t * crash_notes;
 
-/* Lock to prevent race conditions when allocating the crash note buffers. */
+/* Lock to prevent race conditions when allocating the crash note buffers.
+ * It also serves to protect calls to alloc_from_crash_heap when allocating
+ * crash note buffers in lower memory. */
 static DEFINE_SPINLOCK(crash_notes_lock);
 
 static Elf_Note *xen_crash_note;
@@ -62,6 +64,24 @@
     unsigned long size;
 } ranges[16] __initdata;
 
+/* Low crashinfo mode.  Start as INVALID so serveral codepaths can set up
+ * defaults without needing to know the state of the others. */
+enum low_crashinfo low_crashinfo_mode = LOW_CRASHINFO_INVALID;
+
+/* This value is only considered if low_crash_mode is set to MIN or ALL, so
+ * setting a default here is safe. Default to 4GB.  This is because the current
+ * KEXEC_CMD_get_range compat hypercall trucates 64bit pointers to 32 bits. The
+ * typical usecase for crashinfo_maxaddr will be for 64bit Xen with 32bit dom0
+ * and 32bit crash kernel. */
+static paddr_t __initdata crashinfo_maxaddr = 4ULL << 30;
+
+/* = log base 2 of crashinfo_maxaddr after checking for sanity. Default to
+ * larger than the entire physical address space. */
+paddr_t crashinfo_maxaddr_bits = 64;
+
+/* Pointers to keep track of the crash heap region. */
+static void *crash_heap_current = NULL, *crash_heap_end = NULL;
+
 /*
  * Parse command lines in the format
  *
@@ -140,6 +160,58 @@
 }
 custom_param("crashkernel", parse_crashkernel);
 
+/* Parse command lines in the format:
+ *
+ *   low_crashinfo=[none,min,all]
+ *
+ * - none disables the low allocation of crash info.
+ * - min will allocate enough low information for the crash kernel to be able
+ *       to extract the hypervisor and dom0 message ring buffers.
+ * - all will allocate additional structures such as domain and vcpu structs
+ *       low so the crash kernel can perform an extended analysis of state.
+ */
+static void __init parse_low_crashinfo(const char * str)
+{
+
+    if ( !strlen(str) )
+        /* default to min if user just specifies "low_crashinfo" */
+        low_crashinfo_mode = LOW_CRASHINFO_MIN;
+    else if ( !strcmp(str, "none" ) )
+        low_crashinfo_mode = LOW_CRASHINFO_NONE;
+    else if ( !strcmp(str, "min" ) )
+        low_crashinfo_mode = LOW_CRASHINFO_MIN;
+    else if ( !strcmp(str, "all" ) )
+        low_crashinfo_mode = LOW_CRASHINFO_ALL;
+    else
+    {
+        printk("Unknown low_crashinfo parameter '%s'.  Defaulting to min.\n", str);
+        low_crashinfo_mode = LOW_CRASHINFO_MIN;
+    }
+}
+custom_param("low_crashinfo", parse_low_crashinfo);
+
+/* Parse command lines in the format:
+ *
+ *   crashinfo_maxaddr=<addr>
+ *
+ * <addr> will be rounded down to the nearest power of two.  Defaults to 64G
+ */
+static void __init parse_crashinfo_maxaddr(const char * str)
+{
+    u64 addr;
+
+    /* if low_crashinfo_mode is unset, default to min. */
+    if ( low_crashinfo_mode == LOW_CRASHINFO_INVALID )
+        low_crashinfo_mode = LOW_CRASHINFO_MIN;
+
+    if ( (addr = parse_size_and_unit(str, NULL)) )
+        crashinfo_maxaddr = addr;
+    else
+        printk("Unable to parse crashinfo_maxaddr. Defaulting to %p\n",
+               (void*)crashinfo_maxaddr);
+}
+custom_param("crashinfo_maxaddr", parse_crashinfo_maxaddr);
+
 void __init set_kexec_crash_area_size(u64 system_ram)
 {
     unsigned int idx;
@@ -298,6 +370,20 @@
     return bytes;
 }
 
+/* Allocate size_t bytes of space from the previously allocated
+ * crash heap if the user has requested that crash notes be allocated
+ * in lower memory.  There is currently no case where the crash notes
+ * should be free()'d. */
+static void * alloc_from_crash_heap(const size_t bytes)
+{
+    void * ret;
+    if ( crash_heap_current + bytes > crash_heap_end )
+        return NULL;
+    ret = (void*)crash_heap_current;
+    crash_heap_current += bytes;
+    return ret;
+}
+
 /* Allocate a crash note buffer for a newly onlined cpu. */
 static int kexec_init_cpu_notes(const unsigned long cpu)
 {
@@ -312,7 +398,10 @@
         return ret;
 
     nr_bytes = sizeof_cpu_notes(cpu);
-    note = xmalloc_bytes(nr_bytes);
+
+    /* If we dont care about the position of allocation, malloc. */
+    if ( low_crashinfo_mode == LOW_CRASHINFO_NONE )
+        note = xmalloc_bytes(nr_bytes);
 
     /* Protect the write into crash_notes[] with a spinlock, as this function
      * is on a hotplug path and a hypercall path. */
@@ -330,6 +419,11 @@
     }
     else
     {
+        /* If we care about memory possition, alloc from the crash heap,
+         * also protected by the crash_notes_lock. */
+        if ( low_crashinfo_mode > LOW_CRASHINFO_NONE )
+            note = alloc_from_crash_heap(nr_bytes);
+
         crash_notes[cpu].start = note;
         crash_notes[cpu].size = nr_bytes;
         spin_unlock(&crash_notes_lock);
@@ -389,6 +483,18 @@
     .notifier_call = cpu_callback
 };
 
+void __init kexec_early_calculations(void)
+{
+    /* If low_crashinfo_mode is still INVALID, neither "low_crashinfo" nor
+     * "crashinfo_maxaddr" have been specified on the command line, so
+     * explicitly set to NONE. */
+    if ( low_crashinfo_mode == LOW_CRASHINFO_INVALID )
+        low_crashinfo_mode = LOW_CRASHINFO_NONE;
+
+    if ( low_crashinfo_mode > LOW_CRASHINFO_NONE )
+        crashinfo_maxaddr_bits = fls(crashinfo_maxaddr) - 1;
+}
+
 static int __init kexec_init(void)
 {
     void *cpu = (void *)(unsigned long)smp_processor_id();
@@ -397,6 +503,29 @@
     if ( !kexec_crash_area.size )
         return 0;
 
+    if ( low_crashinfo_mode > LOW_CRASHINFO_NONE )
+    {
+        size_t crash_heap_size;
+
+        /* This calculation is safe even if the machine is booted in
+         * uniprocessor mode. */
+        crash_heap_size = sizeof_cpu_notes(0) +
+            sizeof_cpu_notes(1) * (nr_cpu_ids - 1);
+        crash_heap_size = PAGE_ALIGN(crash_heap_size);
+
+        crash_heap_current = alloc_xenheap_pages(
+            get_order_from_bytes(crash_heap_size),
+            MEMF_bits(crashinfo_maxaddr_bits) );
+
+        if ( ! crash_heap_current )
+            return -ENOMEM;
+
+        crash_heap_end = crash_heap_current + crash_heap_size;
+    }
+
+    /* crash_notes may be allocated anywhere Xen can reach in memory.
+       Only the individual CPU crash notes themselves must be allocated
+       in lower memory if requested. */
     crash_notes = xzalloc_array(crash_note_range_t, nr_cpu_ids);
     if ( ! crash_notes )
         return -ENOMEM;
diff -r 0e3ed266b3bb -r 377c075ec0ec xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Fri Mar 16 10:29:20 2012 +0000
+++ b/xen/drivers/char/console.c	Fri Mar 16 10:30:12 2012 +0000
@@ -596,7 +596,7 @@
         opt_conring_size = num_present_cpus() << (9 + xenlog_lower_thresh);
 
     order = get_order_from_bytes(max(opt_conring_size, conring_size));
-    while ( (ring = alloc_xenheap_pages(order, 0)) == NULL )
+    while ( (ring = alloc_xenheap_pages(order, MEMF_bits(crashinfo_maxaddr_bits))) == NULL )
     {
         BUG_ON(order == 0);
         order--;
diff -r 0e3ed266b3bb -r 377c075ec0ec xen/include/xen/kexec.h
--- a/xen/include/xen/kexec.h	Fri Mar 16 10:29:20 2012 +0000
+++ b/xen/include/xen/kexec.h	Fri Mar 16 10:30:12 2012 +0000
@@ -25,6 +25,19 @@
 #define KEXEC_IMAGE_CRASH_BASE   2
 #define KEXEC_IMAGE_NR           4
 
+enum low_crashinfo {
+    LOW_CRASHINFO_INVALID = 0,
+    LOW_CRASHINFO_NONE = 1,
+    LOW_CRASHINFO_MIN = 2,
+    LOW_CRASHINFO_ALL = 3
+};
+
+/* Low crashinfo mode.  Start as INVALID so serveral codepaths can set up
+ * defaults without needing to know the state of the others. */
+extern enum low_crashinfo low_crashinfo_mode;
+extern paddr_t crashinfo_maxaddr_bits;
+void kexec_early_calculations(void);
+
 int machine_kexec_load(int type, int slot, xen_kexec_image_t *image);
 void machine_kexec_unload(int type, int slot, xen_kexec_image_t *image);
 void machine_kexec_reserved(xen_kexec_reserve_t *reservation);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8irZ-0006dC-Pg; Sat, 17 Mar 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 1S8irY-0006cG-6p
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:20 +0000
Received: from [85.158.143.35:37904] by server-2.bemta-4.messagelabs.com id
	92/94-17550-70FE36F4; Sat, 17 Mar 2012 01:55:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1331949316!11620311!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23321 invoked from network); 17 Mar 2012 01:55:17 -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;
	17 Mar 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 1S8irU-0005bR-6F
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:16 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irT-0005WT-UI
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:15 +0000
Message-Id: <E1S8irT-0005WT-UI@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:15 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] KEXEC: Allocate crash structures in
	low memory
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331893812 0
# Node ID 377c075ec0ecf0364cc0b48862dc9e6a39afe5cf
# Parent  0e3ed266b3bbe8228d08c522508e811a54e891ba
KEXEC: Allocate crash structures in low memory

On 64bit Xen with 32bit dom0 and crashkernel, xmalloc'ing items such
as the CPU crash notes will go into the xenheap, which tends to be in
upper memory.  This causes problems on machines with more than 64GB
(or 4GB if no PAE support) of ram as the crashkernel physically cant
access the crash notes.

The solution is to force Xen to allocate certain structures in lower
memory.  This is achieved by introducing two new command line
parameters; low_crashinfo and crashinfo_maxaddr.  Because of the
potential impact on 32bit PV guests, and that this problem does not
exist for 64bit dom0 on 64bit Xen, this new functionality defaults to
the codebase's previous behavior, requiring the user to explicitly
add extra command line parameters to change the behavior.

This patch consists of 3 logically distinct but closely related
changes.
 1) Add the two new command line parameters.
 2) Change crash note allocation to use lower memory when instructed.
 3) Change the conring buffer to use lower memory when instructed.

There result is that the crash notes and console ring will be placed
in lower memory so useful information can be recovered in the case of
a crash.

Changes since v1:
 -  Patch xen-command-line.markdown to document new options

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 0e3ed266b3bb -r 377c075ec0ec docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Fri Mar 16 10:29:20 2012 +0000
+++ b/docs/misc/xen-command-line.markdown	Fri Mar 16 10:30:12 2012 +0000
@@ -188,6 +188,13 @@
 ### cpuid\_mask\_xsave\_eax
 ### cpuidle
 ### cpuinfo
+### crashinfo_maxaddr
+> `= <size>`
+
+> Default: `4G`
+
+Specify the maximum address to allocate certain strucutres, if used in combination with the `low_crashinfo` command line option.
+
 ### crashkernel
 ### credit2\_balance\_over
 ### credit2\_balance\_under
@@ -273,6 +280,13 @@
 
 The optional `<rate-limited level>` options instructs which severities should be rate limited.
 
+### low\_crashinfo
+> `= none | min | all`
+
+> Default: `none` if not specified at all, or to `min` if `low\_crashinfo` is present without qualification.
+
+This option is only useful for hosts with a 32bit dom0 kernel, wishing to use kexec functionality in the case of a crash.  It represents which data structures should be deliberatly allocated in low memory, so the crash kernel may find find them.  Should be used in combination with `crashinfo_maxaddr`.
+
 ### max\_cstate
 ### max\_gsi\_irqs
 ### maxcpus
diff -r 0e3ed266b3bb -r 377c075ec0ec xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Fri Mar 16 10:29:20 2012 +0000
+++ b/xen/arch/x86/setup.c	Fri Mar 16 10:30:12 2012 +0000
@@ -583,6 +583,10 @@
     }
     cmdline_parse(cmdline);
 
+    /* Must be after command line argument parsing and before
+     * allocing any xenheap structures wanted in lower memory. */
+    kexec_early_calculations();
+
     parse_video_info();
 
     set_current((struct vcpu *)0xfffff000); /* debug sanity */
diff -r 0e3ed266b3bb -r 377c075ec0ec xen/common/kexec.c
--- a/xen/common/kexec.c	Fri Mar 16 10:29:20 2012 +0000
+++ b/xen/common/kexec.c	Fri Mar 16 10:30:12 2012 +0000
@@ -36,7 +36,9 @@
 typedef struct { Elf_Note * start; size_t size; } crash_note_range_t;
 static crash_note_range_t * crash_notes;
 
-/* Lock to prevent race conditions when allocating the crash note buffers. */
+/* Lock to prevent race conditions when allocating the crash note buffers.
+ * It also serves to protect calls to alloc_from_crash_heap when allocating
+ * crash note buffers in lower memory. */
 static DEFINE_SPINLOCK(crash_notes_lock);
 
 static Elf_Note *xen_crash_note;
@@ -62,6 +64,24 @@
     unsigned long size;
 } ranges[16] __initdata;
 
+/* Low crashinfo mode.  Start as INVALID so serveral codepaths can set up
+ * defaults without needing to know the state of the others. */
+enum low_crashinfo low_crashinfo_mode = LOW_CRASHINFO_INVALID;
+
+/* This value is only considered if low_crash_mode is set to MIN or ALL, so
+ * setting a default here is safe. Default to 4GB.  This is because the current
+ * KEXEC_CMD_get_range compat hypercall trucates 64bit pointers to 32 bits. The
+ * typical usecase for crashinfo_maxaddr will be for 64bit Xen with 32bit dom0
+ * and 32bit crash kernel. */
+static paddr_t __initdata crashinfo_maxaddr = 4ULL << 30;
+
+/* = log base 2 of crashinfo_maxaddr after checking for sanity. Default to
+ * larger than the entire physical address space. */
+paddr_t crashinfo_maxaddr_bits = 64;
+
+/* Pointers to keep track of the crash heap region. */
+static void *crash_heap_current = NULL, *crash_heap_end = NULL;
+
 /*
  * Parse command lines in the format
  *
@@ -140,6 +160,58 @@
 }
 custom_param("crashkernel", parse_crashkernel);
 
+/* Parse command lines in the format:
+ *
+ *   low_crashinfo=[none,min,all]
+ *
+ * - none disables the low allocation of crash info.
+ * - min will allocate enough low information for the crash kernel to be able
+ *       to extract the hypervisor and dom0 message ring buffers.
+ * - all will allocate additional structures such as domain and vcpu structs
+ *       low so the crash kernel can perform an extended analysis of state.
+ */
+static void __init parse_low_crashinfo(const char * str)
+{
+
+    if ( !strlen(str) )
+        /* default to min if user just specifies "low_crashinfo" */
+        low_crashinfo_mode = LOW_CRASHINFO_MIN;
+    else if ( !strcmp(str, "none" ) )
+        low_crashinfo_mode = LOW_CRASHINFO_NONE;
+    else if ( !strcmp(str, "min" ) )
+        low_crashinfo_mode = LOW_CRASHINFO_MIN;
+    else if ( !strcmp(str, "all" ) )
+        low_crashinfo_mode = LOW_CRASHINFO_ALL;
+    else
+    {
+        printk("Unknown low_crashinfo parameter '%s'.  Defaulting to min.\n", str);
+        low_crashinfo_mode = LOW_CRASHINFO_MIN;
+    }
+}
+custom_param("low_crashinfo", parse_low_crashinfo);
+
+/* Parse command lines in the format:
+ *
+ *   crashinfo_maxaddr=<addr>
+ *
+ * <addr> will be rounded down to the nearest power of two.  Defaults to 64G
+ */
+static void __init parse_crashinfo_maxaddr(const char * str)
+{
+    u64 addr;
+
+    /* if low_crashinfo_mode is unset, default to min. */
+    if ( low_crashinfo_mode == LOW_CRASHINFO_INVALID )
+        low_crashinfo_mode = LOW_CRASHINFO_MIN;
+
+    if ( (addr = parse_size_and_unit(str, NULL)) )
+        crashinfo_maxaddr = addr;
+    else
+        printk("Unable to parse crashinfo_maxaddr. Defaulting to %p\n",
+               (void*)crashinfo_maxaddr);
+}
+custom_param("crashinfo_maxaddr", parse_crashinfo_maxaddr);
+
 void __init set_kexec_crash_area_size(u64 system_ram)
 {
     unsigned int idx;
@@ -298,6 +370,20 @@
     return bytes;
 }
 
+/* Allocate size_t bytes of space from the previously allocated
+ * crash heap if the user has requested that crash notes be allocated
+ * in lower memory.  There is currently no case where the crash notes
+ * should be free()'d. */
+static void * alloc_from_crash_heap(const size_t bytes)
+{
+    void * ret;
+    if ( crash_heap_current + bytes > crash_heap_end )
+        return NULL;
+    ret = (void*)crash_heap_current;
+    crash_heap_current += bytes;
+    return ret;
+}
+
 /* Allocate a crash note buffer for a newly onlined cpu. */
 static int kexec_init_cpu_notes(const unsigned long cpu)
 {
@@ -312,7 +398,10 @@
         return ret;
 
     nr_bytes = sizeof_cpu_notes(cpu);
-    note = xmalloc_bytes(nr_bytes);
+
+    /* If we dont care about the position of allocation, malloc. */
+    if ( low_crashinfo_mode == LOW_CRASHINFO_NONE )
+        note = xmalloc_bytes(nr_bytes);
 
     /* Protect the write into crash_notes[] with a spinlock, as this function
      * is on a hotplug path and a hypercall path. */
@@ -330,6 +419,11 @@
     }
     else
     {
+        /* If we care about memory possition, alloc from the crash heap,
+         * also protected by the crash_notes_lock. */
+        if ( low_crashinfo_mode > LOW_CRASHINFO_NONE )
+            note = alloc_from_crash_heap(nr_bytes);
+
         crash_notes[cpu].start = note;
         crash_notes[cpu].size = nr_bytes;
         spin_unlock(&crash_notes_lock);
@@ -389,6 +483,18 @@
     .notifier_call = cpu_callback
 };
 
+void __init kexec_early_calculations(void)
+{
+    /* If low_crashinfo_mode is still INVALID, neither "low_crashinfo" nor
+     * "crashinfo_maxaddr" have been specified on the command line, so
+     * explicitly set to NONE. */
+    if ( low_crashinfo_mode == LOW_CRASHINFO_INVALID )
+        low_crashinfo_mode = LOW_CRASHINFO_NONE;
+
+    if ( low_crashinfo_mode > LOW_CRASHINFO_NONE )
+        crashinfo_maxaddr_bits = fls(crashinfo_maxaddr) - 1;
+}
+
 static int __init kexec_init(void)
 {
     void *cpu = (void *)(unsigned long)smp_processor_id();
@@ -397,6 +503,29 @@
     if ( !kexec_crash_area.size )
         return 0;
 
+    if ( low_crashinfo_mode > LOW_CRASHINFO_NONE )
+    {
+        size_t crash_heap_size;
+
+        /* This calculation is safe even if the machine is booted in
+         * uniprocessor mode. */
+        crash_heap_size = sizeof_cpu_notes(0) +
+            sizeof_cpu_notes(1) * (nr_cpu_ids - 1);
+        crash_heap_size = PAGE_ALIGN(crash_heap_size);
+
+        crash_heap_current = alloc_xenheap_pages(
+            get_order_from_bytes(crash_heap_size),
+            MEMF_bits(crashinfo_maxaddr_bits) );
+
+        if ( ! crash_heap_current )
+            return -ENOMEM;
+
+        crash_heap_end = crash_heap_current + crash_heap_size;
+    }
+
+    /* crash_notes may be allocated anywhere Xen can reach in memory.
+       Only the individual CPU crash notes themselves must be allocated
+       in lower memory if requested. */
     crash_notes = xzalloc_array(crash_note_range_t, nr_cpu_ids);
     if ( ! crash_notes )
         return -ENOMEM;
diff -r 0e3ed266b3bb -r 377c075ec0ec xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Fri Mar 16 10:29:20 2012 +0000
+++ b/xen/drivers/char/console.c	Fri Mar 16 10:30:12 2012 +0000
@@ -596,7 +596,7 @@
         opt_conring_size = num_present_cpus() << (9 + xenlog_lower_thresh);
 
     order = get_order_from_bytes(max(opt_conring_size, conring_size));
-    while ( (ring = alloc_xenheap_pages(order, 0)) == NULL )
+    while ( (ring = alloc_xenheap_pages(order, MEMF_bits(crashinfo_maxaddr_bits))) == NULL )
     {
         BUG_ON(order == 0);
         order--;
diff -r 0e3ed266b3bb -r 377c075ec0ec xen/include/xen/kexec.h
--- a/xen/include/xen/kexec.h	Fri Mar 16 10:29:20 2012 +0000
+++ b/xen/include/xen/kexec.h	Fri Mar 16 10:30:12 2012 +0000
@@ -25,6 +25,19 @@
 #define KEXEC_IMAGE_CRASH_BASE   2
 #define KEXEC_IMAGE_NR           4
 
+enum low_crashinfo {
+    LOW_CRASHINFO_INVALID = 0,
+    LOW_CRASHINFO_NONE = 1,
+    LOW_CRASHINFO_MIN = 2,
+    LOW_CRASHINFO_ALL = 3
+};
+
+/* Low crashinfo mode.  Start as INVALID so serveral codepaths can set up
+ * defaults without needing to know the state of the others. */
+extern enum low_crashinfo low_crashinfo_mode;
+extern paddr_t crashinfo_maxaddr_bits;
+void kexec_early_calculations(void);
+
 int machine_kexec_load(int type, int slot, xen_kexec_image_t *image);
 void machine_kexec_unload(int type, int slot, xen_kexec_image_t *image);
 void machine_kexec_reserved(xen_kexec_reserve_t *reservation);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8irY-0006ce-L1; Sat, 17 Mar 2012 01:55:20 +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 1S8irX-0006cE-QS
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:19 +0000
Received: from [85.158.139.83:41352] by server-8.bemta-5.messagelabs.com id
	41/D8-26964-60FE36F4; Sat, 17 Mar 2012 01:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1331949316!15812259!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13043 invoked from network); 17 Mar 2012 01:55:17 -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;
	17 Mar 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 1S8irT-0005bL-71
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irS-0005VW-O7
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:14 +0000
Message-Id: <E1S8irS-0005VW-O7@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/vpmu: small fix for console
	logging beauty
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
# Date 1331889278 -3600
# Node ID 9151dfa96c3a5d95f913416673a0106c3b69f514
# Parent  1b68427875f7ffe3025ea13c7f6e8cf71ce54769
x86/vpmu: small fix for console logging beauty

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 1b68427875f7 -r 9151dfa96c3a xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Thu Mar 15 15:20:37 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Fri Mar 16 10:14:38 2012 +0100
@@ -690,7 +690,7 @@
             printk("******************************************************\n");
             printk("** WARNING: Emulation of BTS Feature is switched on **\n");
             printk("** Using this processor feature in a virtualized    **\n");
-            printk("** environment is not 100%% safe.                   **\n");
+            printk("** environment is not 100%% safe.                    **\n");
             printk("** Setting the DS buffer address with wrong values  **\n");
             printk("** may lead to hypervisor hangs or crashes.         **\n");
             printk("** It is NOT recommended for production use!        **\n");

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01:55:25 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1S8irY-0006ce-L1; Sat, 17 Mar 2012 01:55:20 +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 1S8irX-0006cE-QS
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:19 +0000
Received: from [85.158.139.83:41352] by server-8.bemta-5.messagelabs.com id
	41/D8-26964-60FE36F4; Sat, 17 Mar 2012 01:55:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-182.messagelabs.com!1331949316!15812259!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13043 invoked from network); 17 Mar 2012 01:55:17 -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;
	17 Mar 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 1S8irT-0005bL-71
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irS-0005VW-O7
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:14 +0000
Message-Id: <E1S8irS-0005VW-O7@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/vpmu: small fix for console
	logging beauty
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
# Date 1331889278 -3600
# Node ID 9151dfa96c3a5d95f913416673a0106c3b69f514
# Parent  1b68427875f7ffe3025ea13c7f6e8cf71ce54769
x86/vpmu: small fix for console logging beauty

Signed-off-by: Dietmar Hahn <dietmar.hahn@ts.fujitsu.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 1b68427875f7 -r 9151dfa96c3a xen/arch/x86/hvm/vmx/vpmu_core2.c
--- a/xen/arch/x86/hvm/vmx/vpmu_core2.c	Thu Mar 15 15:20:37 2012 +0000
+++ b/xen/arch/x86/hvm/vmx/vpmu_core2.c	Fri Mar 16 10:14:38 2012 +0100
@@ -690,7 +690,7 @@
             printk("******************************************************\n");
             printk("** WARNING: Emulation of BTS Feature is switched on **\n");
             printk("** Using this processor feature in a virtualized    **\n");
-            printk("** environment is not 100%% safe.                   **\n");
+            printk("** environment is not 100%% safe.                    **\n");
             printk("** Setting the DS buffer address with wrong values  **\n");
             printk("** may lead to hypervisor hangs or crashes.         **\n");
             printk("** It is NOT recommended for production use!        **\n");

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01: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 1S8ira-0006dW-4W; Sat, 17 Mar 2012 01:55:22 +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 1S8irZ-0006cP-BJ
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:21 +0000
Received: from [85.158.143.99:34381] by server-3.bemta-4.messagelabs.com id
	D4/7A-05853-80FE36F4; Sat, 17 Mar 2012 01:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1331949318!14327877!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11846 invoked from network); 17 Mar 2012 01:55:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Mar 2012 01:55: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 1S8irW-0005bd-2v
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irW-0005YG-12
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:18 +0000
Message-Id: <E1S8irW-0005YG-12@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] unmodified drivers: use upstream
	sync_bitops if available
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331894106 -3600
# Node ID 46bf3ab42baf922bdd43d8cbe672ae1b18e31ed9
# Parent  e4460795ee6605fe58ce6d00acc6a747c21429f5
unmodified drivers: use upstream sync_bitops if available

The forward ported xenlinux sources in openSuSE 12.2 were switched from
the old synch_bitops to the sync_bitops since kernel version 3.3. Add
compat macros to use either old or new helpers depending on used kernel
source version.

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


diff -r e4460795ee66 -r 46bf3ab42baf unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
--- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h	Fri Mar 16 11:34:41 2012 +0100
+++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h	Fri Mar 16 11:35:06 2012 +0100
@@ -161,4 +161,14 @@
 #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
 #endif
 
+#ifdef sync_test_bit
+#define synch_change_bit		sync_change_bit
+#define synch_clear_bit			sync_clear_bit
+#define synch_set_bit			sync_set_bit
+#define synch_test_and_change_bit	sync_test_and_change_bit
+#define synch_test_and_clear_bit	sync_test_and_clear_bit
+#define synch_test_and_set_bit		sync_test_and_set_bit
+#define synch_test_bit			sync_test_bit
 #endif
+
+#endif

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

From xen-changelog-bounces@lists.xen.org Sat Mar 17 01:55:26 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 17 Mar 2012 01: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 1S8ira-0006dW-4W; Sat, 17 Mar 2012 01:55:22 +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 1S8irZ-0006cP-BJ
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:21 +0000
Received: from [85.158.143.99:34381] by server-3.bemta-4.messagelabs.com id
	D4/7A-05853-80FE36F4; Sat, 17 Mar 2012 01:55:20 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1331949318!14327877!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11846 invoked from network); 17 Mar 2012 01:55:19 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	17 Mar 2012 01:55: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 1S8irW-0005bd-2v
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:18 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1S8irW-0005YG-12
	for xen-changelog@lists.xensource.com; Sat, 17 Mar 2012 01:55:18 +0000
Message-Id: <E1S8irW-0005YG-12@xenbits.xen.org>
Date: Sat, 17 Mar 2012 01:55:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] unmodified drivers: use upstream
	sync_bitops if available
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1331894106 -3600
# Node ID 46bf3ab42baf922bdd43d8cbe672ae1b18e31ed9
# Parent  e4460795ee6605fe58ce6d00acc6a747c21429f5
unmodified drivers: use upstream sync_bitops if available

The forward ported xenlinux sources in openSuSE 12.2 were switched from
the old synch_bitops to the sync_bitops since kernel version 3.3. Add
compat macros to use either old or new helpers depending on used kernel
source version.

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


diff -r e4460795ee66 -r 46bf3ab42baf unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h
--- a/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h	Fri Mar 16 11:34:41 2012 +0100
+++ b/unmodified_drivers/linux-2.6/compat-include/xen/platform-compat.h	Fri Mar 16 11:35:06 2012 +0100
@@ -161,4 +161,14 @@
 #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
 #endif
 
+#ifdef sync_test_bit
+#define synch_change_bit		sync_change_bit
+#define synch_clear_bit			sync_clear_bit
+#define synch_set_bit			sync_set_bit
+#define synch_test_and_change_bit	sync_test_and_change_bit
+#define synch_test_and_clear_bit	sync_test_and_clear_bit
+#define synch_test_and_set_bit		sync_test_and_set_bit
+#define synch_test_bit			sync_test_bit
 #endif
+
+#endif

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21: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 1SApdA-0007bp-C6; Thu, 22 Mar 2012 21: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 1SApd9-0007bh-SF
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:11 +0000
Received: from [193.109.254.147:55446] by server-3.bemta-14.messagelabs.com id
	12/00-23274-79A9B6F4; Thu, 22 Mar 2012 21:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1332451989!1697776!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28000 invoked from network); 22 Mar 2012 21:33:10 -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 Mar 2012 21: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 1SApd6-0001sg-W9
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd6-0003k3-Rc
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:08 +0000
Message-Id: <E1SApd6-0003k3-Rc@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ia64: fix build (after c/s
	25070:4e1d091d10d8)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332319044 -3600
# Node ID 713bc70e5fe71670bd40de2c5524cade6220afcf
# Parent  4e1d091d10d83130842170cd61f1194e5459f2aa
ia64: fix build (after c/s 25070:4e1d091d10d8)

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


diff -r 4e1d091d10d8 -r 713bc70e5fe7 xen/include/asm-ia64/config.h
--- a/xen/include/asm-ia64/config.h	Fri Mar 16 15:24:25 2012 +0000
+++ b/xen/include/asm-ia64/config.h	Wed Mar 21 09:37:24 2012 +0100
@@ -73,6 +73,7 @@
 // now needed for xen/include/mm.h
 typedef unsigned long paddr_t;
 #define INVALID_PADDR (~0UL)
+#define PRIpaddr "016lx"
 // from include/linux/kernel.h
 #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1))
 

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21: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 1SApdA-0007bp-C6; Thu, 22 Mar 2012 21: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 1SApd9-0007bh-SF
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:11 +0000
Received: from [193.109.254.147:55446] by server-3.bemta-14.messagelabs.com id
	12/00-23274-79A9B6F4; Thu, 22 Mar 2012 21:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1332451989!1697776!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28000 invoked from network); 22 Mar 2012 21:33:10 -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 Mar 2012 21: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 1SApd6-0001sg-W9
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd6-0003k3-Rc
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:08 +0000
Message-Id: <E1SApd6-0003k3-Rc@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] ia64: fix build (after c/s
	25070:4e1d091d10d8)
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332319044 -3600
# Node ID 713bc70e5fe71670bd40de2c5524cade6220afcf
# Parent  4e1d091d10d83130842170cd61f1194e5459f2aa
ia64: fix build (after c/s 25070:4e1d091d10d8)

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


diff -r 4e1d091d10d8 -r 713bc70e5fe7 xen/include/asm-ia64/config.h
--- a/xen/include/asm-ia64/config.h	Fri Mar 16 15:24:25 2012 +0000
+++ b/xen/include/asm-ia64/config.h	Wed Mar 21 09:37:24 2012 +0100
@@ -73,6 +73,7 @@
 // now needed for xen/include/mm.h
 typedef unsigned long paddr_t;
 #define INVALID_PADDR (~0UL)
+#define PRIpaddr "016lx"
 // from include/linux/kernel.h
 #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1))
 

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21: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 1SApdD-0007cm-JS; Thu, 22 Mar 2012 21:33: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 1SApdC-0007c8-CN
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:14 +0000
Received: from [85.158.143.99:61538] by server-3.bemta-4.messagelabs.com id
	1C/23-05853-99A9B6F4; Thu, 22 Mar 2012 21:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1332451991!14695664!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31120 invoked from network); 22 Mar 2012 21:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Mar 2012 21:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd8-0001sp-SX
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd8-0003lS-ID
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:10 +0000
Message-Id: <E1SApd8-0003lS-ID@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: improve documentation for the
	the dom0_mem command line 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332411810 0
# Node ID 00a8292b8180a82d090749289e0a95091248028a
# Parent  a0aad46225ac94ec341d2667fd91e2c1f9362a3e
docs: improve documentation for the the dom0_mem command line option

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


diff -r a0aad46225ac -r 00a8292b8180 docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Thu Mar 22 10:19:01 2012 +0000
+++ b/docs/misc/xen-command-line.markdown	Thu Mar 22 10:23:30 2012 +0000
@@ -8,7 +8,7 @@
 
 Most parameters take the form `option=value`.  Different options on the command line should be space delimited.
 
-### Boolean
+### Boolean (`<boolean>`)
 
 All boolean option may be explicitly enabled using a `value` of
 > `yes`, `on`, `true`, `enable` or `1`
@@ -29,11 +29,11 @@
 Enable synchronous console mode
 > `sync_console`
 
-### Integer
+### Integer (`<integer>`)
 
 An integer parameter will default to decimal and may be prefixed with a `-` for negative numbers.  Alternativly, a hexidecimal number may be used by prefixing the number with `0x`, or an octal number may be used if a leading `0` is present.
 
-### Size
+### Size (`<size>`)
 
 A size parameter may be any integer, with a size suffix
 
@@ -96,7 +96,7 @@
 ### ats
 ### availmem
 ### badpage
-> `= List of [ <integer> | <ingeter>-<integer> ]`
+> `= List of [ <integer> | <integer>-<integer> ]`
 
 Specify that certain pages, or certain ranges of pages contain bad bytes and should not be used.  For example, if your memory tester says that byte `0x12345678` is bad, you would place `badpage=0x12345` on Xen's command line.
 
@@ -219,13 +219,22 @@
 Specify the total size for dom0.
 
 ### dom0\_mem (x86)
-> `= List of ( min:<value> | max: <value> | <value> )`
+> `= List of ( min:<size> | max:<size> | <size> )`
 
-each `<value>` is a size parameter.  If the size is positive, it represents an absolute value.  If the size is negative, the size specified is subtracted from the total available memory.
+Set the amount of memory for the initial domain (dom0). If a size is
+positive, it represents an absolute value.  If a size is negative, the
+size specified is subtracted from the total available memory.
 
-* `min:<value>` specifies the minimum amount of memory allocated to dom0.
-* `max:<value>` specifies the maximum amount of memory allocated to dom0.
-* `<value>` specified the exact amount of memory allocated to dom0.
+* `min:<size>` specifies the minimum amount of memory allocated to dom0.
+* `max:<size>` specifies the maximum amount of memory allocated to dom0.
+* `<size>` specified the exact amount of memory allocated to dom0.
+
+`max:<size>` also sets the maximum reservation (the maximum amount of
+memory dom0 can balloon up to).  If this is omitted then the maximum
+reservation is unlimited.
+
+For example, to set dom0's memory to 512 MB but no more than 1 GB use
+`dom0_mem=512M,max:1G`.
 
 ### dom0\_shadow
 ### dom0\_vcpus\_pin

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21: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 1SApdD-0007cm-JS; Thu, 22 Mar 2012 21:33: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 1SApdC-0007c8-CN
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:14 +0000
Received: from [85.158.143.99:61538] by server-3.bemta-4.messagelabs.com id
	1C/23-05853-99A9B6F4; Thu, 22 Mar 2012 21:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-216.messagelabs.com!1332451991!14695664!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31120 invoked from network); 22 Mar 2012 21:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Mar 2012 21:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd8-0001sp-SX
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd8-0003lS-ID
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:10 +0000
Message-Id: <E1SApd8-0003lS-ID@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] docs: improve documentation for the
	the dom0_mem command line 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332411810 0
# Node ID 00a8292b8180a82d090749289e0a95091248028a
# Parent  a0aad46225ac94ec341d2667fd91e2c1f9362a3e
docs: improve documentation for the the dom0_mem command line option

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


diff -r a0aad46225ac -r 00a8292b8180 docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Thu Mar 22 10:19:01 2012 +0000
+++ b/docs/misc/xen-command-line.markdown	Thu Mar 22 10:23:30 2012 +0000
@@ -8,7 +8,7 @@
 
 Most parameters take the form `option=value`.  Different options on the command line should be space delimited.
 
-### Boolean
+### Boolean (`<boolean>`)
 
 All boolean option may be explicitly enabled using a `value` of
 > `yes`, `on`, `true`, `enable` or `1`
@@ -29,11 +29,11 @@
 Enable synchronous console mode
 > `sync_console`
 
-### Integer
+### Integer (`<integer>`)
 
 An integer parameter will default to decimal and may be prefixed with a `-` for negative numbers.  Alternativly, a hexidecimal number may be used by prefixing the number with `0x`, or an octal number may be used if a leading `0` is present.
 
-### Size
+### Size (`<size>`)
 
 A size parameter may be any integer, with a size suffix
 
@@ -96,7 +96,7 @@
 ### ats
 ### availmem
 ### badpage
-> `= List of [ <integer> | <ingeter>-<integer> ]`
+> `= List of [ <integer> | <integer>-<integer> ]`
 
 Specify that certain pages, or certain ranges of pages contain bad bytes and should not be used.  For example, if your memory tester says that byte `0x12345678` is bad, you would place `badpage=0x12345` on Xen's command line.
 
@@ -219,13 +219,22 @@
 Specify the total size for dom0.
 
 ### dom0\_mem (x86)
-> `= List of ( min:<value> | max: <value> | <value> )`
+> `= List of ( min:<size> | max:<size> | <size> )`
 
-each `<value>` is a size parameter.  If the size is positive, it represents an absolute value.  If the size is negative, the size specified is subtracted from the total available memory.
+Set the amount of memory for the initial domain (dom0). If a size is
+positive, it represents an absolute value.  If a size is negative, the
+size specified is subtracted from the total available memory.
 
-* `min:<value>` specifies the minimum amount of memory allocated to dom0.
-* `max:<value>` specifies the maximum amount of memory allocated to dom0.
-* `<value>` specified the exact amount of memory allocated to dom0.
+* `min:<size>` specifies the minimum amount of memory allocated to dom0.
+* `max:<size>` specifies the maximum amount of memory allocated to dom0.
+* `<size>` specified the exact amount of memory allocated to dom0.
+
+`max:<size>` also sets the maximum reservation (the maximum amount of
+memory dom0 can balloon up to).  If this is omitted then the maximum
+reservation is unlimited.
+
+For example, to set dom0's memory to 512 MB but no more than 1 GB use
+`dom0_mem=512M,max:1G`.
 
 ### dom0\_shadow
 ### dom0\_vcpus\_pin

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21: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 1SApdC-0007cB-ET; Thu, 22 Mar 2012 21:33: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 1SApdB-0007bu-1n
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:13 +0000
Received: from [85.158.138.51:29755] by server-9.bemta-3.messagelabs.com id
	1A/5B-10923-89A9B6F4; Thu, 22 Mar 2012 21:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1332451990!17071734!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2312 invoked from network); 22 Mar 2012 21:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Mar 2012 21:33: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 1SApd7-0001sj-Pw
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd7-0003kY-Em
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:09 +0000
Message-Id: <E1SApd7-0003kY-Em@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] CODING_STYLE: Document the coding
	style conventions.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332411492 0
# Node ID 6fde5df8b8501c22e959f6b3510e7c775ac1d385
# Parent  713bc70e5fe71670bd40de2c5524cade6220afcf
CODING_STYLE: Document the coding style conventions.

Based on a version originally posted in 2007.
http://lists.xen.org/archives/html/xen-devel/2007-06/msg00070.html

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


diff -r 713bc70e5fe7 -r 6fde5df8b850 CODING_STYLE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CODING_STYLE	Thu Mar 22 10:18:12 2012 +0000
@@ -0,0 +1,120 @@
+Coding Style for the Xen Hypervisor
+===================================
+
+The Xen coding style described below is the coding style used by the
+Xen hypervisor itself (xen/*) as well as various associated low-level
+libraries (e.g. tools/libxc/*).
+        
+An exception is made for files which are imported from an external
+source. In these cases the prevailing coding style of the upstream
+source is generally used (commonly the Linux coding style).
+        
+Other parts of the code base may use other coding styles, sometimes
+explicitly (e.g. tools/libxl/CODING_STYLE) but often implicitly (Linux
+coding style is fairly common). In general you should copy the style
+of the surrounding code. If you are unsure please ask.
+
+Indentation
+-----------
+
+Indenting uses spaces, not tabs - in contrast to Linux.  An indent
+level consists of four spaces.  Code within blocks is indented by one
+extra indent level.  The enclosing braces of a block are indented the
+same as the code _outside_ the block.  e.g.
+
+void fun(void)
+{
+    /* One level of indent. */
+
+    {
+        /* A second level of indent. */
+    }
+}
+
+White space
+-----------
+
+Space characters are used to spread out logical statements, such as in
+the condition of an if or while.  Spaces are placed between the
+keyword and the brackets surrounding the condition, between the
+brackets and the condition itself, and around binary operators (except
+the structure access operators, '.' and '->'). e.g.
+
+if ( (wibble & wombat) == 42 )
+{
+    ...
+
+There should be no trailing white space at the end of lines (including
+after the opening /* of a comment block).
+
+Line Length
+-----------
+
+Lines should be less than 80 characters in length.  Long lines should
+be split at sensible places and the trailing portions indented.
+
+User visible strings (e.g., printk() messages) should not be split so
+they can searched for more easily.
+
+Bracing
+-------
+
+Braces ('{' and '}') are usually placed on a line of their own, except
+for the do/while loop.  This is unlike the Linux coding style and
+unlike K&R.  do/while loops are an exception. e.g.:
+
+if ( condition )
+{
+    /* Do stuff. */
+}
+else
+{
+    /* Other stuff. */
+}
+
+while ( condition )
+{
+    /* Do stuff. */
+}
+
+do {
+    /* Do stuff. */
+} while ( condition );
+
+etc.
+
+Braces should be omitted for blocks with a single statement. e.g.,
+
+if ( condition )
+    single_statement();
+
+Comments
+--------
+
+Only C style /* ... */ comments are to be used.  C++ style // comments
+should not be used.  Multi-word comments should begin with a capital
+letter and end with a full stop.
+
+Multi-line comment blocks should start and end with comment markers on
+separate lines and each line should begin with a leading '*'.
+
+/*
+ * Example, multi-line comment block.
+ *
+ * Note beginning and end markers on separate lines and leading '*'.
+ */
+
+Emacs local variables
+---------------------
+
+A comment block containing local variables for emacs is permitted at
+the end of files.  It should be:
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21: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 1SApdC-0007cB-ET; Thu, 22 Mar 2012 21:33: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 1SApdB-0007bu-1n
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:13 +0000
Received: from [85.158.138.51:29755] by server-9.bemta-3.messagelabs.com id
	1A/5B-10923-89A9B6F4; Thu, 22 Mar 2012 21:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1332451990!17071734!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2312 invoked from network); 22 Mar 2012 21:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Mar 2012 21:33: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 1SApd7-0001sj-Pw
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd7-0003kY-Em
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:09 +0000
Message-Id: <E1SApd7-0003kY-Em@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] CODING_STYLE: Document the coding
	style conventions.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332411492 0
# Node ID 6fde5df8b8501c22e959f6b3510e7c775ac1d385
# Parent  713bc70e5fe71670bd40de2c5524cade6220afcf
CODING_STYLE: Document the coding style conventions.

Based on a version originally posted in 2007.
http://lists.xen.org/archives/html/xen-devel/2007-06/msg00070.html

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


diff -r 713bc70e5fe7 -r 6fde5df8b850 CODING_STYLE
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/CODING_STYLE	Thu Mar 22 10:18:12 2012 +0000
@@ -0,0 +1,120 @@
+Coding Style for the Xen Hypervisor
+===================================
+
+The Xen coding style described below is the coding style used by the
+Xen hypervisor itself (xen/*) as well as various associated low-level
+libraries (e.g. tools/libxc/*).
+        
+An exception is made for files which are imported from an external
+source. In these cases the prevailing coding style of the upstream
+source is generally used (commonly the Linux coding style).
+        
+Other parts of the code base may use other coding styles, sometimes
+explicitly (e.g. tools/libxl/CODING_STYLE) but often implicitly (Linux
+coding style is fairly common). In general you should copy the style
+of the surrounding code. If you are unsure please ask.
+
+Indentation
+-----------
+
+Indenting uses spaces, not tabs - in contrast to Linux.  An indent
+level consists of four spaces.  Code within blocks is indented by one
+extra indent level.  The enclosing braces of a block are indented the
+same as the code _outside_ the block.  e.g.
+
+void fun(void)
+{
+    /* One level of indent. */
+
+    {
+        /* A second level of indent. */
+    }
+}
+
+White space
+-----------
+
+Space characters are used to spread out logical statements, such as in
+the condition of an if or while.  Spaces are placed between the
+keyword and the brackets surrounding the condition, between the
+brackets and the condition itself, and around binary operators (except
+the structure access operators, '.' and '->'). e.g.
+
+if ( (wibble & wombat) == 42 )
+{
+    ...
+
+There should be no trailing white space at the end of lines (including
+after the opening /* of a comment block).
+
+Line Length
+-----------
+
+Lines should be less than 80 characters in length.  Long lines should
+be split at sensible places and the trailing portions indented.
+
+User visible strings (e.g., printk() messages) should not be split so
+they can searched for more easily.
+
+Bracing
+-------
+
+Braces ('{' and '}') are usually placed on a line of their own, except
+for the do/while loop.  This is unlike the Linux coding style and
+unlike K&R.  do/while loops are an exception. e.g.:
+
+if ( condition )
+{
+    /* Do stuff. */
+}
+else
+{
+    /* Other stuff. */
+}
+
+while ( condition )
+{
+    /* Do stuff. */
+}
+
+do {
+    /* Do stuff. */
+} while ( condition );
+
+etc.
+
+Braces should be omitted for blocks with a single statement. e.g.,
+
+if ( condition )
+    single_statement();
+
+Comments
+--------
+
+Only C style /* ... */ comments are to be used.  C++ style // comments
+should not be used.  Multi-word comments should begin with a capital
+letter and end with a full stop.
+
+Multi-line comment blocks should start and end with comment markers on
+separate lines and each line should begin with a leading '*'.
+
+/*
+ * Example, multi-line comment block.
+ *
+ * Note beginning and end markers on separate lines and leading '*'.
+ */
+
+Emacs local variables
+---------------------
+
+A comment block containing local variables for emacs is permitted at
+the end of files.  It should be:
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21: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 1SApdE-0007dU-Qg; Thu, 22 Mar 2012 21:33: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 1SApdD-0007cW-DN
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:15 +0000
Received: from [85.158.143.99:61569] by server-2.bemta-4.messagelabs.com id
	4E/29-17550-A9A9B6F4; Thu, 22 Mar 2012 21:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1332451992!15145853!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18690 invoked from network); 22 Mar 2012 21:33:13 -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;
	22 Mar 2012 21:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApdA-0001sy-Ch
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApdA-0003ms-87
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:12 +0000
Message-Id: <E1SApdA-0003ms-87@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: fix broken shadow debug
	printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332411808 0
# Node ID 4347c2a26913b02e84c337a7969d8c4b33ab96ba
# Parent  363579ff4fa30d7198d18ef8da94ccdf515bb0c2
x86/mm: fix broken shadow debug printk

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


diff -r 363579ff4fa3 -r 4347c2a26913 xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c	Thu Mar 22 10:25:28 2012 +0000
+++ b/xen/arch/x86/mm/shadow/common.c	Thu Mar 22 10:23:28 2012 +0000
@@ -2920,7 +2920,7 @@
         if ( v->arch.paging.mode != old_mode )
         {
             SHADOW_PRINTK("new paging mode: d=%u v=%u pe=%d gl=%u "
-                          "(was g=%u s=%u)\n",
+                          "sl=%u (was g=%u s=%u)\n",
                           d->domain_id, v->vcpu_id,
                           is_hvm_domain(d) ? hvm_paging_enabled(v) : 1,
                           v->arch.paging.mode->guest_levels,

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21: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 1SApdE-0007dU-Qg; Thu, 22 Mar 2012 21:33: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 1SApdD-0007cW-DN
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:15 +0000
Received: from [85.158.143.99:61569] by server-2.bemta-4.messagelabs.com id
	4E/29-17550-A9A9B6F4; Thu, 22 Mar 2012 21:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1332451992!15145853!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18690 invoked from network); 22 Mar 2012 21:33:13 -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;
	22 Mar 2012 21:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApdA-0001sy-Ch
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApdA-0003ms-87
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:12 +0000
Message-Id: <E1SApdA-0003ms-87@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: fix broken shadow debug
	printk
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332411808 0
# Node ID 4347c2a26913b02e84c337a7969d8c4b33ab96ba
# Parent  363579ff4fa30d7198d18ef8da94ccdf515bb0c2
x86/mm: fix broken shadow debug printk

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


diff -r 363579ff4fa3 -r 4347c2a26913 xen/arch/x86/mm/shadow/common.c
--- a/xen/arch/x86/mm/shadow/common.c	Thu Mar 22 10:25:28 2012 +0000
+++ b/xen/arch/x86/mm/shadow/common.c	Thu Mar 22 10:23:28 2012 +0000
@@ -2920,7 +2920,7 @@
         if ( v->arch.paging.mode != old_mode )
         {
             SHADOW_PRINTK("new paging mode: d=%u v=%u pe=%d gl=%u "
-                          "(was g=%u s=%u)\n",
+                          "sl=%u (was g=%u s=%u)\n",
                           d->domain_id, v->vcpu_id,
                           is_hvm_domain(d) ? hvm_paging_enabled(v) : 1,
                           v->arch.paging.mode->guest_levels,

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21: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 1SApdD-0007cr-Ln; Thu, 22 Mar 2012 21:33: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 1SApdC-0007cA-VN
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:15 +0000
Received: from [85.158.143.35:5749] by server-1.bemta-4.messagelabs.com id
	05/9B-20925-A9A9B6F4; Thu, 22 Mar 2012 21:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1332451992!12522033!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1995 invoked from network); 22 Mar 2012 21:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Mar 2012 21:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd9-0001sv-QX
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd9-0003mN-Ld
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:11 +0000
Message-Id: <E1SApd9-0003mN-Ld@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Fix put_gfn in
	XEN_DOMCTL_getpageframeinfo3.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332411928 0
# Node ID 363579ff4fa30d7198d18ef8da94ccdf515bb0c2
# Parent  a0aad46225ac94ec341d2667fd91e2c1f9362a3e
x86: Fix put_gfn in XEN_DOMCTL_getpageframeinfo3.

Reported by Christian Limpach.
Signed-off-by: Tim Deegan <tim@xen.org>
---


diff -r a0aad46225ac -r 363579ff4fa3 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Thu Mar 22 10:19:01 2012 +0000
+++ b/xen/arch/x86/domctl.c	Thu Mar 22 10:25:28 2012 +0000
@@ -237,8 +237,8 @@
                     else
                         type = XEN_DOMCTL_PFINFO_XTAB;
 
+                    put_gfn(d, arr[j]);
                     arr[j] = type;
-                    put_gfn(d, arr[j]);
                 }
 
                 if ( copy_to_guest_offset(domctl->u.getpageframeinfo3.array,

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21: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 1SApdD-0007cr-Ln; Thu, 22 Mar 2012 21:33: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 1SApdC-0007cA-VN
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:15 +0000
Received: from [85.158.143.35:5749] by server-1.bemta-4.messagelabs.com id
	05/9B-20925-A9A9B6F4; Thu, 22 Mar 2012 21:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1332451992!12522033!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1995 invoked from network); 22 Mar 2012 21:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Mar 2012 21:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd9-0001sv-QX
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd9-0003mN-Ld
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:11 +0000
Message-Id: <E1SApd9-0003mN-Ld@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Fix put_gfn in
	XEN_DOMCTL_getpageframeinfo3.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332411928 0
# Node ID 363579ff4fa30d7198d18ef8da94ccdf515bb0c2
# Parent  a0aad46225ac94ec341d2667fd91e2c1f9362a3e
x86: Fix put_gfn in XEN_DOMCTL_getpageframeinfo3.

Reported by Christian Limpach.
Signed-off-by: Tim Deegan <tim@xen.org>
---


diff -r a0aad46225ac -r 363579ff4fa3 xen/arch/x86/domctl.c
--- a/xen/arch/x86/domctl.c	Thu Mar 22 10:19:01 2012 +0000
+++ b/xen/arch/x86/domctl.c	Thu Mar 22 10:25:28 2012 +0000
@@ -237,8 +237,8 @@
                     else
                         type = XEN_DOMCTL_PFINFO_XTAB;
 
+                    put_gfn(d, arr[j]);
                     arr[j] = type;
-                    put_gfn(d, arr[j]);
                 }
 
                 if ( copy_to_guest_offset(domctl->u.getpageframeinfo3.array,

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SApdF-0007e1-Vd; Thu, 22 Mar 2012 21:33: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 1SApdE-0007dP-UW
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:17 +0000
Received: from [85.158.139.83:2187] by server-6.bemta-5.messagelabs.com id
	C5/0E-13222-C9A9B6F4; Thu, 22 Mar 2012 21:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1332451993!20512105!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17014 invoked from network); 22 Mar 2012 21:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Mar 2012 21:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApdB-0001t4-Dv
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApdB-0003nn-CS
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:13 +0000
Message-Id: <E1SApdB-0003nn-CS@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Introduce system_state variable.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332418813 0
# Node ID d5ccb2d1dbd1dce76f9d427073306941d48c3095
# Parent  8180cb3895af71d090fa82d66b012f1f65029055
Introduce system_state variable.

Use it to replace x86-specific early_boot boolean variable.

Also use it to detect suspend/resume case during cpu offline/online
to avoid unnecessarily breaking vcpu and cpupool affinities.

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


diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/arch/arm/setup.c	Thu Mar 22 12:20:13 2012 +0000
@@ -253,6 +253,8 @@
     /* Hide UART from DOM0 if we're using it */
     serial_endboot();
 
+    system_state = SYS_STATE_active;
+
     domain_unpause_by_systemcontroller(dom0);
 
     /* Switch on to the dynamically allocated stack for the idle vcpu
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/arch/x86/acpi/power.c
--- a/xen/arch/x86/acpi/power.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/arch/x86/acpi/power.c	Thu Mar 22 12:20:13 2012 +0000
@@ -135,6 +135,9 @@
     if ( !spin_trylock(&pm_lock) )
         return -EBUSY;
 
+    BUG_ON(system_state != SYS_STATE_active);
+    system_state = SYS_STATE_suspend;
+
     printk(XENLOG_INFO "Preparing system for ACPI S%d state.\n", state);
 
     freeze_domains();
@@ -142,7 +145,10 @@
     acpi_dmar_reinstate();
 
     if ( (error = disable_nonboot_cpus()) )
+    {
+        system_state = SYS_STATE_resume;
         goto enable_cpu;
+    }
 
     cpufreq_del_cpu(0);
 
@@ -159,6 +165,7 @@
     if ( (error = device_power_down()) )
     {
         printk(XENLOG_ERR "Some devices failed to power down.");
+        system_state = SYS_STATE_resume;
         goto done;
     }
 
@@ -179,6 +186,8 @@
         break;
     }
 
+    system_state = SYS_STATE_resume;
+
     /* Restore CR4 and EFER from cached values. */
     cr4 = read_cr4();
     write_cr4(cr4 & ~X86_CR4_MCE);
@@ -212,6 +221,7 @@
     mtrr_aps_sync_end();
     acpi_dmar_zap();
     thaw_domains();
+    system_state = SYS_STATE_active;
     spin_unlock(&pm_lock);
     return error;
 }
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Mar 22 12:20:13 2012 +0000
@@ -5316,7 +5316,7 @@
 
 void free_xen_pagetable(void *v)
 {
-    if ( early_boot )
+    if ( system_state == SYS_STATE_early_boot )
         return;
 
     if ( is_xen_heap_page(virt_to_page(v)) )
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/arch/x86/setup.c	Thu Mar 22 12:20:13 2012 +0000
@@ -81,8 +81,6 @@
 s8 __read_mostly xen_cpuidle = -1;
 boolean_param("cpuidle", xen_cpuidle);
 
-bool_t __read_mostly early_boot = 1;
-
 cpumask_t __read_mostly cpu_present_map;
 
 unsigned long __read_mostly xen_phys_start;
@@ -271,7 +269,7 @@
     void *ret;
 
 #ifdef __x86_64__
-    if ( !early_boot )
+    if ( system_state != SYS_STATE_early_boot )
         return mod ? mfn_to_virt(mod->mod_start) : NULL;
 #endif
 
@@ -1168,7 +1166,7 @@
 #endif
 
     end_boot_allocator();
-    early_boot = 0;
+    system_state = SYS_STATE_boot;
 
 #if defined(CONFIG_X86_64)
     vesa_init();
@@ -1391,6 +1389,8 @@
 
     dmi_end_boot();
 
+    system_state = SYS_STATE_active;
+
     domain_unpause_by_systemcontroller(dom0);
 
     reset_stack_and_jump(init_done);
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/arch/x86/x86_32/mm.c
--- a/xen/arch/x86/x86_32/mm.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/arch/x86/x86_32/mm.c	Thu Mar 22 12:20:13 2012 +0000
@@ -43,7 +43,7 @@
 {
     unsigned long mfn;
 
-    if ( !early_boot )
+    if ( system_state != SYS_STATE_early_boot )
     {
         void *v = alloc_xenheap_page();
 
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/arch/x86/x86_64/mm.c	Thu Mar 22 12:20:13 2012 +0000
@@ -85,7 +85,7 @@
 {
     unsigned long mfn;
 
-    if ( !early_boot )
+    if ( system_state != SYS_STATE_early_boot )
     {
         struct page_info *pg = alloc_domheap_page(NULL, 0);
 
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/common/cpupool.c
--- a/xen/common/cpupool.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/common/cpupool.c	Thu Mar 22 12:20:13 2012 +0000
@@ -629,6 +629,10 @@
     unsigned int cpu = (unsigned long)hcpu;
     int rc = 0;
 
+    if ( (system_state == SYS_STATE_suspend) ||
+         (system_state == SYS_STATE_resume) )
+        goto out;
+
     switch ( action )
     {
     case CPU_DOWN_FAILED:
@@ -642,6 +646,7 @@
         break;
     }
 
+out:
     return !rc ? NOTIFY_DONE : notifier_from_errno(rc);
 }
 
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/common/kernel.c
--- a/xen/common/kernel.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/common/kernel.c	Thu Mar 22 12:20:13 2012 +0000
@@ -20,6 +20,8 @@
 
 #ifndef COMPAT
 
+enum system_state system_state = SYS_STATE_early_boot;
+
 int tainted;
 
 xen_commandline_t saved_cmdline;
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/common/schedule.c
--- a/xen/common/schedule.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/common/schedule.c	Thu Mar 22 12:20:13 2012 +0000
@@ -538,7 +538,7 @@
     int    ret = 0;
 
     c = per_cpu(cpupool, cpu);
-    if ( c == NULL )
+    if ( (c == NULL) || (system_state == SYS_STATE_suspend) )
         return ret;
 
     for_each_domain_in_cpupool ( d, c )
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/include/asm-x86/setup.h
--- a/xen/include/asm-x86/setup.h	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/include/asm-x86/setup.h	Thu Mar 22 12:20:13 2012 +0000
@@ -3,7 +3,6 @@
 
 #include <xen/multiboot.h>
 
-extern bool_t early_boot;
 extern unsigned long xenheap_initial_phys_start;
 
 void early_cpu_init(void);
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/include/xen/kernel.h
--- a/xen/include/xen/kernel.h	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/include/xen/kernel.h	Thu Mar 22 12:20:13 2012 +0000
@@ -87,5 +87,13 @@
     (__p >= _sinittext) && (__p < _einittext);  \
 })
 
+extern enum system_state {
+    SYS_STATE_early_boot,
+    SYS_STATE_boot,
+    SYS_STATE_active,
+    SYS_STATE_suspend,
+    SYS_STATE_resume
+} system_state;
+
 #endif /* _LINUX_KERNEL_H */
 

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SApdF-0007e1-Vd; Thu, 22 Mar 2012 21:33: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 1SApdE-0007dP-UW
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:17 +0000
Received: from [85.158.139.83:2187] by server-6.bemta-5.messagelabs.com id
	C5/0E-13222-C9A9B6F4; Thu, 22 Mar 2012 21:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-182.messagelabs.com!1332451993!20512105!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 17014 invoked from network); 22 Mar 2012 21:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	22 Mar 2012 21:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApdB-0001t4-Dv
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApdB-0003nn-CS
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:13 +0000
Message-Id: <E1SApdB-0003nn-CS@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Introduce system_state variable.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332418813 0
# Node ID d5ccb2d1dbd1dce76f9d427073306941d48c3095
# Parent  8180cb3895af71d090fa82d66b012f1f65029055
Introduce system_state variable.

Use it to replace x86-specific early_boot boolean variable.

Also use it to detect suspend/resume case during cpu offline/online
to avoid unnecessarily breaking vcpu and cpupool affinities.

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


diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/arch/arm/setup.c
--- a/xen/arch/arm/setup.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/arch/arm/setup.c	Thu Mar 22 12:20:13 2012 +0000
@@ -253,6 +253,8 @@
     /* Hide UART from DOM0 if we're using it */
     serial_endboot();
 
+    system_state = SYS_STATE_active;
+
     domain_unpause_by_systemcontroller(dom0);
 
     /* Switch on to the dynamically allocated stack for the idle vcpu
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/arch/x86/acpi/power.c
--- a/xen/arch/x86/acpi/power.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/arch/x86/acpi/power.c	Thu Mar 22 12:20:13 2012 +0000
@@ -135,6 +135,9 @@
     if ( !spin_trylock(&pm_lock) )
         return -EBUSY;
 
+    BUG_ON(system_state != SYS_STATE_active);
+    system_state = SYS_STATE_suspend;
+
     printk(XENLOG_INFO "Preparing system for ACPI S%d state.\n", state);
 
     freeze_domains();
@@ -142,7 +145,10 @@
     acpi_dmar_reinstate();
 
     if ( (error = disable_nonboot_cpus()) )
+    {
+        system_state = SYS_STATE_resume;
         goto enable_cpu;
+    }
 
     cpufreq_del_cpu(0);
 
@@ -159,6 +165,7 @@
     if ( (error = device_power_down()) )
     {
         printk(XENLOG_ERR "Some devices failed to power down.");
+        system_state = SYS_STATE_resume;
         goto done;
     }
 
@@ -179,6 +186,8 @@
         break;
     }
 
+    system_state = SYS_STATE_resume;
+
     /* Restore CR4 and EFER from cached values. */
     cr4 = read_cr4();
     write_cr4(cr4 & ~X86_CR4_MCE);
@@ -212,6 +221,7 @@
     mtrr_aps_sync_end();
     acpi_dmar_zap();
     thaw_domains();
+    system_state = SYS_STATE_active;
     spin_unlock(&pm_lock);
     return error;
 }
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Mar 22 12:20:13 2012 +0000
@@ -5316,7 +5316,7 @@
 
 void free_xen_pagetable(void *v)
 {
-    if ( early_boot )
+    if ( system_state == SYS_STATE_early_boot )
         return;
 
     if ( is_xen_heap_page(virt_to_page(v)) )
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/arch/x86/setup.c	Thu Mar 22 12:20:13 2012 +0000
@@ -81,8 +81,6 @@
 s8 __read_mostly xen_cpuidle = -1;
 boolean_param("cpuidle", xen_cpuidle);
 
-bool_t __read_mostly early_boot = 1;
-
 cpumask_t __read_mostly cpu_present_map;
 
 unsigned long __read_mostly xen_phys_start;
@@ -271,7 +269,7 @@
     void *ret;
 
 #ifdef __x86_64__
-    if ( !early_boot )
+    if ( system_state != SYS_STATE_early_boot )
         return mod ? mfn_to_virt(mod->mod_start) : NULL;
 #endif
 
@@ -1168,7 +1166,7 @@
 #endif
 
     end_boot_allocator();
-    early_boot = 0;
+    system_state = SYS_STATE_boot;
 
 #if defined(CONFIG_X86_64)
     vesa_init();
@@ -1391,6 +1389,8 @@
 
     dmi_end_boot();
 
+    system_state = SYS_STATE_active;
+
     domain_unpause_by_systemcontroller(dom0);
 
     reset_stack_and_jump(init_done);
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/arch/x86/x86_32/mm.c
--- a/xen/arch/x86/x86_32/mm.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/arch/x86/x86_32/mm.c	Thu Mar 22 12:20:13 2012 +0000
@@ -43,7 +43,7 @@
 {
     unsigned long mfn;
 
-    if ( !early_boot )
+    if ( system_state != SYS_STATE_early_boot )
     {
         void *v = alloc_xenheap_page();
 
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/arch/x86/x86_64/mm.c	Thu Mar 22 12:20:13 2012 +0000
@@ -85,7 +85,7 @@
 {
     unsigned long mfn;
 
-    if ( !early_boot )
+    if ( system_state != SYS_STATE_early_boot )
     {
         struct page_info *pg = alloc_domheap_page(NULL, 0);
 
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/common/cpupool.c
--- a/xen/common/cpupool.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/common/cpupool.c	Thu Mar 22 12:20:13 2012 +0000
@@ -629,6 +629,10 @@
     unsigned int cpu = (unsigned long)hcpu;
     int rc = 0;
 
+    if ( (system_state == SYS_STATE_suspend) ||
+         (system_state == SYS_STATE_resume) )
+        goto out;
+
     switch ( action )
     {
     case CPU_DOWN_FAILED:
@@ -642,6 +646,7 @@
         break;
     }
 
+out:
     return !rc ? NOTIFY_DONE : notifier_from_errno(rc);
 }
 
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/common/kernel.c
--- a/xen/common/kernel.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/common/kernel.c	Thu Mar 22 12:20:13 2012 +0000
@@ -20,6 +20,8 @@
 
 #ifndef COMPAT
 
+enum system_state system_state = SYS_STATE_early_boot;
+
 int tainted;
 
 xen_commandline_t saved_cmdline;
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/common/schedule.c
--- a/xen/common/schedule.c	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/common/schedule.c	Thu Mar 22 12:20:13 2012 +0000
@@ -538,7 +538,7 @@
     int    ret = 0;
 
     c = per_cpu(cpupool, cpu);
-    if ( c == NULL )
+    if ( (c == NULL) || (system_state == SYS_STATE_suspend) )
         return ret;
 
     for_each_domain_in_cpupool ( d, c )
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/include/asm-x86/setup.h
--- a/xen/include/asm-x86/setup.h	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/include/asm-x86/setup.h	Thu Mar 22 12:20:13 2012 +0000
@@ -3,7 +3,6 @@
 
 #include <xen/multiboot.h>
 
-extern bool_t early_boot;
 extern unsigned long xenheap_initial_phys_start;
 
 void early_cpu_init(void);
diff -r 8180cb3895af -r d5ccb2d1dbd1 xen/include/xen/kernel.h
--- a/xen/include/xen/kernel.h	Thu Mar 22 10:26:45 2012 +0000
+++ b/xen/include/xen/kernel.h	Thu Mar 22 12:20:13 2012 +0000
@@ -87,5 +87,13 @@
     (__p >= _sinittext) && (__p < _einittext);  \
 })
 
+extern enum system_state {
+    SYS_STATE_early_boot,
+    SYS_STATE_boot,
+    SYS_STATE_active,
+    SYS_STATE_suspend,
+    SYS_STATE_resume
+} system_state;
+
 #endif /* _LINUX_KERNEL_H */
 

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SApdD-0007cw-O1; Thu, 22 Mar 2012 21:33: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 1SApdC-0007c9-Vj
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:15 +0000
Received: from [85.158.138.51:29827] by server-7.bemta-3.messagelabs.com id
	FD/7D-07528-A9A9B6F4; Thu, 22 Mar 2012 21:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1332451991!18907749!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18778 invoked from network); 22 Mar 2012 21:33: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;
	22 Mar 2012 21:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd9-0001ss-7V
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd9-0003lv-43
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:11 +0000
Message-Id: <E1SApd9-0003lv-43@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Fetch the OVMF repository from
	specific git mirror and enable it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Attilio Rao <attilio.rao@citrix.com>
# Date 1332411963 0
# Node ID 6bf50858c3c5e2cc1e863336628111e00cbf09fc
# Parent  00a8292b8180a82d090749289e0a95091248028a
Fetch the OVMF repository from specific git mirror and enable it

Signed-off-by: Attilio Rao <attilio.rao@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 00a8292b8180 -r 6bf50858c3c5 .hgignore
--- a/.hgignore	Thu Mar 22 10:23:30 2012 +0000
+++ b/.hgignore	Thu Mar 22 10:26:03 2012 +0000
@@ -289,6 +289,8 @@
 ^tools/xm-test/lib/XmTestLib/config.py$
 ^tools/xm-test/lib/XmTestReport/xmtest.py$
 ^tools/xm-test/tests/.*\.test$
+^tools/firmware/ovmf-remote
+^tools/firmware/ovmf$
 ^tools/qemu-xen-traditional-dir-remote
 ^tools/qemu-xen-traditional-dir$
 ^tools/qemu-xen-dir-remote
diff -r 00a8292b8180 -r 6bf50858c3c5 Config.mk
--- a/Config.mk	Thu Mar 22 10:23:30 2012 +0000
+++ b/Config.mk	Thu Mar 22 10:26:03 2012 +0000
@@ -191,12 +191,15 @@
 endif
 
 ifeq ($(GIT_HTTP),y)
+OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
 QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
+OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
+OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
 QEMU_UPSTREAM_REVISION ?= master
 SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 # Sun Mar 11 09:27:07 2012 -0400
@@ -204,7 +207,7 @@
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
-CONFIG_OVMF ?= n
+CONFIG_OVMF ?= $(CONFIG_Linux)
 CONFIG_ROMBIOS ?= y
 CONFIG_SEABIOS ?= y
 
diff -r 00a8292b8180 -r 6bf50858c3c5 tools/firmware/Makefile
--- a/tools/firmware/Makefile	Thu Mar 22 10:23:30 2012 +0000
+++ b/tools/firmware/Makefile	Thu Mar 22 10:26:03 2012 +0000
@@ -6,12 +6,17 @@
 INST_DIR := $(DESTDIR)$(XENFIRMWAREDIR)
 
 SUBDIRS-y :=
+SUBDIRS-$(CONFIG_OVMF) += ovmf
 SUBDIRS-$(CONFIG_SEABIOS) += seabios-dir
 SUBDIRS-$(CONFIG_ROMBIOS) += rombios
 SUBDIRS-$(CONFIG_ROMBIOS) += vgabios
 SUBDIRS-$(CONFIG_ROMBIOS) += etherboot
 SUBDIRS-y += hvmloader
 
+ovmf:
+	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(OVMF_UPSTREAM_URL) $(OVMF_UPSTREAM_REVISION) ovmf
+	cp ovmf-makefile ovmf/Makefile;
+
 seabios-dir:
 	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_TAG) seabios-dir
 	cp seabios-config seabios-dir/.config;
@@ -44,9 +49,35 @@
 subdir-distclean-etherboot: .phony
 	$(MAKE) -C etherboot distclean
 
+subdir-distclean-ovmf: .phony
+	rm -rf ovmf ovmf-remote
+
 subdir-distclean-seabios-dir: .phony
 	rm -rf seabios-dir seabios-dir-remote
 
+.PHONY: ovmf-find
+ovmf-find:
+	if test -d $(OVMF_UPSTREAM_URL) ; then \
+	               mkdir -p ovmf; \
+        else \
+                export GIT=$(GIT); \
+                $(XEN_ROOT)/scripts/git-checkout.sh $(OVMF_UPSTREAM_URL) $(OVMF_UPSTREAM_REVISION) ovmf ; \
+        fi
+
+.PHONY: ovmf-force-update
+ovmf-force-update:
+	set -ex; \
+	if [ "$(OVMF_UPSTREAM_REVISION)" ]; then \
+		cd ovmf-remote; \
+		$(GIT) fetch origin; \
+		$(GIT) reset --hard $(OVMF_UPSTREAM_REVISION); \
+	fi
+
+subdir-clean-ovmf:
+	set -e; if test -d ovmf/.; then \
+		$(MAKE) -C ovmf clean; \
+	fi
+
 .PHONY: seabios-dir-force-update
 seabios-dir-force-update:
 	set -ex; \
diff -r 00a8292b8180 -r 6bf50858c3c5 tools/firmware/ovmf-makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/firmware/ovmf-makefile	Thu Mar 22 10:26:03 2012 +0000
@@ -0,0 +1,17 @@
+# OVMF building system is not ready yet to run in parallel.
+# Force it to be serial in order to exploit parallelism for neighbors.
+
+.NOTPARALLEL:
+MAKEFLAGS  += -j1
+
+.PHONY: all
+all: ovmf.bin
+
+.PHONY: ovmf.bin
+ovmf.bin:
+	OvmfPkg/build.sh -a X64
+	cp Build/OvmfX64/DEBUG_GCC44/FV/OVMF.fd ovmf.bin
+
+.PHONY: clean
+clean:
+	rm -rf ovmf.bin Build/*

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SApdD-0007cw-O1; Thu, 22 Mar 2012 21:33: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 1SApdC-0007c9-Vj
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:15 +0000
Received: from [85.158.138.51:29827] by server-7.bemta-3.messagelabs.com id
	FD/7D-07528-A9A9B6F4; Thu, 22 Mar 2012 21:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-174.messagelabs.com!1332451991!18907749!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18778 invoked from network); 22 Mar 2012 21:33: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;
	22 Mar 2012 21:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd9-0001ss-7V
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd9-0003lv-43
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:11 +0000
Message-Id: <E1SApd9-0003lv-43@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Fetch the OVMF repository from
	specific git mirror and enable it
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Attilio Rao <attilio.rao@citrix.com>
# Date 1332411963 0
# Node ID 6bf50858c3c5e2cc1e863336628111e00cbf09fc
# Parent  00a8292b8180a82d090749289e0a95091248028a
Fetch the OVMF repository from specific git mirror and enable it

Signed-off-by: Attilio Rao <attilio.rao@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 00a8292b8180 -r 6bf50858c3c5 .hgignore
--- a/.hgignore	Thu Mar 22 10:23:30 2012 +0000
+++ b/.hgignore	Thu Mar 22 10:26:03 2012 +0000
@@ -289,6 +289,8 @@
 ^tools/xm-test/lib/XmTestLib/config.py$
 ^tools/xm-test/lib/XmTestReport/xmtest.py$
 ^tools/xm-test/tests/.*\.test$
+^tools/firmware/ovmf-remote
+^tools/firmware/ovmf$
 ^tools/qemu-xen-traditional-dir-remote
 ^tools/qemu-xen-traditional-dir$
 ^tools/qemu-xen-dir-remote
diff -r 00a8292b8180 -r 6bf50858c3c5 Config.mk
--- a/Config.mk	Thu Mar 22 10:23:30 2012 +0000
+++ b/Config.mk	Thu Mar 22 10:26:03 2012 +0000
@@ -191,12 +191,15 @@
 endif
 
 ifeq ($(GIT_HTTP),y)
+OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
 QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
+OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
+OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
 QEMU_UPSTREAM_REVISION ?= master
 SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 # Sun Mar 11 09:27:07 2012 -0400
@@ -204,7 +207,7 @@
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
-CONFIG_OVMF ?= n
+CONFIG_OVMF ?= $(CONFIG_Linux)
 CONFIG_ROMBIOS ?= y
 CONFIG_SEABIOS ?= y
 
diff -r 00a8292b8180 -r 6bf50858c3c5 tools/firmware/Makefile
--- a/tools/firmware/Makefile	Thu Mar 22 10:23:30 2012 +0000
+++ b/tools/firmware/Makefile	Thu Mar 22 10:26:03 2012 +0000
@@ -6,12 +6,17 @@
 INST_DIR := $(DESTDIR)$(XENFIRMWAREDIR)
 
 SUBDIRS-y :=
+SUBDIRS-$(CONFIG_OVMF) += ovmf
 SUBDIRS-$(CONFIG_SEABIOS) += seabios-dir
 SUBDIRS-$(CONFIG_ROMBIOS) += rombios
 SUBDIRS-$(CONFIG_ROMBIOS) += vgabios
 SUBDIRS-$(CONFIG_ROMBIOS) += etherboot
 SUBDIRS-y += hvmloader
 
+ovmf:
+	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(OVMF_UPSTREAM_URL) $(OVMF_UPSTREAM_REVISION) ovmf
+	cp ovmf-makefile ovmf/Makefile;
+
 seabios-dir:
 	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_TAG) seabios-dir
 	cp seabios-config seabios-dir/.config;
@@ -44,9 +49,35 @@
 subdir-distclean-etherboot: .phony
 	$(MAKE) -C etherboot distclean
 
+subdir-distclean-ovmf: .phony
+	rm -rf ovmf ovmf-remote
+
 subdir-distclean-seabios-dir: .phony
 	rm -rf seabios-dir seabios-dir-remote
 
+.PHONY: ovmf-find
+ovmf-find:
+	if test -d $(OVMF_UPSTREAM_URL) ; then \
+	               mkdir -p ovmf; \
+        else \
+                export GIT=$(GIT); \
+                $(XEN_ROOT)/scripts/git-checkout.sh $(OVMF_UPSTREAM_URL) $(OVMF_UPSTREAM_REVISION) ovmf ; \
+        fi
+
+.PHONY: ovmf-force-update
+ovmf-force-update:
+	set -ex; \
+	if [ "$(OVMF_UPSTREAM_REVISION)" ]; then \
+		cd ovmf-remote; \
+		$(GIT) fetch origin; \
+		$(GIT) reset --hard $(OVMF_UPSTREAM_REVISION); \
+	fi
+
+subdir-clean-ovmf:
+	set -e; if test -d ovmf/.; then \
+		$(MAKE) -C ovmf clean; \
+	fi
+
 .PHONY: seabios-dir-force-update
 seabios-dir-force-update:
 	set -ex; \
diff -r 00a8292b8180 -r 6bf50858c3c5 tools/firmware/ovmf-makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/firmware/ovmf-makefile	Thu Mar 22 10:26:03 2012 +0000
@@ -0,0 +1,17 @@
+# OVMF building system is not ready yet to run in parallel.
+# Force it to be serial in order to exploit parallelism for neighbors.
+
+.NOTPARALLEL:
+MAKEFLAGS  += -j1
+
+.PHONY: all
+all: ovmf.bin
+
+.PHONY: ovmf.bin
+ovmf.bin:
+	OvmfPkg/build.sh -a X64
+	cp Build/OvmfX64/DEBUG_GCC44/FV/OVMF.fd ovmf.bin
+
+.PHONY: clean
+clean:
+	rm -rf ovmf.bin Build/*

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SApdC-0007cI-Gu; Thu, 22 Mar 2012 21:33: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 1SApdB-0007bv-2r
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:13 +0000
Received: from [85.158.139.83:13678] by server-3.bemta-5.messagelabs.com id
	B7/4E-25237-89A9B6F4; Thu, 22 Mar 2012 21:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1332451990!20547895!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24013 invoked from network); 22 Mar 2012 21:33:11 -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;
	22 Mar 2012 21:33: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 1SApd8-0001sm-1e
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd8-0003kz-06
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:10 +0000
Message-Id: <E1SApd8-0003kz-06@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] kexec: provide
	crashinfo_maxaddr_bits if !CONFIG_KEXEC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332411541 0
# Node ID a0aad46225ac94ec341d2667fd91e2c1f9362a3e
# Parent  6fde5df8b8501c22e959f6b3510e7c775ac1d385
kexec: provide crashinfo_maxaddr_bits if !CONFIG_KEXEC

Fix the build where !CONFIG_KEXEC (e.g., arm) by providing a default
crashinfo_maxaddr_bits.

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


diff -r 6fde5df8b850 -r a0aad46225ac xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Thu Mar 22 10:18:12 2012 +0000
+++ b/xen/drivers/char/console.c	Thu Mar 22 10:19:01 2012 +0000
@@ -22,9 +22,7 @@
 #include <xen/guest_access.h>
 #include <xen/shutdown.h>
 #include <xen/vga.h>
-#ifdef CONFIG_KEXEC
 #include <xen/kexec.h>
-#endif
 #include <asm/debugger.h>
 #include <asm/div64.h>
 #include <xen/hypercall.h> /* for do_console_io */
diff -r 6fde5df8b850 -r a0aad46225ac xen/include/xen/kexec.h
--- a/xen/include/xen/kexec.h	Thu Mar 22 10:18:12 2012 +0000
+++ b/xen/include/xen/kexec.h	Thu Mar 22 10:19:01 2012 +0000
@@ -1,6 +1,8 @@
 #ifndef __XEN_KEXEC_H__
 #define __XEN_KEXEC_H__
 
+#ifdef CONFIG_KEXEC
+
 #include <public/kexec.h>
 #include <asm/percpu.h>
 #include <xen/elfcore.h>
@@ -76,6 +78,12 @@
        vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \
                              (unsigned long)offsetof(struct name, sub.field))
 
+#else /* !CONFIG_KEXEC */
+
+#define crashinfo_maxaddr_bits 0
+
+#endif
+
 #endif /* __XEN_KEXEC_H__ */
 
 /*

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SApdC-0007cI-Gu; Thu, 22 Mar 2012 21:33: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 1SApdB-0007bv-2r
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:13 +0000
Received: from [85.158.139.83:13678] by server-3.bemta-5.messagelabs.com id
	B7/4E-25237-89A9B6F4; Thu, 22 Mar 2012 21:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-182.messagelabs.com!1332451990!20547895!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24013 invoked from network); 22 Mar 2012 21:33:11 -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;
	22 Mar 2012 21:33: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 1SApd8-0001sm-1e
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApd8-0003kz-06
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:10 +0000
Message-Id: <E1SApd8-0003kz-06@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] kexec: provide
	crashinfo_maxaddr_bits if !CONFIG_KEXEC
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332411541 0
# Node ID a0aad46225ac94ec341d2667fd91e2c1f9362a3e
# Parent  6fde5df8b8501c22e959f6b3510e7c775ac1d385
kexec: provide crashinfo_maxaddr_bits if !CONFIG_KEXEC

Fix the build where !CONFIG_KEXEC (e.g., arm) by providing a default
crashinfo_maxaddr_bits.

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


diff -r 6fde5df8b850 -r a0aad46225ac xen/drivers/char/console.c
--- a/xen/drivers/char/console.c	Thu Mar 22 10:18:12 2012 +0000
+++ b/xen/drivers/char/console.c	Thu Mar 22 10:19:01 2012 +0000
@@ -22,9 +22,7 @@
 #include <xen/guest_access.h>
 #include <xen/shutdown.h>
 #include <xen/vga.h>
-#ifdef CONFIG_KEXEC
 #include <xen/kexec.h>
-#endif
 #include <asm/debugger.h>
 #include <asm/div64.h>
 #include <xen/hypercall.h> /* for do_console_io */
diff -r 6fde5df8b850 -r a0aad46225ac xen/include/xen/kexec.h
--- a/xen/include/xen/kexec.h	Thu Mar 22 10:18:12 2012 +0000
+++ b/xen/include/xen/kexec.h	Thu Mar 22 10:19:01 2012 +0000
@@ -1,6 +1,8 @@
 #ifndef __XEN_KEXEC_H__
 #define __XEN_KEXEC_H__
 
+#ifdef CONFIG_KEXEC
+
 #include <public/kexec.h>
 #include <asm/percpu.h>
 #include <xen/elfcore.h>
@@ -76,6 +78,12 @@
        vmcoreinfo_append_str("OFFSET(%s.%s)=%lu\n", #name, #field, \
                              (unsigned long)offsetof(struct name, sub.field))
 
+#else /* !CONFIG_KEXEC */
+
+#define crashinfo_maxaddr_bits 0
+
+#endif
+
 #endif /* __XEN_KEXEC_H__ */
 
 /*

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SApdF-0007dv-TH; Thu, 22 Mar 2012 21:33:17 +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 1SApdE-0007dA-AB
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:16 +0000
Received: from [193.109.254.147:5747] by server-10.bemta-14.messagelabs.com id
	44/2B-05847-B9A9B6F4; Thu, 22 Mar 2012 21:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1332451993!1689859!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15598 invoked from network); 22 Mar 2012 21:33:14 -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;
	22 Mar 2012 21:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApdA-0001t1-Tw
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApdA-0003nJ-PZ
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:12 +0000
Message-Id: <E1SApdA-0003nJ-PZ@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Merge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332412005 0
# Node ID 8180cb3895af71d090fa82d66b012f1f65029055
# Parent  4347c2a26913b02e84c337a7969d8c4b33ab96ba
# Parent  6bf50858c3c5e2cc1e863336628111e00cbf09fc
Merge
---


diff -r 4347c2a26913 -r 8180cb3895af .hgignore
--- a/.hgignore	Thu Mar 22 10:23:28 2012 +0000
+++ b/.hgignore	Thu Mar 22 10:26:45 2012 +0000
@@ -289,6 +289,8 @@
 ^tools/xm-test/lib/XmTestLib/config.py$
 ^tools/xm-test/lib/XmTestReport/xmtest.py$
 ^tools/xm-test/tests/.*\.test$
+^tools/firmware/ovmf-remote
+^tools/firmware/ovmf$
 ^tools/qemu-xen-traditional-dir-remote
 ^tools/qemu-xen-traditional-dir$
 ^tools/qemu-xen-dir-remote
diff -r 4347c2a26913 -r 8180cb3895af Config.mk
--- a/Config.mk	Thu Mar 22 10:23:28 2012 +0000
+++ b/Config.mk	Thu Mar 22 10:26:45 2012 +0000
@@ -191,12 +191,15 @@
 endif
 
 ifeq ($(GIT_HTTP),y)
+OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
 QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
+OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
+OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
 QEMU_UPSTREAM_REVISION ?= master
 SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 # Sun Mar 11 09:27:07 2012 -0400
@@ -204,7 +207,7 @@
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
-CONFIG_OVMF ?= n
+CONFIG_OVMF ?= $(CONFIG_Linux)
 CONFIG_ROMBIOS ?= y
 CONFIG_SEABIOS ?= y
 
diff -r 4347c2a26913 -r 8180cb3895af docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Thu Mar 22 10:23:28 2012 +0000
+++ b/docs/misc/xen-command-line.markdown	Thu Mar 22 10:26:45 2012 +0000
@@ -8,7 +8,7 @@
 
 Most parameters take the form `option=value`.  Different options on the command line should be space delimited.
 
-### Boolean
+### Boolean (`<boolean>`)
 
 All boolean option may be explicitly enabled using a `value` of
 > `yes`, `on`, `true`, `enable` or `1`
@@ -29,11 +29,11 @@
 Enable synchronous console mode
 > `sync_console`
 
-### Integer
+### Integer (`<integer>`)
 
 An integer parameter will default to decimal and may be prefixed with a `-` for negative numbers.  Alternativly, a hexidecimal number may be used by prefixing the number with `0x`, or an octal number may be used if a leading `0` is present.
 
-### Size
+### Size (`<size>`)
 
 A size parameter may be any integer, with a size suffix
 
@@ -96,7 +96,7 @@
 ### ats
 ### availmem
 ### badpage
-> `= List of [ <integer> | <ingeter>-<integer> ]`
+> `= List of [ <integer> | <integer>-<integer> ]`
 
 Specify that certain pages, or certain ranges of pages contain bad bytes and should not be used.  For example, if your memory tester says that byte `0x12345678` is bad, you would place `badpage=0x12345` on Xen's command line.
 
@@ -219,13 +219,22 @@
 Specify the total size for dom0.
 
 ### dom0\_mem (x86)
-> `= List of ( min:<value> | max: <value> | <value> )`
+> `= List of ( min:<size> | max:<size> | <size> )`
 
-each `<value>` is a size parameter.  If the size is positive, it represents an absolute value.  If the size is negative, the size specified is subtracted from the total available memory.
+Set the amount of memory for the initial domain (dom0). If a size is
+positive, it represents an absolute value.  If a size is negative, the
+size specified is subtracted from the total available memory.
 
-* `min:<value>` specifies the minimum amount of memory allocated to dom0.
-* `max:<value>` specifies the maximum amount of memory allocated to dom0.
-* `<value>` specified the exact amount of memory allocated to dom0.
+* `min:<size>` specifies the minimum amount of memory allocated to dom0.
+* `max:<size>` specifies the maximum amount of memory allocated to dom0.
+* `<size>` specified the exact amount of memory allocated to dom0.
+
+`max:<size>` also sets the maximum reservation (the maximum amount of
+memory dom0 can balloon up to).  If this is omitted then the maximum
+reservation is unlimited.
+
+For example, to set dom0's memory to 512 MB but no more than 1 GB use
+`dom0_mem=512M,max:1G`.
 
 ### dom0\_shadow
 ### dom0\_vcpus\_pin
diff -r 4347c2a26913 -r 8180cb3895af tools/firmware/Makefile
--- a/tools/firmware/Makefile	Thu Mar 22 10:23:28 2012 +0000
+++ b/tools/firmware/Makefile	Thu Mar 22 10:26:45 2012 +0000
@@ -6,12 +6,17 @@
 INST_DIR := $(DESTDIR)$(XENFIRMWAREDIR)
 
 SUBDIRS-y :=
+SUBDIRS-$(CONFIG_OVMF) += ovmf
 SUBDIRS-$(CONFIG_SEABIOS) += seabios-dir
 SUBDIRS-$(CONFIG_ROMBIOS) += rombios
 SUBDIRS-$(CONFIG_ROMBIOS) += vgabios
 SUBDIRS-$(CONFIG_ROMBIOS) += etherboot
 SUBDIRS-y += hvmloader
 
+ovmf:
+	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(OVMF_UPSTREAM_URL) $(OVMF_UPSTREAM_REVISION) ovmf
+	cp ovmf-makefile ovmf/Makefile;
+
 seabios-dir:
 	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_TAG) seabios-dir
 	cp seabios-config seabios-dir/.config;
@@ -44,9 +49,35 @@
 subdir-distclean-etherboot: .phony
 	$(MAKE) -C etherboot distclean
 
+subdir-distclean-ovmf: .phony
+	rm -rf ovmf ovmf-remote
+
 subdir-distclean-seabios-dir: .phony
 	rm -rf seabios-dir seabios-dir-remote
 
+.PHONY: ovmf-find
+ovmf-find:
+	if test -d $(OVMF_UPSTREAM_URL) ; then \
+	               mkdir -p ovmf; \
+        else \
+                export GIT=$(GIT); \
+                $(XEN_ROOT)/scripts/git-checkout.sh $(OVMF_UPSTREAM_URL) $(OVMF_UPSTREAM_REVISION) ovmf ; \
+        fi
+
+.PHONY: ovmf-force-update
+ovmf-force-update:
+	set -ex; \
+	if [ "$(OVMF_UPSTREAM_REVISION)" ]; then \
+		cd ovmf-remote; \
+		$(GIT) fetch origin; \
+		$(GIT) reset --hard $(OVMF_UPSTREAM_REVISION); \
+	fi
+
+subdir-clean-ovmf:
+	set -e; if test -d ovmf/.; then \
+		$(MAKE) -C ovmf clean; \
+	fi
+
 .PHONY: seabios-dir-force-update
 seabios-dir-force-update:
 	set -ex; \
diff -r 4347c2a26913 -r 8180cb3895af tools/firmware/ovmf-makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/firmware/ovmf-makefile	Thu Mar 22 10:26:45 2012 +0000
@@ -0,0 +1,17 @@
+# OVMF building system is not ready yet to run in parallel.
+# Force it to be serial in order to exploit parallelism for neighbors.
+
+.NOTPARALLEL:
+MAKEFLAGS  += -j1
+
+.PHONY: all
+all: ovmf.bin
+
+.PHONY: ovmf.bin
+ovmf.bin:
+	OvmfPkg/build.sh -a X64
+	cp Build/OvmfX64/DEBUG_GCC44/FV/OVMF.fd ovmf.bin
+
+.PHONY: clean
+clean:
+	rm -rf ovmf.bin Build/*

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

From xen-changelog-bounces@lists.xen.org Thu Mar 22 21:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 22 Mar 2012 21:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SApdF-0007dv-TH; Thu, 22 Mar 2012 21:33:17 +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 1SApdE-0007dA-AB
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:16 +0000
Received: from [193.109.254.147:5747] by server-10.bemta-14.messagelabs.com id
	44/2B-05847-B9A9B6F4; Thu, 22 Mar 2012 21:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1332451993!1689859!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 15598 invoked from network); 22 Mar 2012 21:33:14 -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;
	22 Mar 2012 21:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApdA-0001t1-Tw
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SApdA-0003nJ-PZ
	for xen-changelog@lists.xensource.com; Thu, 22 Mar 2012 21:33:12 +0000
Message-Id: <E1SApdA-0003nJ-PZ@xenbits.xen.org>
Date: Thu, 22 Mar 2012 21:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Merge
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332412005 0
# Node ID 8180cb3895af71d090fa82d66b012f1f65029055
# Parent  4347c2a26913b02e84c337a7969d8c4b33ab96ba
# Parent  6bf50858c3c5e2cc1e863336628111e00cbf09fc
Merge
---


diff -r 4347c2a26913 -r 8180cb3895af .hgignore
--- a/.hgignore	Thu Mar 22 10:23:28 2012 +0000
+++ b/.hgignore	Thu Mar 22 10:26:45 2012 +0000
@@ -289,6 +289,8 @@
 ^tools/xm-test/lib/XmTestLib/config.py$
 ^tools/xm-test/lib/XmTestReport/xmtest.py$
 ^tools/xm-test/tests/.*\.test$
+^tools/firmware/ovmf-remote
+^tools/firmware/ovmf$
 ^tools/qemu-xen-traditional-dir-remote
 ^tools/qemu-xen-traditional-dir$
 ^tools/qemu-xen-dir-remote
diff -r 4347c2a26913 -r 8180cb3895af Config.mk
--- a/Config.mk	Thu Mar 22 10:23:28 2012 +0000
+++ b/Config.mk	Thu Mar 22 10:26:45 2012 +0000
@@ -191,12 +191,15 @@
 endif
 
 ifeq ($(GIT_HTTP),y)
+OVMF_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/ovmf.git
 QEMU_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/qemu-upstream-unstable.git
 SEABIOS_UPSTREAM_URL ?= http://xenbits.xen.org/git-http/seabios.git
 else
+OVMF_UPSTREAM_URL ?= git://xenbits.xen.org/ovmf.git
 QEMU_UPSTREAM_URL ?= git://xenbits.xen.org/qemu-upstream-unstable.git
 SEABIOS_UPSTREAM_URL ?= git://xenbits.xen.org/seabios.git
 endif
+OVMF_UPSTREAM_REVISION ?= b0855f925c6e2e0b21fbb03fab4b5fb5b6876871
 QEMU_UPSTREAM_REVISION ?= master
 SEABIOS_UPSTREAM_TAG ?= rel-1.6.3.2
 # Sun Mar 11 09:27:07 2012 -0400
@@ -204,7 +207,7 @@
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
-CONFIG_OVMF ?= n
+CONFIG_OVMF ?= $(CONFIG_Linux)
 CONFIG_ROMBIOS ?= y
 CONFIG_SEABIOS ?= y
 
diff -r 4347c2a26913 -r 8180cb3895af docs/misc/xen-command-line.markdown
--- a/docs/misc/xen-command-line.markdown	Thu Mar 22 10:23:28 2012 +0000
+++ b/docs/misc/xen-command-line.markdown	Thu Mar 22 10:26:45 2012 +0000
@@ -8,7 +8,7 @@
 
 Most parameters take the form `option=value`.  Different options on the command line should be space delimited.
 
-### Boolean
+### Boolean (`<boolean>`)
 
 All boolean option may be explicitly enabled using a `value` of
 > `yes`, `on`, `true`, `enable` or `1`
@@ -29,11 +29,11 @@
 Enable synchronous console mode
 > `sync_console`
 
-### Integer
+### Integer (`<integer>`)
 
 An integer parameter will default to decimal and may be prefixed with a `-` for negative numbers.  Alternativly, a hexidecimal number may be used by prefixing the number with `0x`, or an octal number may be used if a leading `0` is present.
 
-### Size
+### Size (`<size>`)
 
 A size parameter may be any integer, with a size suffix
 
@@ -96,7 +96,7 @@
 ### ats
 ### availmem
 ### badpage
-> `= List of [ <integer> | <ingeter>-<integer> ]`
+> `= List of [ <integer> | <integer>-<integer> ]`
 
 Specify that certain pages, or certain ranges of pages contain bad bytes and should not be used.  For example, if your memory tester says that byte `0x12345678` is bad, you would place `badpage=0x12345` on Xen's command line.
 
@@ -219,13 +219,22 @@
 Specify the total size for dom0.
 
 ### dom0\_mem (x86)
-> `= List of ( min:<value> | max: <value> | <value> )`
+> `= List of ( min:<size> | max:<size> | <size> )`
 
-each `<value>` is a size parameter.  If the size is positive, it represents an absolute value.  If the size is negative, the size specified is subtracted from the total available memory.
+Set the amount of memory for the initial domain (dom0). If a size is
+positive, it represents an absolute value.  If a size is negative, the
+size specified is subtracted from the total available memory.
 
-* `min:<value>` specifies the minimum amount of memory allocated to dom0.
-* `max:<value>` specifies the maximum amount of memory allocated to dom0.
-* `<value>` specified the exact amount of memory allocated to dom0.
+* `min:<size>` specifies the minimum amount of memory allocated to dom0.
+* `max:<size>` specifies the maximum amount of memory allocated to dom0.
+* `<size>` specified the exact amount of memory allocated to dom0.
+
+`max:<size>` also sets the maximum reservation (the maximum amount of
+memory dom0 can balloon up to).  If this is omitted then the maximum
+reservation is unlimited.
+
+For example, to set dom0's memory to 512 MB but no more than 1 GB use
+`dom0_mem=512M,max:1G`.
 
 ### dom0\_shadow
 ### dom0\_vcpus\_pin
diff -r 4347c2a26913 -r 8180cb3895af tools/firmware/Makefile
--- a/tools/firmware/Makefile	Thu Mar 22 10:23:28 2012 +0000
+++ b/tools/firmware/Makefile	Thu Mar 22 10:26:45 2012 +0000
@@ -6,12 +6,17 @@
 INST_DIR := $(DESTDIR)$(XENFIRMWAREDIR)
 
 SUBDIRS-y :=
+SUBDIRS-$(CONFIG_OVMF) += ovmf
 SUBDIRS-$(CONFIG_SEABIOS) += seabios-dir
 SUBDIRS-$(CONFIG_ROMBIOS) += rombios
 SUBDIRS-$(CONFIG_ROMBIOS) += vgabios
 SUBDIRS-$(CONFIG_ROMBIOS) += etherboot
 SUBDIRS-y += hvmloader
 
+ovmf:
+	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(OVMF_UPSTREAM_URL) $(OVMF_UPSTREAM_REVISION) ovmf
+	cp ovmf-makefile ovmf/Makefile;
+
 seabios-dir:
 	GIT=$(GIT) $(XEN_ROOT)/scripts/git-checkout.sh $(SEABIOS_UPSTREAM_URL) $(SEABIOS_UPSTREAM_TAG) seabios-dir
 	cp seabios-config seabios-dir/.config;
@@ -44,9 +49,35 @@
 subdir-distclean-etherboot: .phony
 	$(MAKE) -C etherboot distclean
 
+subdir-distclean-ovmf: .phony
+	rm -rf ovmf ovmf-remote
+
 subdir-distclean-seabios-dir: .phony
 	rm -rf seabios-dir seabios-dir-remote
 
+.PHONY: ovmf-find
+ovmf-find:
+	if test -d $(OVMF_UPSTREAM_URL) ; then \
+	               mkdir -p ovmf; \
+        else \
+                export GIT=$(GIT); \
+                $(XEN_ROOT)/scripts/git-checkout.sh $(OVMF_UPSTREAM_URL) $(OVMF_UPSTREAM_REVISION) ovmf ; \
+        fi
+
+.PHONY: ovmf-force-update
+ovmf-force-update:
+	set -ex; \
+	if [ "$(OVMF_UPSTREAM_REVISION)" ]; then \
+		cd ovmf-remote; \
+		$(GIT) fetch origin; \
+		$(GIT) reset --hard $(OVMF_UPSTREAM_REVISION); \
+	fi
+
+subdir-clean-ovmf:
+	set -e; if test -d ovmf/.; then \
+		$(MAKE) -C ovmf clean; \
+	fi
+
 .PHONY: seabios-dir-force-update
 seabios-dir-force-update:
 	set -ex; \
diff -r 4347c2a26913 -r 8180cb3895af tools/firmware/ovmf-makefile
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/firmware/ovmf-makefile	Thu Mar 22 10:26:45 2012 +0000
@@ -0,0 +1,17 @@
+# OVMF building system is not ready yet to run in parallel.
+# Force it to be serial in order to exploit parallelism for neighbors.
+
+.NOTPARALLEL:
+MAKEFLAGS  += -j1
+
+.PHONY: all
+all: ovmf.bin
+
+.PHONY: ovmf.bin
+ovmf.bin:
+	OvmfPkg/build.sh -a X64
+	cp Build/OvmfX64/DEBUG_GCC44/FV/OVMF.fd ovmf.bin
+
+.PHONY: clean
+clean:
+	rm -rf ovmf.bin Build/*

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07: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 1SAyzp-0007y3-Qk; Fri, 23 Mar 2012 07: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 1SAyzo-0007xi-1y
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:12 +0000
Received: from [85.158.138.51:27285] by server-4.bemta-3.messagelabs.com id
	47/F1-16467-7372C6F4; Fri, 23 Mar 2012 07:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1332487989!18977419!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28243 invoked from network); 23 Mar 2012 07:33:10 -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;
	23 Mar 2012 07: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 1SAyzl-0000yi-2C
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzk-000304-T3
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:08 +0000
Message-Id: <E1SAyzk-000304-T3@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: remove hard tabs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426401 0
# Node ID f7b324f6c78d4461b5288f382588df1a938b68c4
# Parent  d5ccb2d1dbd1dce76f9d427073306941d48c3095
arm: remove hard tabs

The only hard tabs remaining in xen/arch/arm and xen/include/asm-arm are now
only in .S files and .[ch] imported from Linux

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


diff -r d5ccb2d1dbd1 -r f7b324f6c78d xen/arch/arm/domctl.c
--- a/xen/arch/arm/domctl.c	Thu Mar 22 12:20:13 2012 +0000
+++ b/xen/arch/arm/domctl.c	Thu Mar 22 14:26:41 2012 +0000
@@ -13,7 +13,7 @@
 long arch_do_domctl(struct xen_domctl *domctl,
                     XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
 {
-	return -ENOSYS;
+    return -ENOSYS;
 }
 
 /*
diff -r d5ccb2d1dbd1 -r f7b324f6c78d xen/arch/arm/sysctl.c
--- a/xen/arch/arm/sysctl.c	Thu Mar 22 12:20:13 2012 +0000
+++ b/xen/arch/arm/sysctl.c	Thu Mar 22 14:26:41 2012 +0000
@@ -13,9 +13,9 @@
 #include <public/sysctl.h>
 
 long arch_do_sysctl(struct xen_sysctl *sysctl,
-		    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
+                    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
 {
-	return -ENOSYS;
+    return -ENOSYS;
 }
 
 /*
diff -r d5ccb2d1dbd1 -r f7b324f6c78d xen/include/asm-arm/numa.h
--- a/xen/include/asm-arm/numa.h	Thu Mar 22 12:20:13 2012 +0000
+++ b/xen/include/asm-arm/numa.h	Thu Mar 22 14:26:41 2012 +0000
@@ -3,11 +3,11 @@
 
 /* Fake one node for now... */
 #define cpu_to_node(cpu) 0
-#define node_to_cpumask(node)	(cpu_online_map)
+#define node_to_cpumask(node)   (cpu_online_map)
 
 static inline __attribute__((pure)) int phys_to_nid(paddr_t addr)
 {
-        return 0;
+    return 0;
 }
 
 #endif /* __ARCH_ARM_NUMA_H */

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07: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 1SAyzp-0007y3-Qk; Fri, 23 Mar 2012 07: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 1SAyzo-0007xi-1y
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:12 +0000
Received: from [85.158.138.51:27285] by server-4.bemta-3.messagelabs.com id
	47/F1-16467-7372C6F4; Fri, 23 Mar 2012 07:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-174.messagelabs.com!1332487989!18977419!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28243 invoked from network); 23 Mar 2012 07:33:10 -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;
	23 Mar 2012 07: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 1SAyzl-0000yi-2C
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzk-000304-T3
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:08 +0000
Message-Id: <E1SAyzk-000304-T3@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: remove hard tabs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426401 0
# Node ID f7b324f6c78d4461b5288f382588df1a938b68c4
# Parent  d5ccb2d1dbd1dce76f9d427073306941d48c3095
arm: remove hard tabs

The only hard tabs remaining in xen/arch/arm and xen/include/asm-arm are now
only in .S files and .[ch] imported from Linux

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


diff -r d5ccb2d1dbd1 -r f7b324f6c78d xen/arch/arm/domctl.c
--- a/xen/arch/arm/domctl.c	Thu Mar 22 12:20:13 2012 +0000
+++ b/xen/arch/arm/domctl.c	Thu Mar 22 14:26:41 2012 +0000
@@ -13,7 +13,7 @@
 long arch_do_domctl(struct xen_domctl *domctl,
                     XEN_GUEST_HANDLE(xen_domctl_t) u_domctl)
 {
-	return -ENOSYS;
+    return -ENOSYS;
 }
 
 /*
diff -r d5ccb2d1dbd1 -r f7b324f6c78d xen/arch/arm/sysctl.c
--- a/xen/arch/arm/sysctl.c	Thu Mar 22 12:20:13 2012 +0000
+++ b/xen/arch/arm/sysctl.c	Thu Mar 22 14:26:41 2012 +0000
@@ -13,9 +13,9 @@
 #include <public/sysctl.h>
 
 long arch_do_sysctl(struct xen_sysctl *sysctl,
-		    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
+                    XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl)
 {
-	return -ENOSYS;
+    return -ENOSYS;
 }
 
 /*
diff -r d5ccb2d1dbd1 -r f7b324f6c78d xen/include/asm-arm/numa.h
--- a/xen/include/asm-arm/numa.h	Thu Mar 22 12:20:13 2012 +0000
+++ b/xen/include/asm-arm/numa.h	Thu Mar 22 14:26:41 2012 +0000
@@ -3,11 +3,11 @@
 
 /* Fake one node for now... */
 #define cpu_to_node(cpu) 0
-#define node_to_cpumask(node)	(cpu_online_map)
+#define node_to_cpumask(node)   (cpu_online_map)
 
 static inline __attribute__((pure)) int phys_to_nid(paddr_t addr)
 {
-        return 0;
+    return 0;
 }
 
 #endif /* __ARCH_ARM_NUMA_H */

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzs-0007yf-23; Fri, 23 Mar 2012 07:33: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 1SAyzq-0007y8-Ph
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:15 +0000
Received: from [85.158.139.83:61648] by server-9.bemta-5.messagelabs.com id
	E2/FE-09826-A372C6F4; Fri, 23 Mar 2012 07:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1332487991!19960153!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6801 invoked from network); 23 Mar 2012 07:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Mar 2012 07:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzn-0000yu-Gn
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzn-00031w-67
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:11 +0000
Message-Id: <E1SAyzn-00031w-67@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] device tree: follow coding style
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426404 0
# Node ID 369454095131bc7d5fd6f7658f5cf817855adae7
# Parent  b3a46133d1e9168a84231bc236186e693689db09
device tree: follow coding style

Only changes to the coding style, no functional changes.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r b3a46133d1e9 -r 369454095131 xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Mar 22 14:26:43 2012 +0000
+++ b/xen/common/device_tree.c	Thu Mar 22 14:26:44 2012 +0000
@@ -27,25 +27,28 @@
 {
     *val = 0;
 
-    while (cells--) {
+    while ( cells-- )
+    {
         *val <<= 32;
         *val |= fdt32_to_cpu(*(*cell)++);
     }
 }
 
-static void __init get_register(const u32 **cell, u32 address_cells, u32 size_cells,
+static void __init get_register(const u32 **cell,
+                                u32 address_cells, u32 size_cells,
                                 u64 *start, u64 *size)
 {
     get_val(cell, address_cells, start);
     get_val(cell, size_cells, size);
 }
 
-static u32 __init prop_by_name_u32(const void *fdt, int node, const char *prop_name)
+static u32 __init prop_by_name_u32(const void *fdt, int node,
+                                   const char *prop_name)
 {
     const struct fdt_property *prop;
 
     prop = fdt_get_property(fdt, node, prop_name, NULL);
-    if (!prop || prop->len < sizeof(u32))
+    if ( !prop || prop->len < sizeof(u32) )
         return 0; /* default to 0 */
 
     return fdt32_to_cpu(*(uint32_t*)prop->data);
@@ -61,14 +64,16 @@
     const u32 *cell;
     paddr_t start, size;
 
-    if (address_cells < 1 || size_cells < 1) {
+    if ( address_cells < 1 || size_cells < 1 )
+    {
         early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
                      fdt_get_name(fdt, node, NULL));
         return;
     }
 
     prop = fdt_get_property(fdt, node, "reg", NULL);
-    if (!prop) {
+    if ( !prop )
+    {
         early_printk("fdt: node `%s': missing `reg' property\n",
                      fdt_get_name(fdt, node, NULL));
         return;
@@ -78,7 +83,8 @@
     reg_cells = address_cells + size_cells;
     banks = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));
 
-    for (i = 0; i < banks && early_info.mem.nr_banks < NR_MEM_BANKS; i++) {
+    for ( i = 0; i < banks && early_info.mem.nr_banks < NR_MEM_BANKS; i++ )
+    {
         get_register(&cell, address_cells, size_cells, &start, &size);
         early_info.mem.bank[early_info.mem.nr_banks].start = start;
         early_info.mem.bank[early_info.mem.nr_banks].size = size;
@@ -96,10 +102,12 @@
     u32 address_cells[MAX_DEPTH];
     u32 size_cells[MAX_DEPTH];
 
-    for (node = 0; depth >= 0; node = fdt_next_node(fdt, node, &depth)) {
+    for ( node = 0; depth >= 0; node = fdt_next_node(fdt, node, &depth) )
+    {
         name = fdt_get_name(fdt, node, NULL);
 
-        if (depth >= MAX_DEPTH) {
+        if ( depth >= MAX_DEPTH )
+        {
             early_printk("fdt: node '%s': nested too deep\n",
                          fdt_get_name(fdt, node, NULL));
             continue;
@@ -108,8 +116,9 @@
         address_cells[depth] = prop_by_name_u32(fdt, node, "#address-cells");
         size_cells[depth] = prop_by_name_u32(fdt, node, "#size-cells");
 
-        if (strncmp(name, "memory", 6) == 0)
-            process_memory_node(fdt, node, address_cells[depth-1], size_cells[depth-1]);
+        if ( strncmp(name, "memory", 6) == 0 )
+            process_memory_node(fdt, node,
+                                address_cells[depth-1], size_cells[depth-1]);
     }
 }
 
@@ -118,9 +127,10 @@
     struct dt_mem_info *mi = &early_info.mem;
     int i;
 
-    for (i = 0; i < mi->nr_banks; i++)
+    for ( i = 0; i < mi->nr_banks; i++ )
         early_printk("RAM: %016llx - %016llx\n",
-                     mi->bank[i].start, mi->bank[i].start + mi->bank[i].size - 1);
+                     mi->bank[i].start,
+                     mi->bank[i].start + mi->bank[i].size - 1);
 }
 
 /**
@@ -134,7 +144,7 @@
     int ret;
 
     ret = fdt_check_header(fdt);
-    if (ret < 0)
+    if ( ret < 0 )
         early_panic("No valid device tree\n");
 
     early_scan(fdt);
@@ -159,15 +169,17 @@
     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) {
+    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)
+            if ( t > paddr )
                 paddr = t;
         }
     }
 
-    if (!paddr)
+    if ( !paddr )
         early_panic("Not enough memory to relocate Xen\n");
 
     return paddr;

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzs-0007yf-23; Fri, 23 Mar 2012 07:33: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 1SAyzq-0007y8-Ph
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:15 +0000
Received: from [85.158.139.83:61648] by server-9.bemta-5.messagelabs.com id
	E2/FE-09826-A372C6F4; Fri, 23 Mar 2012 07:33:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1332487991!19960153!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6801 invoked from network); 23 Mar 2012 07:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Mar 2012 07:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzn-0000yu-Gn
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzn-00031w-67
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:11 +0000
Message-Id: <E1SAyzn-00031w-67@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] device tree: follow coding style
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426404 0
# Node ID 369454095131bc7d5fd6f7658f5cf817855adae7
# Parent  b3a46133d1e9168a84231bc236186e693689db09
device tree: follow coding style

Only changes to the coding style, no functional changes.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r b3a46133d1e9 -r 369454095131 xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Mar 22 14:26:43 2012 +0000
+++ b/xen/common/device_tree.c	Thu Mar 22 14:26:44 2012 +0000
@@ -27,25 +27,28 @@
 {
     *val = 0;
 
-    while (cells--) {
+    while ( cells-- )
+    {
         *val <<= 32;
         *val |= fdt32_to_cpu(*(*cell)++);
     }
 }
 
-static void __init get_register(const u32 **cell, u32 address_cells, u32 size_cells,
+static void __init get_register(const u32 **cell,
+                                u32 address_cells, u32 size_cells,
                                 u64 *start, u64 *size)
 {
     get_val(cell, address_cells, start);
     get_val(cell, size_cells, size);
 }
 
-static u32 __init prop_by_name_u32(const void *fdt, int node, const char *prop_name)
+static u32 __init prop_by_name_u32(const void *fdt, int node,
+                                   const char *prop_name)
 {
     const struct fdt_property *prop;
 
     prop = fdt_get_property(fdt, node, prop_name, NULL);
-    if (!prop || prop->len < sizeof(u32))
+    if ( !prop || prop->len < sizeof(u32) )
         return 0; /* default to 0 */
 
     return fdt32_to_cpu(*(uint32_t*)prop->data);
@@ -61,14 +64,16 @@
     const u32 *cell;
     paddr_t start, size;
 
-    if (address_cells < 1 || size_cells < 1) {
+    if ( address_cells < 1 || size_cells < 1 )
+    {
         early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
                      fdt_get_name(fdt, node, NULL));
         return;
     }
 
     prop = fdt_get_property(fdt, node, "reg", NULL);
-    if (!prop) {
+    if ( !prop )
+    {
         early_printk("fdt: node `%s': missing `reg' property\n",
                      fdt_get_name(fdt, node, NULL));
         return;
@@ -78,7 +83,8 @@
     reg_cells = address_cells + size_cells;
     banks = fdt32_to_cpu(prop->len) / (reg_cells * sizeof(u32));
 
-    for (i = 0; i < banks && early_info.mem.nr_banks < NR_MEM_BANKS; i++) {
+    for ( i = 0; i < banks && early_info.mem.nr_banks < NR_MEM_BANKS; i++ )
+    {
         get_register(&cell, address_cells, size_cells, &start, &size);
         early_info.mem.bank[early_info.mem.nr_banks].start = start;
         early_info.mem.bank[early_info.mem.nr_banks].size = size;
@@ -96,10 +102,12 @@
     u32 address_cells[MAX_DEPTH];
     u32 size_cells[MAX_DEPTH];
 
-    for (node = 0; depth >= 0; node = fdt_next_node(fdt, node, &depth)) {
+    for ( node = 0; depth >= 0; node = fdt_next_node(fdt, node, &depth) )
+    {
         name = fdt_get_name(fdt, node, NULL);
 
-        if (depth >= MAX_DEPTH) {
+        if ( depth >= MAX_DEPTH )
+        {
             early_printk("fdt: node '%s': nested too deep\n",
                          fdt_get_name(fdt, node, NULL));
             continue;
@@ -108,8 +116,9 @@
         address_cells[depth] = prop_by_name_u32(fdt, node, "#address-cells");
         size_cells[depth] = prop_by_name_u32(fdt, node, "#size-cells");
 
-        if (strncmp(name, "memory", 6) == 0)
-            process_memory_node(fdt, node, address_cells[depth-1], size_cells[depth-1]);
+        if ( strncmp(name, "memory", 6) == 0 )
+            process_memory_node(fdt, node,
+                                address_cells[depth-1], size_cells[depth-1]);
     }
 }
 
@@ -118,9 +127,10 @@
     struct dt_mem_info *mi = &early_info.mem;
     int i;
 
-    for (i = 0; i < mi->nr_banks; i++)
+    for ( i = 0; i < mi->nr_banks; i++ )
         early_printk("RAM: %016llx - %016llx\n",
-                     mi->bank[i].start, mi->bank[i].start + mi->bank[i].size - 1);
+                     mi->bank[i].start,
+                     mi->bank[i].start + mi->bank[i].size - 1);
 }
 
 /**
@@ -134,7 +144,7 @@
     int ret;
 
     ret = fdt_check_header(fdt);
-    if (ret < 0)
+    if ( ret < 0 )
         early_panic("No valid device tree\n");
 
     early_scan(fdt);
@@ -159,15 +169,17 @@
     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) {
+    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)
+            if ( t > paddr )
                 paddr = t;
         }
     }
 
-    if (!paddr)
+    if ( !paddr )
         early_panic("Not enough memory to relocate Xen\n");
 
     return paddr;

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzq-0007yH-TE; Fri, 23 Mar 2012 07:33: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 1SAyzp-0007xw-Em
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:13 +0000
Received: from [85.158.139.83:41102] by server-2.bemta-5.messagelabs.com id
	C4/95-17016-8372C6F4; Fri, 23 Mar 2012 07:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1332487990!20641275!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22720 invoked from network); 23 Mar 2012 07:33:11 -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;
	23 Mar 2012 07:33: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 1SAyzl-0000yl-RU
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzl-00030Z-Gh
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:09 +0000
Message-Id: <E1SAyzl-00030Z-Gh@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: use symbolic constants for
	initial page table attributes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426401 0
# Node ID 777658bb5eb9c1b5e6043a8d04366ea4889b42ac
# Parent  f7b324f6c78d4461b5288f382588df1a938b68c4
arm: use symbolic constants for initial page table attributes

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


diff -r f7b324f6c78d -r 777658bb5eb9 xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Thu Mar 22 14:26:41 2012 +0000
+++ b/xen/arch/arm/head.S	Thu Mar 22 14:26:41 2012 +0000
@@ -21,6 +21,12 @@
 #include <asm/page.h>
 #include <asm/asm_defns.h>
 
+#define XEN_PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
+#define XEN_PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
+#define XEN_PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
+
+#define PT_UPPER(x) (XEN_PT_##x & 0xf00)
+#define PT_LOWER(x) (XEN_PT_##x & 0x0ff)
 
 /* Macro to print a string to the UART, if there is one.
  * Clobbers r0-r3. */
@@ -203,8 +209,8 @@
 	ldr   r1, =xen_second
 	add   r1, r1, r10            /* r1 := paddr (xen_second) */
 	mov   r3, #0x0
-	orr   r2, r1, #0xe00         /* r2:r3 := table map of xen_second */
-	orr   r2, r2, #0x07f         /* (+ rights for linear PT) */
+	orr   r2, r1, #PT_UPPER(PT)  /* r2:r3 := table map of xen_second */
+	orr   r2, r2, #PT_LOWER(PT)  /* (+ rights for linear PT) */
 	strd  r2, r3, [r4, #0]       /* Map it in slot 0 */
 	add   r2, r2, #0x1000
 	strd  r2, r3, [r4, #8]       /* Map 2nd page in slot 1 */
@@ -214,8 +220,8 @@
 	strd  r2, r3, [r4, #24]      /* Map 4th page in slot 3 */
 
 	/* Now set up the second-level entries */
-	orr   r2, r9, #0xe00
-	orr   r2, r2, #0x07d         /* r2:r3 := 2MB normal map of Xen */
+	orr   r2, r9, #PT_UPPER(MEM)
+	orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB normal map of Xen */
 	mov   r4, r9, lsr #18        /* Slot for paddr(start) */
 	strd  r2, r3, [r1, r4]       /* Map Xen there */
 	ldr   r4, =start
@@ -225,8 +231,8 @@
 	ldr   r3, =(1<<(54-32))      /* NS for device mapping */
 	lsr   r2, r11, #21
 	lsl   r2, r2, #21            /* 2MB-aligned paddr of UART */
-	orr   r2, r2, #0xe00
-	orr   r2, r2, #0x071         /* r2:r3 := 2MB dev map including UART */
+	orr   r2, r2, #PT_UPPER(DEV)
+	orr   r2, r2, #PT_LOWER(DEV) /* r2:r3 := 2MB dev map including UART */
 	add   r4, r4, #8
 	strd  r2, r3, [r1, r4]       /* Map it in the fixmap's slot */
 #else
@@ -235,8 +241,8 @@
 	mov   r3, #0x0
 	lsr   r2, r8, #21
 	lsl   r2, r2, #21            /* 2MB-aligned paddr of DTB */
-	orr   r2, r2, #0xe00
-	orr   r2, r2, #0x07d         /* r2:r3 := 2MB RAM incl. DTB */
+	orr   r2, r2, #PT_UPPER(MEM)
+	orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB RAM incl. DTB */
 	add   r4, r4, #8
 	strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */
 

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzq-0007yH-TE; Fri, 23 Mar 2012 07:33: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 1SAyzp-0007xw-Em
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:13 +0000
Received: from [85.158.139.83:41102] by server-2.bemta-5.messagelabs.com id
	C4/95-17016-8372C6F4; Fri, 23 Mar 2012 07:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-182.messagelabs.com!1332487990!20641275!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22720 invoked from network); 23 Mar 2012 07:33:11 -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;
	23 Mar 2012 07:33: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 1SAyzl-0000yl-RU
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzl-00030Z-Gh
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:09 +0000
Message-Id: <E1SAyzl-00030Z-Gh@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: use symbolic constants for
	initial page table attributes
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426401 0
# Node ID 777658bb5eb9c1b5e6043a8d04366ea4889b42ac
# Parent  f7b324f6c78d4461b5288f382588df1a938b68c4
arm: use symbolic constants for initial page table attributes

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


diff -r f7b324f6c78d -r 777658bb5eb9 xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Thu Mar 22 14:26:41 2012 +0000
+++ b/xen/arch/arm/head.S	Thu Mar 22 14:26:41 2012 +0000
@@ -21,6 +21,12 @@
 #include <asm/page.h>
 #include <asm/asm_defns.h>
 
+#define XEN_PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
+#define XEN_PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
+#define XEN_PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
+
+#define PT_UPPER(x) (XEN_PT_##x & 0xf00)
+#define PT_LOWER(x) (XEN_PT_##x & 0x0ff)
 
 /* Macro to print a string to the UART, if there is one.
  * Clobbers r0-r3. */
@@ -203,8 +209,8 @@
 	ldr   r1, =xen_second
 	add   r1, r1, r10            /* r1 := paddr (xen_second) */
 	mov   r3, #0x0
-	orr   r2, r1, #0xe00         /* r2:r3 := table map of xen_second */
-	orr   r2, r2, #0x07f         /* (+ rights for linear PT) */
+	orr   r2, r1, #PT_UPPER(PT)  /* r2:r3 := table map of xen_second */
+	orr   r2, r2, #PT_LOWER(PT)  /* (+ rights for linear PT) */
 	strd  r2, r3, [r4, #0]       /* Map it in slot 0 */
 	add   r2, r2, #0x1000
 	strd  r2, r3, [r4, #8]       /* Map 2nd page in slot 1 */
@@ -214,8 +220,8 @@
 	strd  r2, r3, [r4, #24]      /* Map 4th page in slot 3 */
 
 	/* Now set up the second-level entries */
-	orr   r2, r9, #0xe00
-	orr   r2, r2, #0x07d         /* r2:r3 := 2MB normal map of Xen */
+	orr   r2, r9, #PT_UPPER(MEM)
+	orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB normal map of Xen */
 	mov   r4, r9, lsr #18        /* Slot for paddr(start) */
 	strd  r2, r3, [r1, r4]       /* Map Xen there */
 	ldr   r4, =start
@@ -225,8 +231,8 @@
 	ldr   r3, =(1<<(54-32))      /* NS for device mapping */
 	lsr   r2, r11, #21
 	lsl   r2, r2, #21            /* 2MB-aligned paddr of UART */
-	orr   r2, r2, #0xe00
-	orr   r2, r2, #0x071         /* r2:r3 := 2MB dev map including UART */
+	orr   r2, r2, #PT_UPPER(DEV)
+	orr   r2, r2, #PT_LOWER(DEV) /* r2:r3 := 2MB dev map including UART */
 	add   r4, r4, #8
 	strd  r2, r3, [r1, r4]       /* Map it in the fixmap's slot */
 #else
@@ -235,8 +241,8 @@
 	mov   r3, #0x0
 	lsr   r2, r8, #21
 	lsl   r2, r2, #21            /* 2MB-aligned paddr of DTB */
-	orr   r2, r2, #0xe00
-	orr   r2, r2, #0x07d         /* r2:r3 := 2MB RAM incl. DTB */
+	orr   r2, r2, #PT_UPPER(MEM)
+	orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 := 2MB RAM incl. DTB */
 	add   r4, r4, #8
 	strd  r2, r3, [r1, r4]       /* Map it in the early boot slot */
 

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzr-0007yZ-W1; Fri, 23 Mar 2012 07:33:15 +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 1SAyzq-0007y2-8e
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:14 +0000
Received: from [193.109.254.147:14832] by server-5.bemta-14.messagelabs.com id
	65/54-30733-9372C6F4; Fri, 23 Mar 2012 07:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1332487992!1719552!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8929 invoked from network); 23 Mar 2012 07:33:13 -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;
	23 Mar 2012 07:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzn-0000yx-Or
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzn-00032O-Nh
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:11 +0000
Message-Id: <E1SAyzn-00032O-Nh@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] device tree: correctly ignore
	unit-address when matching nodes by name
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426404 0
# Node ID da5b84cf21c27edf28b68cc251d7664c1874f791
# Parent  369454095131bc7d5fd6f7658f5cf817855adae7
device tree: correctly ignore unit-address when matching nodes by name

When matching node by their name, correctly ignore the unit address
(@...) part of the name.  Previously, a "memory-controller" node would
be incorrectly matched as a "memory" node.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 369454095131 -r da5b84cf21c2 xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Mar 22 14:26:44 2012 +0000
+++ b/xen/common/device_tree.c	Thu Mar 22 14:26:44 2012 +0000
@@ -23,6 +23,20 @@
 struct dt_early_info __initdata early_info;
 void *device_tree_flattened;
 
+static bool_t __init node_matches(const void *fdt, int node, const char *match)
+{
+    const char *name;
+    size_t match_len;
+
+    name = fdt_get_name(fdt, node, NULL);
+    match_len = strlen(match);
+
+    /* Match both "match" and "match@..." patterns but not
+       "match-foo". */
+    return strncmp(name, match, match_len) == 0
+        && (name[match_len] == '@' || name[match_len] == '\0');
+}
+
 static void __init get_val(const u32 **cell, u32 cells, u64 *val)
 {
     *val = 0;
@@ -98,14 +112,11 @@
 {
     int node;
     int depth;
-    const char *name;
     u32 address_cells[MAX_DEPTH];
     u32 size_cells[MAX_DEPTH];
 
     for ( node = 0; depth >= 0; node = fdt_next_node(fdt, node, &depth) )
     {
-        name = fdt_get_name(fdt, node, NULL);
-
         if ( depth >= MAX_DEPTH )
         {
             early_printk("fdt: node '%s': nested too deep\n",
@@ -116,9 +127,8 @@
         address_cells[depth] = prop_by_name_u32(fdt, node, "#address-cells");
         size_cells[depth] = prop_by_name_u32(fdt, node, "#size-cells");
 
-        if ( strncmp(name, "memory", 6) == 0 )
-            process_memory_node(fdt, node,
-                                address_cells[depth-1], size_cells[depth-1]);
+        if ( node_matches(fdt, node, "memory") )
+            process_memory_node(fdt, node, address_cells[depth-1], size_cells[depth-1]);
     }
 }
 

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzr-0007yZ-W1; Fri, 23 Mar 2012 07:33:15 +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 1SAyzq-0007y2-8e
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:14 +0000
Received: from [193.109.254.147:14832] by server-5.bemta-14.messagelabs.com id
	65/54-30733-9372C6F4; Fri, 23 Mar 2012 07:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-27.messagelabs.com!1332487992!1719552!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8929 invoked from network); 23 Mar 2012 07:33:13 -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;
	23 Mar 2012 07:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzn-0000yx-Or
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzn-00032O-Nh
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:11 +0000
Message-Id: <E1SAyzn-00032O-Nh@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] device tree: correctly ignore
	unit-address when matching nodes by name
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426404 0
# Node ID da5b84cf21c27edf28b68cc251d7664c1874f791
# Parent  369454095131bc7d5fd6f7658f5cf817855adae7
device tree: correctly ignore unit-address when matching nodes by name

When matching node by their name, correctly ignore the unit address
(@...) part of the name.  Previously, a "memory-controller" node would
be incorrectly matched as a "memory" node.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 369454095131 -r da5b84cf21c2 xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Mar 22 14:26:44 2012 +0000
+++ b/xen/common/device_tree.c	Thu Mar 22 14:26:44 2012 +0000
@@ -23,6 +23,20 @@
 struct dt_early_info __initdata early_info;
 void *device_tree_flattened;
 
+static bool_t __init node_matches(const void *fdt, int node, const char *match)
+{
+    const char *name;
+    size_t match_len;
+
+    name = fdt_get_name(fdt, node, NULL);
+    match_len = strlen(match);
+
+    /* Match both "match" and "match@..." patterns but not
+       "match-foo". */
+    return strncmp(name, match, match_len) == 0
+        && (name[match_len] == '@' || name[match_len] == '\0');
+}
+
 static void __init get_val(const u32 **cell, u32 cells, u64 *val)
 {
     *val = 0;
@@ -98,14 +112,11 @@
 {
     int node;
     int depth;
-    const char *name;
     u32 address_cells[MAX_DEPTH];
     u32 size_cells[MAX_DEPTH];
 
     for ( node = 0; depth >= 0; node = fdt_next_node(fdt, node, &depth) )
     {
-        name = fdt_get_name(fdt, node, NULL);
-
         if ( depth >= MAX_DEPTH )
         {
             early_printk("fdt: node '%s': nested too deep\n",
@@ -116,9 +127,8 @@
         address_cells[depth] = prop_by_name_u32(fdt, node, "#address-cells");
         size_cells[depth] = prop_by_name_u32(fdt, node, "#size-cells");
 
-        if ( strncmp(name, "memory", 6) == 0 )
-            process_memory_node(fdt, node,
-                                address_cells[depth-1], size_cells[depth-1]);
+        if ( node_matches(fdt, node, "memory") )
+            process_memory_node(fdt, node, address_cells[depth-1], size_cells[depth-1]);
     }
 }
 

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzt-0007zE-4s; Fri, 23 Mar 2012 07:33: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 1SAyzr-0007yW-Rq
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:16 +0000
Received: from [85.158.139.83:61727] by server-12.bemta-5.messagelabs.com id
	71/93-05587-B372C6F4; Fri, 23 Mar 2012 07:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1332487992!19960155!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6929 invoked from network); 23 Mar 2012 07:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Mar 2012 07:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzo-0000z0-CS
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzo-00032q-7y
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:12 +0000
Message-Id: <E1SAyzo-00032q-7y@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] device tree: add
	device_tree_for_each_node()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426405 0
# Node ID cb2e700ce5bb459ecc98c62e4f73ad9d35f4101a
# Parent  da5b84cf21c27edf28b68cc251d7664c1874f791
device tree: add device_tree_for_each_node()

Add device_tree_for_each_node() to iterate over all nodes in a flat
device tree.  Use this in device_tree_early_init().

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r da5b84cf21c2 -r cb2e700ce5bb xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Mar 22 14:26:44 2012 +0000
+++ b/xen/common/device_tree.c	Thu Mar 22 14:26:45 2012 +0000
@@ -68,7 +68,43 @@
     return fdt32_to_cpu(*(uint32_t*)prop->data);
 }
 
+#define MAX_DEPTH 16
+
+/**
+ * device_tree_for_each_node - iterate over all device tree nodes
+ * @fdt: flat device tree.
+ * @func: function to call for each node.
+ * @data: data to pass to @func.
+ */
+int device_tree_for_each_node(const void *fdt,
+                              device_tree_node_func func, void *data)
+{
+    int node;
+    int depth;
+    u32 address_cells[MAX_DEPTH];
+    u32 size_cells[MAX_DEPTH];
+    int ret;
+
+    for ( node = 0, depth = 0;
+          node >=0 && depth >= 0;
+          node = fdt_next_node(fdt, node, &depth) )
+    {
+        if ( depth >= MAX_DEPTH )
+            continue;
+
+        address_cells[depth] = prop_by_name_u32(fdt, node, "#address-cells");
+        size_cells[depth] = prop_by_name_u32(fdt, node, "#size-cells");
+
+        ret = func(fdt, node, fdt_get_name(fdt, node, NULL), depth,
+                   address_cells[depth-1], size_cells[depth-1], data);
+        if ( ret < 0 )
+            return ret;
+    }
+    return 0;
+}
+
 static void __init process_memory_node(const void *fdt, int node,
+                                       const char *name,
                                        u32 address_cells, u32 size_cells)
 {
     const struct fdt_property *prop;
@@ -81,15 +117,14 @@
     if ( address_cells < 1 || size_cells < 1 )
     {
         early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
-                     fdt_get_name(fdt, node, NULL));
+                     name);
         return;
     }
 
     prop = fdt_get_property(fdt, node, "reg", NULL);
     if ( !prop )
     {
-        early_printk("fdt: node `%s': missing `reg' property\n",
-                     fdt_get_name(fdt, node, NULL));
+        early_printk("fdt: node `%s': missing `reg' property\n", name);
         return;
     }
 
@@ -106,30 +141,15 @@
     }
 }
 
-#define MAX_DEPTH 16
+static int __init early_scan_node(const void *fdt,
+                                  int node, const char *name, int depth,
+                                  u32 address_cells, u32 size_cells,
+                                  void *data)
+{
+    if ( node_matches(fdt, node, "memory") )
+        process_memory_node(fdt, node, name, address_cells, size_cells);
 
-static void __init early_scan(const void *fdt)
-{
-    int node;
-    int depth;
-    u32 address_cells[MAX_DEPTH];
-    u32 size_cells[MAX_DEPTH];
-
-    for ( node = 0; depth >= 0; node = fdt_next_node(fdt, node, &depth) )
-    {
-        if ( depth >= MAX_DEPTH )
-        {
-            early_printk("fdt: node '%s': nested too deep\n",
-                         fdt_get_name(fdt, node, NULL));
-            continue;
-        }
-
-        address_cells[depth] = prop_by_name_u32(fdt, node, "#address-cells");
-        size_cells[depth] = prop_by_name_u32(fdt, node, "#size-cells");
-
-        if ( node_matches(fdt, node, "memory") )
-            process_memory_node(fdt, node, address_cells[depth-1], size_cells[depth-1]);
-    }
+    return 0;
 }
 
 static void __init early_print_info(void)
@@ -157,7 +177,7 @@
     if ( ret < 0 )
         early_panic("No valid device tree\n");
 
-    early_scan(fdt);
+    device_tree_for_each_node((void *)fdt, early_scan_node, NULL);
     early_print_info();
 
     return fdt_totalsize(fdt);
diff -r da5b84cf21c2 -r cb2e700ce5bb xen/include/xen/device_tree.h
--- a/xen/include/xen/device_tree.h	Thu Mar 22 14:26:44 2012 +0000
+++ b/xen/include/xen/device_tree.h	Thu Mar 22 14:26:45 2012 +0000
@@ -28,10 +28,18 @@
     struct dt_mem_info mem;
 };
 
+typedef int (*device_tree_node_func)(const void *fdt,
+                                     int node, const char *name, int depth,
+                                     u32 address_cells, u32 size_cells,
+                                     void *data);
+
 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);
 
+int device_tree_for_each_node(const void *fdt,
+                              device_tree_node_func func, void *data);
+
 #endif

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzt-0007zE-4s; Fri, 23 Mar 2012 07:33: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 1SAyzr-0007yW-Rq
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:16 +0000
Received: from [85.158.139.83:61727] by server-12.bemta-5.messagelabs.com id
	71/93-05587-B372C6F4; Fri, 23 Mar 2012 07:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1332487992!19960155!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6929 invoked from network); 23 Mar 2012 07:33:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-9.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Mar 2012 07:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzo-0000z0-CS
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzo-00032q-7y
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:12 +0000
Message-Id: <E1SAyzo-00032q-7y@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] device tree: add
	device_tree_for_each_node()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426405 0
# Node ID cb2e700ce5bb459ecc98c62e4f73ad9d35f4101a
# Parent  da5b84cf21c27edf28b68cc251d7664c1874f791
device tree: add device_tree_for_each_node()

Add device_tree_for_each_node() to iterate over all nodes in a flat
device tree.  Use this in device_tree_early_init().

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r da5b84cf21c2 -r cb2e700ce5bb xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Mar 22 14:26:44 2012 +0000
+++ b/xen/common/device_tree.c	Thu Mar 22 14:26:45 2012 +0000
@@ -68,7 +68,43 @@
     return fdt32_to_cpu(*(uint32_t*)prop->data);
 }
 
+#define MAX_DEPTH 16
+
+/**
+ * device_tree_for_each_node - iterate over all device tree nodes
+ * @fdt: flat device tree.
+ * @func: function to call for each node.
+ * @data: data to pass to @func.
+ */
+int device_tree_for_each_node(const void *fdt,
+                              device_tree_node_func func, void *data)
+{
+    int node;
+    int depth;
+    u32 address_cells[MAX_DEPTH];
+    u32 size_cells[MAX_DEPTH];
+    int ret;
+
+    for ( node = 0, depth = 0;
+          node >=0 && depth >= 0;
+          node = fdt_next_node(fdt, node, &depth) )
+    {
+        if ( depth >= MAX_DEPTH )
+            continue;
+
+        address_cells[depth] = prop_by_name_u32(fdt, node, "#address-cells");
+        size_cells[depth] = prop_by_name_u32(fdt, node, "#size-cells");
+
+        ret = func(fdt, node, fdt_get_name(fdt, node, NULL), depth,
+                   address_cells[depth-1], size_cells[depth-1], data);
+        if ( ret < 0 )
+            return ret;
+    }
+    return 0;
+}
+
 static void __init process_memory_node(const void *fdt, int node,
+                                       const char *name,
                                        u32 address_cells, u32 size_cells)
 {
     const struct fdt_property *prop;
@@ -81,15 +117,14 @@
     if ( address_cells < 1 || size_cells < 1 )
     {
         early_printk("fdt: node `%s': invalid #address-cells or #size-cells",
-                     fdt_get_name(fdt, node, NULL));
+                     name);
         return;
     }
 
     prop = fdt_get_property(fdt, node, "reg", NULL);
     if ( !prop )
     {
-        early_printk("fdt: node `%s': missing `reg' property\n",
-                     fdt_get_name(fdt, node, NULL));
+        early_printk("fdt: node `%s': missing `reg' property\n", name);
         return;
     }
 
@@ -106,30 +141,15 @@
     }
 }
 
-#define MAX_DEPTH 16
+static int __init early_scan_node(const void *fdt,
+                                  int node, const char *name, int depth,
+                                  u32 address_cells, u32 size_cells,
+                                  void *data)
+{
+    if ( node_matches(fdt, node, "memory") )
+        process_memory_node(fdt, node, name, address_cells, size_cells);
 
-static void __init early_scan(const void *fdt)
-{
-    int node;
-    int depth;
-    u32 address_cells[MAX_DEPTH];
-    u32 size_cells[MAX_DEPTH];
-
-    for ( node = 0; depth >= 0; node = fdt_next_node(fdt, node, &depth) )
-    {
-        if ( depth >= MAX_DEPTH )
-        {
-            early_printk("fdt: node '%s': nested too deep\n",
-                         fdt_get_name(fdt, node, NULL));
-            continue;
-        }
-
-        address_cells[depth] = prop_by_name_u32(fdt, node, "#address-cells");
-        size_cells[depth] = prop_by_name_u32(fdt, node, "#size-cells");
-
-        if ( node_matches(fdt, node, "memory") )
-            process_memory_node(fdt, node, address_cells[depth-1], size_cells[depth-1]);
-    }
+    return 0;
 }
 
 static void __init early_print_info(void)
@@ -157,7 +177,7 @@
     if ( ret < 0 )
         early_panic("No valid device tree\n");
 
-    early_scan(fdt);
+    device_tree_for_each_node((void *)fdt, early_scan_node, NULL);
     early_print_info();
 
     return fdt_totalsize(fdt);
diff -r da5b84cf21c2 -r cb2e700ce5bb xen/include/xen/device_tree.h
--- a/xen/include/xen/device_tree.h	Thu Mar 22 14:26:44 2012 +0000
+++ b/xen/include/xen/device_tree.h	Thu Mar 22 14:26:45 2012 +0000
@@ -28,10 +28,18 @@
     struct dt_mem_info mem;
 };
 
+typedef int (*device_tree_node_func)(const void *fdt,
+                                     int node, const char *name, int depth,
+                                     u32 address_cells, u32 size_cells,
+                                     void *data);
+
 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);
 
+int device_tree_for_each_node(const void *fdt,
+                              device_tree_node_func func, void *data);
+
 #endif

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzu-000809-Ew; Fri, 23 Mar 2012 07:33: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 1SAyzs-0007yd-Ti
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:17 +0000
Received: from [85.158.143.35:25065] by server-2.bemta-4.messagelabs.com id
	3C/5D-17550-C372C6F4; Fri, 23 Mar 2012 07:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1332487994!5794677!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29391 invoked from network); 23 Mar 2012 07:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Mar 2012 07:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzq-0000zC-HL
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzq-00034h-Cz
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:14 +0000
Message-Id: <E1SAyzq-00034h-Cz@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: shorten constant names in
	head.S to keep within 80 columns
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332429320 0
# Node ID 237e3e4cd94606cad042a839e141ac624bd30a48
# Parent  f165d51985d124af0f713a8ed5eb9ac90248e7d2
arm: shorten constant names in head.S to keep within 80 columns

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


diff -r f165d51985d1 -r 237e3e4cd946 xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Thu Mar 22 14:26:47 2012 +0000
+++ b/xen/arch/arm/head.S	Thu Mar 22 15:15:20 2012 +0000
@@ -21,12 +21,12 @@
 #include <asm/page.h>
 #include <asm/asm_defns.h>
 
-#define XEN_PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
-#define XEN_PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
-#define XEN_PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
+#define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
+#define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
+#define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
 
-#define PT_UPPER(x) (XEN_PT_##x & 0xf00)
-#define PT_LOWER(x) (XEN_PT_##x & 0x0ff)
+#define PT_UPPER(x) (PT_##x & 0xf00)
+#define PT_LOWER(x) (PT_##x & 0x0ff)
 
 /* Macro to print a string to the UART, if there is one.
  * Clobbers r0-r3. */

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzu-000809-Ew; Fri, 23 Mar 2012 07:33: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 1SAyzs-0007yd-Ti
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:17 +0000
Received: from [85.158.143.35:25065] by server-2.bemta-4.messagelabs.com id
	3C/5D-17550-C372C6F4; Fri, 23 Mar 2012 07:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1332487994!5794677!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29391 invoked from network); 23 Mar 2012 07:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Mar 2012 07:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzq-0000zC-HL
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzq-00034h-Cz
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:14 +0000
Message-Id: <E1SAyzq-00034h-Cz@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: shorten constant names in
	head.S to keep within 80 columns
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332429320 0
# Node ID 237e3e4cd94606cad042a839e141ac624bd30a48
# Parent  f165d51985d124af0f713a8ed5eb9ac90248e7d2
arm: shorten constant names in head.S to keep within 80 columns

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


diff -r f165d51985d1 -r 237e3e4cd946 xen/arch/arm/head.S
--- a/xen/arch/arm/head.S	Thu Mar 22 14:26:47 2012 +0000
+++ b/xen/arch/arm/head.S	Thu Mar 22 15:15:20 2012 +0000
@@ -21,12 +21,12 @@
 #include <asm/page.h>
 #include <asm/asm_defns.h>
 
-#define XEN_PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
-#define XEN_PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
-#define XEN_PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
+#define PT_PT  0xe7f /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=1, P=1 */
+#define PT_MEM 0xe7d /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=111, T=0, P=1 */
+#define PT_DEV 0xe71 /* nG=1, AF=1, SH=10, AP=01, NS=1, ATTR=100, T=0, P=1 */
 
-#define PT_UPPER(x) (XEN_PT_##x & 0xf00)
-#define PT_LOWER(x) (XEN_PT_##x & 0x0ff)
+#define PT_UPPER(x) (PT_##x & 0xf00)
+#define PT_LOWER(x) (PT_##x & 0x0ff)
 
 /* Macro to print a string to the UART, if there is one.
  * Clobbers r0-r3. */

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzu-0007zg-9A; Fri, 23 Mar 2012 07:33: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 1SAyzs-0007yd-Gu
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:16 +0000
Received: from [85.158.143.99:25797] by server-2.bemta-4.messagelabs.com id
	F6/5D-17550-B372C6F4; Fri, 23 Mar 2012 07:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1332487991!20463185!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9175 invoked from network); 23 Mar 2012 07:33:13 -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;
	23 Mar 2012 07:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzm-0000yr-SR
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzm-00031U-Kq
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:10 +0000
Message-Id: <E1SAyzm-00031U-Kq@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] MAINTAINERS: add device tree
	maintainer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426403 0
# Node ID b3a46133d1e9168a84231bc236186e693689db09
# Parent  d9ca8249409d6e554dede70f856e451096d1cd8e
MAINTAINERS: add device tree maintainer

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d9ca8249409d -r b3a46133d1e9 MAINTAINERS
--- a/MAINTAINERS	Thu Mar 22 14:26:42 2012 +0000
+++ b/MAINTAINERS	Thu Mar 22 14:26:43 2012 +0000
@@ -111,6 +111,14 @@
 S:	Supported
 F:	xen/common/cpupool.c
 
+DEVICE TREE
+M:	David Vrabel <david.vrabel@citrix.com>
+S:	Supported
+F:	xen/common/libfdt/
+F:	xen/common/device_tree.c
+F:	xen/include/xen/libfdt/
+F:	xen/include/xen/device_tree.h
+
 EFI
 M:     Jan Beulich <jbeulich@suse.com>
 S:     Supported

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzu-0007zg-9A; Fri, 23 Mar 2012 07:33: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 1SAyzs-0007yd-Gu
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:16 +0000
Received: from [85.158.143.99:25797] by server-2.bemta-4.messagelabs.com id
	F6/5D-17550-B372C6F4; Fri, 23 Mar 2012 07:33:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-216.messagelabs.com!1332487991!20463185!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9175 invoked from network); 23 Mar 2012 07:33:13 -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;
	23 Mar 2012 07:33:13 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzm-0000yr-SR
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzm-00031U-Kq
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:10 +0000
Message-Id: <E1SAyzm-00031U-Kq@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] MAINTAINERS: add device tree
	maintainer
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426403 0
# Node ID b3a46133d1e9168a84231bc236186e693689db09
# Parent  d9ca8249409d6e554dede70f856e451096d1cd8e
MAINTAINERS: add device tree maintainer

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r d9ca8249409d -r b3a46133d1e9 MAINTAINERS
--- a/MAINTAINERS	Thu Mar 22 14:26:42 2012 +0000
+++ b/MAINTAINERS	Thu Mar 22 14:26:43 2012 +0000
@@ -111,6 +111,14 @@
 S:	Supported
 F:	xen/common/cpupool.c
 
+DEVICE TREE
+M:	David Vrabel <david.vrabel@citrix.com>
+S:	Supported
+F:	xen/common/libfdt/
+F:	xen/common/device_tree.c
+F:	xen/include/xen/libfdt/
+F:	xen/include/xen/device_tree.h
+
 EFI
 M:     Jan Beulich <jbeulich@suse.com>
 S:     Supported

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzu-00080Q-Lm; Fri, 23 Mar 2012 07:33: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 1SAyzt-0007zD-Js
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:17 +0000
Received: from [193.109.254.147:15027] by server-1.bemta-14.messagelabs.com id
	1D/21-29372-C372C6F4; Fri, 23 Mar 2012 07:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1332487995!1740074!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28713 invoked from network); 23 Mar 2012 07:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Mar 2012 07:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzp-0000z6-FI
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzp-00033n-AI
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:13 +0000
Message-Id: <E1SAyzp-00033n-AI@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: remove the hack for loading
	vmlinux images
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426406 0
# Node ID eb3b8574d4047f6f76cd41ed6357654e413a4053
# Parent  eb2dc06f68e69f87d5e018349c3c239fcc59753f
arm: remove the hack for loading vmlinux images

Don't adjust the RAM location/size when loading an ELF for dom0.  It
was vmlinux specific and no longer needed because Linux can be loaded
from a zImage.  Support for loading ELF images is not removed as it
may be useful for loading things other than the Linux kernel.

This also makes preparing the device tree for dom0 easier.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r eb2dc06f68e6 -r eb3b8574d404 xen/arch/arm/kernel.c
--- a/xen/arch/arm/kernel.c	Thu Mar 22 14:26:46 2012 +0000
+++ b/xen/arch/arm/kernel.c	Thu Mar 22 14:26:46 2012 +0000
@@ -91,7 +91,6 @@
 
 /**
  * Check the image is a zImage and return the load address and length
- * (FIXME: including any appended DTB).
  */
 static int kernel_try_zimage_prepare(struct kernel_info *info)
 {
@@ -117,8 +116,6 @@
         end += be32_to_cpu(dtb_hdr.total_size);
     }
 
-    /* FIXME: get RAM location from appended DTB (if there is one)? */
-
     /*
      * If start is zero, the zImage is position independent -- load it
      * at 32k from start of RAM.
@@ -166,13 +163,9 @@
         return rc;
 
     /*
-     * FIXME: can the ELF header be used to find the physical address
-     * to load the image to?  Instead of making virt == phys by
-     * relocating the guest's RAM.
+     * TODO: can the ELF header be used to find the physical address
+     * to load the image to?  Instead of assuming virt == phys.
      */
-    info->ram_start = 0xc0000000;
-    info->ram_end   = 0xc8000000;
-
     info->entry = info->elf.parms.virt_entry;
     info->load = kernel_elf_load;
 

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzu-00080Q-Lm; Fri, 23 Mar 2012 07:33: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 1SAyzt-0007zD-Js
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:17 +0000
Received: from [193.109.254.147:15027] by server-1.bemta-14.messagelabs.com id
	1D/21-29372-C372C6F4; Fri, 23 Mar 2012 07:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-27.messagelabs.com!1332487995!1740074!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 28713 invoked from network); 23 Mar 2012 07:33:16 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Mar 2012 07:33:16 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzp-0000z6-FI
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzp-00033n-AI
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:13 +0000
Message-Id: <E1SAyzp-00033n-AI@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] arm: remove the hack for loading
	vmlinux images
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426406 0
# Node ID eb3b8574d4047f6f76cd41ed6357654e413a4053
# Parent  eb2dc06f68e69f87d5e018349c3c239fcc59753f
arm: remove the hack for loading vmlinux images

Don't adjust the RAM location/size when loading an ELF for dom0.  It
was vmlinux specific and no longer needed because Linux can be loaded
from a zImage.  Support for loading ELF images is not removed as it
may be useful for loading things other than the Linux kernel.

This also makes preparing the device tree for dom0 easier.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r eb2dc06f68e6 -r eb3b8574d404 xen/arch/arm/kernel.c
--- a/xen/arch/arm/kernel.c	Thu Mar 22 14:26:46 2012 +0000
+++ b/xen/arch/arm/kernel.c	Thu Mar 22 14:26:46 2012 +0000
@@ -91,7 +91,6 @@
 
 /**
  * Check the image is a zImage and return the load address and length
- * (FIXME: including any appended DTB).
  */
 static int kernel_try_zimage_prepare(struct kernel_info *info)
 {
@@ -117,8 +116,6 @@
         end += be32_to_cpu(dtb_hdr.total_size);
     }
 
-    /* FIXME: get RAM location from appended DTB (if there is one)? */
-
     /*
      * If start is zero, the zImage is position independent -- load it
      * at 32k from start of RAM.
@@ -166,13 +163,9 @@
         return rc;
 
     /*
-     * FIXME: can the ELF header be used to find the physical address
-     * to load the image to?  Instead of making virt == phys by
-     * relocating the guest's RAM.
+     * TODO: can the ELF header be used to find the physical address
+     * to load the image to?  Instead of assuming virt == phys.
      */
-    info->ram_start = 0xc0000000;
-    info->ram_end   = 0xc8000000;
-
     info->entry = info->elf.parms.virt_entry;
     info->load = kernel_elf_load;
 

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzu-00080I-If; Fri, 23 Mar 2012 07:33: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 1SAyzt-0007z0-8m
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:17 +0000
Received: from [85.158.139.83:41517] by server-5.bemta-5.messagelabs.com id
	80/FB-13566-C372C6F4; Fri, 23 Mar 2012 07:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1332487994!13284891!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30379 invoked from network); 23 Mar 2012 07:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Mar 2012 07:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzp-0000z9-Sz
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzp-00034F-Ro
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:13 +0000
Message-Id: <E1SAyzp-00034F-Ro@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Allow cmdline_parse() to be used
	with const strings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426407 0
# Node ID f165d51985d124af0f713a8ed5eb9ac90248e7d2
# Parent  eb3b8574d4047f6f76cd41ed6357654e413a4053
Allow cmdline_parse() to be used with const strings

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r eb3b8574d404 -r f165d51985d1 xen/common/kernel.c
--- a/xen/common/kernel.c	Thu Mar 22 14:26:46 2012 +0000
+++ b/xen/common/kernel.c	Thu Mar 22 14:26:47 2012 +0000
@@ -48,7 +48,7 @@
     }
 }
 
-void __init cmdline_parse(char *cmdline)
+void __init cmdline_parse(const char *cmdline)
 {
     char opt[100], *optval, *optkey, *q;
     const char *p = cmdline;
diff -r eb3b8574d404 -r f165d51985d1 xen/include/xen/lib.h
--- a/xen/include/xen/lib.h	Thu Mar 22 14:26:46 2012 +0000
+++ b/xen/include/xen/lib.h	Thu Mar 22 14:26:47 2012 +0000
@@ -56,7 +56,7 @@
 
 struct domain;
 
-void cmdline_parse(char *cmdline);
+void cmdline_parse(const char *cmdline);
 int parse_bool(const char *s);
 
 /*#define DEBUG_TRACE_DUMP*/

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzu-00080I-If; Fri, 23 Mar 2012 07:33: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 1SAyzt-0007z0-8m
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:17 +0000
Received: from [85.158.139.83:41517] by server-5.bemta-5.messagelabs.com id
	80/FB-13566-C372C6F4; Fri, 23 Mar 2012 07:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-182.messagelabs.com!1332487994!13284891!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 30379 invoked from network); 23 Mar 2012 07:33:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-16.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Mar 2012 07:33:15 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzp-0000z9-Sz
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzp-00034F-Ro
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:13 +0000
Message-Id: <E1SAyzp-00034F-Ro@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Allow cmdline_parse() to be used
	with const strings
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426407 0
# Node ID f165d51985d124af0f713a8ed5eb9ac90248e7d2
# Parent  eb3b8574d4047f6f76cd41ed6357654e413a4053
Allow cmdline_parse() to be used with const strings

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r eb3b8574d404 -r f165d51985d1 xen/common/kernel.c
--- a/xen/common/kernel.c	Thu Mar 22 14:26:46 2012 +0000
+++ b/xen/common/kernel.c	Thu Mar 22 14:26:47 2012 +0000
@@ -48,7 +48,7 @@
     }
 }
 
-void __init cmdline_parse(char *cmdline)
+void __init cmdline_parse(const char *cmdline)
 {
     char opt[100], *optval, *optkey, *q;
     const char *p = cmdline;
diff -r eb3b8574d404 -r f165d51985d1 xen/include/xen/lib.h
--- a/xen/include/xen/lib.h	Thu Mar 22 14:26:46 2012 +0000
+++ b/xen/include/xen/lib.h	Thu Mar 22 14:26:47 2012 +0000
@@ -56,7 +56,7 @@
 
 struct domain;
 
-void cmdline_parse(char *cmdline);
+void cmdline_parse(const char *cmdline);
 int parse_bool(const char *s);
 
 /*#define DEBUG_TRACE_DUMP*/

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzv-00080y-Oy; Fri, 23 Mar 2012 07:33: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 1SAyzu-0007yq-Ne
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:18 +0000
Received: from [85.158.143.99:27327] by server-1.bemta-4.messagelabs.com id
	63/9F-20925-E372C6F4; Fri, 23 Mar 2012 07:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1332487995!14175054!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8671 invoked from network); 23 Mar 2012 07:33:17 -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;
	23 Mar 2012 07:33: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 1SAyzr-0000zF-2V
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzq-000358-UZ
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:14 +0000
Message-Id: <E1SAyzq-000358-UZ@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Disable OVMF build - it's not baked
	yet.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332436522 0
# Node ID 0ecb8ffe61b2ffff4331fcf49487c956ccb297a0
# Parent  237e3e4cd94606cad042a839e141ac624bd30a48
Disable OVMF build - it's not baked yet.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 237e3e4cd946 -r 0ecb8ffe61b2 Config.mk
--- a/Config.mk	Thu Mar 22 15:15:20 2012 +0000
+++ b/Config.mk	Thu Mar 22 17:15:22 2012 +0000
@@ -207,7 +207,7 @@
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
-CONFIG_OVMF ?= $(CONFIG_Linux)
+CONFIG_OVMF ?= n
 CONFIG_ROMBIOS ?= y
 CONFIG_SEABIOS ?= y
 

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:21 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:21 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzv-00080y-Oy; Fri, 23 Mar 2012 07:33: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 1SAyzu-0007yq-Ne
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:18 +0000
Received: from [85.158.143.99:27327] by server-1.bemta-4.messagelabs.com id
	63/9F-20925-E372C6F4; Fri, 23 Mar 2012 07:33:18 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1332487995!14175054!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8671 invoked from network); 23 Mar 2012 07:33:17 -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;
	23 Mar 2012 07:33: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 1SAyzr-0000zF-2V
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:15 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzq-000358-UZ
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:14 +0000
Message-Id: <E1SAyzq-000358-UZ@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Disable OVMF build - it's not baked
	yet.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332436522 0
# Node ID 0ecb8ffe61b2ffff4331fcf49487c956ccb297a0
# Parent  237e3e4cd94606cad042a839e141ac624bd30a48
Disable OVMF build - it's not baked yet.

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 237e3e4cd946 -r 0ecb8ffe61b2 Config.mk
--- a/Config.mk	Thu Mar 22 15:15:20 2012 +0000
+++ b/Config.mk	Thu Mar 22 17:15:22 2012 +0000
@@ -207,7 +207,7 @@
 
 ETHERBOOT_NICS ?= rtl8139 8086100e
 
-CONFIG_OVMF ?= $(CONFIG_Linux)
+CONFIG_OVMF ?= n
 CONFIG_ROMBIOS ?= y
 CONFIG_SEABIOS ?= y
 

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzu-0007zx-CG; Fri, 23 Mar 2012 07:33: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 1SAyzs-0007yq-Pk
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:16 +0000
Received: from [85.158.143.35:24996] by server-1.bemta-4.messagelabs.com id
	6A/8F-20925-C372C6F4; Fri, 23 Mar 2012 07:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1332487993!13228262!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23292 invoked from network); 23 Mar 2012 07:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Mar 2012 07:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzo-0000z3-TQ
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzo-00033J-P1
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:12 +0000
Message-Id: <E1SAyzo-00033J-P1@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] device tree: add device_tree_dump()
	to print a flat device tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426406 0
# Node ID eb2dc06f68e69f87d5e018349c3c239fcc59753f
# Parent  cb2e700ce5bb459ecc98c62e4f73ad9d35f4101a
device tree: add device_tree_dump() to print a flat device tree

Add a device_tree_dump() function which prints to main structure and
properties names of a flat device tree (but not the properties values
yet).

This will be useful for debugging problems with the device tree
generated for dom0.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r cb2e700ce5bb -r eb2dc06f68e6 xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Mar 22 14:26:45 2012 +0000
+++ b/xen/common/device_tree.c	Thu Mar 22 14:26:46 2012 +0000
@@ -103,6 +103,44 @@
     return 0;
 }
 
+static int dump_node(const void *fdt, int node, const char *name, int depth,
+                     u32 address_cells, u32 size_cells, void *data)
+{
+    char prefix[2*MAX_DEPTH + 1] = "";
+    int i;
+    int prop;
+
+    for ( i = 0; i < depth; i++ )
+        safe_strcat(prefix, "  ");
+
+    if ( name[0] == '\0' )
+        name = "/";
+    printk("%s%s:\n", prefix, name);
+
+    for ( prop = fdt_first_property_offset(fdt, node);
+          prop >= 0;
+          prop = fdt_next_property_offset(fdt, prop) )
+    {
+        const struct fdt_property *p;
+
+        p = fdt_get_property_by_offset(fdt, prop, NULL);
+
+        printk("%s  %s\n", prefix, fdt_string(fdt, fdt32_to_cpu(p->nameoff)));
+    }
+
+    return 0;
+}
+
+/**
+ * device_tree_dump - print a text representation of a device tree
+ * @fdt: flat device tree to print
+ */
+void device_tree_dump(const void *fdt)
+{
+    device_tree_for_each_node(fdt, dump_node, NULL);
+}
+
+
 static void __init process_memory_node(const void *fdt, int node,
                                        const char *name,
                                        u32 address_cells, u32 size_cells)
diff -r cb2e700ce5bb -r eb2dc06f68e6 xen/include/xen/device_tree.h
--- a/xen/include/xen/device_tree.h	Thu Mar 22 14:26:45 2012 +0000
+++ b/xen/include/xen/device_tree.h	Thu Mar 22 14:26:46 2012 +0000
@@ -41,5 +41,6 @@
 
 int device_tree_for_each_node(const void *fdt,
                               device_tree_node_func func, void *data);
+void device_tree_dump(const void *fdt);
 
 #endif

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzu-0007zx-CG; Fri, 23 Mar 2012 07:33: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 1SAyzs-0007yq-Pk
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:16 +0000
Received: from [85.158.143.35:24996] by server-1.bemta-4.messagelabs.com id
	6A/8F-20925-C372C6F4; Fri, 23 Mar 2012 07:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1332487993!13228262!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23292 invoked from network); 23 Mar 2012 07:33:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	23 Mar 2012 07:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzo-0000z3-TQ
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzo-00033J-P1
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:12 +0000
Message-Id: <E1SAyzo-00033J-P1@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] device tree: add device_tree_dump()
	to print a flat device tree
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426406 0
# Node ID eb2dc06f68e69f87d5e018349c3c239fcc59753f
# Parent  cb2e700ce5bb459ecc98c62e4f73ad9d35f4101a
device tree: add device_tree_dump() to print a flat device tree

Add a device_tree_dump() function which prints to main structure and
properties names of a flat device tree (but not the properties values
yet).

This will be useful for debugging problems with the device tree
generated for dom0.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r cb2e700ce5bb -r eb2dc06f68e6 xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Mar 22 14:26:45 2012 +0000
+++ b/xen/common/device_tree.c	Thu Mar 22 14:26:46 2012 +0000
@@ -103,6 +103,44 @@
     return 0;
 }
 
+static int dump_node(const void *fdt, int node, const char *name, int depth,
+                     u32 address_cells, u32 size_cells, void *data)
+{
+    char prefix[2*MAX_DEPTH + 1] = "";
+    int i;
+    int prop;
+
+    for ( i = 0; i < depth; i++ )
+        safe_strcat(prefix, "  ");
+
+    if ( name[0] == '\0' )
+        name = "/";
+    printk("%s%s:\n", prefix, name);
+
+    for ( prop = fdt_first_property_offset(fdt, node);
+          prop >= 0;
+          prop = fdt_next_property_offset(fdt, prop) )
+    {
+        const struct fdt_property *p;
+
+        p = fdt_get_property_by_offset(fdt, prop, NULL);
+
+        printk("%s  %s\n", prefix, fdt_string(fdt, fdt32_to_cpu(p->nameoff)));
+    }
+
+    return 0;
+}
+
+/**
+ * device_tree_dump - print a text representation of a device tree
+ * @fdt: flat device tree to print
+ */
+void device_tree_dump(const void *fdt)
+{
+    device_tree_for_each_node(fdt, dump_node, NULL);
+}
+
+
 static void __init process_memory_node(const void *fdt, int node,
                                        const char *name,
                                        u32 address_cells, u32 size_cells)
diff -r cb2e700ce5bb -r eb2dc06f68e6 xen/include/xen/device_tree.h
--- a/xen/include/xen/device_tree.h	Thu Mar 22 14:26:45 2012 +0000
+++ b/xen/include/xen/device_tree.h	Thu Mar 22 14:26:46 2012 +0000
@@ -41,5 +41,6 @@
 
 int device_tree_for_each_node(const void *fdt,
                               device_tree_node_func func, void *data);
+void device_tree_dump(const void *fdt);
 
 #endif

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzx-00083b-Ru; Fri, 23 Mar 2012 07:33: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 1SAyzw-00081M-O1
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:21 +0000
Received: from [85.158.143.35:3958] by server-3.bemta-4.messagelabs.com id
	2C/FA-05853-F372C6F4; Fri, 23 Mar 2012 07:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1332487993!12611270!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3407 invoked from network); 23 Mar 2012 07:33:14 -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;
	23 Mar 2012 07:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzm-0000yo-7o
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzm-000312-38
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:10 +0000
Message-Id: <E1SAyzm-000312-38@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libfdt: move headers to
	xen/include/xen/libfdt/
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426402 0
# Node ID d9ca8249409d6e554dede70f856e451096d1cd8e
# Parent  777658bb5eb9c1b5e6043a8d04366ea4889b42ac
libfdt: move headers to xen/include/xen/libfdt/

Move the public libfdt headers to xen/include/xen/libfdt/ so CFLAGS
does need to be set to find them.  This requires minor tweaks to one
of the headers imported from upstream.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 777658bb5eb9 -r d9ca8249409d xen/common/Makefile
--- a/xen/common/Makefile	Thu Mar 22 14:26:41 2012 +0000
+++ b/xen/common/Makefile	Thu Mar 22 14:26:42 2012 +0000
@@ -61,5 +61,3 @@
 
 subdir-y += libelf
 subdir-$(HAS_DEVICE_TREE) += libfdt
-
-CFLAGS += -Ilibfdt
diff -r 777658bb5eb9 -r d9ca8249409d xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Mar 22 14:26:41 2012 +0000
+++ b/xen/common/device_tree.c	Thu Mar 22 14:26:42 2012 +0000
@@ -14,13 +14,12 @@
 #include <xen/device_tree.h>
 #include <xen/kernel.h>
 #include <xen/lib.h>
+#include <xen/libfdt/libfdt.h>
 #include <xen/mm.h>
 #include <xen/stdarg.h>
 #include <xen/string.h>
 #include <asm/early_printk.h>
 
-#include <libfdt.h>
-
 struct dt_early_info __initdata early_info;
 void *device_tree_flattened;
 
diff -r 777658bb5eb9 -r d9ca8249409d xen/common/libfdt/Makefile
--- a/xen/common/libfdt/Makefile	Thu Mar 22 14:26:41 2012 +0000
+++ b/xen/common/libfdt/Makefile	Thu Mar 22 14:26:42 2012 +0000
@@ -2,4 +2,4 @@
 
 obj-y += $(LIBFDT_OBJS)
 
-CFLAGS += -I.
+CFLAGS += -I$(BASEDIR)/include/xen/libfdt/
diff -r 777658bb5eb9 -r d9ca8249409d xen/common/libfdt/fdt.h
--- a/xen/common/libfdt/fdt.h	Thu Mar 22 14:26:41 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-#ifndef _FDT_H
-#define _FDT_H
-
-#ifndef __ASSEMBLY__
-
-struct fdt_header {
-	uint32_t magic;			 /* magic word FDT_MAGIC */
-	uint32_t totalsize;		 /* total size of DT block */
-	uint32_t off_dt_struct;		 /* offset to structure */
-	uint32_t off_dt_strings;	 /* offset to strings */
-	uint32_t off_mem_rsvmap;	 /* offset to memory reserve map */
-	uint32_t version;		 /* format version */
-	uint32_t last_comp_version;	 /* last compatible version */
-
-	/* version 2 fields below */
-	uint32_t boot_cpuid_phys;	 /* Which physical CPU id we're
-					    booting on */
-	/* version 3 fields below */
-	uint32_t size_dt_strings;	 /* size of the strings block */
-
-	/* version 17 fields below */
-	uint32_t size_dt_struct;	 /* size of the structure block */
-};
-
-struct fdt_reserve_entry {
-	uint64_t address;
-	uint64_t size;
-};
-
-struct fdt_node_header {
-	uint32_t tag;
-	char name[0];
-};
-
-struct fdt_property {
-	uint32_t tag;
-	uint32_t len;
-	uint32_t nameoff;
-	char data[0];
-};
-
-#endif /* !__ASSEMBLY */
-
-#define FDT_MAGIC	0xd00dfeed	/* 4: version, 4: total size */
-#define FDT_TAGSIZE	sizeof(uint32_t)
-
-#define FDT_BEGIN_NODE	0x1		/* Start node: full name */
-#define FDT_END_NODE	0x2		/* End node */
-#define FDT_PROP	0x3		/* Property: name off,
-					   size, content */
-#define FDT_NOP		0x4		/* nop */
-#define FDT_END		0x9
-
-#define FDT_V1_SIZE	(7*sizeof(uint32_t))
-#define FDT_V2_SIZE	(FDT_V1_SIZE + sizeof(uint32_t))
-#define FDT_V3_SIZE	(FDT_V2_SIZE + sizeof(uint32_t))
-#define FDT_V16_SIZE	FDT_V3_SIZE
-#define FDT_V17_SIZE	(FDT_V16_SIZE + sizeof(uint32_t))
-
-#endif /* _FDT_H */
diff -r 777658bb5eb9 -r d9ca8249409d xen/common/libfdt/libfdt.h
--- a/xen/common/libfdt/libfdt.h	Thu Mar 22 14:26:41 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1235 +0,0 @@
-#ifndef _LIBFDT_H
-#define _LIBFDT_H
-/*
- * libfdt - Flat Device Tree manipulation
- * Copyright (C) 2006 David Gibson, IBM Corporation.
- *
- * libfdt is dual licensed: you can use it either under the terms of
- * the GPL, or the BSD license, at your option.
- *
- *  a) This library 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 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 General Public License for more details.
- *
- *     You should have received a copy of the GNU General Public
- *     License along with this library; if not, write to the Free
- *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- *     MA 02110-1301 USA
- *
- * Alternatively,
- *
- *  b) Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *     1. Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *     2. Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <libfdt_env.h>
-#include <fdt.h>
-
-#define FDT_FIRST_SUPPORTED_VERSION	0x10
-#define FDT_LAST_SUPPORTED_VERSION	0x11
-
-/* Error codes: informative error codes */
-#define FDT_ERR_NOTFOUND	1
-	/* FDT_ERR_NOTFOUND: The requested node or property does not exist */
-#define FDT_ERR_EXISTS		2
-	/* FDT_ERR_EXISTS: Attemped to create a node or property which
-	 * already exists */
-#define FDT_ERR_NOSPACE		3
-	/* FDT_ERR_NOSPACE: Operation needed to expand the device
-	 * tree, but its buffer did not have sufficient space to
-	 * contain the expanded tree. Use fdt_open_into() to move the
-	 * device tree to a buffer with more space. */
-
-/* Error codes: codes for bad parameters */
-#define FDT_ERR_BADOFFSET	4
-	/* FDT_ERR_BADOFFSET: Function was passed a structure block
-	 * offset which is out-of-bounds, or which points to an
-	 * unsuitable part of the structure for the operation. */
-#define FDT_ERR_BADPATH		5
-	/* FDT_ERR_BADPATH: Function was passed a badly formatted path
-	 * (e.g. missing a leading / for a function which requires an
-	 * absolute path) */
-#define FDT_ERR_BADPHANDLE	6
-	/* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle
-	 * value.  phandle values of 0 and -1 are not permitted. */
-#define FDT_ERR_BADSTATE	7
-	/* FDT_ERR_BADSTATE: Function was passed an incomplete device
-	 * tree created by the sequential-write functions, which is
-	 * not sufficiently complete for the requested operation. */
-
-/* Error codes: codes for bad device tree blobs */
-#define FDT_ERR_TRUNCATED	8
-	/* FDT_ERR_TRUNCATED: Structure block of the given device tree
-	 * ends without an FDT_END tag. */
-#define FDT_ERR_BADMAGIC	9
-	/* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a
-	 * device tree at all - it is missing the flattened device
-	 * tree magic number. */
-#define FDT_ERR_BADVERSION	10
-	/* FDT_ERR_BADVERSION: Given device tree has a version which
-	 * can't be handled by the requested operation.  For
-	 * read-write functions, this may mean that fdt_open_into() is
-	 * required to convert the tree to the expected version. */
-#define FDT_ERR_BADSTRUCTURE	11
-	/* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt
-	 * structure block or other serious error (e.g. misnested
-	 * nodes, or subnodes preceding properties). */
-#define FDT_ERR_BADLAYOUT	12
-	/* FDT_ERR_BADLAYOUT: For read-write functions, the given
-	 * device tree has it's sub-blocks in an order that the
-	 * function can't handle (memory reserve map, then structure,
-	 * then strings).  Use fdt_open_into() to reorganize the tree
-	 * into a form suitable for the read-write operations. */
-
-/* "Can't happen" error indicating a bug in libfdt */
-#define FDT_ERR_INTERNAL	13
-	/* FDT_ERR_INTERNAL: libfdt has failed an internal assertion.
-	 * Should never be returned, if it is, it indicates a bug in
-	 * libfdt itself. */
-
-#define FDT_ERR_MAX		13
-
-/**********************************************************************/
-/* Low-level functions (you probably don't need these)                */
-/**********************************************************************/
-
-const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
-static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
-{
-	return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen);
-}
-
-uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
-
-/**********************************************************************/
-/* Traversal functions                                                */
-/**********************************************************************/
-
-int fdt_next_node(const void *fdt, int offset, int *depth);
-
-/**********************************************************************/
-/* General functions                                                  */
-/**********************************************************************/
-
-#define fdt_get_header(fdt, field) \
-	(fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
-#define fdt_magic(fdt) 			(fdt_get_header(fdt, magic))
-#define fdt_totalsize(fdt)		(fdt_get_header(fdt, totalsize))
-#define fdt_off_dt_struct(fdt)		(fdt_get_header(fdt, off_dt_struct))
-#define fdt_off_dt_strings(fdt)		(fdt_get_header(fdt, off_dt_strings))
-#define fdt_off_mem_rsvmap(fdt)		(fdt_get_header(fdt, off_mem_rsvmap))
-#define fdt_version(fdt)		(fdt_get_header(fdt, version))
-#define fdt_last_comp_version(fdt) 	(fdt_get_header(fdt, last_comp_version))
-#define fdt_boot_cpuid_phys(fdt) 	(fdt_get_header(fdt, boot_cpuid_phys))
-#define fdt_size_dt_strings(fdt) 	(fdt_get_header(fdt, size_dt_strings))
-#define fdt_size_dt_struct(fdt)		(fdt_get_header(fdt, size_dt_struct))
-
-#define __fdt_set_hdr(name) \
-	static inline void fdt_set_##name(void *fdt, uint32_t val) \
-	{ \
-		struct fdt_header *fdth = (struct fdt_header*)fdt; \
-		fdth->name = cpu_to_fdt32(val); \
-	}
-__fdt_set_hdr(magic);
-__fdt_set_hdr(totalsize);
-__fdt_set_hdr(off_dt_struct);
-__fdt_set_hdr(off_dt_strings);
-__fdt_set_hdr(off_mem_rsvmap);
-__fdt_set_hdr(version);
-__fdt_set_hdr(last_comp_version);
-__fdt_set_hdr(boot_cpuid_phys);
-__fdt_set_hdr(size_dt_strings);
-__fdt_set_hdr(size_dt_struct);
-#undef __fdt_set_hdr
-
-/**
- * fdt_check_header - sanity check a device tree or possible device tree
- * @fdt: pointer to data which might be a flattened device tree
- *
- * fdt_check_header() checks that the given buffer contains what
- * appears to be a flattened device tree with sane information in its
- * header.
- *
- * returns:
- *     0, if the buffer appears to contain a valid device tree
- *     -FDT_ERR_BADMAGIC,
- *     -FDT_ERR_BADVERSION,
- *     -FDT_ERR_BADSTATE, standard meanings, as above
- */
-int fdt_check_header(const void *fdt);
-
-/**
- * fdt_move - move a device tree around in memory
- * @fdt: pointer to the device tree to move
- * @buf: pointer to memory where the device is to be moved
- * @bufsize: size of the memory space at buf
- *
- * fdt_move() relocates, if possible, the device tree blob located at
- * fdt to the buffer at buf of size bufsize.  The buffer may overlap
- * with the existing device tree blob at fdt.  Therefore,
- *     fdt_move(fdt, fdt, fdt_totalsize(fdt))
- * should always succeed.
- *
- * returns:
- *     0, on success
- *     -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree
- *     -FDT_ERR_BADMAGIC,
- *     -FDT_ERR_BADVERSION,
- *     -FDT_ERR_BADSTATE, standard meanings
- */
-int fdt_move(const void *fdt, void *buf, int bufsize);
-
-/**********************************************************************/
-/* Read-only functions                                                */
-/**********************************************************************/
-
-/**
- * fdt_string - retrieve a string from the strings block of a device tree
- * @fdt: pointer to the device tree blob
- * @stroffset: offset of the string within the strings block (native endian)
- *
- * fdt_string() retrieves a pointer to a single string from the
- * strings block of the device tree blob at fdt.
- *
- * returns:
- *     a pointer to the string, on success
- *     NULL, if stroffset is out of bounds
- */
-const char *fdt_string(const void *fdt, int stroffset);
-
-/**
- * fdt_num_mem_rsv - retrieve the number of memory reserve map entries
- * @fdt: pointer to the device tree blob
- *
- * Returns the number of entries in the device tree blob's memory
- * reservation map.  This does not include the terminating 0,0 entry
- * or any other (0,0) entries reserved for expansion.
- *
- * returns:
- *     the number of entries
- */
-int fdt_num_mem_rsv(const void *fdt);
-
-/**
- * fdt_get_mem_rsv - retrieve one memory reserve map entry
- * @fdt: pointer to the device tree blob
- * @address, @size: pointers to 64-bit variables
- *
- * On success, *address and *size will contain the address and size of
- * the n-th reserve map entry from the device tree blob, in
- * native-endian format.
- *
- * returns:
- *     0, on success
- *     -FDT_ERR_BADMAGIC,
- *     -FDT_ERR_BADVERSION,
- *     -FDT_ERR_BADSTATE, standard meanings
- */
-int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
-
-/**
- * fdt_subnode_offset_namelen - find a subnode based on substring
- * @fdt: pointer to the device tree blob
- * @parentoffset: structure block offset of a node
- * @name: name of the subnode to locate
- * @namelen: number of characters of name to consider
- *
- * Identical to fdt_subnode_offset(), but only examine the first
- * namelen characters of name for matching the subnode name.  This is
- * useful for finding subnodes based on a portion of a larger string,
- * such as a full path.
- */
-int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
-			       const char *name, int namelen);
-/**
- * fdt_subnode_offset - find a subnode of a given node
- * @fdt: pointer to the device tree blob
- * @parentoffset: structure block offset of a node
- * @name: name of the subnode to locate
- *
- * fdt_subnode_offset() finds a subnode of the node at structure block
- * offset parentoffset with the given name.  name may include a unit
- * address, in which case fdt_subnode_offset() will find the subnode
- * with that unit address, or the unit address may be omitted, in
- * which case fdt_subnode_offset() will find an arbitrary subnode
- * whose name excluding unit address matches the given name.
- *
- * returns:
- *	structure block offset of the requested subnode (>=0), on success
- *	-FDT_ERR_NOTFOUND, if the requested subnode does not exist
- *	-FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
- *      -FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings.
- */
-int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
-
-/**
- * fdt_path_offset - find a tree node by its full path
- * @fdt: pointer to the device tree blob
- * @path: full path of the node to locate
- *
- * fdt_path_offset() finds a node of a given path in the device tree.
- * Each path component may omit the unit address portion, but the
- * results of this are undefined if any such path component is
- * ambiguous (that is if there are multiple nodes at the relevant
- * level matching the given component, differentiated only by unit
- * address).
- *
- * returns:
- *	structure block offset of the node with the requested path (>=0), on success
- *	-FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
- *	-FDT_ERR_NOTFOUND, if the requested node does not exist
- *      -FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings.
- */
-int fdt_path_offset(const void *fdt, const char *path);
-
-/**
- * fdt_get_name - retrieve the name of a given node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: structure block offset of the starting node
- * @lenp: pointer to an integer variable (will be overwritten) or NULL
- *
- * fdt_get_name() retrieves the name (including unit address) of the
- * device tree node at structure block offset nodeoffset.  If lenp is
- * non-NULL, the length of this name is also returned, in the integer
- * pointed to by lenp.
- *
- * returns:
- *	pointer to the node's name, on success
- *		If lenp is non-NULL, *lenp contains the length of that name (>=0)
- *	NULL, on error
- *		if lenp is non-NULL *lenp contains an error code (<0):
- *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *		-FDT_ERR_BADMAGIC,
- *		-FDT_ERR_BADVERSION,
- *		-FDT_ERR_BADSTATE, standard meanings
- */
-const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
-
-/**
- * fdt_first_property_offset - find the offset of a node's first property
- * @fdt: pointer to the device tree blob
- * @nodeoffset: structure block offset of a node
- *
- * fdt_first_property_offset() finds the first property of the node at
- * the given structure block offset.
- *
- * returns:
- *	structure block offset of the property (>=0), on success
- *	-FDT_ERR_NOTFOUND, if the requested node has no properties
- *	-FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_BEGIN_NODE tag
- *      -FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings.
- */
-int fdt_first_property_offset(const void *fdt, int nodeoffset);
-
-/**
- * fdt_next_property_offset - step through a node's properties
- * @fdt: pointer to the device tree blob
- * @offset: structure block offset of a property
- *
- * fdt_next_property_offset() finds the property immediately after the
- * one at the given structure block offset.  This will be a property
- * of the same node as the given property.
- *
- * returns:
- *	structure block offset of the next property (>=0), on success
- *	-FDT_ERR_NOTFOUND, if the given property is the last in its node
- *	-FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_PROP tag
- *      -FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings.
- */
-int fdt_next_property_offset(const void *fdt, int offset);
-
-/**
- * fdt_get_property_by_offset - retrieve the property at a given offset
- * @fdt: pointer to the device tree blob
- * @offset: offset of the property to retrieve
- * @lenp: pointer to an integer variable (will be overwritten) or NULL
- *
- * fdt_get_property_by_offset() retrieves a pointer to the
- * fdt_property structure within the device tree blob at the given
- * offset.  If lenp is non-NULL, the length of the property value is
- * also returned, in the integer pointed to by lenp.
- *
- * returns:
- *	pointer to the structure representing the property
- *		if lenp is non-NULL, *lenp contains the length of the property
- *		value (>=0)
- *	NULL, on error
- *		if lenp is non-NULL, *lenp contains an error code (<0):
- *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
- *		-FDT_ERR_BADMAGIC,
- *		-FDT_ERR_BADVERSION,
- *		-FDT_ERR_BADSTATE,
- *		-FDT_ERR_BADSTRUCTURE,
- *		-FDT_ERR_TRUNCATED, standard meanings
- */
-const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
-						      int offset,
-						      int *lenp);
-
-/**
- * fdt_get_property_namelen - find a property based on substring
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to find
- * @name: name of the property to find
- * @namelen: number of characters of name to consider
- * @lenp: pointer to an integer variable (will be overwritten) or NULL
- *
- * Identical to fdt_get_property_namelen(), but only examine the first
- * namelen characters of name for matching the property name.
- */
-const struct fdt_property *fdt_get_property_namelen(const void *fdt,
-						    int nodeoffset,
-						    const char *name,
-						    int namelen, int *lenp);
-
-/**
- * fdt_get_property - find a given property in a given node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to find
- * @name: name of the property to find
- * @lenp: pointer to an integer variable (will be overwritten) or NULL
- *
- * fdt_get_property() retrieves a pointer to the fdt_property
- * structure within the device tree blob corresponding to the property
- * named 'name' of the node at offset nodeoffset.  If lenp is
- * non-NULL, the length of the property value is also returned, in the
- * integer pointed to by lenp.
- *
- * returns:
- *	pointer to the structure representing the property
- *		if lenp is non-NULL, *lenp contains the length of the property
- *		value (>=0)
- *	NULL, on error
- *		if lenp is non-NULL, *lenp contains an error code (<0):
- *		-FDT_ERR_NOTFOUND, node does not have named property
- *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *		-FDT_ERR_BADMAGIC,
- *		-FDT_ERR_BADVERSION,
- *		-FDT_ERR_BADSTATE,
- *		-FDT_ERR_BADSTRUCTURE,
- *		-FDT_ERR_TRUNCATED, standard meanings
- */
-const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
-					    const char *name, int *lenp);
-static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
-						      const char *name,
-						      int *lenp)
-{
-	return (struct fdt_property *)(uintptr_t)
-		fdt_get_property(fdt, nodeoffset, name, lenp);
-}
-
-/**
- * fdt_getprop_by_offset - retrieve the value of a property at a given offset
- * @fdt: pointer to the device tree blob
- * @ffset: offset of the property to read
- * @namep: pointer to a string variable (will be overwritten) or NULL
- * @lenp: pointer to an integer variable (will be overwritten) or NULL
- *
- * fdt_getprop_by_offset() retrieves a pointer to the value of the
- * property at structure block offset 'offset' (this will be a pointer
- * to within the device blob itself, not a copy of the value).  If
- * lenp is non-NULL, the length of the property value is also
- * returned, in the integer pointed to by lenp.  If namep is non-NULL,
- * the property's namne will also be returned in the char * pointed to
- * by namep (this will be a pointer to within the device tree's string
- * block, not a new copy of the name).
- *
- * returns:
- *	pointer to the property's value
- *		if lenp is non-NULL, *lenp contains the length of the property
- *		value (>=0)
- *		if namep is non-NULL *namep contiains a pointer to the property
- *		name.
- *	NULL, on error
- *		if lenp is non-NULL, *lenp contains an error code (<0):
- *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
- *		-FDT_ERR_BADMAGIC,
- *		-FDT_ERR_BADVERSION,
- *		-FDT_ERR_BADSTATE,
- *		-FDT_ERR_BADSTRUCTURE,
- *		-FDT_ERR_TRUNCATED, standard meanings
- */
-const void *fdt_getprop_by_offset(const void *fdt, int offset,
-				  const char **namep, int *lenp);
-
-/**
- * fdt_getprop_namelen - get property value based on substring
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to find
- * @name: name of the property to find
- * @namelen: number of characters of name to consider
- * @lenp: pointer to an integer variable (will be overwritten) or NULL
- *
- * Identical to fdt_getprop(), but only examine the first namelen
- * characters of name for matching the property name.
- */
-const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
-				const char *name, int namelen, int *lenp);
-
-/**
- * fdt_getprop - retrieve the value of a given property
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to find
- * @name: name of the property to find
- * @lenp: pointer to an integer variable (will be overwritten) or NULL
- *
- * fdt_getprop() retrieves a pointer to the value of the property
- * named 'name' of the node at offset nodeoffset (this will be a
- * pointer to within the device blob itself, not a copy of the value).
- * If lenp is non-NULL, the length of the property value is also
- * returned, in the integer pointed to by lenp.
- *
- * returns:
- *	pointer to the property's value
- *		if lenp is non-NULL, *lenp contains the length of the property
- *		value (>=0)
- *	NULL, on error
- *		if lenp is non-NULL, *lenp contains an error code (<0):
- *		-FDT_ERR_NOTFOUND, node does not have named property
- *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *		-FDT_ERR_BADMAGIC,
- *		-FDT_ERR_BADVERSION,
- *		-FDT_ERR_BADSTATE,
- *		-FDT_ERR_BADSTRUCTURE,
- *		-FDT_ERR_TRUNCATED, standard meanings
- */
-const void *fdt_getprop(const void *fdt, int nodeoffset,
-			const char *name, int *lenp);
-static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
-				  const char *name, int *lenp)
-{
-	return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp);
-}
-
-/**
- * fdt_get_phandle - retrieve the phandle of a given node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: structure block offset of the node
- *
- * fdt_get_phandle() retrieves the phandle of the device tree node at
- * structure block offset nodeoffset.
- *
- * returns:
- *	the phandle of the node at nodeoffset, on success (!= 0, != -1)
- *	0, if the node has no phandle, or another error occurs
- */
-uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
-
-/**
- * fdt_get_alias_namelen - get alias based on substring
- * @fdt: pointer to the device tree blob
- * @name: name of the alias th look up
- * @namelen: number of characters of name to consider
- *
- * Identical to fdt_get_alias(), but only examine the first namelen
- * characters of name for matching the alias name.
- */
-const char *fdt_get_alias_namelen(const void *fdt,
-				  const char *name, int namelen);
-
-/**
- * fdt_get_alias - retreive the path referenced by a given alias
- * @fdt: pointer to the device tree blob
- * @name: name of the alias th look up
- *
- * fdt_get_alias() retrieves the value of a given alias.  That is, the
- * value of the property named 'name' in the node /aliases.
- *
- * returns:
- *	a pointer to the expansion of the alias named 'name', of it exists
- *	NULL, if the given alias or the /aliases node does not exist
- */
-const char *fdt_get_alias(const void *fdt, const char *name);
-
-/**
- * fdt_get_path - determine the full path of a node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose path to find
- * @buf: character buffer to contain the returned path (will be overwritten)
- * @buflen: size of the character buffer at buf
- *
- * fdt_get_path() computes the full path of the node at offset
- * nodeoffset, and records that path in the buffer at buf.
- *
- * NOTE: This function is expensive, as it must scan the device tree
- * structure from the start to nodeoffset.
- *
- * returns:
- *	0, on success
- *		buf contains the absolute path of the node at
- *		nodeoffset, as a NUL-terminated string.
- * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
- *	-FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
- *		characters and will not fit in the given buffer.
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
-
-/**
- * fdt_supernode_atdepth_offset - find a specific ancestor of a node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose parent to find
- * @supernodedepth: depth of the ancestor to find
- * @nodedepth: pointer to an integer variable (will be overwritten) or NULL
- *
- * fdt_supernode_atdepth_offset() finds an ancestor of the given node
- * at a specific depth from the root (where the root itself has depth
- * 0, its immediate subnodes depth 1 and so forth).  So
- *	fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
- * will always return 0, the offset of the root node.  If the node at
- * nodeoffset has depth D, then:
- *	fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
- * will return nodeoffset itself.
- *
- * NOTE: This function is expensive, as it must scan the device tree
- * structure from the start to nodeoffset.
- *
- * returns:
-
- *	structure block offset of the node at node offset's ancestor
- *		of depth supernodedepth (>=0), on success
- * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
-*	-FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of nodeoffset
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
-				 int supernodedepth, int *nodedepth);
-
-/**
- * fdt_node_depth - find the depth of a given node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose parent to find
- *
- * fdt_node_depth() finds the depth of a given node.  The root node
- * has depth 0, its immediate subnodes depth 1 and so forth.
- *
- * NOTE: This function is expensive, as it must scan the device tree
- * structure from the start to nodeoffset.
- *
- * returns:
- *	depth of the node at nodeoffset (>=0), on success
- * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_node_depth(const void *fdt, int nodeoffset);
-
-/**
- * fdt_parent_offset - find the parent of a given node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose parent to find
- *
- * fdt_parent_offset() locates the parent node of a given node (that
- * is, it finds the offset of the node which contains the node at
- * nodeoffset as a subnode).
- *
- * NOTE: This function is expensive, as it must scan the device tree
- * structure from the start to nodeoffset, *twice*.
- *
- * returns:
- *	structure block offset of the parent of the node at nodeoffset
- *		(>=0), on success
- * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_parent_offset(const void *fdt, int nodeoffset);
-
-/**
- * fdt_node_offset_by_prop_value - find nodes with a given property value
- * @fdt: pointer to the device tree blob
- * @startoffset: only find nodes after this offset
- * @propname: property name to check
- * @propval: property value to search for
- * @proplen: length of the value in propval
- *
- * fdt_node_offset_by_prop_value() returns the offset of the first
- * node after startoffset, which has a property named propname whose
- * value is of length proplen and has value equal to propval; or if
- * startoffset is -1, the very first such node in the tree.
- *
- * To iterate through all nodes matching the criterion, the following
- * idiom can be used:
- *	offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
- *					       propval, proplen);
- *	while (offset != -FDT_ERR_NOTFOUND) {
- *		// other code here
- *		offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
- *						       propval, proplen);
- *	}
- *
- * Note the -1 in the first call to the function, if 0 is used here
- * instead, the function will never locate the root node, even if it
- * matches the criterion.
- *
- * returns:
- *	structure block offset of the located node (>= 0, >startoffset),
- *		 on success
- *	-FDT_ERR_NOTFOUND, no node matching the criterion exists in the
- *		tree after startoffset
- * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
-				  const char *propname,
-				  const void *propval, int proplen);
-
-/**
- * fdt_node_offset_by_phandle - find the node with a given phandle
- * @fdt: pointer to the device tree blob
- * @phandle: phandle value
- *
- * fdt_node_offset_by_phandle() returns the offset of the node
- * which has the given phandle value.  If there is more than one node
- * in the tree with the given phandle (an invalid tree), results are
- * undefined.
- *
- * returns:
- *	structure block offset of the located node (>= 0), on success
- *	-FDT_ERR_NOTFOUND, no node with that phandle exists
- *	-FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1)
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
-
-/**
- * fdt_node_check_compatible: check a node's compatible property
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of a tree node
- * @compatible: string to match against
- *
- *
- * fdt_node_check_compatible() returns 0 if the given node contains a
- * 'compatible' property with the given string as one of its elements,
- * it returns non-zero otherwise, or on error.
- *
- * returns:
- *	0, if the node has a 'compatible' property listing the given string
- *	1, if the node has a 'compatible' property, but it does not list
- *		the given string
- *	-FDT_ERR_NOTFOUND, if the given node has no 'compatible' property
- * 	-FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_node_check_compatible(const void *fdt, int nodeoffset,
-			      const char *compatible);
-
-/**
- * fdt_node_offset_by_compatible - find nodes with a given 'compatible' value
- * @fdt: pointer to the device tree blob
- * @startoffset: only find nodes after this offset
- * @compatible: 'compatible' string to match against
- *
- * fdt_node_offset_by_compatible() returns the offset of the first
- * node after startoffset, which has a 'compatible' property which
- * lists the given compatible string; or if startoffset is -1, the
- * very first such node in the tree.
- *
- * To iterate through all nodes matching the criterion, the following
- * idiom can be used:
- *	offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
- *	while (offset != -FDT_ERR_NOTFOUND) {
- *		// other code here
- *		offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
- *	}
- *
- * Note the -1 in the first call to the function, if 0 is used here
- * instead, the function will never locate the root node, even if it
- * matches the criterion.
- *
- * returns:
- *	structure block offset of the located node (>= 0, >startoffset),
- *		 on success
- *	-FDT_ERR_NOTFOUND, no node matching the criterion exists in the
- *		tree after startoffset
- * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
-				  const char *compatible);
-
-/**********************************************************************/
-/* Write-in-place functions                                           */
-/**********************************************************************/
-
-/**
- * fdt_setprop_inplace - change a property's value, but not its size
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to change
- * @name: name of the property to change
- * @val: pointer to data to replace the property value with
- * @len: length of the property value
- *
- * fdt_setprop_inplace() replaces the value of a given property with
- * the data in val, of length len.  This function cannot change the
- * size of a property, and so will only work if len is equal to the
- * current length of the property.
- *
- * This function will alter only the bytes in the blob which contain
- * the given property value, and will not alter or move any other part
- * of the tree.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOSPACE, if len is not equal to the property's current length
- *	-FDT_ERR_NOTFOUND, node does not have the named property
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
-			const void *val, int len);
-
-/**
- * fdt_setprop_inplace_cell - change the value of a single-cell property
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to change
- * @name: name of the property to change
- * @val: cell (32-bit integer) value to replace the property with
- *
- * fdt_setprop_inplace_cell() replaces the value of a given property
- * with the 32-bit integer cell value in val, converting val to
- * big-endian if necessary.  This function cannot change the size of a
- * property, and so will only work if the property already exists and
- * has length 4.
- *
- * This function will alter only the bytes in the blob which contain
- * the given property value, and will not alter or move any other part
- * of the tree.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOSPACE, if the property's length is not equal to 4
-  *	-FDT_ERR_NOTFOUND, node does not have the named property
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
-					   const char *name, uint32_t val)
-{
-	val = cpu_to_fdt32(val);
-	return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
-}
-
-/**
- * fdt_nop_property - replace a property with nop tags
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to nop
- * @name: name of the property to nop
- *
- * fdt_nop_property() will replace a given property's representation
- * in the blob with FDT_NOP tags, effectively removing it from the
- * tree.
- *
- * This function will alter only the bytes in the blob which contain
- * the property, and will not alter or move any other part of the
- * tree.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOTFOUND, node does not have the named property
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
-
-/**
- * fdt_nop_node - replace a node (subtree) with nop tags
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node to nop
- *
- * fdt_nop_node() will replace a given node's representation in the
- * blob, including all its subnodes, if any, with FDT_NOP tags,
- * effectively removing it from the tree.
- *
- * This function will alter only the bytes in the blob which contain
- * the node and its properties and subnodes, and will not alter or
- * move any other part of the tree.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_nop_node(void *fdt, int nodeoffset);
-
-/**********************************************************************/
-/* Sequential write functions                                         */
-/**********************************************************************/
-
-int fdt_create(void *buf, int bufsize);
-int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
-int fdt_finish_reservemap(void *fdt);
-int fdt_begin_node(void *fdt, const char *name);
-int fdt_property(void *fdt, const char *name, const void *val, int len);
-static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
-{
-	val = cpu_to_fdt32(val);
-	return fdt_property(fdt, name, &val, sizeof(val));
-}
-#define fdt_property_string(fdt, name, str) \
-	fdt_property(fdt, name, str, strlen(str)+1)
-int fdt_end_node(void *fdt);
-int fdt_finish(void *fdt);
-
-/**********************************************************************/
-/* Read-write functions                                               */
-/**********************************************************************/
-
-int fdt_open_into(const void *fdt, void *buf, int bufsize);
-int fdt_pack(void *fdt);
-
-/**
- * fdt_add_mem_rsv - add one memory reserve map entry
- * @fdt: pointer to the device tree blob
- * @address, @size: 64-bit values (native endian)
- *
- * Adds a reserve map entry to the given blob reserving a region at
- * address address of length size.
- *
- * This function will insert data into the reserve map and will
- * therefore change the indexes of some entries in the table.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
- *		contain the new reservation entry
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
-
-/**
- * fdt_del_mem_rsv - remove a memory reserve map entry
- * @fdt: pointer to the device tree blob
- * @n: entry to remove
- *
- * fdt_del_mem_rsv() removes the n-th memory reserve map entry from
- * the blob.
- *
- * This function will delete data from the reservation table and will
- * therefore change the indexes of some entries in the table.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOTFOUND, there is no entry of the given index (i.e. there
- *		are less than n+1 reserve map entries)
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_del_mem_rsv(void *fdt, int n);
-
-/**
- * fdt_set_name - change the name of a given node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: structure block offset of a node
- * @name: name to give the node
- *
- * fdt_set_name() replaces the name (including unit address, if any)
- * of the given node with the given string.  NOTE: this function can't
- * efficiently check if the new name is unique amongst the given
- * node's siblings; results are undefined if this function is invoked
- * with a name equal to one of the given node's siblings.
- *
- * This function may insert or delete data from the blob, and will
- * therefore change the offsets of some existing nodes.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob
- *		to contain the new name
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE, standard meanings
- */
-int fdt_set_name(void *fdt, int nodeoffset, const char *name);
-
-/**
- * fdt_setprop - create or change a property
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to change
- * @name: name of the property to change
- * @val: pointer to data to set the property value to
- * @len: length of the property value
- *
- * fdt_setprop() sets the value of the named property in the given
- * node to the given value and length, creating the property if it
- * does not already exist.
- *
- * This function may insert or delete data from the blob, and will
- * therefore change the offsets of some existing nodes.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
- *		contain the new property value
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_setprop(void *fdt, int nodeoffset, const char *name,
-		const void *val, int len);
-
-/**
- * fdt_setprop_cell - set a property to a single cell value
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to change
- * @name: name of the property to change
- * @val: 32-bit integer value for the property (native endian)
- *
- * fdt_setprop_cell() sets the value of the named property in the
- * given node to the given cell value (converting to big-endian if
- * necessary), or creates a new property with that value if it does
- * not already exist.
- *
- * This function may insert or delete data from the blob, and will
- * therefore change the offsets of some existing nodes.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
- *		contain the new property value
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
-				   uint32_t val)
-{
-	val = cpu_to_fdt32(val);
-	return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
-}
-
-/**
- * fdt_setprop_string - set a property to a string value
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to change
- * @name: name of the property to change
- * @str: string value for the property
- *
- * fdt_setprop_string() sets the value of the named property in the
- * given node to the given string value (using the length of the
- * string to determine the new length of the property), or creates a
- * new property with that value if it does not already exist.
- *
- * This function may insert or delete data from the blob, and will
- * therefore change the offsets of some existing nodes.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
- *		contain the new property value
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-#define fdt_setprop_string(fdt, nodeoffset, name, str) \
-	fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
-
-/**
- * fdt_delprop - delete a property
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to nop
- * @name: name of the property to nop
- *
- * fdt_del_property() will delete the given property.
- *
- * This function will delete data from the blob, and will therefore
- * change the offsets of some existing nodes.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOTFOUND, node does not have the named property
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_delprop(void *fdt, int nodeoffset, const char *name);
-
-/**
- * fdt_add_subnode_namelen - creates a new node based on substring
- * @fdt: pointer to the device tree blob
- * @parentoffset: structure block offset of a node
- * @name: name of the subnode to locate
- * @namelen: number of characters of name to consider
- *
- * Identical to fdt_add_subnode(), but use only the first namelen
- * characters of name as the name of the new node.  This is useful for
- * creating subnodes based on a portion of a larger string, such as a
- * full path.
- */
-int fdt_add_subnode_namelen(void *fdt, int parentoffset,
-			    const char *name, int namelen);
-
-/**
- * fdt_add_subnode - creates a new node
- * @fdt: pointer to the device tree blob
- * @parentoffset: structure block offset of a node
- * @name: name of the subnode to locate
- *
- * fdt_add_subnode() creates a new node as a subnode of the node at
- * structure block offset parentoffset, with the given name (which
- * should include the unit address, if any).
- *
- * This function will insert data into the blob, and will therefore
- * change the offsets of some existing nodes.
-
- * returns:
- *	structure block offset of the created nodeequested subnode (>=0), on success
- *	-FDT_ERR_NOTFOUND, if the requested subnode does not exist
- *	-FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
- *	-FDT_ERR_EXISTS, if the node at parentoffset already has a subnode of
- *		the given name
- *	-FDT_ERR_NOSPACE, if there is insufficient free space in the
- *		blob to contain the new node
- *	-FDT_ERR_NOSPACE
- *	-FDT_ERR_BADLAYOUT
- *      -FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings.
- */
-int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
-
-/**
- * fdt_del_node - delete a node (subtree)
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node to nop
- *
- * fdt_del_node() will remove the given node, including all its
- * subnodes if any, from the blob.
- *
- * This function will delete data from the blob, and will therefore
- * change the offsets of some existing nodes.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_del_node(void *fdt, int nodeoffset);
-
-/**********************************************************************/
-/* Debugging / informational functions                                */
-/**********************************************************************/
-
-const char *fdt_strerror(int errval);
-
-#endif /* _LIBFDT_H */
diff -r 777658bb5eb9 -r d9ca8249409d xen/common/libfdt/libfdt_env.h
--- a/xen/common/libfdt/libfdt_env.h	Thu Mar 22 14:26:41 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-#ifndef _LIBFDT_ENV_H
-#define _LIBFDT_ENV_H
-
-#include <xen/config.h>
-#include <xen/types.h>
-#include <xen/string.h>
-#include <asm/byteorder.h>
-
-#define fdt16_to_cpu(x) be16_to_cpu(x)
-#define cpu_to_fdt16(x) cpu_to_be16(x)
-#define fdt32_to_cpu(x) be32_to_cpu(x)
-#define cpu_to_fdt32(x) cpu_to_be32(x)
-#define fdt64_to_cpu(x) be64_to_cpu(x)
-#define cpu_to_fdt64(x) cpu_to_be64(x)
-
-#endif /* _LIBFDT_ENV_H */
diff -r 777658bb5eb9 -r d9ca8249409d xen/include/xen/libfdt/fdt.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/xen/libfdt/fdt.h	Thu Mar 22 14:26:42 2012 +0000
@@ -0,0 +1,60 @@
+#ifndef _FDT_H
+#define _FDT_H
+
+#ifndef __ASSEMBLY__
+
+struct fdt_header {
+	uint32_t magic;			 /* magic word FDT_MAGIC */
+	uint32_t totalsize;		 /* total size of DT block */
+	uint32_t off_dt_struct;		 /* offset to structure */
+	uint32_t off_dt_strings;	 /* offset to strings */
+	uint32_t off_mem_rsvmap;	 /* offset to memory reserve map */
+	uint32_t version;		 /* format version */
+	uint32_t last_comp_version;	 /* last compatible version */
+
+	/* version 2 fields below */
+	uint32_t boot_cpuid_phys;	 /* Which physical CPU id we're
+					    booting on */
+	/* version 3 fields below */
+	uint32_t size_dt_strings;	 /* size of the strings block */
+
+	/* version 17 fields below */
+	uint32_t size_dt_struct;	 /* size of the structure block */
+};
+
+struct fdt_reserve_entry {
+	uint64_t address;
+	uint64_t size;
+};
+
+struct fdt_node_header {
+	uint32_t tag;
+	char name[0];
+};
+
+struct fdt_property {
+	uint32_t tag;
+	uint32_t len;
+	uint32_t nameoff;
+	char data[0];
+};
+
+#endif /* !__ASSEMBLY */
+
+#define FDT_MAGIC	0xd00dfeed	/* 4: version, 4: total size */
+#define FDT_TAGSIZE	sizeof(uint32_t)
+
+#define FDT_BEGIN_NODE	0x1		/* Start node: full name */
+#define FDT_END_NODE	0x2		/* End node */
+#define FDT_PROP	0x3		/* Property: name off,
+					   size, content */
+#define FDT_NOP		0x4		/* nop */
+#define FDT_END		0x9
+
+#define FDT_V1_SIZE	(7*sizeof(uint32_t))
+#define FDT_V2_SIZE	(FDT_V1_SIZE + sizeof(uint32_t))
+#define FDT_V3_SIZE	(FDT_V2_SIZE + sizeof(uint32_t))
+#define FDT_V16_SIZE	FDT_V3_SIZE
+#define FDT_V17_SIZE	(FDT_V16_SIZE + sizeof(uint32_t))
+
+#endif /* _FDT_H */
diff -r 777658bb5eb9 -r d9ca8249409d xen/include/xen/libfdt/libfdt.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/xen/libfdt/libfdt.h	Thu Mar 22 14:26:42 2012 +0000
@@ -0,0 +1,1235 @@
+#ifndef _LIBFDT_H
+#define _LIBFDT_H
+/*
+ * libfdt - Flat Device Tree manipulation
+ * Copyright (C) 2006 David Gibson, IBM Corporation.
+ *
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ *
+ *  a) This library 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 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 General Public License for more details.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <xen/libfdt/libfdt_env.h>
+#include <xen/libfdt/fdt.h>
+
+#define FDT_FIRST_SUPPORTED_VERSION	0x10
+#define FDT_LAST_SUPPORTED_VERSION	0x11
+
+/* Error codes: informative error codes */
+#define FDT_ERR_NOTFOUND	1
+	/* FDT_ERR_NOTFOUND: The requested node or property does not exist */
+#define FDT_ERR_EXISTS		2
+	/* FDT_ERR_EXISTS: Attemped to create a node or property which
+	 * already exists */
+#define FDT_ERR_NOSPACE		3
+	/* FDT_ERR_NOSPACE: Operation needed to expand the device
+	 * tree, but its buffer did not have sufficient space to
+	 * contain the expanded tree. Use fdt_open_into() to move the
+	 * device tree to a buffer with more space. */
+
+/* Error codes: codes for bad parameters */
+#define FDT_ERR_BADOFFSET	4
+	/* FDT_ERR_BADOFFSET: Function was passed a structure block
+	 * offset which is out-of-bounds, or which points to an
+	 * unsuitable part of the structure for the operation. */
+#define FDT_ERR_BADPATH		5
+	/* FDT_ERR_BADPATH: Function was passed a badly formatted path
+	 * (e.g. missing a leading / for a function which requires an
+	 * absolute path) */
+#define FDT_ERR_BADPHANDLE	6
+	/* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle
+	 * value.  phandle values of 0 and -1 are not permitted. */
+#define FDT_ERR_BADSTATE	7
+	/* FDT_ERR_BADSTATE: Function was passed an incomplete device
+	 * tree created by the sequential-write functions, which is
+	 * not sufficiently complete for the requested operation. */
+
+/* Error codes: codes for bad device tree blobs */
+#define FDT_ERR_TRUNCATED	8
+	/* FDT_ERR_TRUNCATED: Structure block of the given device tree
+	 * ends without an FDT_END tag. */
+#define FDT_ERR_BADMAGIC	9
+	/* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a
+	 * device tree at all - it is missing the flattened device
+	 * tree magic number. */
+#define FDT_ERR_BADVERSION	10
+	/* FDT_ERR_BADVERSION: Given device tree has a version which
+	 * can't be handled by the requested operation.  For
+	 * read-write functions, this may mean that fdt_open_into() is
+	 * required to convert the tree to the expected version. */
+#define FDT_ERR_BADSTRUCTURE	11
+	/* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt
+	 * structure block or other serious error (e.g. misnested
+	 * nodes, or subnodes preceding properties). */
+#define FDT_ERR_BADLAYOUT	12
+	/* FDT_ERR_BADLAYOUT: For read-write functions, the given
+	 * device tree has it's sub-blocks in an order that the
+	 * function can't handle (memory reserve map, then structure,
+	 * then strings).  Use fdt_open_into() to reorganize the tree
+	 * into a form suitable for the read-write operations. */
+
+/* "Can't happen" error indicating a bug in libfdt */
+#define FDT_ERR_INTERNAL	13
+	/* FDT_ERR_INTERNAL: libfdt has failed an internal assertion.
+	 * Should never be returned, if it is, it indicates a bug in
+	 * libfdt itself. */
+
+#define FDT_ERR_MAX		13
+
+/**********************************************************************/
+/* Low-level functions (you probably don't need these)                */
+/**********************************************************************/
+
+const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
+static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
+{
+	return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen);
+}
+
+uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
+
+/**********************************************************************/
+/* Traversal functions                                                */
+/**********************************************************************/
+
+int fdt_next_node(const void *fdt, int offset, int *depth);
+
+/**********************************************************************/
+/* General functions                                                  */
+/**********************************************************************/
+
+#define fdt_get_header(fdt, field) \
+	(fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
+#define fdt_magic(fdt) 			(fdt_get_header(fdt, magic))
+#define fdt_totalsize(fdt)		(fdt_get_header(fdt, totalsize))
+#define fdt_off_dt_struct(fdt)		(fdt_get_header(fdt, off_dt_struct))
+#define fdt_off_dt_strings(fdt)		(fdt_get_header(fdt, off_dt_strings))
+#define fdt_off_mem_rsvmap(fdt)		(fdt_get_header(fdt, off_mem_rsvmap))
+#define fdt_version(fdt)		(fdt_get_header(fdt, version))
+#define fdt_last_comp_version(fdt) 	(fdt_get_header(fdt, last_comp_version))
+#define fdt_boot_cpuid_phys(fdt) 	(fdt_get_header(fdt, boot_cpuid_phys))
+#define fdt_size_dt_strings(fdt) 	(fdt_get_header(fdt, size_dt_strings))
+#define fdt_size_dt_struct(fdt)		(fdt_get_header(fdt, size_dt_struct))
+
+#define __fdt_set_hdr(name) \
+	static inline void fdt_set_##name(void *fdt, uint32_t val) \
+	{ \
+		struct fdt_header *fdth = (struct fdt_header*)fdt; \
+		fdth->name = cpu_to_fdt32(val); \
+	}
+__fdt_set_hdr(magic);
+__fdt_set_hdr(totalsize);
+__fdt_set_hdr(off_dt_struct);
+__fdt_set_hdr(off_dt_strings);
+__fdt_set_hdr(off_mem_rsvmap);
+__fdt_set_hdr(version);
+__fdt_set_hdr(last_comp_version);
+__fdt_set_hdr(boot_cpuid_phys);
+__fdt_set_hdr(size_dt_strings);
+__fdt_set_hdr(size_dt_struct);
+#undef __fdt_set_hdr
+
+/**
+ * fdt_check_header - sanity check a device tree or possible device tree
+ * @fdt: pointer to data which might be a flattened device tree
+ *
+ * fdt_check_header() checks that the given buffer contains what
+ * appears to be a flattened device tree with sane information in its
+ * header.
+ *
+ * returns:
+ *     0, if the buffer appears to contain a valid device tree
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE, standard meanings, as above
+ */
+int fdt_check_header(const void *fdt);
+
+/**
+ * fdt_move - move a device tree around in memory
+ * @fdt: pointer to the device tree to move
+ * @buf: pointer to memory where the device is to be moved
+ * @bufsize: size of the memory space at buf
+ *
+ * fdt_move() relocates, if possible, the device tree blob located at
+ * fdt to the buffer at buf of size bufsize.  The buffer may overlap
+ * with the existing device tree blob at fdt.  Therefore,
+ *     fdt_move(fdt, fdt, fdt_totalsize(fdt))
+ * should always succeed.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE, standard meanings
+ */
+int fdt_move(const void *fdt, void *buf, int bufsize);
+
+/**********************************************************************/
+/* Read-only functions                                                */
+/**********************************************************************/
+
+/**
+ * fdt_string - retrieve a string from the strings block of a device tree
+ * @fdt: pointer to the device tree blob
+ * @stroffset: offset of the string within the strings block (native endian)
+ *
+ * fdt_string() retrieves a pointer to a single string from the
+ * strings block of the device tree blob at fdt.
+ *
+ * returns:
+ *     a pointer to the string, on success
+ *     NULL, if stroffset is out of bounds
+ */
+const char *fdt_string(const void *fdt, int stroffset);
+
+/**
+ * fdt_num_mem_rsv - retrieve the number of memory reserve map entries
+ * @fdt: pointer to the device tree blob
+ *
+ * Returns the number of entries in the device tree blob's memory
+ * reservation map.  This does not include the terminating 0,0 entry
+ * or any other (0,0) entries reserved for expansion.
+ *
+ * returns:
+ *     the number of entries
+ */
+int fdt_num_mem_rsv(const void *fdt);
+
+/**
+ * fdt_get_mem_rsv - retrieve one memory reserve map entry
+ * @fdt: pointer to the device tree blob
+ * @address, @size: pointers to 64-bit variables
+ *
+ * On success, *address and *size will contain the address and size of
+ * the n-th reserve map entry from the device tree blob, in
+ * native-endian format.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE, standard meanings
+ */
+int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
+
+/**
+ * fdt_subnode_offset_namelen - find a subnode based on substring
+ * @fdt: pointer to the device tree blob
+ * @parentoffset: structure block offset of a node
+ * @name: name of the subnode to locate
+ * @namelen: number of characters of name to consider
+ *
+ * Identical to fdt_subnode_offset(), but only examine the first
+ * namelen characters of name for matching the subnode name.  This is
+ * useful for finding subnodes based on a portion of a larger string,
+ * such as a full path.
+ */
+int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
+			       const char *name, int namelen);
+/**
+ * fdt_subnode_offset - find a subnode of a given node
+ * @fdt: pointer to the device tree blob
+ * @parentoffset: structure block offset of a node
+ * @name: name of the subnode to locate
+ *
+ * fdt_subnode_offset() finds a subnode of the node at structure block
+ * offset parentoffset with the given name.  name may include a unit
+ * address, in which case fdt_subnode_offset() will find the subnode
+ * with that unit address, or the unit address may be omitted, in
+ * which case fdt_subnode_offset() will find an arbitrary subnode
+ * whose name excluding unit address matches the given name.
+ *
+ * returns:
+ *	structure block offset of the requested subnode (>=0), on success
+ *	-FDT_ERR_NOTFOUND, if the requested subnode does not exist
+ *	-FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
+ *      -FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
+
+/**
+ * fdt_path_offset - find a tree node by its full path
+ * @fdt: pointer to the device tree blob
+ * @path: full path of the node to locate
+ *
+ * fdt_path_offset() finds a node of a given path in the device tree.
+ * Each path component may omit the unit address portion, but the
+ * results of this are undefined if any such path component is
+ * ambiguous (that is if there are multiple nodes at the relevant
+ * level matching the given component, differentiated only by unit
+ * address).
+ *
+ * returns:
+ *	structure block offset of the node with the requested path (>=0), on success
+ *	-FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
+ *	-FDT_ERR_NOTFOUND, if the requested node does not exist
+ *      -FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_path_offset(const void *fdt, const char *path);
+
+/**
+ * fdt_get_name - retrieve the name of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: structure block offset of the starting node
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_get_name() retrieves the name (including unit address) of the
+ * device tree node at structure block offset nodeoffset.  If lenp is
+ * non-NULL, the length of this name is also returned, in the integer
+ * pointed to by lenp.
+ *
+ * returns:
+ *	pointer to the node's name, on success
+ *		If lenp is non-NULL, *lenp contains the length of that name (>=0)
+ *	NULL, on error
+ *		if lenp is non-NULL *lenp contains an error code (<0):
+ *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *		-FDT_ERR_BADMAGIC,
+ *		-FDT_ERR_BADVERSION,
+ *		-FDT_ERR_BADSTATE, standard meanings
+ */
+const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
+
+/**
+ * fdt_first_property_offset - find the offset of a node's first property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: structure block offset of a node
+ *
+ * fdt_first_property_offset() finds the first property of the node at
+ * the given structure block offset.
+ *
+ * returns:
+ *	structure block offset of the property (>=0), on success
+ *	-FDT_ERR_NOTFOUND, if the requested node has no properties
+ *	-FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_BEGIN_NODE tag
+ *      -FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_first_property_offset(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_next_property_offset - step through a node's properties
+ * @fdt: pointer to the device tree blob
+ * @offset: structure block offset of a property
+ *
+ * fdt_next_property_offset() finds the property immediately after the
+ * one at the given structure block offset.  This will be a property
+ * of the same node as the given property.
+ *
+ * returns:
+ *	structure block offset of the next property (>=0), on success
+ *	-FDT_ERR_NOTFOUND, if the given property is the last in its node
+ *	-FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_PROP tag
+ *      -FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_next_property_offset(const void *fdt, int offset);
+
+/**
+ * fdt_get_property_by_offset - retrieve the property at a given offset
+ * @fdt: pointer to the device tree blob
+ * @offset: offset of the property to retrieve
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_get_property_by_offset() retrieves a pointer to the
+ * fdt_property structure within the device tree blob at the given
+ * offset.  If lenp is non-NULL, the length of the property value is
+ * also returned, in the integer pointed to by lenp.
+ *
+ * returns:
+ *	pointer to the structure representing the property
+ *		if lenp is non-NULL, *lenp contains the length of the property
+ *		value (>=0)
+ *	NULL, on error
+ *		if lenp is non-NULL, *lenp contains an error code (<0):
+ *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
+ *		-FDT_ERR_BADMAGIC,
+ *		-FDT_ERR_BADVERSION,
+ *		-FDT_ERR_BADSTATE,
+ *		-FDT_ERR_BADSTRUCTURE,
+ *		-FDT_ERR_TRUNCATED, standard meanings
+ */
+const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
+						      int offset,
+						      int *lenp);
+
+/**
+ * fdt_get_property_namelen - find a property based on substring
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @namelen: number of characters of name to consider
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * Identical to fdt_get_property_namelen(), but only examine the first
+ * namelen characters of name for matching the property name.
+ */
+const struct fdt_property *fdt_get_property_namelen(const void *fdt,
+						    int nodeoffset,
+						    const char *name,
+						    int namelen, int *lenp);
+
+/**
+ * fdt_get_property - find a given property in a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_get_property() retrieves a pointer to the fdt_property
+ * structure within the device tree blob corresponding to the property
+ * named 'name' of the node at offset nodeoffset.  If lenp is
+ * non-NULL, the length of the property value is also returned, in the
+ * integer pointed to by lenp.
+ *
+ * returns:
+ *	pointer to the structure representing the property
+ *		if lenp is non-NULL, *lenp contains the length of the property
+ *		value (>=0)
+ *	NULL, on error
+ *		if lenp is non-NULL, *lenp contains an error code (<0):
+ *		-FDT_ERR_NOTFOUND, node does not have named property
+ *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *		-FDT_ERR_BADMAGIC,
+ *		-FDT_ERR_BADVERSION,
+ *		-FDT_ERR_BADSTATE,
+ *		-FDT_ERR_BADSTRUCTURE,
+ *		-FDT_ERR_TRUNCATED, standard meanings
+ */
+const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
+					    const char *name, int *lenp);
+static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
+						      const char *name,
+						      int *lenp)
+{
+	return (struct fdt_property *)(uintptr_t)
+		fdt_get_property(fdt, nodeoffset, name, lenp);
+}
+
+/**
+ * fdt_getprop_by_offset - retrieve the value of a property at a given offset
+ * @fdt: pointer to the device tree blob
+ * @ffset: offset of the property to read
+ * @namep: pointer to a string variable (will be overwritten) or NULL
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_getprop_by_offset() retrieves a pointer to the value of the
+ * property at structure block offset 'offset' (this will be a pointer
+ * to within the device blob itself, not a copy of the value).  If
+ * lenp is non-NULL, the length of the property value is also
+ * returned, in the integer pointed to by lenp.  If namep is non-NULL,
+ * the property's namne will also be returned in the char * pointed to
+ * by namep (this will be a pointer to within the device tree's string
+ * block, not a new copy of the name).
+ *
+ * returns:
+ *	pointer to the property's value
+ *		if lenp is non-NULL, *lenp contains the length of the property
+ *		value (>=0)
+ *		if namep is non-NULL *namep contiains a pointer to the property
+ *		name.
+ *	NULL, on error
+ *		if lenp is non-NULL, *lenp contains an error code (<0):
+ *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
+ *		-FDT_ERR_BADMAGIC,
+ *		-FDT_ERR_BADVERSION,
+ *		-FDT_ERR_BADSTATE,
+ *		-FDT_ERR_BADSTRUCTURE,
+ *		-FDT_ERR_TRUNCATED, standard meanings
+ */
+const void *fdt_getprop_by_offset(const void *fdt, int offset,
+				  const char **namep, int *lenp);
+
+/**
+ * fdt_getprop_namelen - get property value based on substring
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @namelen: number of characters of name to consider
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * Identical to fdt_getprop(), but only examine the first namelen
+ * characters of name for matching the property name.
+ */
+const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
+				const char *name, int namelen, int *lenp);
+
+/**
+ * fdt_getprop - retrieve the value of a given property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_getprop() retrieves a pointer to the value of the property
+ * named 'name' of the node at offset nodeoffset (this will be a
+ * pointer to within the device blob itself, not a copy of the value).
+ * If lenp is non-NULL, the length of the property value is also
+ * returned, in the integer pointed to by lenp.
+ *
+ * returns:
+ *	pointer to the property's value
+ *		if lenp is non-NULL, *lenp contains the length of the property
+ *		value (>=0)
+ *	NULL, on error
+ *		if lenp is non-NULL, *lenp contains an error code (<0):
+ *		-FDT_ERR_NOTFOUND, node does not have named property
+ *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *		-FDT_ERR_BADMAGIC,
+ *		-FDT_ERR_BADVERSION,
+ *		-FDT_ERR_BADSTATE,
+ *		-FDT_ERR_BADSTRUCTURE,
+ *		-FDT_ERR_TRUNCATED, standard meanings
+ */
+const void *fdt_getprop(const void *fdt, int nodeoffset,
+			const char *name, int *lenp);
+static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
+				  const char *name, int *lenp)
+{
+	return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp);
+}
+
+/**
+ * fdt_get_phandle - retrieve the phandle of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: structure block offset of the node
+ *
+ * fdt_get_phandle() retrieves the phandle of the device tree node at
+ * structure block offset nodeoffset.
+ *
+ * returns:
+ *	the phandle of the node at nodeoffset, on success (!= 0, != -1)
+ *	0, if the node has no phandle, or another error occurs
+ */
+uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_get_alias_namelen - get alias based on substring
+ * @fdt: pointer to the device tree blob
+ * @name: name of the alias th look up
+ * @namelen: number of characters of name to consider
+ *
+ * Identical to fdt_get_alias(), but only examine the first namelen
+ * characters of name for matching the alias name.
+ */
+const char *fdt_get_alias_namelen(const void *fdt,
+				  const char *name, int namelen);
+
+/**
+ * fdt_get_alias - retreive the path referenced by a given alias
+ * @fdt: pointer to the device tree blob
+ * @name: name of the alias th look up
+ *
+ * fdt_get_alias() retrieves the value of a given alias.  That is, the
+ * value of the property named 'name' in the node /aliases.
+ *
+ * returns:
+ *	a pointer to the expansion of the alias named 'name', of it exists
+ *	NULL, if the given alias or the /aliases node does not exist
+ */
+const char *fdt_get_alias(const void *fdt, const char *name);
+
+/**
+ * fdt_get_path - determine the full path of a node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose path to find
+ * @buf: character buffer to contain the returned path (will be overwritten)
+ * @buflen: size of the character buffer at buf
+ *
+ * fdt_get_path() computes the full path of the node at offset
+ * nodeoffset, and records that path in the buffer at buf.
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset.
+ *
+ * returns:
+ *	0, on success
+ *		buf contains the absolute path of the node at
+ *		nodeoffset, as a NUL-terminated string.
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
+ *		characters and will not fit in the given buffer.
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
+
+/**
+ * fdt_supernode_atdepth_offset - find a specific ancestor of a node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose parent to find
+ * @supernodedepth: depth of the ancestor to find
+ * @nodedepth: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_supernode_atdepth_offset() finds an ancestor of the given node
+ * at a specific depth from the root (where the root itself has depth
+ * 0, its immediate subnodes depth 1 and so forth).  So
+ *	fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
+ * will always return 0, the offset of the root node.  If the node at
+ * nodeoffset has depth D, then:
+ *	fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
+ * will return nodeoffset itself.
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset.
+ *
+ * returns:
+
+ *	structure block offset of the node at node offset's ancestor
+ *		of depth supernodedepth (>=0), on success
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+*	-FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of nodeoffset
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
+				 int supernodedepth, int *nodedepth);
+
+/**
+ * fdt_node_depth - find the depth of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose parent to find
+ *
+ * fdt_node_depth() finds the depth of a given node.  The root node
+ * has depth 0, its immediate subnodes depth 1 and so forth.
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset.
+ *
+ * returns:
+ *	depth of the node at nodeoffset (>=0), on success
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_depth(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_parent_offset - find the parent of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose parent to find
+ *
+ * fdt_parent_offset() locates the parent node of a given node (that
+ * is, it finds the offset of the node which contains the node at
+ * nodeoffset as a subnode).
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset, *twice*.
+ *
+ * returns:
+ *	structure block offset of the parent of the node at nodeoffset
+ *		(>=0), on success
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_parent_offset(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_node_offset_by_prop_value - find nodes with a given property value
+ * @fdt: pointer to the device tree blob
+ * @startoffset: only find nodes after this offset
+ * @propname: property name to check
+ * @propval: property value to search for
+ * @proplen: length of the value in propval
+ *
+ * fdt_node_offset_by_prop_value() returns the offset of the first
+ * node after startoffset, which has a property named propname whose
+ * value is of length proplen and has value equal to propval; or if
+ * startoffset is -1, the very first such node in the tree.
+ *
+ * To iterate through all nodes matching the criterion, the following
+ * idiom can be used:
+ *	offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
+ *					       propval, proplen);
+ *	while (offset != -FDT_ERR_NOTFOUND) {
+ *		// other code here
+ *		offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
+ *						       propval, proplen);
+ *	}
+ *
+ * Note the -1 in the first call to the function, if 0 is used here
+ * instead, the function will never locate the root node, even if it
+ * matches the criterion.
+ *
+ * returns:
+ *	structure block offset of the located node (>= 0, >startoffset),
+ *		 on success
+ *	-FDT_ERR_NOTFOUND, no node matching the criterion exists in the
+ *		tree after startoffset
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
+				  const char *propname,
+				  const void *propval, int proplen);
+
+/**
+ * fdt_node_offset_by_phandle - find the node with a given phandle
+ * @fdt: pointer to the device tree blob
+ * @phandle: phandle value
+ *
+ * fdt_node_offset_by_phandle() returns the offset of the node
+ * which has the given phandle value.  If there is more than one node
+ * in the tree with the given phandle (an invalid tree), results are
+ * undefined.
+ *
+ * returns:
+ *	structure block offset of the located node (>= 0), on success
+ *	-FDT_ERR_NOTFOUND, no node with that phandle exists
+ *	-FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1)
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
+
+/**
+ * fdt_node_check_compatible: check a node's compatible property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of a tree node
+ * @compatible: string to match against
+ *
+ *
+ * fdt_node_check_compatible() returns 0 if the given node contains a
+ * 'compatible' property with the given string as one of its elements,
+ * it returns non-zero otherwise, or on error.
+ *
+ * returns:
+ *	0, if the node has a 'compatible' property listing the given string
+ *	1, if the node has a 'compatible' property, but it does not list
+ *		the given string
+ *	-FDT_ERR_NOTFOUND, if the given node has no 'compatible' property
+ * 	-FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_check_compatible(const void *fdt, int nodeoffset,
+			      const char *compatible);
+
+/**
+ * fdt_node_offset_by_compatible - find nodes with a given 'compatible' value
+ * @fdt: pointer to the device tree blob
+ * @startoffset: only find nodes after this offset
+ * @compatible: 'compatible' string to match against
+ *
+ * fdt_node_offset_by_compatible() returns the offset of the first
+ * node after startoffset, which has a 'compatible' property which
+ * lists the given compatible string; or if startoffset is -1, the
+ * very first such node in the tree.
+ *
+ * To iterate through all nodes matching the criterion, the following
+ * idiom can be used:
+ *	offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
+ *	while (offset != -FDT_ERR_NOTFOUND) {
+ *		// other code here
+ *		offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
+ *	}
+ *
+ * Note the -1 in the first call to the function, if 0 is used here
+ * instead, the function will never locate the root node, even if it
+ * matches the criterion.
+ *
+ * returns:
+ *	structure block offset of the located node (>= 0, >startoffset),
+ *		 on success
+ *	-FDT_ERR_NOTFOUND, no node matching the criterion exists in the
+ *		tree after startoffset
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
+				  const char *compatible);
+
+/**********************************************************************/
+/* Write-in-place functions                                           */
+/**********************************************************************/
+
+/**
+ * fdt_setprop_inplace - change a property's value, but not its size
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: pointer to data to replace the property value with
+ * @len: length of the property value
+ *
+ * fdt_setprop_inplace() replaces the value of a given property with
+ * the data in val, of length len.  This function cannot change the
+ * size of a property, and so will only work if len is equal to the
+ * current length of the property.
+ *
+ * This function will alter only the bytes in the blob which contain
+ * the given property value, and will not alter or move any other part
+ * of the tree.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOSPACE, if len is not equal to the property's current length
+ *	-FDT_ERR_NOTFOUND, node does not have the named property
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
+			const void *val, int len);
+
+/**
+ * fdt_setprop_inplace_cell - change the value of a single-cell property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: cell (32-bit integer) value to replace the property with
+ *
+ * fdt_setprop_inplace_cell() replaces the value of a given property
+ * with the 32-bit integer cell value in val, converting val to
+ * big-endian if necessary.  This function cannot change the size of a
+ * property, and so will only work if the property already exists and
+ * has length 4.
+ *
+ * This function will alter only the bytes in the blob which contain
+ * the given property value, and will not alter or move any other part
+ * of the tree.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOSPACE, if the property's length is not equal to 4
+  *	-FDT_ERR_NOTFOUND, node does not have the named property
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
+					   const char *name, uint32_t val)
+{
+	val = cpu_to_fdt32(val);
+	return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
+}
+
+/**
+ * fdt_nop_property - replace a property with nop tags
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to nop
+ * @name: name of the property to nop
+ *
+ * fdt_nop_property() will replace a given property's representation
+ * in the blob with FDT_NOP tags, effectively removing it from the
+ * tree.
+ *
+ * This function will alter only the bytes in the blob which contain
+ * the property, and will not alter or move any other part of the
+ * tree.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOTFOUND, node does not have the named property
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
+
+/**
+ * fdt_nop_node - replace a node (subtree) with nop tags
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node to nop
+ *
+ * fdt_nop_node() will replace a given node's representation in the
+ * blob, including all its subnodes, if any, with FDT_NOP tags,
+ * effectively removing it from the tree.
+ *
+ * This function will alter only the bytes in the blob which contain
+ * the node and its properties and subnodes, and will not alter or
+ * move any other part of the tree.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_nop_node(void *fdt, int nodeoffset);
+
+/**********************************************************************/
+/* Sequential write functions                                         */
+/**********************************************************************/
+
+int fdt_create(void *buf, int bufsize);
+int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
+int fdt_finish_reservemap(void *fdt);
+int fdt_begin_node(void *fdt, const char *name);
+int fdt_property(void *fdt, const char *name, const void *val, int len);
+static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
+{
+	val = cpu_to_fdt32(val);
+	return fdt_property(fdt, name, &val, sizeof(val));
+}
+#define fdt_property_string(fdt, name, str) \
+	fdt_property(fdt, name, str, strlen(str)+1)
+int fdt_end_node(void *fdt);
+int fdt_finish(void *fdt);
+
+/**********************************************************************/
+/* Read-write functions                                               */
+/**********************************************************************/
+
+int fdt_open_into(const void *fdt, void *buf, int bufsize);
+int fdt_pack(void *fdt);
+
+/**
+ * fdt_add_mem_rsv - add one memory reserve map entry
+ * @fdt: pointer to the device tree blob
+ * @address, @size: 64-bit values (native endian)
+ *
+ * Adds a reserve map entry to the given blob reserving a region at
+ * address address of length size.
+ *
+ * This function will insert data into the reserve map and will
+ * therefore change the indexes of some entries in the table.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *		contain the new reservation entry
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
+
+/**
+ * fdt_del_mem_rsv - remove a memory reserve map entry
+ * @fdt: pointer to the device tree blob
+ * @n: entry to remove
+ *
+ * fdt_del_mem_rsv() removes the n-th memory reserve map entry from
+ * the blob.
+ *
+ * This function will delete data from the reservation table and will
+ * therefore change the indexes of some entries in the table.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOTFOUND, there is no entry of the given index (i.e. there
+ *		are less than n+1 reserve map entries)
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_del_mem_rsv(void *fdt, int n);
+
+/**
+ * fdt_set_name - change the name of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: structure block offset of a node
+ * @name: name to give the node
+ *
+ * fdt_set_name() replaces the name (including unit address, if any)
+ * of the given node with the given string.  NOTE: this function can't
+ * efficiently check if the new name is unique amongst the given
+ * node's siblings; results are undefined if this function is invoked
+ * with a name equal to one of the given node's siblings.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob
+ *		to contain the new name
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE, standard meanings
+ */
+int fdt_set_name(void *fdt, int nodeoffset, const char *name);
+
+/**
+ * fdt_setprop - create or change a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: pointer to data to set the property value to
+ * @len: length of the property value
+ *
+ * fdt_setprop() sets the value of the named property in the given
+ * node to the given value and length, creating the property if it
+ * does not already exist.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *		contain the new property value
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_setprop(void *fdt, int nodeoffset, const char *name,
+		const void *val, int len);
+
+/**
+ * fdt_setprop_cell - set a property to a single cell value
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: 32-bit integer value for the property (native endian)
+ *
+ * fdt_setprop_cell() sets the value of the named property in the
+ * given node to the given cell value (converting to big-endian if
+ * necessary), or creates a new property with that value if it does
+ * not already exist.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *		contain the new property value
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
+				   uint32_t val)
+{
+	val = cpu_to_fdt32(val);
+	return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
+}
+
+/**
+ * fdt_setprop_string - set a property to a string value
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @str: string value for the property
+ *
+ * fdt_setprop_string() sets the value of the named property in the
+ * given node to the given string value (using the length of the
+ * string to determine the new length of the property), or creates a
+ * new property with that value if it does not already exist.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *		contain the new property value
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+#define fdt_setprop_string(fdt, nodeoffset, name, str) \
+	fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
+
+/**
+ * fdt_delprop - delete a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to nop
+ * @name: name of the property to nop
+ *
+ * fdt_del_property() will delete the given property.
+ *
+ * This function will delete data from the blob, and will therefore
+ * change the offsets of some existing nodes.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOTFOUND, node does not have the named property
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_delprop(void *fdt, int nodeoffset, const char *name);
+
+/**
+ * fdt_add_subnode_namelen - creates a new node based on substring
+ * @fdt: pointer to the device tree blob
+ * @parentoffset: structure block offset of a node
+ * @name: name of the subnode to locate
+ * @namelen: number of characters of name to consider
+ *
+ * Identical to fdt_add_subnode(), but use only the first namelen
+ * characters of name as the name of the new node.  This is useful for
+ * creating subnodes based on a portion of a larger string, such as a
+ * full path.
+ */
+int fdt_add_subnode_namelen(void *fdt, int parentoffset,
+			    const char *name, int namelen);
+
+/**
+ * fdt_add_subnode - creates a new node
+ * @fdt: pointer to the device tree blob
+ * @parentoffset: structure block offset of a node
+ * @name: name of the subnode to locate
+ *
+ * fdt_add_subnode() creates a new node as a subnode of the node at
+ * structure block offset parentoffset, with the given name (which
+ * should include the unit address, if any).
+ *
+ * This function will insert data into the blob, and will therefore
+ * change the offsets of some existing nodes.
+
+ * returns:
+ *	structure block offset of the created nodeequested subnode (>=0), on success
+ *	-FDT_ERR_NOTFOUND, if the requested subnode does not exist
+ *	-FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
+ *	-FDT_ERR_EXISTS, if the node at parentoffset already has a subnode of
+ *		the given name
+ *	-FDT_ERR_NOSPACE, if there is insufficient free space in the
+ *		blob to contain the new node
+ *	-FDT_ERR_NOSPACE
+ *	-FDT_ERR_BADLAYOUT
+ *      -FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
+
+/**
+ * fdt_del_node - delete a node (subtree)
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node to nop
+ *
+ * fdt_del_node() will remove the given node, including all its
+ * subnodes if any, from the blob.
+ *
+ * This function will delete data from the blob, and will therefore
+ * change the offsets of some existing nodes.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_del_node(void *fdt, int nodeoffset);
+
+/**********************************************************************/
+/* Debugging / informational functions                                */
+/**********************************************************************/
+
+const char *fdt_strerror(int errval);
+
+#endif /* _LIBFDT_H */
diff -r 777658bb5eb9 -r d9ca8249409d xen/include/xen/libfdt/libfdt_env.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/xen/libfdt/libfdt_env.h	Thu Mar 22 14:26:42 2012 +0000
@@ -0,0 +1,16 @@
+#ifndef _LIBFDT_ENV_H
+#define _LIBFDT_ENV_H
+
+#include <xen/config.h>
+#include <xen/types.h>
+#include <xen/string.h>
+#include <asm/byteorder.h>
+
+#define fdt16_to_cpu(x) be16_to_cpu(x)
+#define cpu_to_fdt16(x) cpu_to_be16(x)
+#define fdt32_to_cpu(x) be32_to_cpu(x)
+#define cpu_to_fdt32(x) cpu_to_be32(x)
+#define fdt64_to_cpu(x) be64_to_cpu(x)
+#define cpu_to_fdt64(x) cpu_to_be64(x)
+
+#endif /* _LIBFDT_ENV_H */

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

From xen-changelog-bounces@lists.xen.org Fri Mar 23 07:33:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 23 Mar 2012 07:33:23 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SAyzx-00083b-Ru; Fri, 23 Mar 2012 07:33: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 1SAyzw-00081M-O1
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:21 +0000
Received: from [85.158.143.35:3958] by server-3.bemta-4.messagelabs.com id
	2C/FA-05853-F372C6F4; Fri, 23 Mar 2012 07:33:19 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-21.messagelabs.com!1332487993!12611270!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3407 invoked from network); 23 Mar 2012 07:33:14 -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;
	23 Mar 2012 07:33:14 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzm-0000yo-7o
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SAyzm-000312-38
	for xen-changelog@lists.xensource.com; Fri, 23 Mar 2012 07:33:10 +0000
Message-Id: <E1SAyzm-000312-38@xenbits.xen.org>
Date: Fri, 23 Mar 2012 07:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] libfdt: move headers to
	xen/include/xen/libfdt/
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332426402 0
# Node ID d9ca8249409d6e554dede70f856e451096d1cd8e
# Parent  777658bb5eb9c1b5e6043a8d04366ea4889b42ac
libfdt: move headers to xen/include/xen/libfdt/

Move the public libfdt headers to xen/include/xen/libfdt/ so CFLAGS
does need to be set to find them.  This requires minor tweaks to one
of the headers imported from upstream.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 777658bb5eb9 -r d9ca8249409d xen/common/Makefile
--- a/xen/common/Makefile	Thu Mar 22 14:26:41 2012 +0000
+++ b/xen/common/Makefile	Thu Mar 22 14:26:42 2012 +0000
@@ -61,5 +61,3 @@
 
 subdir-y += libelf
 subdir-$(HAS_DEVICE_TREE) += libfdt
-
-CFLAGS += -Ilibfdt
diff -r 777658bb5eb9 -r d9ca8249409d xen/common/device_tree.c
--- a/xen/common/device_tree.c	Thu Mar 22 14:26:41 2012 +0000
+++ b/xen/common/device_tree.c	Thu Mar 22 14:26:42 2012 +0000
@@ -14,13 +14,12 @@
 #include <xen/device_tree.h>
 #include <xen/kernel.h>
 #include <xen/lib.h>
+#include <xen/libfdt/libfdt.h>
 #include <xen/mm.h>
 #include <xen/stdarg.h>
 #include <xen/string.h>
 #include <asm/early_printk.h>
 
-#include <libfdt.h>
-
 struct dt_early_info __initdata early_info;
 void *device_tree_flattened;
 
diff -r 777658bb5eb9 -r d9ca8249409d xen/common/libfdt/Makefile
--- a/xen/common/libfdt/Makefile	Thu Mar 22 14:26:41 2012 +0000
+++ b/xen/common/libfdt/Makefile	Thu Mar 22 14:26:42 2012 +0000
@@ -2,4 +2,4 @@
 
 obj-y += $(LIBFDT_OBJS)
 
-CFLAGS += -I.
+CFLAGS += -I$(BASEDIR)/include/xen/libfdt/
diff -r 777658bb5eb9 -r d9ca8249409d xen/common/libfdt/fdt.h
--- a/xen/common/libfdt/fdt.h	Thu Mar 22 14:26:41 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-#ifndef _FDT_H
-#define _FDT_H
-
-#ifndef __ASSEMBLY__
-
-struct fdt_header {
-	uint32_t magic;			 /* magic word FDT_MAGIC */
-	uint32_t totalsize;		 /* total size of DT block */
-	uint32_t off_dt_struct;		 /* offset to structure */
-	uint32_t off_dt_strings;	 /* offset to strings */
-	uint32_t off_mem_rsvmap;	 /* offset to memory reserve map */
-	uint32_t version;		 /* format version */
-	uint32_t last_comp_version;	 /* last compatible version */
-
-	/* version 2 fields below */
-	uint32_t boot_cpuid_phys;	 /* Which physical CPU id we're
-					    booting on */
-	/* version 3 fields below */
-	uint32_t size_dt_strings;	 /* size of the strings block */
-
-	/* version 17 fields below */
-	uint32_t size_dt_struct;	 /* size of the structure block */
-};
-
-struct fdt_reserve_entry {
-	uint64_t address;
-	uint64_t size;
-};
-
-struct fdt_node_header {
-	uint32_t tag;
-	char name[0];
-};
-
-struct fdt_property {
-	uint32_t tag;
-	uint32_t len;
-	uint32_t nameoff;
-	char data[0];
-};
-
-#endif /* !__ASSEMBLY */
-
-#define FDT_MAGIC	0xd00dfeed	/* 4: version, 4: total size */
-#define FDT_TAGSIZE	sizeof(uint32_t)
-
-#define FDT_BEGIN_NODE	0x1		/* Start node: full name */
-#define FDT_END_NODE	0x2		/* End node */
-#define FDT_PROP	0x3		/* Property: name off,
-					   size, content */
-#define FDT_NOP		0x4		/* nop */
-#define FDT_END		0x9
-
-#define FDT_V1_SIZE	(7*sizeof(uint32_t))
-#define FDT_V2_SIZE	(FDT_V1_SIZE + sizeof(uint32_t))
-#define FDT_V3_SIZE	(FDT_V2_SIZE + sizeof(uint32_t))
-#define FDT_V16_SIZE	FDT_V3_SIZE
-#define FDT_V17_SIZE	(FDT_V16_SIZE + sizeof(uint32_t))
-
-#endif /* _FDT_H */
diff -r 777658bb5eb9 -r d9ca8249409d xen/common/libfdt/libfdt.h
--- a/xen/common/libfdt/libfdt.h	Thu Mar 22 14:26:41 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1235 +0,0 @@
-#ifndef _LIBFDT_H
-#define _LIBFDT_H
-/*
- * libfdt - Flat Device Tree manipulation
- * Copyright (C) 2006 David Gibson, IBM Corporation.
- *
- * libfdt is dual licensed: you can use it either under the terms of
- * the GPL, or the BSD license, at your option.
- *
- *  a) This library 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 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 General Public License for more details.
- *
- *     You should have received a copy of the GNU General Public
- *     License along with this library; if not, write to the Free
- *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
- *     MA 02110-1301 USA
- *
- * Alternatively,
- *
- *  b) Redistribution and use in source and binary forms, with or
- *     without modification, are permitted provided that the following
- *     conditions are met:
- *
- *     1. Redistributions of source code must retain the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer.
- *     2. Redistributions in binary form must reproduce the above
- *        copyright notice, this list of conditions and the following
- *        disclaimer in the documentation and/or other materials
- *        provided with the distribution.
- *
- *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
- *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
- *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
- *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
- *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <libfdt_env.h>
-#include <fdt.h>
-
-#define FDT_FIRST_SUPPORTED_VERSION	0x10
-#define FDT_LAST_SUPPORTED_VERSION	0x11
-
-/* Error codes: informative error codes */
-#define FDT_ERR_NOTFOUND	1
-	/* FDT_ERR_NOTFOUND: The requested node or property does not exist */
-#define FDT_ERR_EXISTS		2
-	/* FDT_ERR_EXISTS: Attemped to create a node or property which
-	 * already exists */
-#define FDT_ERR_NOSPACE		3
-	/* FDT_ERR_NOSPACE: Operation needed to expand the device
-	 * tree, but its buffer did not have sufficient space to
-	 * contain the expanded tree. Use fdt_open_into() to move the
-	 * device tree to a buffer with more space. */
-
-/* Error codes: codes for bad parameters */
-#define FDT_ERR_BADOFFSET	4
-	/* FDT_ERR_BADOFFSET: Function was passed a structure block
-	 * offset which is out-of-bounds, or which points to an
-	 * unsuitable part of the structure for the operation. */
-#define FDT_ERR_BADPATH		5
-	/* FDT_ERR_BADPATH: Function was passed a badly formatted path
-	 * (e.g. missing a leading / for a function which requires an
-	 * absolute path) */
-#define FDT_ERR_BADPHANDLE	6
-	/* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle
-	 * value.  phandle values of 0 and -1 are not permitted. */
-#define FDT_ERR_BADSTATE	7
-	/* FDT_ERR_BADSTATE: Function was passed an incomplete device
-	 * tree created by the sequential-write functions, which is
-	 * not sufficiently complete for the requested operation. */
-
-/* Error codes: codes for bad device tree blobs */
-#define FDT_ERR_TRUNCATED	8
-	/* FDT_ERR_TRUNCATED: Structure block of the given device tree
-	 * ends without an FDT_END tag. */
-#define FDT_ERR_BADMAGIC	9
-	/* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a
-	 * device tree at all - it is missing the flattened device
-	 * tree magic number. */
-#define FDT_ERR_BADVERSION	10
-	/* FDT_ERR_BADVERSION: Given device tree has a version which
-	 * can't be handled by the requested operation.  For
-	 * read-write functions, this may mean that fdt_open_into() is
-	 * required to convert the tree to the expected version. */
-#define FDT_ERR_BADSTRUCTURE	11
-	/* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt
-	 * structure block or other serious error (e.g. misnested
-	 * nodes, or subnodes preceding properties). */
-#define FDT_ERR_BADLAYOUT	12
-	/* FDT_ERR_BADLAYOUT: For read-write functions, the given
-	 * device tree has it's sub-blocks in an order that the
-	 * function can't handle (memory reserve map, then structure,
-	 * then strings).  Use fdt_open_into() to reorganize the tree
-	 * into a form suitable for the read-write operations. */
-
-/* "Can't happen" error indicating a bug in libfdt */
-#define FDT_ERR_INTERNAL	13
-	/* FDT_ERR_INTERNAL: libfdt has failed an internal assertion.
-	 * Should never be returned, if it is, it indicates a bug in
-	 * libfdt itself. */
-
-#define FDT_ERR_MAX		13
-
-/**********************************************************************/
-/* Low-level functions (you probably don't need these)                */
-/**********************************************************************/
-
-const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
-static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
-{
-	return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen);
-}
-
-uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
-
-/**********************************************************************/
-/* Traversal functions                                                */
-/**********************************************************************/
-
-int fdt_next_node(const void *fdt, int offset, int *depth);
-
-/**********************************************************************/
-/* General functions                                                  */
-/**********************************************************************/
-
-#define fdt_get_header(fdt, field) \
-	(fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
-#define fdt_magic(fdt) 			(fdt_get_header(fdt, magic))
-#define fdt_totalsize(fdt)		(fdt_get_header(fdt, totalsize))
-#define fdt_off_dt_struct(fdt)		(fdt_get_header(fdt, off_dt_struct))
-#define fdt_off_dt_strings(fdt)		(fdt_get_header(fdt, off_dt_strings))
-#define fdt_off_mem_rsvmap(fdt)		(fdt_get_header(fdt, off_mem_rsvmap))
-#define fdt_version(fdt)		(fdt_get_header(fdt, version))
-#define fdt_last_comp_version(fdt) 	(fdt_get_header(fdt, last_comp_version))
-#define fdt_boot_cpuid_phys(fdt) 	(fdt_get_header(fdt, boot_cpuid_phys))
-#define fdt_size_dt_strings(fdt) 	(fdt_get_header(fdt, size_dt_strings))
-#define fdt_size_dt_struct(fdt)		(fdt_get_header(fdt, size_dt_struct))
-
-#define __fdt_set_hdr(name) \
-	static inline void fdt_set_##name(void *fdt, uint32_t val) \
-	{ \
-		struct fdt_header *fdth = (struct fdt_header*)fdt; \
-		fdth->name = cpu_to_fdt32(val); \
-	}
-__fdt_set_hdr(magic);
-__fdt_set_hdr(totalsize);
-__fdt_set_hdr(off_dt_struct);
-__fdt_set_hdr(off_dt_strings);
-__fdt_set_hdr(off_mem_rsvmap);
-__fdt_set_hdr(version);
-__fdt_set_hdr(last_comp_version);
-__fdt_set_hdr(boot_cpuid_phys);
-__fdt_set_hdr(size_dt_strings);
-__fdt_set_hdr(size_dt_struct);
-#undef __fdt_set_hdr
-
-/**
- * fdt_check_header - sanity check a device tree or possible device tree
- * @fdt: pointer to data which might be a flattened device tree
- *
- * fdt_check_header() checks that the given buffer contains what
- * appears to be a flattened device tree with sane information in its
- * header.
- *
- * returns:
- *     0, if the buffer appears to contain a valid device tree
- *     -FDT_ERR_BADMAGIC,
- *     -FDT_ERR_BADVERSION,
- *     -FDT_ERR_BADSTATE, standard meanings, as above
- */
-int fdt_check_header(const void *fdt);
-
-/**
- * fdt_move - move a device tree around in memory
- * @fdt: pointer to the device tree to move
- * @buf: pointer to memory where the device is to be moved
- * @bufsize: size of the memory space at buf
- *
- * fdt_move() relocates, if possible, the device tree blob located at
- * fdt to the buffer at buf of size bufsize.  The buffer may overlap
- * with the existing device tree blob at fdt.  Therefore,
- *     fdt_move(fdt, fdt, fdt_totalsize(fdt))
- * should always succeed.
- *
- * returns:
- *     0, on success
- *     -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree
- *     -FDT_ERR_BADMAGIC,
- *     -FDT_ERR_BADVERSION,
- *     -FDT_ERR_BADSTATE, standard meanings
- */
-int fdt_move(const void *fdt, void *buf, int bufsize);
-
-/**********************************************************************/
-/* Read-only functions                                                */
-/**********************************************************************/
-
-/**
- * fdt_string - retrieve a string from the strings block of a device tree
- * @fdt: pointer to the device tree blob
- * @stroffset: offset of the string within the strings block (native endian)
- *
- * fdt_string() retrieves a pointer to a single string from the
- * strings block of the device tree blob at fdt.
- *
- * returns:
- *     a pointer to the string, on success
- *     NULL, if stroffset is out of bounds
- */
-const char *fdt_string(const void *fdt, int stroffset);
-
-/**
- * fdt_num_mem_rsv - retrieve the number of memory reserve map entries
- * @fdt: pointer to the device tree blob
- *
- * Returns the number of entries in the device tree blob's memory
- * reservation map.  This does not include the terminating 0,0 entry
- * or any other (0,0) entries reserved for expansion.
- *
- * returns:
- *     the number of entries
- */
-int fdt_num_mem_rsv(const void *fdt);
-
-/**
- * fdt_get_mem_rsv - retrieve one memory reserve map entry
- * @fdt: pointer to the device tree blob
- * @address, @size: pointers to 64-bit variables
- *
- * On success, *address and *size will contain the address and size of
- * the n-th reserve map entry from the device tree blob, in
- * native-endian format.
- *
- * returns:
- *     0, on success
- *     -FDT_ERR_BADMAGIC,
- *     -FDT_ERR_BADVERSION,
- *     -FDT_ERR_BADSTATE, standard meanings
- */
-int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
-
-/**
- * fdt_subnode_offset_namelen - find a subnode based on substring
- * @fdt: pointer to the device tree blob
- * @parentoffset: structure block offset of a node
- * @name: name of the subnode to locate
- * @namelen: number of characters of name to consider
- *
- * Identical to fdt_subnode_offset(), but only examine the first
- * namelen characters of name for matching the subnode name.  This is
- * useful for finding subnodes based on a portion of a larger string,
- * such as a full path.
- */
-int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
-			       const char *name, int namelen);
-/**
- * fdt_subnode_offset - find a subnode of a given node
- * @fdt: pointer to the device tree blob
- * @parentoffset: structure block offset of a node
- * @name: name of the subnode to locate
- *
- * fdt_subnode_offset() finds a subnode of the node at structure block
- * offset parentoffset with the given name.  name may include a unit
- * address, in which case fdt_subnode_offset() will find the subnode
- * with that unit address, or the unit address may be omitted, in
- * which case fdt_subnode_offset() will find an arbitrary subnode
- * whose name excluding unit address matches the given name.
- *
- * returns:
- *	structure block offset of the requested subnode (>=0), on success
- *	-FDT_ERR_NOTFOUND, if the requested subnode does not exist
- *	-FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
- *      -FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings.
- */
-int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
-
-/**
- * fdt_path_offset - find a tree node by its full path
- * @fdt: pointer to the device tree blob
- * @path: full path of the node to locate
- *
- * fdt_path_offset() finds a node of a given path in the device tree.
- * Each path component may omit the unit address portion, but the
- * results of this are undefined if any such path component is
- * ambiguous (that is if there are multiple nodes at the relevant
- * level matching the given component, differentiated only by unit
- * address).
- *
- * returns:
- *	structure block offset of the node with the requested path (>=0), on success
- *	-FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
- *	-FDT_ERR_NOTFOUND, if the requested node does not exist
- *      -FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings.
- */
-int fdt_path_offset(const void *fdt, const char *path);
-
-/**
- * fdt_get_name - retrieve the name of a given node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: structure block offset of the starting node
- * @lenp: pointer to an integer variable (will be overwritten) or NULL
- *
- * fdt_get_name() retrieves the name (including unit address) of the
- * device tree node at structure block offset nodeoffset.  If lenp is
- * non-NULL, the length of this name is also returned, in the integer
- * pointed to by lenp.
- *
- * returns:
- *	pointer to the node's name, on success
- *		If lenp is non-NULL, *lenp contains the length of that name (>=0)
- *	NULL, on error
- *		if lenp is non-NULL *lenp contains an error code (<0):
- *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *		-FDT_ERR_BADMAGIC,
- *		-FDT_ERR_BADVERSION,
- *		-FDT_ERR_BADSTATE, standard meanings
- */
-const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
-
-/**
- * fdt_first_property_offset - find the offset of a node's first property
- * @fdt: pointer to the device tree blob
- * @nodeoffset: structure block offset of a node
- *
- * fdt_first_property_offset() finds the first property of the node at
- * the given structure block offset.
- *
- * returns:
- *	structure block offset of the property (>=0), on success
- *	-FDT_ERR_NOTFOUND, if the requested node has no properties
- *	-FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_BEGIN_NODE tag
- *      -FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings.
- */
-int fdt_first_property_offset(const void *fdt, int nodeoffset);
-
-/**
- * fdt_next_property_offset - step through a node's properties
- * @fdt: pointer to the device tree blob
- * @offset: structure block offset of a property
- *
- * fdt_next_property_offset() finds the property immediately after the
- * one at the given structure block offset.  This will be a property
- * of the same node as the given property.
- *
- * returns:
- *	structure block offset of the next property (>=0), on success
- *	-FDT_ERR_NOTFOUND, if the given property is the last in its node
- *	-FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_PROP tag
- *      -FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings.
- */
-int fdt_next_property_offset(const void *fdt, int offset);
-
-/**
- * fdt_get_property_by_offset - retrieve the property at a given offset
- * @fdt: pointer to the device tree blob
- * @offset: offset of the property to retrieve
- * @lenp: pointer to an integer variable (will be overwritten) or NULL
- *
- * fdt_get_property_by_offset() retrieves a pointer to the
- * fdt_property structure within the device tree blob at the given
- * offset.  If lenp is non-NULL, the length of the property value is
- * also returned, in the integer pointed to by lenp.
- *
- * returns:
- *	pointer to the structure representing the property
- *		if lenp is non-NULL, *lenp contains the length of the property
- *		value (>=0)
- *	NULL, on error
- *		if lenp is non-NULL, *lenp contains an error code (<0):
- *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
- *		-FDT_ERR_BADMAGIC,
- *		-FDT_ERR_BADVERSION,
- *		-FDT_ERR_BADSTATE,
- *		-FDT_ERR_BADSTRUCTURE,
- *		-FDT_ERR_TRUNCATED, standard meanings
- */
-const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
-						      int offset,
-						      int *lenp);
-
-/**
- * fdt_get_property_namelen - find a property based on substring
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to find
- * @name: name of the property to find
- * @namelen: number of characters of name to consider
- * @lenp: pointer to an integer variable (will be overwritten) or NULL
- *
- * Identical to fdt_get_property_namelen(), but only examine the first
- * namelen characters of name for matching the property name.
- */
-const struct fdt_property *fdt_get_property_namelen(const void *fdt,
-						    int nodeoffset,
-						    const char *name,
-						    int namelen, int *lenp);
-
-/**
- * fdt_get_property - find a given property in a given node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to find
- * @name: name of the property to find
- * @lenp: pointer to an integer variable (will be overwritten) or NULL
- *
- * fdt_get_property() retrieves a pointer to the fdt_property
- * structure within the device tree blob corresponding to the property
- * named 'name' of the node at offset nodeoffset.  If lenp is
- * non-NULL, the length of the property value is also returned, in the
- * integer pointed to by lenp.
- *
- * returns:
- *	pointer to the structure representing the property
- *		if lenp is non-NULL, *lenp contains the length of the property
- *		value (>=0)
- *	NULL, on error
- *		if lenp is non-NULL, *lenp contains an error code (<0):
- *		-FDT_ERR_NOTFOUND, node does not have named property
- *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *		-FDT_ERR_BADMAGIC,
- *		-FDT_ERR_BADVERSION,
- *		-FDT_ERR_BADSTATE,
- *		-FDT_ERR_BADSTRUCTURE,
- *		-FDT_ERR_TRUNCATED, standard meanings
- */
-const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
-					    const char *name, int *lenp);
-static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
-						      const char *name,
-						      int *lenp)
-{
-	return (struct fdt_property *)(uintptr_t)
-		fdt_get_property(fdt, nodeoffset, name, lenp);
-}
-
-/**
- * fdt_getprop_by_offset - retrieve the value of a property at a given offset
- * @fdt: pointer to the device tree blob
- * @ffset: offset of the property to read
- * @namep: pointer to a string variable (will be overwritten) or NULL
- * @lenp: pointer to an integer variable (will be overwritten) or NULL
- *
- * fdt_getprop_by_offset() retrieves a pointer to the value of the
- * property at structure block offset 'offset' (this will be a pointer
- * to within the device blob itself, not a copy of the value).  If
- * lenp is non-NULL, the length of the property value is also
- * returned, in the integer pointed to by lenp.  If namep is non-NULL,
- * the property's namne will also be returned in the char * pointed to
- * by namep (this will be a pointer to within the device tree's string
- * block, not a new copy of the name).
- *
- * returns:
- *	pointer to the property's value
- *		if lenp is non-NULL, *lenp contains the length of the property
- *		value (>=0)
- *		if namep is non-NULL *namep contiains a pointer to the property
- *		name.
- *	NULL, on error
- *		if lenp is non-NULL, *lenp contains an error code (<0):
- *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
- *		-FDT_ERR_BADMAGIC,
- *		-FDT_ERR_BADVERSION,
- *		-FDT_ERR_BADSTATE,
- *		-FDT_ERR_BADSTRUCTURE,
- *		-FDT_ERR_TRUNCATED, standard meanings
- */
-const void *fdt_getprop_by_offset(const void *fdt, int offset,
-				  const char **namep, int *lenp);
-
-/**
- * fdt_getprop_namelen - get property value based on substring
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to find
- * @name: name of the property to find
- * @namelen: number of characters of name to consider
- * @lenp: pointer to an integer variable (will be overwritten) or NULL
- *
- * Identical to fdt_getprop(), but only examine the first namelen
- * characters of name for matching the property name.
- */
-const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
-				const char *name, int namelen, int *lenp);
-
-/**
- * fdt_getprop - retrieve the value of a given property
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to find
- * @name: name of the property to find
- * @lenp: pointer to an integer variable (will be overwritten) or NULL
- *
- * fdt_getprop() retrieves a pointer to the value of the property
- * named 'name' of the node at offset nodeoffset (this will be a
- * pointer to within the device blob itself, not a copy of the value).
- * If lenp is non-NULL, the length of the property value is also
- * returned, in the integer pointed to by lenp.
- *
- * returns:
- *	pointer to the property's value
- *		if lenp is non-NULL, *lenp contains the length of the property
- *		value (>=0)
- *	NULL, on error
- *		if lenp is non-NULL, *lenp contains an error code (<0):
- *		-FDT_ERR_NOTFOUND, node does not have named property
- *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *		-FDT_ERR_BADMAGIC,
- *		-FDT_ERR_BADVERSION,
- *		-FDT_ERR_BADSTATE,
- *		-FDT_ERR_BADSTRUCTURE,
- *		-FDT_ERR_TRUNCATED, standard meanings
- */
-const void *fdt_getprop(const void *fdt, int nodeoffset,
-			const char *name, int *lenp);
-static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
-				  const char *name, int *lenp)
-{
-	return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp);
-}
-
-/**
- * fdt_get_phandle - retrieve the phandle of a given node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: structure block offset of the node
- *
- * fdt_get_phandle() retrieves the phandle of the device tree node at
- * structure block offset nodeoffset.
- *
- * returns:
- *	the phandle of the node at nodeoffset, on success (!= 0, != -1)
- *	0, if the node has no phandle, or another error occurs
- */
-uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
-
-/**
- * fdt_get_alias_namelen - get alias based on substring
- * @fdt: pointer to the device tree blob
- * @name: name of the alias th look up
- * @namelen: number of characters of name to consider
- *
- * Identical to fdt_get_alias(), but only examine the first namelen
- * characters of name for matching the alias name.
- */
-const char *fdt_get_alias_namelen(const void *fdt,
-				  const char *name, int namelen);
-
-/**
- * fdt_get_alias - retreive the path referenced by a given alias
- * @fdt: pointer to the device tree blob
- * @name: name of the alias th look up
- *
- * fdt_get_alias() retrieves the value of a given alias.  That is, the
- * value of the property named 'name' in the node /aliases.
- *
- * returns:
- *	a pointer to the expansion of the alias named 'name', of it exists
- *	NULL, if the given alias or the /aliases node does not exist
- */
-const char *fdt_get_alias(const void *fdt, const char *name);
-
-/**
- * fdt_get_path - determine the full path of a node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose path to find
- * @buf: character buffer to contain the returned path (will be overwritten)
- * @buflen: size of the character buffer at buf
- *
- * fdt_get_path() computes the full path of the node at offset
- * nodeoffset, and records that path in the buffer at buf.
- *
- * NOTE: This function is expensive, as it must scan the device tree
- * structure from the start to nodeoffset.
- *
- * returns:
- *	0, on success
- *		buf contains the absolute path of the node at
- *		nodeoffset, as a NUL-terminated string.
- * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
- *	-FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
- *		characters and will not fit in the given buffer.
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
-
-/**
- * fdt_supernode_atdepth_offset - find a specific ancestor of a node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose parent to find
- * @supernodedepth: depth of the ancestor to find
- * @nodedepth: pointer to an integer variable (will be overwritten) or NULL
- *
- * fdt_supernode_atdepth_offset() finds an ancestor of the given node
- * at a specific depth from the root (where the root itself has depth
- * 0, its immediate subnodes depth 1 and so forth).  So
- *	fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
- * will always return 0, the offset of the root node.  If the node at
- * nodeoffset has depth D, then:
- *	fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
- * will return nodeoffset itself.
- *
- * NOTE: This function is expensive, as it must scan the device tree
- * structure from the start to nodeoffset.
- *
- * returns:
-
- *	structure block offset of the node at node offset's ancestor
- *		of depth supernodedepth (>=0), on success
- * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
-*	-FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of nodeoffset
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
-				 int supernodedepth, int *nodedepth);
-
-/**
- * fdt_node_depth - find the depth of a given node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose parent to find
- *
- * fdt_node_depth() finds the depth of a given node.  The root node
- * has depth 0, its immediate subnodes depth 1 and so forth.
- *
- * NOTE: This function is expensive, as it must scan the device tree
- * structure from the start to nodeoffset.
- *
- * returns:
- *	depth of the node at nodeoffset (>=0), on success
- * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_node_depth(const void *fdt, int nodeoffset);
-
-/**
- * fdt_parent_offset - find the parent of a given node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose parent to find
- *
- * fdt_parent_offset() locates the parent node of a given node (that
- * is, it finds the offset of the node which contains the node at
- * nodeoffset as a subnode).
- *
- * NOTE: This function is expensive, as it must scan the device tree
- * structure from the start to nodeoffset, *twice*.
- *
- * returns:
- *	structure block offset of the parent of the node at nodeoffset
- *		(>=0), on success
- * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_parent_offset(const void *fdt, int nodeoffset);
-
-/**
- * fdt_node_offset_by_prop_value - find nodes with a given property value
- * @fdt: pointer to the device tree blob
- * @startoffset: only find nodes after this offset
- * @propname: property name to check
- * @propval: property value to search for
- * @proplen: length of the value in propval
- *
- * fdt_node_offset_by_prop_value() returns the offset of the first
- * node after startoffset, which has a property named propname whose
- * value is of length proplen and has value equal to propval; or if
- * startoffset is -1, the very first such node in the tree.
- *
- * To iterate through all nodes matching the criterion, the following
- * idiom can be used:
- *	offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
- *					       propval, proplen);
- *	while (offset != -FDT_ERR_NOTFOUND) {
- *		// other code here
- *		offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
- *						       propval, proplen);
- *	}
- *
- * Note the -1 in the first call to the function, if 0 is used here
- * instead, the function will never locate the root node, even if it
- * matches the criterion.
- *
- * returns:
- *	structure block offset of the located node (>= 0, >startoffset),
- *		 on success
- *	-FDT_ERR_NOTFOUND, no node matching the criterion exists in the
- *		tree after startoffset
- * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
-				  const char *propname,
-				  const void *propval, int proplen);
-
-/**
- * fdt_node_offset_by_phandle - find the node with a given phandle
- * @fdt: pointer to the device tree blob
- * @phandle: phandle value
- *
- * fdt_node_offset_by_phandle() returns the offset of the node
- * which has the given phandle value.  If there is more than one node
- * in the tree with the given phandle (an invalid tree), results are
- * undefined.
- *
- * returns:
- *	structure block offset of the located node (>= 0), on success
- *	-FDT_ERR_NOTFOUND, no node with that phandle exists
- *	-FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1)
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
-
-/**
- * fdt_node_check_compatible: check a node's compatible property
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of a tree node
- * @compatible: string to match against
- *
- *
- * fdt_node_check_compatible() returns 0 if the given node contains a
- * 'compatible' property with the given string as one of its elements,
- * it returns non-zero otherwise, or on error.
- *
- * returns:
- *	0, if the node has a 'compatible' property listing the given string
- *	1, if the node has a 'compatible' property, but it does not list
- *		the given string
- *	-FDT_ERR_NOTFOUND, if the given node has no 'compatible' property
- * 	-FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_node_check_compatible(const void *fdt, int nodeoffset,
-			      const char *compatible);
-
-/**
- * fdt_node_offset_by_compatible - find nodes with a given 'compatible' value
- * @fdt: pointer to the device tree blob
- * @startoffset: only find nodes after this offset
- * @compatible: 'compatible' string to match against
- *
- * fdt_node_offset_by_compatible() returns the offset of the first
- * node after startoffset, which has a 'compatible' property which
- * lists the given compatible string; or if startoffset is -1, the
- * very first such node in the tree.
- *
- * To iterate through all nodes matching the criterion, the following
- * idiom can be used:
- *	offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
- *	while (offset != -FDT_ERR_NOTFOUND) {
- *		// other code here
- *		offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
- *	}
- *
- * Note the -1 in the first call to the function, if 0 is used here
- * instead, the function will never locate the root node, even if it
- * matches the criterion.
- *
- * returns:
- *	structure block offset of the located node (>= 0, >startoffset),
- *		 on success
- *	-FDT_ERR_NOTFOUND, no node matching the criterion exists in the
- *		tree after startoffset
- * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE, standard meanings
- */
-int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
-				  const char *compatible);
-
-/**********************************************************************/
-/* Write-in-place functions                                           */
-/**********************************************************************/
-
-/**
- * fdt_setprop_inplace - change a property's value, but not its size
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to change
- * @name: name of the property to change
- * @val: pointer to data to replace the property value with
- * @len: length of the property value
- *
- * fdt_setprop_inplace() replaces the value of a given property with
- * the data in val, of length len.  This function cannot change the
- * size of a property, and so will only work if len is equal to the
- * current length of the property.
- *
- * This function will alter only the bytes in the blob which contain
- * the given property value, and will not alter or move any other part
- * of the tree.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOSPACE, if len is not equal to the property's current length
- *	-FDT_ERR_NOTFOUND, node does not have the named property
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
-			const void *val, int len);
-
-/**
- * fdt_setprop_inplace_cell - change the value of a single-cell property
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to change
- * @name: name of the property to change
- * @val: cell (32-bit integer) value to replace the property with
- *
- * fdt_setprop_inplace_cell() replaces the value of a given property
- * with the 32-bit integer cell value in val, converting val to
- * big-endian if necessary.  This function cannot change the size of a
- * property, and so will only work if the property already exists and
- * has length 4.
- *
- * This function will alter only the bytes in the blob which contain
- * the given property value, and will not alter or move any other part
- * of the tree.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOSPACE, if the property's length is not equal to 4
-  *	-FDT_ERR_NOTFOUND, node does not have the named property
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
-					   const char *name, uint32_t val)
-{
-	val = cpu_to_fdt32(val);
-	return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
-}
-
-/**
- * fdt_nop_property - replace a property with nop tags
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to nop
- * @name: name of the property to nop
- *
- * fdt_nop_property() will replace a given property's representation
- * in the blob with FDT_NOP tags, effectively removing it from the
- * tree.
- *
- * This function will alter only the bytes in the blob which contain
- * the property, and will not alter or move any other part of the
- * tree.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOTFOUND, node does not have the named property
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
-
-/**
- * fdt_nop_node - replace a node (subtree) with nop tags
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node to nop
- *
- * fdt_nop_node() will replace a given node's representation in the
- * blob, including all its subnodes, if any, with FDT_NOP tags,
- * effectively removing it from the tree.
- *
- * This function will alter only the bytes in the blob which contain
- * the node and its properties and subnodes, and will not alter or
- * move any other part of the tree.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_nop_node(void *fdt, int nodeoffset);
-
-/**********************************************************************/
-/* Sequential write functions                                         */
-/**********************************************************************/
-
-int fdt_create(void *buf, int bufsize);
-int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
-int fdt_finish_reservemap(void *fdt);
-int fdt_begin_node(void *fdt, const char *name);
-int fdt_property(void *fdt, const char *name, const void *val, int len);
-static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
-{
-	val = cpu_to_fdt32(val);
-	return fdt_property(fdt, name, &val, sizeof(val));
-}
-#define fdt_property_string(fdt, name, str) \
-	fdt_property(fdt, name, str, strlen(str)+1)
-int fdt_end_node(void *fdt);
-int fdt_finish(void *fdt);
-
-/**********************************************************************/
-/* Read-write functions                                               */
-/**********************************************************************/
-
-int fdt_open_into(const void *fdt, void *buf, int bufsize);
-int fdt_pack(void *fdt);
-
-/**
- * fdt_add_mem_rsv - add one memory reserve map entry
- * @fdt: pointer to the device tree blob
- * @address, @size: 64-bit values (native endian)
- *
- * Adds a reserve map entry to the given blob reserving a region at
- * address address of length size.
- *
- * This function will insert data into the reserve map and will
- * therefore change the indexes of some entries in the table.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
- *		contain the new reservation entry
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
-
-/**
- * fdt_del_mem_rsv - remove a memory reserve map entry
- * @fdt: pointer to the device tree blob
- * @n: entry to remove
- *
- * fdt_del_mem_rsv() removes the n-th memory reserve map entry from
- * the blob.
- *
- * This function will delete data from the reservation table and will
- * therefore change the indexes of some entries in the table.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOTFOUND, there is no entry of the given index (i.e. there
- *		are less than n+1 reserve map entries)
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_del_mem_rsv(void *fdt, int n);
-
-/**
- * fdt_set_name - change the name of a given node
- * @fdt: pointer to the device tree blob
- * @nodeoffset: structure block offset of a node
- * @name: name to give the node
- *
- * fdt_set_name() replaces the name (including unit address, if any)
- * of the given node with the given string.  NOTE: this function can't
- * efficiently check if the new name is unique amongst the given
- * node's siblings; results are undefined if this function is invoked
- * with a name equal to one of the given node's siblings.
- *
- * This function may insert or delete data from the blob, and will
- * therefore change the offsets of some existing nodes.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob
- *		to contain the new name
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE, standard meanings
- */
-int fdt_set_name(void *fdt, int nodeoffset, const char *name);
-
-/**
- * fdt_setprop - create or change a property
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to change
- * @name: name of the property to change
- * @val: pointer to data to set the property value to
- * @len: length of the property value
- *
- * fdt_setprop() sets the value of the named property in the given
- * node to the given value and length, creating the property if it
- * does not already exist.
- *
- * This function may insert or delete data from the blob, and will
- * therefore change the offsets of some existing nodes.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
- *		contain the new property value
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_setprop(void *fdt, int nodeoffset, const char *name,
-		const void *val, int len);
-
-/**
- * fdt_setprop_cell - set a property to a single cell value
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to change
- * @name: name of the property to change
- * @val: 32-bit integer value for the property (native endian)
- *
- * fdt_setprop_cell() sets the value of the named property in the
- * given node to the given cell value (converting to big-endian if
- * necessary), or creates a new property with that value if it does
- * not already exist.
- *
- * This function may insert or delete data from the blob, and will
- * therefore change the offsets of some existing nodes.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
- *		contain the new property value
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
-				   uint32_t val)
-{
-	val = cpu_to_fdt32(val);
-	return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
-}
-
-/**
- * fdt_setprop_string - set a property to a string value
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to change
- * @name: name of the property to change
- * @str: string value for the property
- *
- * fdt_setprop_string() sets the value of the named property in the
- * given node to the given string value (using the length of the
- * string to determine the new length of the property), or creates a
- * new property with that value if it does not already exist.
- *
- * This function may insert or delete data from the blob, and will
- * therefore change the offsets of some existing nodes.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
- *		contain the new property value
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-#define fdt_setprop_string(fdt, nodeoffset, name, str) \
-	fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
-
-/**
- * fdt_delprop - delete a property
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node whose property to nop
- * @name: name of the property to nop
- *
- * fdt_del_property() will delete the given property.
- *
- * This function will delete data from the blob, and will therefore
- * change the offsets of some existing nodes.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_NOTFOUND, node does not have the named property
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_delprop(void *fdt, int nodeoffset, const char *name);
-
-/**
- * fdt_add_subnode_namelen - creates a new node based on substring
- * @fdt: pointer to the device tree blob
- * @parentoffset: structure block offset of a node
- * @name: name of the subnode to locate
- * @namelen: number of characters of name to consider
- *
- * Identical to fdt_add_subnode(), but use only the first namelen
- * characters of name as the name of the new node.  This is useful for
- * creating subnodes based on a portion of a larger string, such as a
- * full path.
- */
-int fdt_add_subnode_namelen(void *fdt, int parentoffset,
-			    const char *name, int namelen);
-
-/**
- * fdt_add_subnode - creates a new node
- * @fdt: pointer to the device tree blob
- * @parentoffset: structure block offset of a node
- * @name: name of the subnode to locate
- *
- * fdt_add_subnode() creates a new node as a subnode of the node at
- * structure block offset parentoffset, with the given name (which
- * should include the unit address, if any).
- *
- * This function will insert data into the blob, and will therefore
- * change the offsets of some existing nodes.
-
- * returns:
- *	structure block offset of the created nodeequested subnode (>=0), on success
- *	-FDT_ERR_NOTFOUND, if the requested subnode does not exist
- *	-FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
- *	-FDT_ERR_EXISTS, if the node at parentoffset already has a subnode of
- *		the given name
- *	-FDT_ERR_NOSPACE, if there is insufficient free space in the
- *		blob to contain the new node
- *	-FDT_ERR_NOSPACE
- *	-FDT_ERR_BADLAYOUT
- *      -FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings.
- */
-int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
-
-/**
- * fdt_del_node - delete a node (subtree)
- * @fdt: pointer to the device tree blob
- * @nodeoffset: offset of the node to nop
- *
- * fdt_del_node() will remove the given node, including all its
- * subnodes if any, from the blob.
- *
- * This function will delete data from the blob, and will therefore
- * change the offsets of some existing nodes.
- *
- * returns:
- *	0, on success
- *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
- *	-FDT_ERR_BADLAYOUT,
- *	-FDT_ERR_BADMAGIC,
- *	-FDT_ERR_BADVERSION,
- *	-FDT_ERR_BADSTATE,
- *	-FDT_ERR_BADSTRUCTURE,
- *	-FDT_ERR_TRUNCATED, standard meanings
- */
-int fdt_del_node(void *fdt, int nodeoffset);
-
-/**********************************************************************/
-/* Debugging / informational functions                                */
-/**********************************************************************/
-
-const char *fdt_strerror(int errval);
-
-#endif /* _LIBFDT_H */
diff -r 777658bb5eb9 -r d9ca8249409d xen/common/libfdt/libfdt_env.h
--- a/xen/common/libfdt/libfdt_env.h	Thu Mar 22 14:26:41 2012 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-#ifndef _LIBFDT_ENV_H
-#define _LIBFDT_ENV_H
-
-#include <xen/config.h>
-#include <xen/types.h>
-#include <xen/string.h>
-#include <asm/byteorder.h>
-
-#define fdt16_to_cpu(x) be16_to_cpu(x)
-#define cpu_to_fdt16(x) cpu_to_be16(x)
-#define fdt32_to_cpu(x) be32_to_cpu(x)
-#define cpu_to_fdt32(x) cpu_to_be32(x)
-#define fdt64_to_cpu(x) be64_to_cpu(x)
-#define cpu_to_fdt64(x) cpu_to_be64(x)
-
-#endif /* _LIBFDT_ENV_H */
diff -r 777658bb5eb9 -r d9ca8249409d xen/include/xen/libfdt/fdt.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/xen/libfdt/fdt.h	Thu Mar 22 14:26:42 2012 +0000
@@ -0,0 +1,60 @@
+#ifndef _FDT_H
+#define _FDT_H
+
+#ifndef __ASSEMBLY__
+
+struct fdt_header {
+	uint32_t magic;			 /* magic word FDT_MAGIC */
+	uint32_t totalsize;		 /* total size of DT block */
+	uint32_t off_dt_struct;		 /* offset to structure */
+	uint32_t off_dt_strings;	 /* offset to strings */
+	uint32_t off_mem_rsvmap;	 /* offset to memory reserve map */
+	uint32_t version;		 /* format version */
+	uint32_t last_comp_version;	 /* last compatible version */
+
+	/* version 2 fields below */
+	uint32_t boot_cpuid_phys;	 /* Which physical CPU id we're
+					    booting on */
+	/* version 3 fields below */
+	uint32_t size_dt_strings;	 /* size of the strings block */
+
+	/* version 17 fields below */
+	uint32_t size_dt_struct;	 /* size of the structure block */
+};
+
+struct fdt_reserve_entry {
+	uint64_t address;
+	uint64_t size;
+};
+
+struct fdt_node_header {
+	uint32_t tag;
+	char name[0];
+};
+
+struct fdt_property {
+	uint32_t tag;
+	uint32_t len;
+	uint32_t nameoff;
+	char data[0];
+};
+
+#endif /* !__ASSEMBLY */
+
+#define FDT_MAGIC	0xd00dfeed	/* 4: version, 4: total size */
+#define FDT_TAGSIZE	sizeof(uint32_t)
+
+#define FDT_BEGIN_NODE	0x1		/* Start node: full name */
+#define FDT_END_NODE	0x2		/* End node */
+#define FDT_PROP	0x3		/* Property: name off,
+					   size, content */
+#define FDT_NOP		0x4		/* nop */
+#define FDT_END		0x9
+
+#define FDT_V1_SIZE	(7*sizeof(uint32_t))
+#define FDT_V2_SIZE	(FDT_V1_SIZE + sizeof(uint32_t))
+#define FDT_V3_SIZE	(FDT_V2_SIZE + sizeof(uint32_t))
+#define FDT_V16_SIZE	FDT_V3_SIZE
+#define FDT_V17_SIZE	(FDT_V16_SIZE + sizeof(uint32_t))
+
+#endif /* _FDT_H */
diff -r 777658bb5eb9 -r d9ca8249409d xen/include/xen/libfdt/libfdt.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/xen/libfdt/libfdt.h	Thu Mar 22 14:26:42 2012 +0000
@@ -0,0 +1,1235 @@
+#ifndef _LIBFDT_H
+#define _LIBFDT_H
+/*
+ * libfdt - Flat Device Tree manipulation
+ * Copyright (C) 2006 David Gibson, IBM Corporation.
+ *
+ * libfdt is dual licensed: you can use it either under the terms of
+ * the GPL, or the BSD license, at your option.
+ *
+ *  a) This library 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 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 General Public License for more details.
+ *
+ *     You should have received a copy of the GNU General Public
+ *     License along with this library; if not, write to the Free
+ *     Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+ *     MA 02110-1301 USA
+ *
+ * Alternatively,
+ *
+ *  b) Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *     1. Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *     2. Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ *     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ *     CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ *     INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ *     MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ *     DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ *     CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *     SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ *     LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ *     HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ *     CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ *     OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ *     EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <xen/libfdt/libfdt_env.h>
+#include <xen/libfdt/fdt.h>
+
+#define FDT_FIRST_SUPPORTED_VERSION	0x10
+#define FDT_LAST_SUPPORTED_VERSION	0x11
+
+/* Error codes: informative error codes */
+#define FDT_ERR_NOTFOUND	1
+	/* FDT_ERR_NOTFOUND: The requested node or property does not exist */
+#define FDT_ERR_EXISTS		2
+	/* FDT_ERR_EXISTS: Attemped to create a node or property which
+	 * already exists */
+#define FDT_ERR_NOSPACE		3
+	/* FDT_ERR_NOSPACE: Operation needed to expand the device
+	 * tree, but its buffer did not have sufficient space to
+	 * contain the expanded tree. Use fdt_open_into() to move the
+	 * device tree to a buffer with more space. */
+
+/* Error codes: codes for bad parameters */
+#define FDT_ERR_BADOFFSET	4
+	/* FDT_ERR_BADOFFSET: Function was passed a structure block
+	 * offset which is out-of-bounds, or which points to an
+	 * unsuitable part of the structure for the operation. */
+#define FDT_ERR_BADPATH		5
+	/* FDT_ERR_BADPATH: Function was passed a badly formatted path
+	 * (e.g. missing a leading / for a function which requires an
+	 * absolute path) */
+#define FDT_ERR_BADPHANDLE	6
+	/* FDT_ERR_BADPHANDLE: Function was passed an invalid phandle
+	 * value.  phandle values of 0 and -1 are not permitted. */
+#define FDT_ERR_BADSTATE	7
+	/* FDT_ERR_BADSTATE: Function was passed an incomplete device
+	 * tree created by the sequential-write functions, which is
+	 * not sufficiently complete for the requested operation. */
+
+/* Error codes: codes for bad device tree blobs */
+#define FDT_ERR_TRUNCATED	8
+	/* FDT_ERR_TRUNCATED: Structure block of the given device tree
+	 * ends without an FDT_END tag. */
+#define FDT_ERR_BADMAGIC	9
+	/* FDT_ERR_BADMAGIC: Given "device tree" appears not to be a
+	 * device tree at all - it is missing the flattened device
+	 * tree magic number. */
+#define FDT_ERR_BADVERSION	10
+	/* FDT_ERR_BADVERSION: Given device tree has a version which
+	 * can't be handled by the requested operation.  For
+	 * read-write functions, this may mean that fdt_open_into() is
+	 * required to convert the tree to the expected version. */
+#define FDT_ERR_BADSTRUCTURE	11
+	/* FDT_ERR_BADSTRUCTURE: Given device tree has a corrupt
+	 * structure block or other serious error (e.g. misnested
+	 * nodes, or subnodes preceding properties). */
+#define FDT_ERR_BADLAYOUT	12
+	/* FDT_ERR_BADLAYOUT: For read-write functions, the given
+	 * device tree has it's sub-blocks in an order that the
+	 * function can't handle (memory reserve map, then structure,
+	 * then strings).  Use fdt_open_into() to reorganize the tree
+	 * into a form suitable for the read-write operations. */
+
+/* "Can't happen" error indicating a bug in libfdt */
+#define FDT_ERR_INTERNAL	13
+	/* FDT_ERR_INTERNAL: libfdt has failed an internal assertion.
+	 * Should never be returned, if it is, it indicates a bug in
+	 * libfdt itself. */
+
+#define FDT_ERR_MAX		13
+
+/**********************************************************************/
+/* Low-level functions (you probably don't need these)                */
+/**********************************************************************/
+
+const void *fdt_offset_ptr(const void *fdt, int offset, unsigned int checklen);
+static inline void *fdt_offset_ptr_w(void *fdt, int offset, int checklen)
+{
+	return (void *)(uintptr_t)fdt_offset_ptr(fdt, offset, checklen);
+}
+
+uint32_t fdt_next_tag(const void *fdt, int offset, int *nextoffset);
+
+/**********************************************************************/
+/* Traversal functions                                                */
+/**********************************************************************/
+
+int fdt_next_node(const void *fdt, int offset, int *depth);
+
+/**********************************************************************/
+/* General functions                                                  */
+/**********************************************************************/
+
+#define fdt_get_header(fdt, field) \
+	(fdt32_to_cpu(((const struct fdt_header *)(fdt))->field))
+#define fdt_magic(fdt) 			(fdt_get_header(fdt, magic))
+#define fdt_totalsize(fdt)		(fdt_get_header(fdt, totalsize))
+#define fdt_off_dt_struct(fdt)		(fdt_get_header(fdt, off_dt_struct))
+#define fdt_off_dt_strings(fdt)		(fdt_get_header(fdt, off_dt_strings))
+#define fdt_off_mem_rsvmap(fdt)		(fdt_get_header(fdt, off_mem_rsvmap))
+#define fdt_version(fdt)		(fdt_get_header(fdt, version))
+#define fdt_last_comp_version(fdt) 	(fdt_get_header(fdt, last_comp_version))
+#define fdt_boot_cpuid_phys(fdt) 	(fdt_get_header(fdt, boot_cpuid_phys))
+#define fdt_size_dt_strings(fdt) 	(fdt_get_header(fdt, size_dt_strings))
+#define fdt_size_dt_struct(fdt)		(fdt_get_header(fdt, size_dt_struct))
+
+#define __fdt_set_hdr(name) \
+	static inline void fdt_set_##name(void *fdt, uint32_t val) \
+	{ \
+		struct fdt_header *fdth = (struct fdt_header*)fdt; \
+		fdth->name = cpu_to_fdt32(val); \
+	}
+__fdt_set_hdr(magic);
+__fdt_set_hdr(totalsize);
+__fdt_set_hdr(off_dt_struct);
+__fdt_set_hdr(off_dt_strings);
+__fdt_set_hdr(off_mem_rsvmap);
+__fdt_set_hdr(version);
+__fdt_set_hdr(last_comp_version);
+__fdt_set_hdr(boot_cpuid_phys);
+__fdt_set_hdr(size_dt_strings);
+__fdt_set_hdr(size_dt_struct);
+#undef __fdt_set_hdr
+
+/**
+ * fdt_check_header - sanity check a device tree or possible device tree
+ * @fdt: pointer to data which might be a flattened device tree
+ *
+ * fdt_check_header() checks that the given buffer contains what
+ * appears to be a flattened device tree with sane information in its
+ * header.
+ *
+ * returns:
+ *     0, if the buffer appears to contain a valid device tree
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE, standard meanings, as above
+ */
+int fdt_check_header(const void *fdt);
+
+/**
+ * fdt_move - move a device tree around in memory
+ * @fdt: pointer to the device tree to move
+ * @buf: pointer to memory where the device is to be moved
+ * @bufsize: size of the memory space at buf
+ *
+ * fdt_move() relocates, if possible, the device tree blob located at
+ * fdt to the buffer at buf of size bufsize.  The buffer may overlap
+ * with the existing device tree blob at fdt.  Therefore,
+ *     fdt_move(fdt, fdt, fdt_totalsize(fdt))
+ * should always succeed.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_NOSPACE, bufsize is insufficient to contain the device tree
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE, standard meanings
+ */
+int fdt_move(const void *fdt, void *buf, int bufsize);
+
+/**********************************************************************/
+/* Read-only functions                                                */
+/**********************************************************************/
+
+/**
+ * fdt_string - retrieve a string from the strings block of a device tree
+ * @fdt: pointer to the device tree blob
+ * @stroffset: offset of the string within the strings block (native endian)
+ *
+ * fdt_string() retrieves a pointer to a single string from the
+ * strings block of the device tree blob at fdt.
+ *
+ * returns:
+ *     a pointer to the string, on success
+ *     NULL, if stroffset is out of bounds
+ */
+const char *fdt_string(const void *fdt, int stroffset);
+
+/**
+ * fdt_num_mem_rsv - retrieve the number of memory reserve map entries
+ * @fdt: pointer to the device tree blob
+ *
+ * Returns the number of entries in the device tree blob's memory
+ * reservation map.  This does not include the terminating 0,0 entry
+ * or any other (0,0) entries reserved for expansion.
+ *
+ * returns:
+ *     the number of entries
+ */
+int fdt_num_mem_rsv(const void *fdt);
+
+/**
+ * fdt_get_mem_rsv - retrieve one memory reserve map entry
+ * @fdt: pointer to the device tree blob
+ * @address, @size: pointers to 64-bit variables
+ *
+ * On success, *address and *size will contain the address and size of
+ * the n-th reserve map entry from the device tree blob, in
+ * native-endian format.
+ *
+ * returns:
+ *     0, on success
+ *     -FDT_ERR_BADMAGIC,
+ *     -FDT_ERR_BADVERSION,
+ *     -FDT_ERR_BADSTATE, standard meanings
+ */
+int fdt_get_mem_rsv(const void *fdt, int n, uint64_t *address, uint64_t *size);
+
+/**
+ * fdt_subnode_offset_namelen - find a subnode based on substring
+ * @fdt: pointer to the device tree blob
+ * @parentoffset: structure block offset of a node
+ * @name: name of the subnode to locate
+ * @namelen: number of characters of name to consider
+ *
+ * Identical to fdt_subnode_offset(), but only examine the first
+ * namelen characters of name for matching the subnode name.  This is
+ * useful for finding subnodes based on a portion of a larger string,
+ * such as a full path.
+ */
+int fdt_subnode_offset_namelen(const void *fdt, int parentoffset,
+			       const char *name, int namelen);
+/**
+ * fdt_subnode_offset - find a subnode of a given node
+ * @fdt: pointer to the device tree blob
+ * @parentoffset: structure block offset of a node
+ * @name: name of the subnode to locate
+ *
+ * fdt_subnode_offset() finds a subnode of the node at structure block
+ * offset parentoffset with the given name.  name may include a unit
+ * address, in which case fdt_subnode_offset() will find the subnode
+ * with that unit address, or the unit address may be omitted, in
+ * which case fdt_subnode_offset() will find an arbitrary subnode
+ * whose name excluding unit address matches the given name.
+ *
+ * returns:
+ *	structure block offset of the requested subnode (>=0), on success
+ *	-FDT_ERR_NOTFOUND, if the requested subnode does not exist
+ *	-FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
+ *      -FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_subnode_offset(const void *fdt, int parentoffset, const char *name);
+
+/**
+ * fdt_path_offset - find a tree node by its full path
+ * @fdt: pointer to the device tree blob
+ * @path: full path of the node to locate
+ *
+ * fdt_path_offset() finds a node of a given path in the device tree.
+ * Each path component may omit the unit address portion, but the
+ * results of this are undefined if any such path component is
+ * ambiguous (that is if there are multiple nodes at the relevant
+ * level matching the given component, differentiated only by unit
+ * address).
+ *
+ * returns:
+ *	structure block offset of the node with the requested path (>=0), on success
+ *	-FDT_ERR_BADPATH, given path does not begin with '/' or is invalid
+ *	-FDT_ERR_NOTFOUND, if the requested node does not exist
+ *      -FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_path_offset(const void *fdt, const char *path);
+
+/**
+ * fdt_get_name - retrieve the name of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: structure block offset of the starting node
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_get_name() retrieves the name (including unit address) of the
+ * device tree node at structure block offset nodeoffset.  If lenp is
+ * non-NULL, the length of this name is also returned, in the integer
+ * pointed to by lenp.
+ *
+ * returns:
+ *	pointer to the node's name, on success
+ *		If lenp is non-NULL, *lenp contains the length of that name (>=0)
+ *	NULL, on error
+ *		if lenp is non-NULL *lenp contains an error code (<0):
+ *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *		-FDT_ERR_BADMAGIC,
+ *		-FDT_ERR_BADVERSION,
+ *		-FDT_ERR_BADSTATE, standard meanings
+ */
+const char *fdt_get_name(const void *fdt, int nodeoffset, int *lenp);
+
+/**
+ * fdt_first_property_offset - find the offset of a node's first property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: structure block offset of a node
+ *
+ * fdt_first_property_offset() finds the first property of the node at
+ * the given structure block offset.
+ *
+ * returns:
+ *	structure block offset of the property (>=0), on success
+ *	-FDT_ERR_NOTFOUND, if the requested node has no properties
+ *	-FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_BEGIN_NODE tag
+ *      -FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_first_property_offset(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_next_property_offset - step through a node's properties
+ * @fdt: pointer to the device tree blob
+ * @offset: structure block offset of a property
+ *
+ * fdt_next_property_offset() finds the property immediately after the
+ * one at the given structure block offset.  This will be a property
+ * of the same node as the given property.
+ *
+ * returns:
+ *	structure block offset of the next property (>=0), on success
+ *	-FDT_ERR_NOTFOUND, if the given property is the last in its node
+ *	-FDT_ERR_BADOFFSET, if nodeoffset did not point to an FDT_PROP tag
+ *      -FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_next_property_offset(const void *fdt, int offset);
+
+/**
+ * fdt_get_property_by_offset - retrieve the property at a given offset
+ * @fdt: pointer to the device tree blob
+ * @offset: offset of the property to retrieve
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_get_property_by_offset() retrieves a pointer to the
+ * fdt_property structure within the device tree blob at the given
+ * offset.  If lenp is non-NULL, the length of the property value is
+ * also returned, in the integer pointed to by lenp.
+ *
+ * returns:
+ *	pointer to the structure representing the property
+ *		if lenp is non-NULL, *lenp contains the length of the property
+ *		value (>=0)
+ *	NULL, on error
+ *		if lenp is non-NULL, *lenp contains an error code (<0):
+ *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
+ *		-FDT_ERR_BADMAGIC,
+ *		-FDT_ERR_BADVERSION,
+ *		-FDT_ERR_BADSTATE,
+ *		-FDT_ERR_BADSTRUCTURE,
+ *		-FDT_ERR_TRUNCATED, standard meanings
+ */
+const struct fdt_property *fdt_get_property_by_offset(const void *fdt,
+						      int offset,
+						      int *lenp);
+
+/**
+ * fdt_get_property_namelen - find a property based on substring
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @namelen: number of characters of name to consider
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * Identical to fdt_get_property_namelen(), but only examine the first
+ * namelen characters of name for matching the property name.
+ */
+const struct fdt_property *fdt_get_property_namelen(const void *fdt,
+						    int nodeoffset,
+						    const char *name,
+						    int namelen, int *lenp);
+
+/**
+ * fdt_get_property - find a given property in a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_get_property() retrieves a pointer to the fdt_property
+ * structure within the device tree blob corresponding to the property
+ * named 'name' of the node at offset nodeoffset.  If lenp is
+ * non-NULL, the length of the property value is also returned, in the
+ * integer pointed to by lenp.
+ *
+ * returns:
+ *	pointer to the structure representing the property
+ *		if lenp is non-NULL, *lenp contains the length of the property
+ *		value (>=0)
+ *	NULL, on error
+ *		if lenp is non-NULL, *lenp contains an error code (<0):
+ *		-FDT_ERR_NOTFOUND, node does not have named property
+ *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *		-FDT_ERR_BADMAGIC,
+ *		-FDT_ERR_BADVERSION,
+ *		-FDT_ERR_BADSTATE,
+ *		-FDT_ERR_BADSTRUCTURE,
+ *		-FDT_ERR_TRUNCATED, standard meanings
+ */
+const struct fdt_property *fdt_get_property(const void *fdt, int nodeoffset,
+					    const char *name, int *lenp);
+static inline struct fdt_property *fdt_get_property_w(void *fdt, int nodeoffset,
+						      const char *name,
+						      int *lenp)
+{
+	return (struct fdt_property *)(uintptr_t)
+		fdt_get_property(fdt, nodeoffset, name, lenp);
+}
+
+/**
+ * fdt_getprop_by_offset - retrieve the value of a property at a given offset
+ * @fdt: pointer to the device tree blob
+ * @ffset: offset of the property to read
+ * @namep: pointer to a string variable (will be overwritten) or NULL
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_getprop_by_offset() retrieves a pointer to the value of the
+ * property at structure block offset 'offset' (this will be a pointer
+ * to within the device blob itself, not a copy of the value).  If
+ * lenp is non-NULL, the length of the property value is also
+ * returned, in the integer pointed to by lenp.  If namep is non-NULL,
+ * the property's namne will also be returned in the char * pointed to
+ * by namep (this will be a pointer to within the device tree's string
+ * block, not a new copy of the name).
+ *
+ * returns:
+ *	pointer to the property's value
+ *		if lenp is non-NULL, *lenp contains the length of the property
+ *		value (>=0)
+ *		if namep is non-NULL *namep contiains a pointer to the property
+ *		name.
+ *	NULL, on error
+ *		if lenp is non-NULL, *lenp contains an error code (<0):
+ *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_PROP tag
+ *		-FDT_ERR_BADMAGIC,
+ *		-FDT_ERR_BADVERSION,
+ *		-FDT_ERR_BADSTATE,
+ *		-FDT_ERR_BADSTRUCTURE,
+ *		-FDT_ERR_TRUNCATED, standard meanings
+ */
+const void *fdt_getprop_by_offset(const void *fdt, int offset,
+				  const char **namep, int *lenp);
+
+/**
+ * fdt_getprop_namelen - get property value based on substring
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @namelen: number of characters of name to consider
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * Identical to fdt_getprop(), but only examine the first namelen
+ * characters of name for matching the property name.
+ */
+const void *fdt_getprop_namelen(const void *fdt, int nodeoffset,
+				const char *name, int namelen, int *lenp);
+
+/**
+ * fdt_getprop - retrieve the value of a given property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to find
+ * @name: name of the property to find
+ * @lenp: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_getprop() retrieves a pointer to the value of the property
+ * named 'name' of the node at offset nodeoffset (this will be a
+ * pointer to within the device blob itself, not a copy of the value).
+ * If lenp is non-NULL, the length of the property value is also
+ * returned, in the integer pointed to by lenp.
+ *
+ * returns:
+ *	pointer to the property's value
+ *		if lenp is non-NULL, *lenp contains the length of the property
+ *		value (>=0)
+ *	NULL, on error
+ *		if lenp is non-NULL, *lenp contains an error code (<0):
+ *		-FDT_ERR_NOTFOUND, node does not have named property
+ *		-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *		-FDT_ERR_BADMAGIC,
+ *		-FDT_ERR_BADVERSION,
+ *		-FDT_ERR_BADSTATE,
+ *		-FDT_ERR_BADSTRUCTURE,
+ *		-FDT_ERR_TRUNCATED, standard meanings
+ */
+const void *fdt_getprop(const void *fdt, int nodeoffset,
+			const char *name, int *lenp);
+static inline void *fdt_getprop_w(void *fdt, int nodeoffset,
+				  const char *name, int *lenp)
+{
+	return (void *)(uintptr_t)fdt_getprop(fdt, nodeoffset, name, lenp);
+}
+
+/**
+ * fdt_get_phandle - retrieve the phandle of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: structure block offset of the node
+ *
+ * fdt_get_phandle() retrieves the phandle of the device tree node at
+ * structure block offset nodeoffset.
+ *
+ * returns:
+ *	the phandle of the node at nodeoffset, on success (!= 0, != -1)
+ *	0, if the node has no phandle, or another error occurs
+ */
+uint32_t fdt_get_phandle(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_get_alias_namelen - get alias based on substring
+ * @fdt: pointer to the device tree blob
+ * @name: name of the alias th look up
+ * @namelen: number of characters of name to consider
+ *
+ * Identical to fdt_get_alias(), but only examine the first namelen
+ * characters of name for matching the alias name.
+ */
+const char *fdt_get_alias_namelen(const void *fdt,
+				  const char *name, int namelen);
+
+/**
+ * fdt_get_alias - retreive the path referenced by a given alias
+ * @fdt: pointer to the device tree blob
+ * @name: name of the alias th look up
+ *
+ * fdt_get_alias() retrieves the value of a given alias.  That is, the
+ * value of the property named 'name' in the node /aliases.
+ *
+ * returns:
+ *	a pointer to the expansion of the alias named 'name', of it exists
+ *	NULL, if the given alias or the /aliases node does not exist
+ */
+const char *fdt_get_alias(const void *fdt, const char *name);
+
+/**
+ * fdt_get_path - determine the full path of a node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose path to find
+ * @buf: character buffer to contain the returned path (will be overwritten)
+ * @buflen: size of the character buffer at buf
+ *
+ * fdt_get_path() computes the full path of the node at offset
+ * nodeoffset, and records that path in the buffer at buf.
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset.
+ *
+ * returns:
+ *	0, on success
+ *		buf contains the absolute path of the node at
+ *		nodeoffset, as a NUL-terminated string.
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_NOSPACE, the path of the given node is longer than (bufsize-1)
+ *		characters and will not fit in the given buffer.
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_get_path(const void *fdt, int nodeoffset, char *buf, int buflen);
+
+/**
+ * fdt_supernode_atdepth_offset - find a specific ancestor of a node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose parent to find
+ * @supernodedepth: depth of the ancestor to find
+ * @nodedepth: pointer to an integer variable (will be overwritten) or NULL
+ *
+ * fdt_supernode_atdepth_offset() finds an ancestor of the given node
+ * at a specific depth from the root (where the root itself has depth
+ * 0, its immediate subnodes depth 1 and so forth).  So
+ *	fdt_supernode_atdepth_offset(fdt, nodeoffset, 0, NULL);
+ * will always return 0, the offset of the root node.  If the node at
+ * nodeoffset has depth D, then:
+ *	fdt_supernode_atdepth_offset(fdt, nodeoffset, D, NULL);
+ * will return nodeoffset itself.
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset.
+ *
+ * returns:
+
+ *	structure block offset of the node at node offset's ancestor
+ *		of depth supernodedepth (>=0), on success
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+*	-FDT_ERR_NOTFOUND, supernodedepth was greater than the depth of nodeoffset
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_supernode_atdepth_offset(const void *fdt, int nodeoffset,
+				 int supernodedepth, int *nodedepth);
+
+/**
+ * fdt_node_depth - find the depth of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose parent to find
+ *
+ * fdt_node_depth() finds the depth of a given node.  The root node
+ * has depth 0, its immediate subnodes depth 1 and so forth.
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset.
+ *
+ * returns:
+ *	depth of the node at nodeoffset (>=0), on success
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_depth(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_parent_offset - find the parent of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose parent to find
+ *
+ * fdt_parent_offset() locates the parent node of a given node (that
+ * is, it finds the offset of the node which contains the node at
+ * nodeoffset as a subnode).
+ *
+ * NOTE: This function is expensive, as it must scan the device tree
+ * structure from the start to nodeoffset, *twice*.
+ *
+ * returns:
+ *	structure block offset of the parent of the node at nodeoffset
+ *		(>=0), on success
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_parent_offset(const void *fdt, int nodeoffset);
+
+/**
+ * fdt_node_offset_by_prop_value - find nodes with a given property value
+ * @fdt: pointer to the device tree blob
+ * @startoffset: only find nodes after this offset
+ * @propname: property name to check
+ * @propval: property value to search for
+ * @proplen: length of the value in propval
+ *
+ * fdt_node_offset_by_prop_value() returns the offset of the first
+ * node after startoffset, which has a property named propname whose
+ * value is of length proplen and has value equal to propval; or if
+ * startoffset is -1, the very first such node in the tree.
+ *
+ * To iterate through all nodes matching the criterion, the following
+ * idiom can be used:
+ *	offset = fdt_node_offset_by_prop_value(fdt, -1, propname,
+ *					       propval, proplen);
+ *	while (offset != -FDT_ERR_NOTFOUND) {
+ *		// other code here
+ *		offset = fdt_node_offset_by_prop_value(fdt, offset, propname,
+ *						       propval, proplen);
+ *	}
+ *
+ * Note the -1 in the first call to the function, if 0 is used here
+ * instead, the function will never locate the root node, even if it
+ * matches the criterion.
+ *
+ * returns:
+ *	structure block offset of the located node (>= 0, >startoffset),
+ *		 on success
+ *	-FDT_ERR_NOTFOUND, no node matching the criterion exists in the
+ *		tree after startoffset
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_offset_by_prop_value(const void *fdt, int startoffset,
+				  const char *propname,
+				  const void *propval, int proplen);
+
+/**
+ * fdt_node_offset_by_phandle - find the node with a given phandle
+ * @fdt: pointer to the device tree blob
+ * @phandle: phandle value
+ *
+ * fdt_node_offset_by_phandle() returns the offset of the node
+ * which has the given phandle value.  If there is more than one node
+ * in the tree with the given phandle (an invalid tree), results are
+ * undefined.
+ *
+ * returns:
+ *	structure block offset of the located node (>= 0), on success
+ *	-FDT_ERR_NOTFOUND, no node with that phandle exists
+ *	-FDT_ERR_BADPHANDLE, given phandle value was invalid (0 or -1)
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_offset_by_phandle(const void *fdt, uint32_t phandle);
+
+/**
+ * fdt_node_check_compatible: check a node's compatible property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of a tree node
+ * @compatible: string to match against
+ *
+ *
+ * fdt_node_check_compatible() returns 0 if the given node contains a
+ * 'compatible' property with the given string as one of its elements,
+ * it returns non-zero otherwise, or on error.
+ *
+ * returns:
+ *	0, if the node has a 'compatible' property listing the given string
+ *	1, if the node has a 'compatible' property, but it does not list
+ *		the given string
+ *	-FDT_ERR_NOTFOUND, if the given node has no 'compatible' property
+ * 	-FDT_ERR_BADOFFSET, if nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_check_compatible(const void *fdt, int nodeoffset,
+			      const char *compatible);
+
+/**
+ * fdt_node_offset_by_compatible - find nodes with a given 'compatible' value
+ * @fdt: pointer to the device tree blob
+ * @startoffset: only find nodes after this offset
+ * @compatible: 'compatible' string to match against
+ *
+ * fdt_node_offset_by_compatible() returns the offset of the first
+ * node after startoffset, which has a 'compatible' property which
+ * lists the given compatible string; or if startoffset is -1, the
+ * very first such node in the tree.
+ *
+ * To iterate through all nodes matching the criterion, the following
+ * idiom can be used:
+ *	offset = fdt_node_offset_by_compatible(fdt, -1, compatible);
+ *	while (offset != -FDT_ERR_NOTFOUND) {
+ *		// other code here
+ *		offset = fdt_node_offset_by_compatible(fdt, offset, compatible);
+ *	}
+ *
+ * Note the -1 in the first call to the function, if 0 is used here
+ * instead, the function will never locate the root node, even if it
+ * matches the criterion.
+ *
+ * returns:
+ *	structure block offset of the located node (>= 0, >startoffset),
+ *		 on success
+ *	-FDT_ERR_NOTFOUND, no node matching the criterion exists in the
+ *		tree after startoffset
+ * 	-FDT_ERR_BADOFFSET, nodeoffset does not refer to a BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE, standard meanings
+ */
+int fdt_node_offset_by_compatible(const void *fdt, int startoffset,
+				  const char *compatible);
+
+/**********************************************************************/
+/* Write-in-place functions                                           */
+/**********************************************************************/
+
+/**
+ * fdt_setprop_inplace - change a property's value, but not its size
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: pointer to data to replace the property value with
+ * @len: length of the property value
+ *
+ * fdt_setprop_inplace() replaces the value of a given property with
+ * the data in val, of length len.  This function cannot change the
+ * size of a property, and so will only work if len is equal to the
+ * current length of the property.
+ *
+ * This function will alter only the bytes in the blob which contain
+ * the given property value, and will not alter or move any other part
+ * of the tree.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOSPACE, if len is not equal to the property's current length
+ *	-FDT_ERR_NOTFOUND, node does not have the named property
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_setprop_inplace(void *fdt, int nodeoffset, const char *name,
+			const void *val, int len);
+
+/**
+ * fdt_setprop_inplace_cell - change the value of a single-cell property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: cell (32-bit integer) value to replace the property with
+ *
+ * fdt_setprop_inplace_cell() replaces the value of a given property
+ * with the 32-bit integer cell value in val, converting val to
+ * big-endian if necessary.  This function cannot change the size of a
+ * property, and so will only work if the property already exists and
+ * has length 4.
+ *
+ * This function will alter only the bytes in the blob which contain
+ * the given property value, and will not alter or move any other part
+ * of the tree.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOSPACE, if the property's length is not equal to 4
+  *	-FDT_ERR_NOTFOUND, node does not have the named property
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+static inline int fdt_setprop_inplace_cell(void *fdt, int nodeoffset,
+					   const char *name, uint32_t val)
+{
+	val = cpu_to_fdt32(val);
+	return fdt_setprop_inplace(fdt, nodeoffset, name, &val, sizeof(val));
+}
+
+/**
+ * fdt_nop_property - replace a property with nop tags
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to nop
+ * @name: name of the property to nop
+ *
+ * fdt_nop_property() will replace a given property's representation
+ * in the blob with FDT_NOP tags, effectively removing it from the
+ * tree.
+ *
+ * This function will alter only the bytes in the blob which contain
+ * the property, and will not alter or move any other part of the
+ * tree.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOTFOUND, node does not have the named property
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_nop_property(void *fdt, int nodeoffset, const char *name);
+
+/**
+ * fdt_nop_node - replace a node (subtree) with nop tags
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node to nop
+ *
+ * fdt_nop_node() will replace a given node's representation in the
+ * blob, including all its subnodes, if any, with FDT_NOP tags,
+ * effectively removing it from the tree.
+ *
+ * This function will alter only the bytes in the blob which contain
+ * the node and its properties and subnodes, and will not alter or
+ * move any other part of the tree.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_nop_node(void *fdt, int nodeoffset);
+
+/**********************************************************************/
+/* Sequential write functions                                         */
+/**********************************************************************/
+
+int fdt_create(void *buf, int bufsize);
+int fdt_add_reservemap_entry(void *fdt, uint64_t addr, uint64_t size);
+int fdt_finish_reservemap(void *fdt);
+int fdt_begin_node(void *fdt, const char *name);
+int fdt_property(void *fdt, const char *name, const void *val, int len);
+static inline int fdt_property_cell(void *fdt, const char *name, uint32_t val)
+{
+	val = cpu_to_fdt32(val);
+	return fdt_property(fdt, name, &val, sizeof(val));
+}
+#define fdt_property_string(fdt, name, str) \
+	fdt_property(fdt, name, str, strlen(str)+1)
+int fdt_end_node(void *fdt);
+int fdt_finish(void *fdt);
+
+/**********************************************************************/
+/* Read-write functions                                               */
+/**********************************************************************/
+
+int fdt_open_into(const void *fdt, void *buf, int bufsize);
+int fdt_pack(void *fdt);
+
+/**
+ * fdt_add_mem_rsv - add one memory reserve map entry
+ * @fdt: pointer to the device tree blob
+ * @address, @size: 64-bit values (native endian)
+ *
+ * Adds a reserve map entry to the given blob reserving a region at
+ * address address of length size.
+ *
+ * This function will insert data into the reserve map and will
+ * therefore change the indexes of some entries in the table.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *		contain the new reservation entry
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_add_mem_rsv(void *fdt, uint64_t address, uint64_t size);
+
+/**
+ * fdt_del_mem_rsv - remove a memory reserve map entry
+ * @fdt: pointer to the device tree blob
+ * @n: entry to remove
+ *
+ * fdt_del_mem_rsv() removes the n-th memory reserve map entry from
+ * the blob.
+ *
+ * This function will delete data from the reservation table and will
+ * therefore change the indexes of some entries in the table.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOTFOUND, there is no entry of the given index (i.e. there
+ *		are less than n+1 reserve map entries)
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_del_mem_rsv(void *fdt, int n);
+
+/**
+ * fdt_set_name - change the name of a given node
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: structure block offset of a node
+ * @name: name to give the node
+ *
+ * fdt_set_name() replaces the name (including unit address, if any)
+ * of the given node with the given string.  NOTE: this function can't
+ * efficiently check if the new name is unique amongst the given
+ * node's siblings; results are undefined if this function is invoked
+ * with a name equal to one of the given node's siblings.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob
+ *		to contain the new name
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE, standard meanings
+ */
+int fdt_set_name(void *fdt, int nodeoffset, const char *name);
+
+/**
+ * fdt_setprop - create or change a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: pointer to data to set the property value to
+ * @len: length of the property value
+ *
+ * fdt_setprop() sets the value of the named property in the given
+ * node to the given value and length, creating the property if it
+ * does not already exist.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *		contain the new property value
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_setprop(void *fdt, int nodeoffset, const char *name,
+		const void *val, int len);
+
+/**
+ * fdt_setprop_cell - set a property to a single cell value
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @val: 32-bit integer value for the property (native endian)
+ *
+ * fdt_setprop_cell() sets the value of the named property in the
+ * given node to the given cell value (converting to big-endian if
+ * necessary), or creates a new property with that value if it does
+ * not already exist.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *		contain the new property value
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+static inline int fdt_setprop_cell(void *fdt, int nodeoffset, const char *name,
+				   uint32_t val)
+{
+	val = cpu_to_fdt32(val);
+	return fdt_setprop(fdt, nodeoffset, name, &val, sizeof(val));
+}
+
+/**
+ * fdt_setprop_string - set a property to a string value
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to change
+ * @name: name of the property to change
+ * @str: string value for the property
+ *
+ * fdt_setprop_string() sets the value of the named property in the
+ * given node to the given string value (using the length of the
+ * string to determine the new length of the property), or creates a
+ * new property with that value if it does not already exist.
+ *
+ * This function may insert or delete data from the blob, and will
+ * therefore change the offsets of some existing nodes.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOSPACE, there is insufficient free space in the blob to
+ *		contain the new property value
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+#define fdt_setprop_string(fdt, nodeoffset, name, str) \
+	fdt_setprop((fdt), (nodeoffset), (name), (str), strlen(str)+1)
+
+/**
+ * fdt_delprop - delete a property
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node whose property to nop
+ * @name: name of the property to nop
+ *
+ * fdt_del_property() will delete the given property.
+ *
+ * This function will delete data from the blob, and will therefore
+ * change the offsets of some existing nodes.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_NOTFOUND, node does not have the named property
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_delprop(void *fdt, int nodeoffset, const char *name);
+
+/**
+ * fdt_add_subnode_namelen - creates a new node based on substring
+ * @fdt: pointer to the device tree blob
+ * @parentoffset: structure block offset of a node
+ * @name: name of the subnode to locate
+ * @namelen: number of characters of name to consider
+ *
+ * Identical to fdt_add_subnode(), but use only the first namelen
+ * characters of name as the name of the new node.  This is useful for
+ * creating subnodes based on a portion of a larger string, such as a
+ * full path.
+ */
+int fdt_add_subnode_namelen(void *fdt, int parentoffset,
+			    const char *name, int namelen);
+
+/**
+ * fdt_add_subnode - creates a new node
+ * @fdt: pointer to the device tree blob
+ * @parentoffset: structure block offset of a node
+ * @name: name of the subnode to locate
+ *
+ * fdt_add_subnode() creates a new node as a subnode of the node at
+ * structure block offset parentoffset, with the given name (which
+ * should include the unit address, if any).
+ *
+ * This function will insert data into the blob, and will therefore
+ * change the offsets of some existing nodes.
+
+ * returns:
+ *	structure block offset of the created nodeequested subnode (>=0), on success
+ *	-FDT_ERR_NOTFOUND, if the requested subnode does not exist
+ *	-FDT_ERR_BADOFFSET, if parentoffset did not point to an FDT_BEGIN_NODE tag
+ *	-FDT_ERR_EXISTS, if the node at parentoffset already has a subnode of
+ *		the given name
+ *	-FDT_ERR_NOSPACE, if there is insufficient free space in the
+ *		blob to contain the new node
+ *	-FDT_ERR_NOSPACE
+ *	-FDT_ERR_BADLAYOUT
+ *      -FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings.
+ */
+int fdt_add_subnode(void *fdt, int parentoffset, const char *name);
+
+/**
+ * fdt_del_node - delete a node (subtree)
+ * @fdt: pointer to the device tree blob
+ * @nodeoffset: offset of the node to nop
+ *
+ * fdt_del_node() will remove the given node, including all its
+ * subnodes if any, from the blob.
+ *
+ * This function will delete data from the blob, and will therefore
+ * change the offsets of some existing nodes.
+ *
+ * returns:
+ *	0, on success
+ *	-FDT_ERR_BADOFFSET, nodeoffset did not point to FDT_BEGIN_NODE tag
+ *	-FDT_ERR_BADLAYOUT,
+ *	-FDT_ERR_BADMAGIC,
+ *	-FDT_ERR_BADVERSION,
+ *	-FDT_ERR_BADSTATE,
+ *	-FDT_ERR_BADSTRUCTURE,
+ *	-FDT_ERR_TRUNCATED, standard meanings
+ */
+int fdt_del_node(void *fdt, int nodeoffset);
+
+/**********************************************************************/
+/* Debugging / informational functions                                */
+/**********************************************************************/
+
+const char *fdt_strerror(int errval);
+
+#endif /* _LIBFDT_H */
diff -r 777658bb5eb9 -r d9ca8249409d xen/include/xen/libfdt/libfdt_env.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/xen/libfdt/libfdt_env.h	Thu Mar 22 14:26:42 2012 +0000
@@ -0,0 +1,16 @@
+#ifndef _LIBFDT_ENV_H
+#define _LIBFDT_ENV_H
+
+#include <xen/config.h>
+#include <xen/types.h>
+#include <xen/string.h>
+#include <asm/byteorder.h>
+
+#define fdt16_to_cpu(x) be16_to_cpu(x)
+#define cpu_to_fdt16(x) cpu_to_be16(x)
+#define fdt32_to_cpu(x) be32_to_cpu(x)
+#define cpu_to_fdt32(x) cpu_to_be32(x)
+#define fdt64_to_cpu(x) be64_to_cpu(x)
+#define cpu_to_fdt64(x) cpu_to_be64(x)
+
+#endif /* _LIBFDT_ENV_H */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 01:44:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 01:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBG1o-0006RF-Iu; Sat, 24 Mar 2012 01:44: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 1SBG1n-0006Qs-9u
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:23 +0000
Received: from [85.158.139.83:29300] by server-1.bemta-5.messagelabs.com id
	93/DE-28458-6F62D6F4; Sat, 24 Mar 2012 01:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1332553460!9496551!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29641 invoked from network); 24 Mar 2012 01:44:21 -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;
	24 Mar 2012 01:44: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 1SBG1k-0006Dj-C6
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBG1i-0005BB-RB
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:19 +0000
Message-Id: <E1SBG1i-0005BB-RB@xenbits.xen.org>
Date: Sat, 24 Mar 2012 01:44:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hpet: force_hpet_broadcast can
	be __initdata
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332499571 -3600
# Node ID e1f4d4ca53b48231d777c4b936f747e34d5be068
# Parent  a66fb91cb8d3b1a01538ed8e5cda7847d93aaf06
x86/hpet: force_hpet_broadcast can be __initdata

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


diff -r a66fb91cb8d3 -r e1f4d4ca53b4 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Fri Mar 23 08:39:39 2012 +0100
+++ b/xen/arch/x86/hpet.c	Fri Mar 23 11:46:11 2012 +0100
@@ -57,7 +57,7 @@
  * if RTC interrupts are enabled. Enable this option if want to always enable
  * legacy hpet broadcast for deep C state
  */
-static bool_t __read_mostly force_hpet_broadcast;
+static bool_t __initdata force_hpet_broadcast;
 boolean_param("hpetbroadcast", force_hpet_broadcast);
 
 /*

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 01:44:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 01:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBG1o-0006RF-Iu; Sat, 24 Mar 2012 01:44: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 1SBG1n-0006Qs-9u
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:23 +0000
Received: from [85.158.139.83:29300] by server-1.bemta-5.messagelabs.com id
	93/DE-28458-6F62D6F4; Sat, 24 Mar 2012 01:44:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-182.messagelabs.com!1332553460!9496551!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29641 invoked from network); 24 Mar 2012 01:44:21 -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;
	24 Mar 2012 01:44: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 1SBG1k-0006Dj-C6
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBG1i-0005BB-RB
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:19 +0000
Message-Id: <E1SBG1i-0005BB-RB@xenbits.xen.org>
Date: Sat, 24 Mar 2012 01:44:17 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hpet: force_hpet_broadcast can
	be __initdata
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332499571 -3600
# Node ID e1f4d4ca53b48231d777c4b936f747e34d5be068
# Parent  a66fb91cb8d3b1a01538ed8e5cda7847d93aaf06
x86/hpet: force_hpet_broadcast can be __initdata

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


diff -r a66fb91cb8d3 -r e1f4d4ca53b4 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Fri Mar 23 08:39:39 2012 +0100
+++ b/xen/arch/x86/hpet.c	Fri Mar 23 11:46:11 2012 +0100
@@ -57,7 +57,7 @@
  * if RTC interrupts are enabled. Enable this option if want to always enable
  * legacy hpet broadcast for deep C state
  */
-static bool_t __read_mostly force_hpet_broadcast;
+static bool_t __initdata force_hpet_broadcast;
 boolean_param("hpetbroadcast", force_hpet_broadcast);
 
 /*

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 01:44:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 01:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBG1p-0006RQ-LY; Sat, 24 Mar 2012 01:44: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 1SBG1n-0006Qv-Us
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:24 +0000
Received: from [85.158.143.99:16397] by server-3.bemta-4.messagelabs.com id
	FA/FF-05853-7F62D6F4; Sat, 24 Mar 2012 01:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1332553458!14252975!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2801 invoked from network); 24 Mar 2012 01:44:19 -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;
	24 Mar 2012 01:44: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 1SBG1h-0006Dg-VF
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBG1f-00059m-ED
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:17 +0000
Message-Id: <E1SBG1f-00059m-ED@xenbits.xen.org>
Date: Sat, 24 Mar 2012 01:44:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/gnttab: fix asm() operand in
	gnttab_clear_flag()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332488379 -3600
# Node ID a66fb91cb8d3b1a01538ed8e5cda7847d93aaf06
# Parent  0ecb8ffe61b2ffff4331fcf49487c956ccb297a0
x86/gnttab: fix asm() operand in gnttab_clear_flag()

The operand needs to use the 'w' modifier in case the compiler happens
to pick a register (which apparently it does for no-one but the
reporter of this problem).

Reported-by: Lin Ming <mlin@ss.pku.edu.cn>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 0ecb8ffe61b2 -r a66fb91cb8d3 xen/include/asm-x86/grant_table.h
--- a/xen/include/asm-x86/grant_table.h	Thu Mar 22 17:15:22 2012 +0000
+++ b/xen/include/asm-x86/grant_table.h	Fri Mar 23 08:39:39 2012 +0100
@@ -54,7 +54,7 @@
      * Note that this cannot be clear_bit(), as the access must be
      * confined to the specified 2 bytes.
      */
-    asm volatile ("lock btrw %1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st));
+    asm volatile ("lock btrw %w1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st));
 }
 
 /* Foreign mappings of HHVM-guest pages do not modify the type count. */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 01:44:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 01:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBG1p-0006RQ-LY; Sat, 24 Mar 2012 01:44: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 1SBG1n-0006Qv-Us
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:24 +0000
Received: from [85.158.143.99:16397] by server-3.bemta-4.messagelabs.com id
	FA/FF-05853-7F62D6F4; Sat, 24 Mar 2012 01:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-10.tower-216.messagelabs.com!1332553458!14252975!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 2801 invoked from network); 24 Mar 2012 01:44:19 -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;
	24 Mar 2012 01:44: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 1SBG1h-0006Dg-VF
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:17 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBG1f-00059m-ED
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:17 +0000
Message-Id: <E1SBG1f-00059m-ED@xenbits.xen.org>
Date: Sat, 24 Mar 2012 01:44:14 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/gnttab: fix asm() operand in
	gnttab_clear_flag()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332488379 -3600
# Node ID a66fb91cb8d3b1a01538ed8e5cda7847d93aaf06
# Parent  0ecb8ffe61b2ffff4331fcf49487c956ccb297a0
x86/gnttab: fix asm() operand in gnttab_clear_flag()

The operand needs to use the 'w' modifier in case the compiler happens
to pick a register (which apparently it does for no-one but the
reporter of this problem).

Reported-by: Lin Ming <mlin@ss.pku.edu.cn>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 0ecb8ffe61b2 -r a66fb91cb8d3 xen/include/asm-x86/grant_table.h
--- a/xen/include/asm-x86/grant_table.h	Thu Mar 22 17:15:22 2012 +0000
+++ b/xen/include/asm-x86/grant_table.h	Fri Mar 23 08:39:39 2012 +0100
@@ -54,7 +54,7 @@
      * Note that this cannot be clear_bit(), as the access must be
      * confined to the specified 2 bytes.
      */
-    asm volatile ("lock btrw %1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st));
+    asm volatile ("lock btrw %w1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st));
 }
 
 /* Foreign mappings of HHVM-guest pages do not modify the type count. */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 01:44:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 01:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBG1p-0006RW-Nu; Sat, 24 Mar 2012 01:44: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 1SBG1o-0006Qv-BK
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:24 +0000
Received: from [85.158.143.35:31675] by server-3.bemta-4.messagelabs.com id
	9B/FF-05853-7F62D6F4; Sat, 24 Mar 2012 01:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1332553461!5840949!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23935 invoked from network); 24 Mar 2012 01:44:22 -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;
	24 Mar 2012 01:44: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 1SBG1k-0006Dm-Vi
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBG1k-0005C9-OS
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:20 +0000
Message-Id: <E1SBG1k-0005C9-OS@xenbits.xen.org>
Date: Sat, 24 Mar 2012 01:44:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Fix test for NULL command line in
	cmdline_parse()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332510328 0
# Node ID b7a1794aed59fd2b0816b3bbcf97690c0241814f
# Parent  e1f4d4ca53b48231d777c4b936f747e34d5be068
Fix test for NULL command line in cmdline_parse()

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


diff -r e1f4d4ca53b4 -r b7a1794aed59 xen/common/kernel.c
--- a/xen/common/kernel.c	Fri Mar 23 11:46:11 2012 +0100
+++ b/xen/common/kernel.c	Fri Mar 23 13:45:28 2012 +0000
@@ -55,11 +55,11 @@
     struct kernel_param *param;
     int bool_assert;
 
+    if ( cmdline == NULL )
+        return;
+
     safe_strcpy(saved_cmdline, cmdline);
 
-    if ( p == NULL )
-        return;
-
     for ( ; ; )
     {
         /* Skip whitespace. */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 01:44:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 01:44:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBG1p-0006RW-Nu; Sat, 24 Mar 2012 01:44: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 1SBG1o-0006Qv-BK
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:24 +0000
Received: from [85.158.143.35:31675] by server-3.bemta-4.messagelabs.com id
	9B/FF-05853-7F62D6F4; Sat, 24 Mar 2012 01:44:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1332553461!5840949!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23935 invoked from network); 24 Mar 2012 01:44:22 -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;
	24 Mar 2012 01:44: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 1SBG1k-0006Dm-Vi
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBG1k-0005C9-OS
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 01:44:20 +0000
Message-Id: <E1SBG1k-0005C9-OS@xenbits.xen.org>
Date: Sat, 24 Mar 2012 01:44:20 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Fix test for NULL command line in
	cmdline_parse()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332510328 0
# Node ID b7a1794aed59fd2b0816b3bbcf97690c0241814f
# Parent  e1f4d4ca53b48231d777c4b936f747e34d5be068
Fix test for NULL command line in cmdline_parse()

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


diff -r e1f4d4ca53b4 -r b7a1794aed59 xen/common/kernel.c
--- a/xen/common/kernel.c	Fri Mar 23 11:46:11 2012 +0100
+++ b/xen/common/kernel.c	Fri Mar 23 13:45:28 2012 +0000
@@ -55,11 +55,11 @@
     struct kernel_param *param;
     int bool_assert;
 
+    if ( cmdline == NULL )
+        return;
+
     safe_strcpy(saved_cmdline, cmdline);
 
-    if ( p == NULL )
-        return;
-
     for ( ; ; )
     {
         /* Skip whitespace. */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 04:59:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 04:59: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 1SBJ4J-0007yR-JZ; Sat, 24 Mar 2012 04:59:11 +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 1SBJ4I-0007yF-2a
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 04:59:10 +0000
Received: from [85.158.138.51:40676] by server-6.bemta-3.messagelabs.com id
	AE/49-08206-D945D6F4; Sat, 24 Mar 2012 04:59:09 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1332565147!18898814!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24553 invoked from network); 24 Mar 2012 04:59:08 -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;
	24 Mar 2012 04:59:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBJ4E-0000EQ-JT
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 04:59:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBIwv-0003L8-4U
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 04:59:04 +0000
Message-Id: <E1SBIwv-0003L8-4U@xenbits.xen.org>
Date: Sat, 24 Mar 2012 04:51:29 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/gnttab: fix asm() operand in
	gnttab_clear_flag()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332511102 0
# Node ID 35e2f18e04b6fc3e6a55e1ad4ba9080044083f6a
# Parent  14416d8215d455302d637ed801b0de0ec72645f5
x86/gnttab: fix asm() operand in gnttab_clear_flag()

The operand needs to use the 'w' modifier in case the compiler happens
to pick a register (which apparently it does for no-one but the
reporter of this problem).

Reported-by: Lin Ming <mlin@ss.pku.edu.cn>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25092:a66fb91cb8d3
xen-unstable date:        Fri Mar 23 08:39:39 2012 +0100
---


diff -r 14416d8215d4 -r 35e2f18e04b6 xen/include/asm-x86/grant_table.h
--- a/xen/include/asm-x86/grant_table.h	Wed Mar 14 12:02:02 2012 +0000
+++ b/xen/include/asm-x86/grant_table.h	Fri Mar 23 13:58:22 2012 +0000
@@ -54,7 +54,7 @@
      * Note that this cannot be clear_bit(), as the access must be
      * confined to the specified 2 bytes.
      */
-    asm volatile ("lock btrw %1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st));
+    asm volatile ("lock btrw %w1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st));
 }
 
 /* Foreign mappings of HHVM-guest pages do not modify the type count. */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 04:59:15 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 04:59: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 1SBJ4J-0007yR-JZ; Sat, 24 Mar 2012 04:59:11 +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 1SBJ4I-0007yF-2a
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 04:59:10 +0000
Received: from [85.158.138.51:40676] by server-6.bemta-3.messagelabs.com id
	AE/49-08206-D945D6F4; Sat, 24 Mar 2012 04:59:09 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-174.messagelabs.com!1332565147!18898814!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24553 invoked from network); 24 Mar 2012 04:59:08 -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;
	24 Mar 2012 04:59:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBJ4E-0000EQ-JT
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 04:59:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBIwv-0003L8-4U
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 04:59:04 +0000
Message-Id: <E1SBIwv-0003L8-4U@xenbits.xen.org>
Date: Sat, 24 Mar 2012 04:51:29 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86/gnttab: fix asm() operand in
	gnttab_clear_flag()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332511102 0
# Node ID 35e2f18e04b6fc3e6a55e1ad4ba9080044083f6a
# Parent  14416d8215d455302d637ed801b0de0ec72645f5
x86/gnttab: fix asm() operand in gnttab_clear_flag()

The operand needs to use the 'w' modifier in case the compiler happens
to pick a register (which apparently it does for no-one but the
reporter of this problem).

Reported-by: Lin Ming <mlin@ss.pku.edu.cn>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25092:a66fb91cb8d3
xen-unstable date:        Fri Mar 23 08:39:39 2012 +0100
---


diff -r 14416d8215d4 -r 35e2f18e04b6 xen/include/asm-x86/grant_table.h
--- a/xen/include/asm-x86/grant_table.h	Wed Mar 14 12:02:02 2012 +0000
+++ b/xen/include/asm-x86/grant_table.h	Fri Mar 23 13:58:22 2012 +0000
@@ -54,7 +54,7 @@
      * Note that this cannot be clear_bit(), as the access must be
      * confined to the specified 2 bytes.
      */
-    asm volatile ("lock btrw %1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st));
+    asm volatile ("lock btrw %w1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st));
 }
 
 /* Foreign mappings of HHVM-guest pages do not modify the type count. */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 04:59:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 04:59: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 1SBJ4X-0007zq-Mj; Sat, 24 Mar 2012 04:59: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 1SBJ4W-0007zf-H1
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 04:59:24 +0000
Received: from [85.158.143.99:28525] by server-3.bemta-4.messagelabs.com id
	DC/93-05853-BA45D6F4; Sat, 24 Mar 2012 04:59:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1332565161!15333442!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24019 invoked from network); 24 Mar 2012 04:59:22 -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;
	24 Mar 2012 04:59: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 1SBJ4T-0000Eb-30
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 04:59:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBJ4L-00064o-8t
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 04:59:19 +0000
Message-Id: <E1SBJ4L-00064o-8t@xenbits.xen.org>
Date: Sat, 24 Mar 2012 04:59:04 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Introduce system_state variable.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332511265 0
# Node ID d67e4d12723f26bd12a787f998718d535ca07098
# Parent  35e2f18e04b6fc3e6a55e1ad4ba9080044083f6a
Introduce system_state variable.

Use it to replace x86-specific early_boot boolean variable.

Also use it to detect suspend/resume case during cpu offline/online
to avoid unnecessarily breaking vcpu and cpupool affinities.

Signed-off-by: Keir Fraser <keir@xen.org>
Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
xen-unstable changeset:   25079:d5ccb2d1dbd1
xen-unstable date:        Thu Mar 22 12:20:13 2012 +0000

Backport requested by Juergen to fix crash on poweroff when using
cpupools.
---


diff -r 35e2f18e04b6 -r d67e4d12723f xen/arch/x86/acpi/power.c
--- a/xen/arch/x86/acpi/power.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/arch/x86/acpi/power.c	Fri Mar 23 14:01:05 2012 +0000
@@ -135,6 +135,9 @@
     if ( !spin_trylock(&pm_lock) )
         return -EBUSY;
 
+    BUG_ON(system_state != SYS_STATE_active);
+    system_state = SYS_STATE_suspend;
+
     printk(XENLOG_INFO "Preparing system for ACPI S%d state.\n", state);
 
     freeze_domains();
@@ -142,7 +145,10 @@
     acpi_dmar_reinstate();
 
     if ( (error = disable_nonboot_cpus()) )
+    {
+        system_state = SYS_STATE_resume;
         goto enable_cpu;
+    }
 
     cpufreq_del_cpu(0);
 
@@ -159,6 +165,7 @@
     if ( (error = device_power_down()) )
     {
         printk(XENLOG_ERR "Some devices failed to power down.");
+        system_state = SYS_STATE_resume;
         goto done;
     }
 
@@ -179,6 +186,8 @@
         break;
     }
 
+    system_state = SYS_STATE_resume;
+
     /* Restore CR4 and EFER from cached values. */
     cr4 = read_cr4();
     write_cr4(cr4 & ~X86_CR4_MCE);
@@ -212,6 +221,7 @@
     mtrr_aps_sync_end();
     acpi_dmar_zap();
     thaw_domains();
+    system_state = SYS_STATE_active;
     spin_unlock(&pm_lock);
     return error;
 }
diff -r 35e2f18e04b6 -r d67e4d12723f xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/arch/x86/mm.c	Fri Mar 23 14:01:05 2012 +0000
@@ -5123,7 +5123,7 @@
 
 void free_xen_pagetable(void *v)
 {
-    if ( early_boot )
+    if ( system_state == SYS_STATE_early_boot )
         return;
 
     if ( is_xen_heap_page(virt_to_page(v)) )
diff -r 35e2f18e04b6 -r d67e4d12723f xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/arch/x86/setup.c	Fri Mar 23 14:01:05 2012 +0000
@@ -87,8 +87,6 @@
 s8 __read_mostly xen_cpuidle = -1;
 boolean_param("cpuidle", xen_cpuidle);
 
-bool_t __read_mostly early_boot = 1;
-
 cpumask_t __read_mostly cpu_present_map;
 
 unsigned long __read_mostly xen_phys_start;
@@ -275,7 +273,7 @@
     void *ret;
 
 #ifdef __x86_64__
-    if ( !early_boot )
+    if ( system_state != SYS_STATE_early_boot )
         return mod ? mfn_to_virt(mod->mod_start) : NULL;
 #endif
 
@@ -1142,7 +1140,7 @@
 #endif
 
     end_boot_allocator();
-    early_boot = 0;
+    system_state = SYS_STATE_boot;
 
 #if defined(CONFIG_X86_64)
     vesa_init();
@@ -1341,6 +1339,8 @@
     /* Hide UART from DOM0 if we're using it */
     serial_endboot();
 
+    system_state = SYS_STATE_active;
+
     domain_unpause_by_systemcontroller(dom0);
 
     reset_stack_and_jump(init_done);
diff -r 35e2f18e04b6 -r d67e4d12723f xen/arch/x86/x86_32/mm.c
--- a/xen/arch/x86/x86_32/mm.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/arch/x86/x86_32/mm.c	Fri Mar 23 14:01:05 2012 +0000
@@ -45,7 +45,7 @@
 {
     unsigned long mfn;
 
-    if ( !early_boot )
+    if ( system_state != SYS_STATE_early_boot )
     {
         void *v = alloc_xenheap_page();
 
diff -r 35e2f18e04b6 -r d67e4d12723f xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/arch/x86/x86_64/mm.c	Fri Mar 23 14:01:05 2012 +0000
@@ -81,7 +81,7 @@
 {
     unsigned long mfn;
 
-    if ( !early_boot )
+    if ( system_state != SYS_STATE_early_boot )
     {
         struct page_info *pg = alloc_domheap_page(NULL, 0);
 
diff -r 35e2f18e04b6 -r d67e4d12723f xen/common/cpupool.c
--- a/xen/common/cpupool.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/common/cpupool.c	Fri Mar 23 14:01:05 2012 +0000
@@ -616,6 +616,10 @@
     unsigned int cpu = (unsigned long)hcpu;
     int rc = 0;
 
+    if ( (system_state == SYS_STATE_suspend) ||
+         (system_state == SYS_STATE_resume) )
+        goto out;
+
     switch ( action )
     {
     case CPU_DOWN_FAILED:
@@ -629,6 +633,7 @@
         break;
     }
 
+out:
     return !rc ? NOTIFY_DONE : notifier_from_errno(rc);
 }
 
diff -r 35e2f18e04b6 -r d67e4d12723f xen/common/kernel.c
--- a/xen/common/kernel.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/common/kernel.c	Fri Mar 23 14:01:05 2012 +0000
@@ -22,6 +22,8 @@
 
 #ifndef COMPAT
 
+enum system_state system_state = SYS_STATE_early_boot;
+
 int tainted;
 
 xen_commandline_t saved_cmdline;
diff -r 35e2f18e04b6 -r d67e4d12723f xen/common/schedule.c
--- a/xen/common/schedule.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/common/schedule.c	Fri Mar 23 14:01:05 2012 +0000
@@ -546,7 +546,7 @@
     bool_t affinity_broken;
 
     c = per_cpu(cpupool, cpu);
-    if ( c == NULL )
+    if ( (c == NULL) || (system_state == SYS_STATE_suspend) )
         return ret;
 
     for_each_domain ( d )
diff -r 35e2f18e04b6 -r d67e4d12723f xen/include/asm-x86/setup.h
--- a/xen/include/asm-x86/setup.h	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/include/asm-x86/setup.h	Fri Mar 23 14:01:05 2012 +0000
@@ -3,7 +3,6 @@
 
 #include <xen/multiboot.h>
 
-extern bool_t early_boot;
 extern unsigned long xenheap_initial_phys_start;
 
 void init_done(void);
diff -r 35e2f18e04b6 -r d67e4d12723f xen/include/xen/kernel.h
--- a/xen/include/xen/kernel.h	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/include/xen/kernel.h	Fri Mar 23 14:01:05 2012 +0000
@@ -81,5 +81,13 @@
     (__p >= _sinittext) && (__p <= _einittext); \
 })
 
+extern enum system_state {
+    SYS_STATE_early_boot,
+    SYS_STATE_boot,
+    SYS_STATE_active,
+    SYS_STATE_suspend,
+    SYS_STATE_resume
+} system_state;
+
 #endif /* _LINUX_KERNEL_H */
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 04:59:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 04:59: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 1SBJ4X-0007zq-Mj; Sat, 24 Mar 2012 04:59: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 1SBJ4W-0007zf-H1
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 04:59:24 +0000
Received: from [85.158.143.99:28525] by server-3.bemta-4.messagelabs.com id
	DC/93-05853-BA45D6F4; Sat, 24 Mar 2012 04:59:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-216.messagelabs.com!1332565161!15333442!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24019 invoked from network); 24 Mar 2012 04:59:22 -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;
	24 Mar 2012 04:59: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 1SBJ4T-0000Eb-30
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 04:59:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBJ4L-00064o-8t
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 04:59:19 +0000
Message-Id: <E1SBJ4L-00064o-8t@xenbits.xen.org>
Date: Sat, 24 Mar 2012 04:59:04 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] Introduce system_state variable.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332511265 0
# Node ID d67e4d12723f26bd12a787f998718d535ca07098
# Parent  35e2f18e04b6fc3e6a55e1ad4ba9080044083f6a
Introduce system_state variable.

Use it to replace x86-specific early_boot boolean variable.

Also use it to detect suspend/resume case during cpu offline/online
to avoid unnecessarily breaking vcpu and cpupool affinities.

Signed-off-by: Keir Fraser <keir@xen.org>
Acked-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
xen-unstable changeset:   25079:d5ccb2d1dbd1
xen-unstable date:        Thu Mar 22 12:20:13 2012 +0000

Backport requested by Juergen to fix crash on poweroff when using
cpupools.
---


diff -r 35e2f18e04b6 -r d67e4d12723f xen/arch/x86/acpi/power.c
--- a/xen/arch/x86/acpi/power.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/arch/x86/acpi/power.c	Fri Mar 23 14:01:05 2012 +0000
@@ -135,6 +135,9 @@
     if ( !spin_trylock(&pm_lock) )
         return -EBUSY;
 
+    BUG_ON(system_state != SYS_STATE_active);
+    system_state = SYS_STATE_suspend;
+
     printk(XENLOG_INFO "Preparing system for ACPI S%d state.\n", state);
 
     freeze_domains();
@@ -142,7 +145,10 @@
     acpi_dmar_reinstate();
 
     if ( (error = disable_nonboot_cpus()) )
+    {
+        system_state = SYS_STATE_resume;
         goto enable_cpu;
+    }
 
     cpufreq_del_cpu(0);
 
@@ -159,6 +165,7 @@
     if ( (error = device_power_down()) )
     {
         printk(XENLOG_ERR "Some devices failed to power down.");
+        system_state = SYS_STATE_resume;
         goto done;
     }
 
@@ -179,6 +186,8 @@
         break;
     }
 
+    system_state = SYS_STATE_resume;
+
     /* Restore CR4 and EFER from cached values. */
     cr4 = read_cr4();
     write_cr4(cr4 & ~X86_CR4_MCE);
@@ -212,6 +221,7 @@
     mtrr_aps_sync_end();
     acpi_dmar_zap();
     thaw_domains();
+    system_state = SYS_STATE_active;
     spin_unlock(&pm_lock);
     return error;
 }
diff -r 35e2f18e04b6 -r d67e4d12723f xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/arch/x86/mm.c	Fri Mar 23 14:01:05 2012 +0000
@@ -5123,7 +5123,7 @@
 
 void free_xen_pagetable(void *v)
 {
-    if ( early_boot )
+    if ( system_state == SYS_STATE_early_boot )
         return;
 
     if ( is_xen_heap_page(virt_to_page(v)) )
diff -r 35e2f18e04b6 -r d67e4d12723f xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/arch/x86/setup.c	Fri Mar 23 14:01:05 2012 +0000
@@ -87,8 +87,6 @@
 s8 __read_mostly xen_cpuidle = -1;
 boolean_param("cpuidle", xen_cpuidle);
 
-bool_t __read_mostly early_boot = 1;
-
 cpumask_t __read_mostly cpu_present_map;
 
 unsigned long __read_mostly xen_phys_start;
@@ -275,7 +273,7 @@
     void *ret;
 
 #ifdef __x86_64__
-    if ( !early_boot )
+    if ( system_state != SYS_STATE_early_boot )
         return mod ? mfn_to_virt(mod->mod_start) : NULL;
 #endif
 
@@ -1142,7 +1140,7 @@
 #endif
 
     end_boot_allocator();
-    early_boot = 0;
+    system_state = SYS_STATE_boot;
 
 #if defined(CONFIG_X86_64)
     vesa_init();
@@ -1341,6 +1339,8 @@
     /* Hide UART from DOM0 if we're using it */
     serial_endboot();
 
+    system_state = SYS_STATE_active;
+
     domain_unpause_by_systemcontroller(dom0);
 
     reset_stack_and_jump(init_done);
diff -r 35e2f18e04b6 -r d67e4d12723f xen/arch/x86/x86_32/mm.c
--- a/xen/arch/x86/x86_32/mm.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/arch/x86/x86_32/mm.c	Fri Mar 23 14:01:05 2012 +0000
@@ -45,7 +45,7 @@
 {
     unsigned long mfn;
 
-    if ( !early_boot )
+    if ( system_state != SYS_STATE_early_boot )
     {
         void *v = alloc_xenheap_page();
 
diff -r 35e2f18e04b6 -r d67e4d12723f xen/arch/x86/x86_64/mm.c
--- a/xen/arch/x86/x86_64/mm.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/arch/x86/x86_64/mm.c	Fri Mar 23 14:01:05 2012 +0000
@@ -81,7 +81,7 @@
 {
     unsigned long mfn;
 
-    if ( !early_boot )
+    if ( system_state != SYS_STATE_early_boot )
     {
         struct page_info *pg = alloc_domheap_page(NULL, 0);
 
diff -r 35e2f18e04b6 -r d67e4d12723f xen/common/cpupool.c
--- a/xen/common/cpupool.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/common/cpupool.c	Fri Mar 23 14:01:05 2012 +0000
@@ -616,6 +616,10 @@
     unsigned int cpu = (unsigned long)hcpu;
     int rc = 0;
 
+    if ( (system_state == SYS_STATE_suspend) ||
+         (system_state == SYS_STATE_resume) )
+        goto out;
+
     switch ( action )
     {
     case CPU_DOWN_FAILED:
@@ -629,6 +633,7 @@
         break;
     }
 
+out:
     return !rc ? NOTIFY_DONE : notifier_from_errno(rc);
 }
 
diff -r 35e2f18e04b6 -r d67e4d12723f xen/common/kernel.c
--- a/xen/common/kernel.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/common/kernel.c	Fri Mar 23 14:01:05 2012 +0000
@@ -22,6 +22,8 @@
 
 #ifndef COMPAT
 
+enum system_state system_state = SYS_STATE_early_boot;
+
 int tainted;
 
 xen_commandline_t saved_cmdline;
diff -r 35e2f18e04b6 -r d67e4d12723f xen/common/schedule.c
--- a/xen/common/schedule.c	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/common/schedule.c	Fri Mar 23 14:01:05 2012 +0000
@@ -546,7 +546,7 @@
     bool_t affinity_broken;
 
     c = per_cpu(cpupool, cpu);
-    if ( c == NULL )
+    if ( (c == NULL) || (system_state == SYS_STATE_suspend) )
         return ret;
 
     for_each_domain ( d )
diff -r 35e2f18e04b6 -r d67e4d12723f xen/include/asm-x86/setup.h
--- a/xen/include/asm-x86/setup.h	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/include/asm-x86/setup.h	Fri Mar 23 14:01:05 2012 +0000
@@ -3,7 +3,6 @@
 
 #include <xen/multiboot.h>
 
-extern bool_t early_boot;
 extern unsigned long xenheap_initial_phys_start;
 
 void init_done(void);
diff -r 35e2f18e04b6 -r d67e4d12723f xen/include/xen/kernel.h
--- a/xen/include/xen/kernel.h	Fri Mar 23 13:58:22 2012 +0000
+++ b/xen/include/xen/kernel.h	Fri Mar 23 14:01:05 2012 +0000
@@ -81,5 +81,13 @@
     (__p >= _sinittext) && (__p <= _einittext); \
 })
 
+extern enum system_state {
+    SYS_STATE_early_boot,
+    SYS_STATE_boot,
+    SYS_STATE_active,
+    SYS_STATE_suspend,
+    SYS_STATE_resume
+} system_state;
+
 #endif /* _LINUX_KERNEL_H */
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23: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 1SBZwe-0001u0-UB; Sat, 24 Mar 2012 23:00: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 1SBZwe-0001th-Ds
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:24 +0000
Received: from [85.158.138.51:59556] by server-7.bemta-3.messagelabs.com id
	C0/22-07528-7025E6F4; Sat, 24 Mar 2012 23:00:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1332630021!19005036!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31427 invoked from network); 24 Mar 2012 23: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;
	24 Mar 2012 23: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 1SBZwa-0004Q8-9D
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBZwa-0006rx-6k
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:20 +0000
Message-Id: <E1SBZwa-0006rx-6k@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:00:19 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] vMSI: fix ia64 build for
	21577:c41ab909f08e
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332510940 0
# Node ID 7d704b95c0ef2b42632f04b9bad40db164318ac4
# Parent  85312f3875b6a286759c441f394b0e28ad16723f
vMSI: fix ia64 build for 21577:c41ab909f08e

On ia64, 21577:c41ab909f08e introduces the following error:
  /xen/include/xen/pci.h:52: warning: implicit declaration of function
  `PFN_UP'
  /xen/include/xen/pci.h:52: error: variable-size type declared
  outside of any function
  /xen/include/xen/pci.h:53: error: variable-size type declared
  outside of any function

Because the macro PFN_UP() is defined on x86 only.

Signed-off-by: Keir Fraser <keir@xen.org>
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
xen-unstable changeset:   23074:c80e0fb4fe93
xen-unstable date:        Wed Mar 23 13:34:55 2011 +0000
---


diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/domain_build.c	Fri Mar 23 13:55:40 2012 +0000
@@ -20,6 +20,7 @@
 #include <xen/bitops.h>
 #include <xen/compat.h>
 #include <xen/libelf.h>
+#include <xen/pfn.h>
 #include <asm/regs.h>
 #include <asm/system.h>
 #include <asm/io.h>
diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/e820.c
--- a/xen/arch/x86/e820.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/e820.c	Fri Mar 23 13:55:40 2012 +0000
@@ -4,6 +4,7 @@
 #include <xen/mm.h>
 #include <xen/compat.h>
 #include <xen/dmi.h>
+#include <xen/pfn.h>
 #include <asm/e820.h>
 #include <asm/page.h>
 #include <asm/processor.h>
diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/mm.c	Fri Mar 23 13:55:40 2012 +0000
@@ -99,6 +99,7 @@
 #include <xen/event.h>
 #include <xen/iocap.h>
 #include <xen/guest_access.h>
+#include <xen/pfn.h>
 #include <asm/paging.h>
 #include <asm/shadow.h>
 #include <asm/page.h>
diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/msi.c	Fri Mar 23 13:55:40 2012 +0000
@@ -17,6 +17,7 @@
 #include <xen/pci.h>
 #include <xen/pci_regs.h>
 #include <xen/keyhandler.h>
+#include <xen/pfn.h>
 #include <asm/io.h>
 #include <asm/smp.h>
 #include <asm/desc.h>
diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/numa.c
--- a/xen/arch/x86/numa.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/numa.c	Fri Mar 23 13:55:40 2012 +0000
@@ -13,6 +13,7 @@
 #include <xen/keyhandler.h>
 #include <xen/time.h>
 #include <xen/smp.h>
+#include <xen/pfn.h>
 #include <asm/acpi.h>
 #include <xen/sched.h>
 
diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/setup.c	Fri Mar 23 13:55:40 2012 +0000
@@ -20,6 +20,7 @@
 #include <xen/rcupdate.h>
 #include <xen/vga.h>
 #include <xen/dmi.h>
+#include <xen/pfn.h>
 #include <xen/nodemask.h>
 #include <public/version.h>
 #ifdef CONFIG_COMPAT
diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/srat.c
--- a/xen/arch/x86/srat.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/srat.c	Fri Mar 23 13:55:40 2012 +0000
@@ -17,6 +17,7 @@
 #include <xen/nodemask.h>
 #include <xen/acpi.h>
 #include <xen/numa.h>
+#include <xen/pfn.h>
 #include <asm/e820.h>
 #include <asm/page.h>
 
diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/tboot.c
--- a/xen/arch/x86/tboot.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/tboot.c	Fri Mar 23 13:55:40 2012 +0000
@@ -6,6 +6,7 @@
 #include <xen/domain_page.h>
 #include <xen/iommu.h>
 #include <xen/acpi.h>
+#include <xen/pfn.h>
 #include <asm/fixmap.h>
 #include <asm/page.h>
 #include <asm/processor.h>
diff -r 85312f3875b6 -r 7d704b95c0ef xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/include/asm-x86/page.h	Fri Mar 23 13:55:40 2012 +0000
@@ -385,9 +385,6 @@
 
 #endif /* !__ASSEMBLY__ */
 
-#define PFN_DOWN(x)   ((x) >> PAGE_SHIFT)
-#define PFN_UP(x)     (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
-
 #endif /* __X86_PAGE_H__ */
 
 /*
diff -r 85312f3875b6 -r 7d704b95c0ef xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/include/xen/pci.h	Fri Mar 23 13:55:40 2012 +0000
@@ -12,6 +12,7 @@
 #include <xen/list.h>
 #include <xen/spinlock.h>
 #include <xen/pci_regs.h>
+#include <xen/pfn.h>
 #include <asm/page.h>
 
 /*
diff -r 85312f3875b6 -r 7d704b95c0ef xen/include/xen/pfn.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/xen/pfn.h	Fri Mar 23 13:55:40 2012 +0000
@@ -0,0 +1,9 @@
+#ifndef __XEN_PFN_H__
+#define __XEN_PFN_H__
+
+#include <asm/page.h>
+
+#define PFN_DOWN(x)   ((x) >> PAGE_SHIFT)
+#define PFN_UP(x)     (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
+
+#endif /* __XEN_PFN_H__ */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23: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 1SBZwe-0001u0-UB; Sat, 24 Mar 2012 23:00: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 1SBZwe-0001th-Ds
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:24 +0000
Received: from [85.158.138.51:59556] by server-7.bemta-3.messagelabs.com id
	C0/22-07528-7025E6F4; Sat, 24 Mar 2012 23:00:23 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1332630021!19005036!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 31427 invoked from network); 24 Mar 2012 23: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;
	24 Mar 2012 23: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 1SBZwa-0004Q8-9D
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBZwa-0006rx-6k
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:20 +0000
Message-Id: <E1SBZwa-0006rx-6k@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:00:19 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] vMSI: fix ia64 build for
	21577:c41ab909f08e
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332510940 0
# Node ID 7d704b95c0ef2b42632f04b9bad40db164318ac4
# Parent  85312f3875b6a286759c441f394b0e28ad16723f
vMSI: fix ia64 build for 21577:c41ab909f08e

On ia64, 21577:c41ab909f08e introduces the following error:
  /xen/include/xen/pci.h:52: warning: implicit declaration of function
  `PFN_UP'
  /xen/include/xen/pci.h:52: error: variable-size type declared
  outside of any function
  /xen/include/xen/pci.h:53: error: variable-size type declared
  outside of any function

Because the macro PFN_UP() is defined on x86 only.

Signed-off-by: Keir Fraser <keir@xen.org>
Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
xen-unstable changeset:   23074:c80e0fb4fe93
xen-unstable date:        Wed Mar 23 13:34:55 2011 +0000
---


diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/domain_build.c
--- a/xen/arch/x86/domain_build.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/domain_build.c	Fri Mar 23 13:55:40 2012 +0000
@@ -20,6 +20,7 @@
 #include <xen/bitops.h>
 #include <xen/compat.h>
 #include <xen/libelf.h>
+#include <xen/pfn.h>
 #include <asm/regs.h>
 #include <asm/system.h>
 #include <asm/io.h>
diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/e820.c
--- a/xen/arch/x86/e820.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/e820.c	Fri Mar 23 13:55:40 2012 +0000
@@ -4,6 +4,7 @@
 #include <xen/mm.h>
 #include <xen/compat.h>
 #include <xen/dmi.h>
+#include <xen/pfn.h>
 #include <asm/e820.h>
 #include <asm/page.h>
 #include <asm/processor.h>
diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/mm.c	Fri Mar 23 13:55:40 2012 +0000
@@ -99,6 +99,7 @@
 #include <xen/event.h>
 #include <xen/iocap.h>
 #include <xen/guest_access.h>
+#include <xen/pfn.h>
 #include <asm/paging.h>
 #include <asm/shadow.h>
 #include <asm/page.h>
diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/msi.c
--- a/xen/arch/x86/msi.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/msi.c	Fri Mar 23 13:55:40 2012 +0000
@@ -17,6 +17,7 @@
 #include <xen/pci.h>
 #include <xen/pci_regs.h>
 #include <xen/keyhandler.h>
+#include <xen/pfn.h>
 #include <asm/io.h>
 #include <asm/smp.h>
 #include <asm/desc.h>
diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/numa.c
--- a/xen/arch/x86/numa.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/numa.c	Fri Mar 23 13:55:40 2012 +0000
@@ -13,6 +13,7 @@
 #include <xen/keyhandler.h>
 #include <xen/time.h>
 #include <xen/smp.h>
+#include <xen/pfn.h>
 #include <asm/acpi.h>
 #include <xen/sched.h>
 
diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/setup.c
--- a/xen/arch/x86/setup.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/setup.c	Fri Mar 23 13:55:40 2012 +0000
@@ -20,6 +20,7 @@
 #include <xen/rcupdate.h>
 #include <xen/vga.h>
 #include <xen/dmi.h>
+#include <xen/pfn.h>
 #include <xen/nodemask.h>
 #include <public/version.h>
 #ifdef CONFIG_COMPAT
diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/srat.c
--- a/xen/arch/x86/srat.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/srat.c	Fri Mar 23 13:55:40 2012 +0000
@@ -17,6 +17,7 @@
 #include <xen/nodemask.h>
 #include <xen/acpi.h>
 #include <xen/numa.h>
+#include <xen/pfn.h>
 #include <asm/e820.h>
 #include <asm/page.h>
 
diff -r 85312f3875b6 -r 7d704b95c0ef xen/arch/x86/tboot.c
--- a/xen/arch/x86/tboot.c	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/arch/x86/tboot.c	Fri Mar 23 13:55:40 2012 +0000
@@ -6,6 +6,7 @@
 #include <xen/domain_page.h>
 #include <xen/iommu.h>
 #include <xen/acpi.h>
+#include <xen/pfn.h>
 #include <asm/fixmap.h>
 #include <asm/page.h>
 #include <asm/processor.h>
diff -r 85312f3875b6 -r 7d704b95c0ef xen/include/asm-x86/page.h
--- a/xen/include/asm-x86/page.h	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/include/asm-x86/page.h	Fri Mar 23 13:55:40 2012 +0000
@@ -385,9 +385,6 @@
 
 #endif /* !__ASSEMBLY__ */
 
-#define PFN_DOWN(x)   ((x) >> PAGE_SHIFT)
-#define PFN_UP(x)     (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
-
 #endif /* __X86_PAGE_H__ */
 
 /*
diff -r 85312f3875b6 -r 7d704b95c0ef xen/include/xen/pci.h
--- a/xen/include/xen/pci.h	Fri Mar 23 13:54:02 2012 +0000
+++ b/xen/include/xen/pci.h	Fri Mar 23 13:55:40 2012 +0000
@@ -12,6 +12,7 @@
 #include <xen/list.h>
 #include <xen/spinlock.h>
 #include <xen/pci_regs.h>
+#include <xen/pfn.h>
 #include <asm/page.h>
 
 /*
diff -r 85312f3875b6 -r 7d704b95c0ef xen/include/xen/pfn.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/include/xen/pfn.h	Fri Mar 23 13:55:40 2012 +0000
@@ -0,0 +1,9 @@
+#ifndef __XEN_PFN_H__
+#define __XEN_PFN_H__
+
+#include <asm/page.h>
+
+#define PFN_DOWN(x)   ((x) >> PAGE_SHIFT)
+#define PFN_UP(x)     (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
+
+#endif /* __XEN_PFN_H__ */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23: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 1SBZwe-0001tv-Rw; Sat, 24 Mar 2012 23: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 1SBZwe-0001tf-2G
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:24 +0000
Received: from [85.158.143.35:23186] by server-2.bemta-4.messagelabs.com id
	3A/7D-17550-6025E6F4; Sat, 24 Mar 2012 23:00:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1332630020!6740957!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1678 invoked from network); 24 Mar 2012 23:00:21 -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;
	24 Mar 2012 23: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 1SBZwa-0004Q6-30
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBZwV-0006pr-NH
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:18 +0000
Message-Id: <E1SBZwV-0006pr-NH@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:00:15 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] IRQ: fix ia64 build for
	21530:0383662ea34c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
# Date 1332510842 0
# Node ID 85312f3875b6a286759c441f394b0e28ad16723f
# Parent  c41ab909f08eef8ecf9cfa975e991a767695aed8
IRQ: fix ia64 build for 21530:0383662ea34c

On ia64, 21530:0383662ea34c introduces the following error:
  irq.c:129: warning: initialization from incompatible pointer type
  irq.c: In function '__do_IRQ':
  irq.c:159: error: too few arguments to function 'desc->handler->end'
  irq.c:223: error: too few arguments to function 'desc->handler->end'
  irq.c: In function 'pirq_guest_eoi':
  irq.c:450: error: too few arguments to function 'desc->handler->end'
  irq.c: In function 'pirq_guest_unbind':
  irq.c:579: error: too few arguments to function 'desc->handler->end'

This patch is a part of xen-unstable 24145:967845cb565b.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r c41ab909f08e -r 85312f3875b6 xen/include/xen/irq.h
--- a/xen/include/xen/irq.h	Thu Mar 08 11:00:17 2012 +0000
+++ b/xen/include/xen/irq.h	Fri Mar 23 13:54:02 2012 +0000
@@ -43,7 +43,11 @@
     void (*enable)(unsigned int irq);
     void (*disable)(unsigned int irq);
     void (*ack)(unsigned int irq);
+#ifdef CONFIG_X86
     void (*end)(unsigned int irq, u8 vector);
+#else
+    void (*end)(struct irq_desc *);
+#endif
     void (*set_affinity)(unsigned int irq, cpumask_t mask);
 };
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23: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 1SBZwe-0001tv-Rw; Sat, 24 Mar 2012 23: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 1SBZwe-0001tf-2G
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:24 +0000
Received: from [85.158.143.35:23186] by server-2.bemta-4.messagelabs.com id
	3A/7D-17550-6025E6F4; Sat, 24 Mar 2012 23:00:22 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1332630020!6740957!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 1678 invoked from network); 24 Mar 2012 23:00:21 -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;
	24 Mar 2012 23: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 1SBZwa-0004Q6-30
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:20 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBZwV-0006pr-NH
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:18 +0000
Message-Id: <E1SBZwV-0006pr-NH@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:00:15 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] IRQ: fix ia64 build for
	21530:0383662ea34c
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
# Date 1332510842 0
# Node ID 85312f3875b6a286759c441f394b0e28ad16723f
# Parent  c41ab909f08eef8ecf9cfa975e991a767695aed8
IRQ: fix ia64 build for 21530:0383662ea34c

On ia64, 21530:0383662ea34c introduces the following error:
  irq.c:129: warning: initialization from incompatible pointer type
  irq.c: In function '__do_IRQ':
  irq.c:159: error: too few arguments to function 'desc->handler->end'
  irq.c:223: error: too few arguments to function 'desc->handler->end'
  irq.c: In function 'pirq_guest_eoi':
  irq.c:450: error: too few arguments to function 'desc->handler->end'
  irq.c: In function 'pirq_guest_unbind':
  irq.c:579: error: too few arguments to function 'desc->handler->end'

This patch is a part of xen-unstable 24145:967845cb565b.

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r c41ab909f08e -r 85312f3875b6 xen/include/xen/irq.h
--- a/xen/include/xen/irq.h	Thu Mar 08 11:00:17 2012 +0000
+++ b/xen/include/xen/irq.h	Fri Mar 23 13:54:02 2012 +0000
@@ -43,7 +43,11 @@
     void (*enable)(unsigned int irq);
     void (*disable)(unsigned int irq);
     void (*ack)(unsigned int irq);
+#ifdef CONFIG_X86
     void (*end)(unsigned int irq, u8 vector);
+#else
+    void (*end)(struct irq_desc *);
+#endif
     void (*set_affinity)(unsigned int irq, cpumask_t mask);
 };
 

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23: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 1SBZwg-0001uI-0L; Sat, 24 Mar 2012 23: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 1SBZwf-0001tu-Dw
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:25 +0000
Received: from [85.158.143.35:23236] by server-1.bemta-4.messagelabs.com id
	25/A1-20925-8025E6F4; Sat, 24 Mar 2012 23:00:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1332630022!11953709!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9109 invoked from network); 24 Mar 2012 23: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;
	24 Mar 2012 23: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 1SBZwb-0004QC-IX
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBZwa-0006sQ-Mf
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:20 +0000
Message-Id: <E1SBZwa-0006sQ-Mf@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:00:20 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/gnttab: fix asm() operand in
	gnttab_clear_flag()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332511138 0
# Node ID cbe8948799bfb81624c29675752aaaad390381f9
# Parent  7d704b95c0ef2b42632f04b9bad40db164318ac4
x86/gnttab: fix asm() operand in gnttab_clear_flag()

The operand needs to use the 'w' modifier in case the compiler happens
to pick a register (which apparently it does for no-one but the
reporter of this problem).

Reported-by: Lin Ming <mlin@ss.pku.edu.cn>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25092:a66fb91cb8d3
xen-unstable date:        Fri Mar 23 08:39:39 2012 +0100
---


diff -r 7d704b95c0ef -r cbe8948799bf xen/include/asm-x86/grant_table.h
--- a/xen/include/asm-x86/grant_table.h	Fri Mar 23 13:55:40 2012 +0000
+++ b/xen/include/asm-x86/grant_table.h	Fri Mar 23 13:58:58 2012 +0000
@@ -54,7 +54,7 @@
      * Note that this cannot be clear_bit(), as the access must be
      * confined to the specified 2 bytes.
      */
-    asm volatile ("lock btrw %1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st));
+    asm volatile ("lock btrw %w1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st));
 }
 
 /* Foreign mappings of HHVM-guest pages do not modify the type count. */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:00:29 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23: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 1SBZwg-0001uI-0L; Sat, 24 Mar 2012 23: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 1SBZwf-0001tu-Dw
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:25 +0000
Received: from [85.158.143.35:23236] by server-1.bemta-4.messagelabs.com id
	25/A1-20925-8025E6F4; Sat, 24 Mar 2012 23:00:24 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-21.messagelabs.com!1332630022!11953709!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9109 invoked from network); 24 Mar 2012 23: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;
	24 Mar 2012 23: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 1SBZwb-0004QC-IX
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:21 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBZwa-0006sQ-Mf
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:00:20 +0000
Message-Id: <E1SBZwa-0006sQ-Mf@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:00:20 +0000
From: Xen patchbot-4.0-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.0-testing] x86/gnttab: fix asm() operand in
	gnttab_clear_flag()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332511138 0
# Node ID cbe8948799bfb81624c29675752aaaad390381f9
# Parent  7d704b95c0ef2b42632f04b9bad40db164318ac4
x86/gnttab: fix asm() operand in gnttab_clear_flag()

The operand needs to use the 'w' modifier in case the compiler happens
to pick a register (which apparently it does for no-one but the
reporter of this problem).

Reported-by: Lin Ming <mlin@ss.pku.edu.cn>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   25092:a66fb91cb8d3
xen-unstable date:        Fri Mar 23 08:39:39 2012 +0100
---


diff -r 7d704b95c0ef -r cbe8948799bf xen/include/asm-x86/grant_table.h
--- a/xen/include/asm-x86/grant_table.h	Fri Mar 23 13:55:40 2012 +0000
+++ b/xen/include/asm-x86/grant_table.h	Fri Mar 23 13:58:58 2012 +0000
@@ -54,7 +54,7 @@
      * Note that this cannot be clear_bit(), as the access must be
      * confined to the specified 2 bytes.
      */
-    asm volatile ("lock btrw %1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st));
+    asm volatile ("lock btrw %w1,%0" : "=m" (*st) : "Ir" (nr), "m" (*st));
 }
 
 /* Foreign mappings of HHVM-guest pages do not modify the type count. */

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBad5-0002JG-UC; Sat, 24 Mar 2012 23: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 1SBad4-0002Im-BL
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:14 +0000
Received: from [85.158.138.51:44460] by server-5.bemta-3.messagelabs.com id
	47/81-31925-D4C5E6F4; Sat, 24 Mar 2012 23:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1332632651!19067161!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6498 invoked from network); 24 Mar 2012 23:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Mar 2012 23: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 1SBad1-0004qi-LT
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBad1-0007IZ-Cu
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:11 +0000
Message-Id: <E1SBad1-0007IZ-Cu@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hpet: simplify hpet_get_channel()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332515609 -3600
# Node ID 2ca43b65718fbe2d3f9ea36132e139ef774d9a11
# Parent  5863a55b807ef9111e3159e61e0ca52a55b5c215
x86/hpet: simplify hpet_get_channel()

There's no need for a lock here, elimination of which makes the
function a leaf one, thus allowing for better (and smaller) code.

Further, use the variable next_channel according to its name - so far
it represented the most recently used channel rather than the next one
to use.

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


diff -r 5863a55b807e -r 2ca43b65718f xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Fri Mar 23 15:08:17 2012 +0000
+++ b/xen/arch/x86/hpet.c	Fri Mar 23 16:13:29 2012 +0100
@@ -402,16 +402,17 @@
 static struct hpet_event_channel *hpet_get_channel(unsigned int cpu)
 {
     static unsigned int next_channel;
-    static spinlock_t next_lock = SPIN_LOCK_UNLOCKED;
     unsigned int i, next;
     struct hpet_event_channel *ch;
 
     if ( num_hpets_used == 0 )
         return hpet_events;
 
-    spin_lock(&next_lock);
-    next = next_channel = (next_channel + 1) % num_hpets_used;
-    spin_unlock(&next_lock);
+    do {
+        next = next_channel;
+        if ( (i = next + 1) == num_hpets_used )
+            i = 0;
+    } while ( cmpxchg(&next_channel, next, i) != next );
 
     /* try unused channel first */
     for ( i = next; i < next + num_hpets_used; i++ )

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBad5-0002JG-UC; Sat, 24 Mar 2012 23: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 1SBad4-0002Im-BL
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:14 +0000
Received: from [85.158.138.51:44460] by server-5.bemta-3.messagelabs.com id
	47/81-31925-D4C5E6F4; Sat, 24 Mar 2012 23:44:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-174.messagelabs.com!1332632651!19067161!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6498 invoked from network); 24 Mar 2012 23:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Mar 2012 23: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 1SBad1-0004qi-LT
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBad1-0007IZ-Cu
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:11 +0000
Message-Id: <E1SBad1-0007IZ-Cu@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hpet: simplify hpet_get_channel()
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332515609 -3600
# Node ID 2ca43b65718fbe2d3f9ea36132e139ef774d9a11
# Parent  5863a55b807ef9111e3159e61e0ca52a55b5c215
x86/hpet: simplify hpet_get_channel()

There's no need for a lock here, elimination of which makes the
function a leaf one, thus allowing for better (and smaller) code.

Further, use the variable next_channel according to its name - so far
it represented the most recently used channel rather than the next one
to use.

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


diff -r 5863a55b807e -r 2ca43b65718f xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Fri Mar 23 15:08:17 2012 +0000
+++ b/xen/arch/x86/hpet.c	Fri Mar 23 16:13:29 2012 +0100
@@ -402,16 +402,17 @@
 static struct hpet_event_channel *hpet_get_channel(unsigned int cpu)
 {
     static unsigned int next_channel;
-    static spinlock_t next_lock = SPIN_LOCK_UNLOCKED;
     unsigned int i, next;
     struct hpet_event_channel *ch;
 
     if ( num_hpets_used == 0 )
         return hpet_events;
 
-    spin_lock(&next_lock);
-    next = next_channel = (next_channel + 1) % num_hpets_used;
-    spin_unlock(&next_lock);
+    do {
+        next = next_channel;
+        if ( (i = next + 1) == num_hpets_used )
+            i = 0;
+    } while ( cmpxchg(&next_channel, next, i) != next );
 
     /* try unused channel first */
     for ( i = next; i < next + num_hpets_used; i++ )

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBad5-0002J7-Js; Sat, 24 Mar 2012 23: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 1SBad3-0002Il-QM
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:14 +0000
Received: from [85.158.138.51:44449] by server-9.bemta-3.messagelabs.com id
	14/DF-10923-C4C5E6F4; Sat, 24 Mar 2012 23:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-174.messagelabs.com!1332632651!19111351!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20328 invoked from network); 24 Mar 2012 23:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Mar 2012 23: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 1SBad0-0004qc-Gt
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBad0-0007Ha-2e
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:10 +0000
Message-Id: <E1SBad0-0007Ha-2e@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Xen core parking 1: hypercall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332515273 0
# Node ID f6a2fb739ad053202dc037c963e55b9c3895c26a
# Parent  b7a1794aed59fd2b0816b3bbcf97690c0241814f
Xen core parking 1: hypercall

This patch implement hypercall through which dom0 send core parking
request, and get core parking result.
Due to the characteristic of continue_hypercall_on_cpu, dom0
seperately send/get core parking request/result.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r b7a1794aed59 -r f6a2fb739ad0 xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Fri Mar 23 13:45:28 2012 +0000
+++ b/xen/arch/x86/platform_hypercall.c	Fri Mar 23 15:07:53 2012 +0000
@@ -56,6 +56,10 @@
 long cpu_up_helper(void *data);
 long cpu_down_helper(void *data);
 
+/* from core_parking.c */
+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 ret = 0;
@@ -609,6 +613,32 @@
                       op->u.mem_add.epfn,
                       op->u.mem_add.pxm);
         break;
+
+    case XENPF_core_parking:
+    {
+        uint32_t idle_nums;
+
+        switch(op->u.core_parking.type)
+        {
+        case XEN_CORE_PARKING_SET:
+            idle_nums = min_t(uint32_t,
+                    op->u.core_parking.idle_nums, num_present_cpus() - 1);
+            ret = continue_hypercall_on_cpu(
+                    0, core_parking_helper, (void *)(unsigned long)idle_nums);
+            break;
+
+        case XEN_CORE_PARKING_GET:
+            op->u.core_parking.idle_nums = get_cur_idle_nums();
+            ret = copy_to_guest(u_xenpf_op, op, 1) ? -EFAULT : 0;
+            break;
+
+        default:
+            ret = -EINVAL;
+            break;
+        }
+    }
+    break;
+
     default:
         ret = -ENOSYS;
         break;
diff -r b7a1794aed59 -r f6a2fb739ad0 xen/common/Makefile
--- a/xen/common/Makefile	Fri Mar 23 13:45:28 2012 +0000
+++ b/xen/common/Makefile	Fri Mar 23 15:07:53 2012 +0000
@@ -1,4 +1,5 @@
 obj-y += bitmap.o
+obj-y += core_parking.o
 obj-y += cpu.o
 obj-y += cpupool.o
 obj-$(HAS_DEVICE_TREE) += device_tree.o
diff -r b7a1794aed59 -r f6a2fb739ad0 xen/common/core_parking.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/core_parking.c	Fri Mar 23 15:07:53 2012 +0000
@@ -0,0 +1,13 @@
+#include <xen/types.h>
+
+static uint32_t cur_idle_nums;
+
+long core_parking_helper(void *data)
+{
+    return 0;
+}
+
+uint32_t get_cur_idle_nums(void)
+{
+    return cur_idle_nums;
+}
diff -r b7a1794aed59 -r f6a2fb739ad0 xen/include/public/platform.h
--- a/xen/include/public/platform.h	Fri Mar 23 13:45:28 2012 +0000
+++ b/xen/include/public/platform.h	Fri Mar 23 15:07:53 2012 +0000
@@ -490,6 +490,20 @@
     uint32_t flags;
 };
 
+#define XENPF_core_parking  60
+
+#define XEN_CORE_PARKING_SET 1
+#define XEN_CORE_PARKING_GET 2
+struct xenpf_core_parking {
+    /* IN variables */
+    uint32_t type;
+    /* IN variables:  set cpu nums expected to be idled */
+    /* OUT variables: get cpu nums actually be idled */
+    uint32_t idle_nums;
+};
+typedef struct xenpf_core_parking xenpf_core_parking_t;
+DEFINE_XEN_GUEST_HANDLE(xenpf_core_parking_t);
+
 struct xen_platform_op {
     uint32_t cmd;
     uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -511,6 +525,7 @@
         struct xenpf_cpu_ol            cpu_ol;
         struct xenpf_cpu_hotadd        cpu_add;
         struct xenpf_mem_hotadd        mem_add;
+        struct xenpf_core_parking      core_parking;
         uint8_t                        pad[128];
     } u;
 };

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:44:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23:44:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBad5-0002J7-Js; Sat, 24 Mar 2012 23: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 1SBad3-0002Il-QM
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:14 +0000
Received: from [85.158.138.51:44449] by server-9.bemta-3.messagelabs.com id
	14/DF-10923-C4C5E6F4; Sat, 24 Mar 2012 23:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-11.tower-174.messagelabs.com!1332632651!19111351!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 20328 invoked from network); 24 Mar 2012 23:44:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-11.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Mar 2012 23: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 1SBad0-0004qc-Gt
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBad0-0007Ha-2e
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:10 +0000
Message-Id: <E1SBad0-0007Ha-2e@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:44:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Xen core parking 1: hypercall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332515273 0
# Node ID f6a2fb739ad053202dc037c963e55b9c3895c26a
# Parent  b7a1794aed59fd2b0816b3bbcf97690c0241814f
Xen core parking 1: hypercall

This patch implement hypercall through which dom0 send core parking
request, and get core parking result.
Due to the characteristic of continue_hypercall_on_cpu, dom0
seperately send/get core parking request/result.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r b7a1794aed59 -r f6a2fb739ad0 xen/arch/x86/platform_hypercall.c
--- a/xen/arch/x86/platform_hypercall.c	Fri Mar 23 13:45:28 2012 +0000
+++ b/xen/arch/x86/platform_hypercall.c	Fri Mar 23 15:07:53 2012 +0000
@@ -56,6 +56,10 @@
 long cpu_up_helper(void *data);
 long cpu_down_helper(void *data);
 
+/* from core_parking.c */
+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 ret = 0;
@@ -609,6 +613,32 @@
                       op->u.mem_add.epfn,
                       op->u.mem_add.pxm);
         break;
+
+    case XENPF_core_parking:
+    {
+        uint32_t idle_nums;
+
+        switch(op->u.core_parking.type)
+        {
+        case XEN_CORE_PARKING_SET:
+            idle_nums = min_t(uint32_t,
+                    op->u.core_parking.idle_nums, num_present_cpus() - 1);
+            ret = continue_hypercall_on_cpu(
+                    0, core_parking_helper, (void *)(unsigned long)idle_nums);
+            break;
+
+        case XEN_CORE_PARKING_GET:
+            op->u.core_parking.idle_nums = get_cur_idle_nums();
+            ret = copy_to_guest(u_xenpf_op, op, 1) ? -EFAULT : 0;
+            break;
+
+        default:
+            ret = -EINVAL;
+            break;
+        }
+    }
+    break;
+
     default:
         ret = -ENOSYS;
         break;
diff -r b7a1794aed59 -r f6a2fb739ad0 xen/common/Makefile
--- a/xen/common/Makefile	Fri Mar 23 13:45:28 2012 +0000
+++ b/xen/common/Makefile	Fri Mar 23 15:07:53 2012 +0000
@@ -1,4 +1,5 @@
 obj-y += bitmap.o
+obj-y += core_parking.o
 obj-y += cpu.o
 obj-y += cpupool.o
 obj-$(HAS_DEVICE_TREE) += device_tree.o
diff -r b7a1794aed59 -r f6a2fb739ad0 xen/common/core_parking.c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/xen/common/core_parking.c	Fri Mar 23 15:07:53 2012 +0000
@@ -0,0 +1,13 @@
+#include <xen/types.h>
+
+static uint32_t cur_idle_nums;
+
+long core_parking_helper(void *data)
+{
+    return 0;
+}
+
+uint32_t get_cur_idle_nums(void)
+{
+    return cur_idle_nums;
+}
diff -r b7a1794aed59 -r f6a2fb739ad0 xen/include/public/platform.h
--- a/xen/include/public/platform.h	Fri Mar 23 13:45:28 2012 +0000
+++ b/xen/include/public/platform.h	Fri Mar 23 15:07:53 2012 +0000
@@ -490,6 +490,20 @@
     uint32_t flags;
 };
 
+#define XENPF_core_parking  60
+
+#define XEN_CORE_PARKING_SET 1
+#define XEN_CORE_PARKING_GET 2
+struct xenpf_core_parking {
+    /* IN variables */
+    uint32_t type;
+    /* IN variables:  set cpu nums expected to be idled */
+    /* OUT variables: get cpu nums actually be idled */
+    uint32_t idle_nums;
+};
+typedef struct xenpf_core_parking xenpf_core_parking_t;
+DEFINE_XEN_GUEST_HANDLE(xenpf_core_parking_t);
+
 struct xen_platform_op {
     uint32_t cmd;
     uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -511,6 +525,7 @@
         struct xenpf_cpu_ol            cpu_ol;
         struct xenpf_cpu_hotadd        cpu_add;
         struct xenpf_mem_hotadd        mem_add;
+        struct xenpf_core_parking      core_parking;
         uint8_t                        pad[128];
     } u;
 };

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:44:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBad7-0002JP-30; Sat, 24 Mar 2012 23: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 1SBad4-0002Ir-No
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:15 +0000
Received: from [85.158.143.35:59505] by server-3.bemta-4.messagelabs.com id
	F2/1D-05853-E4C5E6F4; Sat, 24 Mar 2012 23:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1332632651!6743395!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6390 invoked from network); 24 Mar 2012 23:44:12 -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;
	24 Mar 2012 23: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 1SBad1-0004qf-3G
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBad0-0007I5-NC
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:10 +0000
Message-Id: <E1SBad0-0007I5-NC@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Xen core parking 2: core parking
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332515297 0
# Node ID 5863a55b807ef9111e3159e61e0ca52a55b5c215
# Parent  f6a2fb739ad053202dc037c963e55b9c3895c26a
Xen core parking 2: core parking implementation

This patch implement Xen core parking.
Different core parking sequence has different power/performance
result, due to cpu socket/core/thread topology.
This patch provide power-first and performance-first policies, users
can choose core parking policy by their own demand.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r f6a2fb739ad0 -r 5863a55b807e xen/common/core_parking.c
--- a/xen/common/core_parking.c	Fri Mar 23 15:07:53 2012 +0000
+++ b/xen/common/core_parking.c	Fri Mar 23 15:08:17 2012 +0000
@@ -1,13 +1,240 @@
+/*
+ *  core_parking.c - implement core parking according to dom0 requirement
+ *
+ *  Copyright (C) 2012, Intel Corporation.
+ *     Author: Liu, Jinsong <jinsong.liu@intel.com>
+ *
+ *  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.
+ */
+
 #include <xen/types.h>
+#include <xen/cpu.h>
+#include <xen/init.h>
+#include <xen/cpumask.h>
+#include <asm/percpu.h>
+#include <asm/smp.h>
+
+#define CORE_PARKING_INCREMENT 1
+#define CORE_PARKING_DECREMENT 2
+
+static unsigned int core_parking_power(unsigned int event);
+static unsigned int core_parking_performance(unsigned int event);
 
 static uint32_t cur_idle_nums;
+static unsigned int core_parking_cpunum[NR_CPUS] = {[0 ... NR_CPUS-1] = -1};
+
+static struct core_parking_policy {
+    char name[30];
+    unsigned int (*next)(unsigned int event);
+} *core_parking_policy;
+
+static enum core_parking_controller {
+    POWER_FIRST,
+    PERFORMANCE_FIRST
+} core_parking_controller = POWER_FIRST;
+
+static void __init setup_core_parking_option(char *str)
+{
+    if ( !strcmp(str, "power") )
+        core_parking_controller = POWER_FIRST;
+    else if ( !strcmp(str, "performance") )
+        core_parking_controller = PERFORMANCE_FIRST;
+    else
+        return;
+}
+custom_param("core_parking", setup_core_parking_option);
+
+static unsigned int core_parking_performance(unsigned int event)
+{
+    unsigned int cpu = -1;
+
+    switch ( event )
+    {
+    case CORE_PARKING_INCREMENT:
+    {
+        int core_tmp, core_weight = -1;
+        int sibling_tmp, sibling_weight = -1;
+        cpumask_t core_candidate_map, sibling_candidate_map;
+        cpumask_clear(&core_candidate_map);
+        cpumask_clear(&sibling_candidate_map);
+
+        for_each_cpu(cpu, &cpu_online_map)
+        {
+            if ( cpu == 0 )
+                continue;
+
+            core_tmp = cpumask_weight(per_cpu(cpu_core_mask, cpu));
+            if ( core_weight < core_tmp )
+            {
+                core_weight = core_tmp;
+                cpumask_clear(&core_candidate_map);
+                cpumask_set_cpu(cpu, &core_candidate_map);
+            }
+            else if ( core_weight == core_tmp )
+                cpumask_set_cpu(cpu, &core_candidate_map);
+        }
+
+        for_each_cpu(cpu, &core_candidate_map)
+        {
+            sibling_tmp = cpumask_weight(per_cpu(cpu_sibling_mask, cpu));
+            if ( sibling_weight < sibling_tmp )
+            {
+                sibling_weight = sibling_tmp;
+                cpumask_clear(&sibling_candidate_map);
+                cpumask_set_cpu(cpu, &sibling_candidate_map);
+            }
+            else if ( sibling_weight == sibling_tmp )
+                cpumask_set_cpu(cpu, &sibling_candidate_map);
+        }
+
+        cpu = cpumask_first(&sibling_candidate_map);
+    }
+    break;
+
+    case CORE_PARKING_DECREMENT:
+    {
+        cpu = core_parking_cpunum[cur_idle_nums -1];
+    }
+    break;
+
+    default:
+        break;
+    }
+
+    return cpu;
+}
+
+static unsigned int core_parking_power(unsigned int event)
+{
+    unsigned int cpu = -1;
+
+    switch ( event )
+    {
+    case CORE_PARKING_INCREMENT:
+    {
+        int core_tmp, core_weight = NR_CPUS + 1;
+        int sibling_tmp, sibling_weight = NR_CPUS + 1;
+        cpumask_t core_candidate_map, sibling_candidate_map;
+        cpumask_clear(&core_candidate_map);
+        cpumask_clear(&sibling_candidate_map);
+
+        for_each_cpu(cpu, &cpu_online_map)
+        {
+            if ( cpu == 0 )
+                continue;
+
+            core_tmp = cpumask_weight(per_cpu(cpu_core_mask, cpu));
+            if ( core_weight > core_tmp )
+            {
+                core_weight = core_tmp;
+                cpumask_clear(&core_candidate_map);
+                cpumask_set_cpu(cpu, &core_candidate_map);
+            }
+            else if ( core_weight == core_tmp )
+                cpumask_set_cpu(cpu, &core_candidate_map);
+        }
+
+        for_each_cpu(cpu, &core_candidate_map)
+        {
+            sibling_tmp = cpumask_weight(per_cpu(cpu_sibling_mask, cpu));
+            if ( sibling_weight > sibling_tmp )
+            {
+                sibling_weight = sibling_tmp;
+                cpumask_clear(&sibling_candidate_map);
+                cpumask_set_cpu(cpu, &sibling_candidate_map);
+            }
+            else if ( sibling_weight == sibling_tmp )
+                cpumask_set_cpu(cpu, &sibling_candidate_map);
+        }
+
+        cpu = cpumask_first(&sibling_candidate_map);
+    }
+    break;
+
+    case CORE_PARKING_DECREMENT:
+    {
+        cpu = core_parking_cpunum[cur_idle_nums -1];
+    }
+    break;
+
+    default:
+        break;
+    }
+
+    return cpu;
+}
 
 long core_parking_helper(void *data)
 {
-    return 0;
+    uint32_t idle_nums = (unsigned long)data;
+    unsigned int cpu;
+    int ret = 0;
+
+    if ( !core_parking_policy )
+        return -EINVAL;
+
+    while ( cur_idle_nums < idle_nums )
+    {
+        cpu = core_parking_policy->next(CORE_PARKING_INCREMENT);
+        ret = cpu_down(cpu);
+        if ( ret )
+            return ret;
+        core_parking_cpunum[cur_idle_nums++] = cpu;
+    }
+
+    while ( cur_idle_nums > idle_nums )
+    {
+        cpu = core_parking_policy->next(CORE_PARKING_DECREMENT);
+        ret = cpu_up(cpu);
+        if ( ret )
+            return ret;
+        core_parking_cpunum[--cur_idle_nums] = -1;
+    }
+
+    return ret;
 }
 
 uint32_t get_cur_idle_nums(void)
 {
     return cur_idle_nums;
 }
+
+static struct core_parking_policy power_first = {
+    .name = "power",
+    .next = core_parking_power,
+};
+
+static struct core_parking_policy performance_first = {
+    .name = "performance",
+    .next = core_parking_performance,
+};
+
+static int register_core_parking_policy(struct core_parking_policy *policy)
+{
+    if ( !policy || !policy->next )
+        return -EINVAL;
+
+    core_parking_policy = policy;
+    return 0;
+}
+
+static int __init core_parking_init(void)
+{
+    int ret = 0;
+
+    if ( core_parking_controller == PERFORMANCE_FIRST )
+        ret = register_core_parking_policy(&performance_first);
+    else
+        ret = register_core_parking_policy(&power_first);
+
+    return ret;
+}
+__initcall(core_parking_init);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:44:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBad7-0002JP-30; Sat, 24 Mar 2012 23: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 1SBad4-0002Ir-No
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:15 +0000
Received: from [85.158.143.35:59505] by server-3.bemta-4.messagelabs.com id
	F2/1D-05853-E4C5E6F4; Sat, 24 Mar 2012 23:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1332632651!6743395!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 6390 invoked from network); 24 Mar 2012 23:44:12 -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;
	24 Mar 2012 23: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 1SBad1-0004qf-3G
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBad0-0007I5-NC
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:10 +0000
Message-Id: <E1SBad0-0007I5-NC@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:44:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Xen core parking 2: core parking
	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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332515297 0
# Node ID 5863a55b807ef9111e3159e61e0ca52a55b5c215
# Parent  f6a2fb739ad053202dc037c963e55b9c3895c26a
Xen core parking 2: core parking implementation

This patch implement Xen core parking.
Different core parking sequence has different power/performance
result, due to cpu socket/core/thread topology.
This patch provide power-first and performance-first policies, users
can choose core parking policy by their own demand.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r f6a2fb739ad0 -r 5863a55b807e xen/common/core_parking.c
--- a/xen/common/core_parking.c	Fri Mar 23 15:07:53 2012 +0000
+++ b/xen/common/core_parking.c	Fri Mar 23 15:08:17 2012 +0000
@@ -1,13 +1,240 @@
+/*
+ *  core_parking.c - implement core parking according to dom0 requirement
+ *
+ *  Copyright (C) 2012, Intel Corporation.
+ *     Author: Liu, Jinsong <jinsong.liu@intel.com>
+ *
+ *  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.
+ */
+
 #include <xen/types.h>
+#include <xen/cpu.h>
+#include <xen/init.h>
+#include <xen/cpumask.h>
+#include <asm/percpu.h>
+#include <asm/smp.h>
+
+#define CORE_PARKING_INCREMENT 1
+#define CORE_PARKING_DECREMENT 2
+
+static unsigned int core_parking_power(unsigned int event);
+static unsigned int core_parking_performance(unsigned int event);
 
 static uint32_t cur_idle_nums;
+static unsigned int core_parking_cpunum[NR_CPUS] = {[0 ... NR_CPUS-1] = -1};
+
+static struct core_parking_policy {
+    char name[30];
+    unsigned int (*next)(unsigned int event);
+} *core_parking_policy;
+
+static enum core_parking_controller {
+    POWER_FIRST,
+    PERFORMANCE_FIRST
+} core_parking_controller = POWER_FIRST;
+
+static void __init setup_core_parking_option(char *str)
+{
+    if ( !strcmp(str, "power") )
+        core_parking_controller = POWER_FIRST;
+    else if ( !strcmp(str, "performance") )
+        core_parking_controller = PERFORMANCE_FIRST;
+    else
+        return;
+}
+custom_param("core_parking", setup_core_parking_option);
+
+static unsigned int core_parking_performance(unsigned int event)
+{
+    unsigned int cpu = -1;
+
+    switch ( event )
+    {
+    case CORE_PARKING_INCREMENT:
+    {
+        int core_tmp, core_weight = -1;
+        int sibling_tmp, sibling_weight = -1;
+        cpumask_t core_candidate_map, sibling_candidate_map;
+        cpumask_clear(&core_candidate_map);
+        cpumask_clear(&sibling_candidate_map);
+
+        for_each_cpu(cpu, &cpu_online_map)
+        {
+            if ( cpu == 0 )
+                continue;
+
+            core_tmp = cpumask_weight(per_cpu(cpu_core_mask, cpu));
+            if ( core_weight < core_tmp )
+            {
+                core_weight = core_tmp;
+                cpumask_clear(&core_candidate_map);
+                cpumask_set_cpu(cpu, &core_candidate_map);
+            }
+            else if ( core_weight == core_tmp )
+                cpumask_set_cpu(cpu, &core_candidate_map);
+        }
+
+        for_each_cpu(cpu, &core_candidate_map)
+        {
+            sibling_tmp = cpumask_weight(per_cpu(cpu_sibling_mask, cpu));
+            if ( sibling_weight < sibling_tmp )
+            {
+                sibling_weight = sibling_tmp;
+                cpumask_clear(&sibling_candidate_map);
+                cpumask_set_cpu(cpu, &sibling_candidate_map);
+            }
+            else if ( sibling_weight == sibling_tmp )
+                cpumask_set_cpu(cpu, &sibling_candidate_map);
+        }
+
+        cpu = cpumask_first(&sibling_candidate_map);
+    }
+    break;
+
+    case CORE_PARKING_DECREMENT:
+    {
+        cpu = core_parking_cpunum[cur_idle_nums -1];
+    }
+    break;
+
+    default:
+        break;
+    }
+
+    return cpu;
+}
+
+static unsigned int core_parking_power(unsigned int event)
+{
+    unsigned int cpu = -1;
+
+    switch ( event )
+    {
+    case CORE_PARKING_INCREMENT:
+    {
+        int core_tmp, core_weight = NR_CPUS + 1;
+        int sibling_tmp, sibling_weight = NR_CPUS + 1;
+        cpumask_t core_candidate_map, sibling_candidate_map;
+        cpumask_clear(&core_candidate_map);
+        cpumask_clear(&sibling_candidate_map);
+
+        for_each_cpu(cpu, &cpu_online_map)
+        {
+            if ( cpu == 0 )
+                continue;
+
+            core_tmp = cpumask_weight(per_cpu(cpu_core_mask, cpu));
+            if ( core_weight > core_tmp )
+            {
+                core_weight = core_tmp;
+                cpumask_clear(&core_candidate_map);
+                cpumask_set_cpu(cpu, &core_candidate_map);
+            }
+            else if ( core_weight == core_tmp )
+                cpumask_set_cpu(cpu, &core_candidate_map);
+        }
+
+        for_each_cpu(cpu, &core_candidate_map)
+        {
+            sibling_tmp = cpumask_weight(per_cpu(cpu_sibling_mask, cpu));
+            if ( sibling_weight > sibling_tmp )
+            {
+                sibling_weight = sibling_tmp;
+                cpumask_clear(&sibling_candidate_map);
+                cpumask_set_cpu(cpu, &sibling_candidate_map);
+            }
+            else if ( sibling_weight == sibling_tmp )
+                cpumask_set_cpu(cpu, &sibling_candidate_map);
+        }
+
+        cpu = cpumask_first(&sibling_candidate_map);
+    }
+    break;
+
+    case CORE_PARKING_DECREMENT:
+    {
+        cpu = core_parking_cpunum[cur_idle_nums -1];
+    }
+    break;
+
+    default:
+        break;
+    }
+
+    return cpu;
+}
 
 long core_parking_helper(void *data)
 {
-    return 0;
+    uint32_t idle_nums = (unsigned long)data;
+    unsigned int cpu;
+    int ret = 0;
+
+    if ( !core_parking_policy )
+        return -EINVAL;
+
+    while ( cur_idle_nums < idle_nums )
+    {
+        cpu = core_parking_policy->next(CORE_PARKING_INCREMENT);
+        ret = cpu_down(cpu);
+        if ( ret )
+            return ret;
+        core_parking_cpunum[cur_idle_nums++] = cpu;
+    }
+
+    while ( cur_idle_nums > idle_nums )
+    {
+        cpu = core_parking_policy->next(CORE_PARKING_DECREMENT);
+        ret = cpu_up(cpu);
+        if ( ret )
+            return ret;
+        core_parking_cpunum[--cur_idle_nums] = -1;
+    }
+
+    return ret;
 }
 
 uint32_t get_cur_idle_nums(void)
 {
     return cur_idle_nums;
 }
+
+static struct core_parking_policy power_first = {
+    .name = "power",
+    .next = core_parking_power,
+};
+
+static struct core_parking_policy performance_first = {
+    .name = "performance",
+    .next = core_parking_performance,
+};
+
+static int register_core_parking_policy(struct core_parking_policy *policy)
+{
+    if ( !policy || !policy->next )
+        return -EINVAL;
+
+    core_parking_policy = policy;
+    return 0;
+}
+
+static int __init core_parking_init(void)
+{
+    int ret = 0;
+
+    if ( core_parking_controller == PERFORMANCE_FIRST )
+        ret = register_core_parking_policy(&performance_first);
+    else
+        ret = register_core_parking_policy(&power_first);
+
+    return ret;
+}
+__initcall(core_parking_init);

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:44:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBad7-0002Jb-8M; Sat, 24 Mar 2012 23:44:17 +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 1SBad5-0002J1-Ic
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:15 +0000
Received: from [193.109.254.147:12540] by server-2.bemta-14.messagelabs.com id
	81/F6-19409-E4C5E6F4; Sat, 24 Mar 2012 23:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1332632653!1924242!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23503 invoked from network); 24 Mar 2012 23:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Mar 2012 23: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 1SBad2-0004qo-SK
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBad2-0007Jb-J5
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:12 +0000
Message-Id: <E1SBad2-0007Jb-J5@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86_emulate: Do not push an error
	code onto a #UD exception stack
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332535908 0
# Node ID 4bd752a4cdf323c41c50f8cd6286f566d67adeae
# Parent  2e45b26bc412099a2b8f009bcf111e4b6c23847b
x86_emulate: Do not push an error code onto a #UD exception stack

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


diff -r 2e45b26bc412 -r 4bd752a4cdf3 xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Fri Mar 23 20:45:16 2012 +0000
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Fri Mar 23 20:51:48 2012 +0000
@@ -1429,7 +1429,7 @@
     }
 
     /* Lock prefix is allowed only on RMW instructions. */
-    generate_exception_if((d & Mov) && lock_prefix, EXC_UD, 0);
+    generate_exception_if((d & Mov) && lock_prefix, EXC_UD, -1);
 
     /* ModRM and SIB bytes. */
     if ( d & ModRM )
@@ -1712,12 +1712,12 @@
             lock_prefix &&
             ((b < 0x20) || (b > 0x23)) && /* MOV CRn/DRn */
             (b != 0xc7),                  /* CMPXCHG{8,16}B */
-            EXC_UD, 0);
+            EXC_UD, -1);
         dst.type = OP_NONE;
         break;
 
     case DstReg:
-        generate_exception_if(lock_prefix, EXC_UD, 0);
+        generate_exception_if(lock_prefix, EXC_UD, -1);
         dst.type = OP_REG;
         if ( d & ByteOp )
         {
@@ -1773,7 +1773,7 @@
         dst = ea;
         if ( dst.type == OP_REG )
         {
-            generate_exception_if(lock_prefix, EXC_UD, 0);
+            generate_exception_if(lock_prefix, EXC_UD, -1);
             switch ( dst.bytes )
             {
             case 1: dst.val = *(uint8_t  *)dst.reg; break;
@@ -3785,14 +3785,14 @@
         struct segment_register cs = { 0 }, ss = { 0 };
         int rc;
 
-        generate_exception_if(in_realmode(ctxt, ops), EXC_UD, 0);
-        generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, 0);
+        generate_exception_if(in_realmode(ctxt, ops), EXC_UD, -1);
+        generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, -1);
 
         /* Inject #UD if syscall/sysret are disabled. */
         fail_if(ops->read_msr == NULL);
         if ( (rc = ops->read_msr(MSR_EFER, &msr_content, ctxt)) != 0 )
             goto done;
-        generate_exception_if((msr_content & EFER_SCE) == 0, EXC_UD, 0);
+        generate_exception_if((msr_content & EFER_SCE) == 0, EXC_UD, -1);
 
         if ( (rc = ops->read_msr(MSR_STAR, &msr_content, ctxt)) != 0 )
             goto done;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:44:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBad7-0002Jb-8M; Sat, 24 Mar 2012 23:44:17 +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 1SBad5-0002J1-Ic
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:15 +0000
Received: from [193.109.254.147:12540] by server-2.bemta-14.messagelabs.com id
	81/F6-19409-E4C5E6F4; Sat, 24 Mar 2012 23:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-27.messagelabs.com!1332632653!1924242!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23503 invoked from network); 24 Mar 2012 23:44:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-2.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	24 Mar 2012 23: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 1SBad2-0004qo-SK
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBad2-0007Jb-J5
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:12 +0000
Message-Id: <E1SBad2-0007Jb-J5@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:44:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86_emulate: Do not push an error
	code onto a #UD exception stack
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332535908 0
# Node ID 4bd752a4cdf323c41c50f8cd6286f566d67adeae
# Parent  2e45b26bc412099a2b8f009bcf111e4b6c23847b
x86_emulate: Do not push an error code onto a #UD exception stack

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


diff -r 2e45b26bc412 -r 4bd752a4cdf3 xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Fri Mar 23 20:45:16 2012 +0000
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Fri Mar 23 20:51:48 2012 +0000
@@ -1429,7 +1429,7 @@
     }
 
     /* Lock prefix is allowed only on RMW instructions. */
-    generate_exception_if((d & Mov) && lock_prefix, EXC_UD, 0);
+    generate_exception_if((d & Mov) && lock_prefix, EXC_UD, -1);
 
     /* ModRM and SIB bytes. */
     if ( d & ModRM )
@@ -1712,12 +1712,12 @@
             lock_prefix &&
             ((b < 0x20) || (b > 0x23)) && /* MOV CRn/DRn */
             (b != 0xc7),                  /* CMPXCHG{8,16}B */
-            EXC_UD, 0);
+            EXC_UD, -1);
         dst.type = OP_NONE;
         break;
 
     case DstReg:
-        generate_exception_if(lock_prefix, EXC_UD, 0);
+        generate_exception_if(lock_prefix, EXC_UD, -1);
         dst.type = OP_REG;
         if ( d & ByteOp )
         {
@@ -1773,7 +1773,7 @@
         dst = ea;
         if ( dst.type == OP_REG )
         {
-            generate_exception_if(lock_prefix, EXC_UD, 0);
+            generate_exception_if(lock_prefix, EXC_UD, -1);
             switch ( dst.bytes )
             {
             case 1: dst.val = *(uint8_t  *)dst.reg; break;
@@ -3785,14 +3785,14 @@
         struct segment_register cs = { 0 }, ss = { 0 };
         int rc;
 
-        generate_exception_if(in_realmode(ctxt, ops), EXC_UD, 0);
-        generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, 0);
+        generate_exception_if(in_realmode(ctxt, ops), EXC_UD, -1);
+        generate_exception_if(!in_protmode(ctxt, ops), EXC_UD, -1);
 
         /* Inject #UD if syscall/sysret are disabled. */
         fail_if(ops->read_msr == NULL);
         if ( (rc = ops->read_msr(MSR_EFER, &msr_content, ctxt)) != 0 )
             goto done;
-        generate_exception_if((msr_content & EFER_SCE) == 0, EXC_UD, 0);
+        generate_exception_if((msr_content & EFER_SCE) == 0, EXC_UD, -1);
 
         if ( (rc = ops->read_msr(MSR_STAR, &msr_content, ctxt)) != 0 )
             goto done;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:44:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBad7-0002JV-61; Sat, 24 Mar 2012 23:44: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 1SBad5-0002Iw-3l
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:15 +0000
Received: from [85.158.138.51:22110] by server-12.bemta-3.messagelabs.com id
	0D/11-30663-E4C5E6F4; Sat, 24 Mar 2012 23:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1332632652!19117092!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27243 invoked from network); 24 Mar 2012 23:44:13 -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;
	24 Mar 2012 23: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 1SBad2-0004ql-5e
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBad2-0007J4-0T
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:12 +0000
Message-Id: <E1SBad2-0007J4-0T@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86_emulate: raise #UD rather than
	#GP on invalid use of LOCK prefix
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332535516 0
# Node ID 2e45b26bc412099a2b8f009bcf111e4b6c23847b
# Parent  2ca43b65718fbe2d3f9ea36132e139ef774d9a11
x86_emulate: raise #UD rather than #GP on invalid use of LOCK prefix

From: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 2ca43b65718f -r 2e45b26bc412 xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Fri Mar 23 16:13:29 2012 +0100
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Fri Mar 23 20:45:16 2012 +0000
@@ -1429,7 +1429,7 @@
     }
 
     /* Lock prefix is allowed only on RMW instructions. */
-    generate_exception_if((d & Mov) && lock_prefix, EXC_GP, 0);
+    generate_exception_if((d & Mov) && lock_prefix, EXC_UD, 0);
 
     /* ModRM and SIB bytes. */
     if ( d & ModRM )
@@ -1712,12 +1712,12 @@
             lock_prefix &&
             ((b < 0x20) || (b > 0x23)) && /* MOV CRn/DRn */
             (b != 0xc7),                  /* CMPXCHG{8,16}B */
-            EXC_GP, 0);
+            EXC_UD, 0);
         dst.type = OP_NONE;
         break;
 
     case DstReg:
-        generate_exception_if(lock_prefix, EXC_GP, 0);
+        generate_exception_if(lock_prefix, EXC_UD, 0);
         dst.type = OP_REG;
         if ( d & ByteOp )
         {
@@ -1773,7 +1773,7 @@
         dst = ea;
         if ( dst.type == OP_REG )
         {
-            generate_exception_if(lock_prefix, EXC_GP, 0);
+            generate_exception_if(lock_prefix, EXC_UD, 0);
             switch ( dst.bytes )
             {
             case 1: dst.val = *(uint8_t  *)dst.reg; break;

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

From xen-changelog-bounces@lists.xen.org Sat Mar 24 23:44:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 24 Mar 2012 23:44:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SBad7-0002JV-61; Sat, 24 Mar 2012 23:44: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 1SBad5-0002Iw-3l
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:15 +0000
Received: from [85.158.138.51:22110] by server-12.bemta-3.messagelabs.com id
	0D/11-30663-E4C5E6F4; Sat, 24 Mar 2012 23:44:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-174.messagelabs.com!1332632652!19117092!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27243 invoked from network); 24 Mar 2012 23:44:13 -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;
	24 Mar 2012 23: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 1SBad2-0004ql-5e
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SBad2-0007J4-0T
	for xen-changelog@lists.xensource.com; Sat, 24 Mar 2012 23:44:12 +0000
Message-Id: <E1SBad2-0007J4-0T@xenbits.xen.org>
Date: Sat, 24 Mar 2012 23:44:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86_emulate: raise #UD rather than
	#GP on invalid use of LOCK prefix
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332535516 0
# Node ID 2e45b26bc412099a2b8f009bcf111e4b6c23847b
# Parent  2ca43b65718fbe2d3f9ea36132e139ef774d9a11
x86_emulate: raise #UD rather than #GP on invalid use of LOCK prefix

From: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 2ca43b65718f -r 2e45b26bc412 xen/arch/x86/x86_emulate/x86_emulate.c
--- a/xen/arch/x86/x86_emulate/x86_emulate.c	Fri Mar 23 16:13:29 2012 +0100
+++ b/xen/arch/x86/x86_emulate/x86_emulate.c	Fri Mar 23 20:45:16 2012 +0000
@@ -1429,7 +1429,7 @@
     }
 
     /* Lock prefix is allowed only on RMW instructions. */
-    generate_exception_if((d & Mov) && lock_prefix, EXC_GP, 0);
+    generate_exception_if((d & Mov) && lock_prefix, EXC_UD, 0);
 
     /* ModRM and SIB bytes. */
     if ( d & ModRM )
@@ -1712,12 +1712,12 @@
             lock_prefix &&
             ((b < 0x20) || (b > 0x23)) && /* MOV CRn/DRn */
             (b != 0xc7),                  /* CMPXCHG{8,16}B */
-            EXC_GP, 0);
+            EXC_UD, 0);
         dst.type = OP_NONE;
         break;
 
     case DstReg:
-        generate_exception_if(lock_prefix, EXC_GP, 0);
+        generate_exception_if(lock_prefix, EXC_UD, 0);
         dst.type = OP_REG;
         if ( d & ByteOp )
         {
@@ -1773,7 +1773,7 @@
         dst = ea;
         if ( dst.type == OP_REG )
         {
-            generate_exception_if(lock_prefix, EXC_GP, 0);
+            generate_exception_if(lock_prefix, EXC_UD, 0);
             switch ( dst.bytes )
             {
             case 1: dst.val = *(uint8_t  *)dst.reg; break;

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

From xen-changelog-bounces@lists.xen.org Mon Mar 26 09:44:11 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Mar 2012 09:44:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SC6TB-0004xP-2f; Mon, 26 Mar 2012 09:44:09 +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 1SC6TA-0004xG-2l
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:08 +0000
Received: from [193.109.254.147:35105] by server-12.bemta-14.messagelabs.com
	id AF/23-05847-76A307F4; Mon, 26 Mar 2012 09:44:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1332755045!2049972!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27769 invoked from network); 26 Mar 2012 09:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Mar 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 1SC6T6-0005Kw-VF
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SC6T6-0001JM-Gv
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:04 +0000
Message-Id: <E1SC6T6-0001JM-Gv@xenbits.xen.org>
Date: Mon, 26 Mar 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] smpboot: adjust ordering of
	operations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332754587 -7200
# Node ID b7fea0d6bf234c86e65ddf7781fdf63bb046cba6
# Parent  80ed6519816209ea16ab606a58f868eb8b90e909
smpboot: adjust ordering of operations

The primary goal of the change is to add the locking around the setting
of the cpu_online_map bit that got introduced in or before 2.6.16.

In doing so I noticed, however, that the point in time when this is
done wasn't in sync with how native does it (and in actual conflict
with additions to that code path in subsequent Linux versions). So the
setting of this bit now gets done on the CPU being brought up, and the
CPU initiating the bringup, just like on native, waits for up to 5
seconds for the remote to respond.

Finally, rather than BUG()ing on eventual errors, do proper cleanup and
return the error to the caller. Plus call xen_smp_intr_init() earlier
so that no cleanup will need to be performed in case of it failing.

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


diff -r 80ed65198162 -r b7fea0d6bf23 drivers/xen/core/smpboot.c
--- a/drivers/xen/core/smpboot.c	Thu Mar 15 13:40:20 2012 +0100
+++ b/drivers/xen/core/smpboot.c	Mon Mar 26 11:36:27 2012 +0200
@@ -146,7 +146,6 @@
 	return rc;
 }
 
-#ifdef CONFIG_HOTPLUG_CPU
 static void xen_smp_intr_exit(unsigned int cpu)
 {
 	if (cpu != 0)
@@ -155,7 +154,6 @@
 	unbind_from_irqhandler(per_cpu(resched_irq, cpu), NULL);
 	unbind_from_irqhandler(per_cpu(callfunc_irq, cpu), NULL);
 }
-#endif
 
 void __cpuinit cpu_bringup(void)
 {
@@ -163,7 +161,9 @@
 	identify_cpu(cpu_data + smp_processor_id());
 	touch_softlockup_watchdog();
 	preempt_disable();
-	local_irq_enable();
+	lock_ipi_call_lock();
+	cpu_set(smp_processor_id(), cpu_online_map);
+	unlock_ipi_call_lock();
 }
 
 static void __cpuinit cpu_bringup_and_idle(void)
@@ -414,6 +414,10 @@
 	if (rc)
 		return rc;
 
+	rc = xen_smp_intr_init(cpu);
+	if (rc)
+		return rc;
+
 	cpu_initialize_context(cpu);
 
 	if (num_online_cpus() == 1)
@@ -423,18 +427,27 @@
 	set_cpu_sibling_map(cpu);
 	wmb();
 
-	rc = xen_smp_intr_init(cpu);
-	if (rc) {
-		remove_siblinginfo(cpu);
-		return rc;
+	rc = HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL);
+	if (!rc) {
+		/* Wait 5s total for a response. */
+		unsigned long timeout = jiffies + 5 * HZ;
+
+		while (!cpu_online(cpu) && time_before_eq(jiffies, timeout))
+			HYPERVISOR_yield();
+		if (!cpu_online(cpu)) {
+			VOID(HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL));
+			rc = -ETIMEDOUT;
+		}
 	}
 
-	cpu_set(cpu, cpu_online_map);
+	if (rc) {
+		xen_smp_intr_exit(cpu);
+		remove_siblinginfo(cpu);
+		if (num_online_cpus() == 1)
+			alternatives_smp_switch(0);
+	}
 
-	rc = HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL);
-	BUG_ON(rc);
-
-	return 0;
+	return rc;
 }
 
 void __init smp_cpus_done(unsigned int max_cpus)

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

From xen-changelog-bounces@lists.xen.org Mon Mar 26 09:44:11 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Mar 2012 09:44:11 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SC6TB-0004xP-2f; Mon, 26 Mar 2012 09:44:09 +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 1SC6TA-0004xG-2l
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:08 +0000
Received: from [193.109.254.147:35105] by server-12.bemta-14.messagelabs.com
	id AF/23-05847-76A307F4; Mon, 26 Mar 2012 09:44:07 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1332755045!2049972!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 27769 invoked from network); 26 Mar 2012 09:44:06 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Mar 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 1SC6T6-0005Kw-VF
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SC6T6-0001JM-Gv
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:04 +0000
Message-Id: <E1SC6T6-0001JM-Gv@xenbits.xen.org>
Date: Mon, 26 Mar 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] smpboot: adjust ordering of
	operations
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332754587 -7200
# Node ID b7fea0d6bf234c86e65ddf7781fdf63bb046cba6
# Parent  80ed6519816209ea16ab606a58f868eb8b90e909
smpboot: adjust ordering of operations

The primary goal of the change is to add the locking around the setting
of the cpu_online_map bit that got introduced in or before 2.6.16.

In doing so I noticed, however, that the point in time when this is
done wasn't in sync with how native does it (and in actual conflict
with additions to that code path in subsequent Linux versions). So the
setting of this bit now gets done on the CPU being brought up, and the
CPU initiating the bringup, just like on native, waits for up to 5
seconds for the remote to respond.

Finally, rather than BUG()ing on eventual errors, do proper cleanup and
return the error to the caller. Plus call xen_smp_intr_init() earlier
so that no cleanup will need to be performed in case of it failing.

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


diff -r 80ed65198162 -r b7fea0d6bf23 drivers/xen/core/smpboot.c
--- a/drivers/xen/core/smpboot.c	Thu Mar 15 13:40:20 2012 +0100
+++ b/drivers/xen/core/smpboot.c	Mon Mar 26 11:36:27 2012 +0200
@@ -146,7 +146,6 @@
 	return rc;
 }
 
-#ifdef CONFIG_HOTPLUG_CPU
 static void xen_smp_intr_exit(unsigned int cpu)
 {
 	if (cpu != 0)
@@ -155,7 +154,6 @@
 	unbind_from_irqhandler(per_cpu(resched_irq, cpu), NULL);
 	unbind_from_irqhandler(per_cpu(callfunc_irq, cpu), NULL);
 }
-#endif
 
 void __cpuinit cpu_bringup(void)
 {
@@ -163,7 +161,9 @@
 	identify_cpu(cpu_data + smp_processor_id());
 	touch_softlockup_watchdog();
 	preempt_disable();
-	local_irq_enable();
+	lock_ipi_call_lock();
+	cpu_set(smp_processor_id(), cpu_online_map);
+	unlock_ipi_call_lock();
 }
 
 static void __cpuinit cpu_bringup_and_idle(void)
@@ -414,6 +414,10 @@
 	if (rc)
 		return rc;
 
+	rc = xen_smp_intr_init(cpu);
+	if (rc)
+		return rc;
+
 	cpu_initialize_context(cpu);
 
 	if (num_online_cpus() == 1)
@@ -423,18 +427,27 @@
 	set_cpu_sibling_map(cpu);
 	wmb();
 
-	rc = xen_smp_intr_init(cpu);
-	if (rc) {
-		remove_siblinginfo(cpu);
-		return rc;
+	rc = HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL);
+	if (!rc) {
+		/* Wait 5s total for a response. */
+		unsigned long timeout = jiffies + 5 * HZ;
+
+		while (!cpu_online(cpu) && time_before_eq(jiffies, timeout))
+			HYPERVISOR_yield();
+		if (!cpu_online(cpu)) {
+			VOID(HYPERVISOR_vcpu_op(VCPUOP_down, cpu, NULL));
+			rc = -ETIMEDOUT;
+		}
 	}
 
-	cpu_set(cpu, cpu_online_map);
+	if (rc) {
+		xen_smp_intr_exit(cpu);
+		remove_siblinginfo(cpu);
+		if (num_online_cpus() == 1)
+			alternatives_smp_switch(0);
+	}
 
-	rc = HYPERVISOR_vcpu_op(VCPUOP_up, cpu, NULL);
-	BUG_ON(rc);
-
-	return 0;
+	return rc;
 }
 
 void __init smp_cpus_done(unsigned int max_cpus)

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

From xen-changelog-bounces@lists.xen.org Mon Mar 26 09:44:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Mar 2012 09:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SC6TC-0004xd-5i; Mon, 26 Mar 2012 09:44: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 1SC6TB-0004xO-Dc
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:09 +0000
Received: from [85.158.139.83:41802] by server-2.bemta-5.messagelabs.com id
	5E/63-17016-86A307F4; Mon, 26 Mar 2012 09:44:08 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1332755046!18284606!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5881 invoked from network); 26 Mar 2012 09:44:07 -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;
	26 Mar 2012 09:44:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SC6T7-0005Kz-BZ
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SC6T7-0001Jw-4U
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:05 +0000
Message-Id: <E1SC6T7-0001Jw-4U@xenbits.xen.org>
Date: Mon, 26 Mar 2012 09:44: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] x86-64: provide a memset() that
	can deal with 4Gb or above at a time
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332754669 -7200
# Node ID 2748f5d7597de35e59318f4bad8ed762e8ce32aa
# Parent  b7fea0d6bf234c86e65ddf7781fdf63bb046cba6
x86-64: provide a memset() that can deal with 4Gb or above at a time

Now that a corresponding change got accepted into Linux 3.4, let's fix
this in our code too. It is particularly required by the memset()
invoked from __alloc_bootmem_core(), which can be called with sizes
beyond 4Gb out of alloc_node_mem_map() when CONFIG_FLAT_NODE_MEM_MAP is
defined (starting at around 300Gb).

In order to not affect the native kernel (which is unlikely to be
affected anyway, as it usually sets up separate maps for each node [as
long as NUMA is defined], and hence would require said amount of memory
per node [and SPARSEMEM not to be used] for the problem to become
visible, plus in this tree we're not really concerned about fixing
native problems), introduce a Xen-specific clone of the original file.

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


diff -r b7fea0d6bf23 -r 2748f5d7597d arch/x86_64/lib/memset-xen.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/arch/x86_64/lib/memset-xen.S	Mon Mar 26 11:37:49 2012 +0200
@@ -0,0 +1,122 @@
+/* Copyright 2002 Andi Kleen, SuSE Labs */
+/*
+ * ISO C memset - set a memory block to a byte value.
+ *
+ * rdi   destination
+ * rsi   value (char)
+ * rdx   count (bytes)
+ *
+ * rax   original destination
+ */
+	.globl __memset
+	.globl memset
+	.p2align 4
+memset:
+__memset:
+	movq %rdi,%r10
+
+	/* expand byte value  */
+	movzbl %sil,%ecx
+	movabs $0x0101010101010101,%rax
+	imulq  %rcx,%rax
+
+	/* align dst */
+	movl  %edi,%r9d
+	andl  $7,%r9d
+	jnz  .Lbad_alignment
+.Lafter_bad_alignment:
+
+	movq  %rdx,%rcx
+	shrq  $6,%rcx
+	jz	 .Lhandle_tail
+
+	.p2align 4
+.Lloop_64:
+	decq  %rcx
+	movq  %rax,(%rdi)
+	movq  %rax,8(%rdi)
+	movq  %rax,16(%rdi)
+	movq  %rax,24(%rdi)
+	movq  %rax,32(%rdi)
+	movq  %rax,40(%rdi)
+	movq  %rax,48(%rdi)
+	movq  %rax,56(%rdi)
+	leaq  64(%rdi),%rdi
+	jnz    .Lloop_64
+
+	/* Handle tail in loops. The loops should be faster than hard
+	   to predict jump tables. */
+	.p2align 4
+.Lhandle_tail:
+	movl	%edx,%ecx
+	andl    $63&(~7),%ecx
+	jz 		.Lhandle_7
+	shrl	$3,%ecx
+	.p2align 4
+.Lloop_8:
+	decl   %ecx
+	movq  %rax,(%rdi)
+	leaq  8(%rdi),%rdi
+	jnz    .Lloop_8
+
+.Lhandle_7:
+	andl	$7,%edx
+	jz      .Lende
+	.p2align 4
+.Lloop_1:
+	decl    %edx
+	movb 	%al,(%rdi)
+	leaq	1(%rdi),%rdi
+	jnz     .Lloop_1
+
+.Lende:
+	movq	%r10,%rax
+	ret
+
+.Lbad_alignment:
+	cmpq $7,%rdx
+	jbe	.Lhandle_7
+	movq %rax,(%rdi)	/* unaligned store */
+	movq $8,%r8
+	subq %r9,%r8
+	addq %r8,%rdi
+	subq %r8,%rdx
+	jmp .Lafter_bad_alignment
+
+	/* Some CPUs run faster using the string instructions.
+	   It is also a lot simpler. Use this when possible */
+
+#include <asm/cpufeature.h>
+
+	.section .altinstructions,"a"
+	.align 8
+	.quad  memset
+	.quad  memset_c
+	.byte  X86_FEATURE_REP_GOOD
+	.byte  memset_c_end-memset_c
+	.byte  memset_c_end-memset_c
+	.previous
+
+	.section .altinstr_replacement,"ax"
+ /* rdi	destination
+  * rsi value
+  * rdx count
+  */
+memset_c:
+	movq %rdi,%r9
+	movq %rdx,%rcx
+	andl $7,%edx
+	shrq $3,%rcx
+	/* expand byte value  */
+	movzbl %sil,%esi
+	movabs $0x0101010101010101,%rax
+	imulq %rsi,%rax
+	rep
+	stosq
+	movl %edx,%ecx
+	rep
+	stosb
+	movq %r9,%rax
+	ret
+memset_c_end:
+	.previous

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

From xen-changelog-bounces@lists.xen.org Mon Mar 26 09:44:13 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Mar 2012 09:44:13 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SC6TC-0004xd-5i; Mon, 26 Mar 2012 09:44: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 1SC6TB-0004xO-Dc
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:09 +0000
Received: from [85.158.139.83:41802] by server-2.bemta-5.messagelabs.com id
	5E/63-17016-86A307F4; Mon, 26 Mar 2012 09:44:08 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-182.messagelabs.com!1332755046!18284606!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5881 invoked from network); 26 Mar 2012 09:44:07 -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;
	26 Mar 2012 09:44:07 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SC6T7-0005Kz-BZ
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:05 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SC6T7-0001Jw-4U
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:05 +0000
Message-Id: <E1SC6T7-0001Jw-4U@xenbits.xen.org>
Date: Mon, 26 Mar 2012 09:44: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] x86-64: provide a memset() that
	can deal with 4Gb or above at a time
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332754669 -7200
# Node ID 2748f5d7597de35e59318f4bad8ed762e8ce32aa
# Parent  b7fea0d6bf234c86e65ddf7781fdf63bb046cba6
x86-64: provide a memset() that can deal with 4Gb or above at a time

Now that a corresponding change got accepted into Linux 3.4, let's fix
this in our code too. It is particularly required by the memset()
invoked from __alloc_bootmem_core(), which can be called with sizes
beyond 4Gb out of alloc_node_mem_map() when CONFIG_FLAT_NODE_MEM_MAP is
defined (starting at around 300Gb).

In order to not affect the native kernel (which is unlikely to be
affected anyway, as it usually sets up separate maps for each node [as
long as NUMA is defined], and hence would require said amount of memory
per node [and SPARSEMEM not to be used] for the problem to become
visible, plus in this tree we're not really concerned about fixing
native problems), introduce a Xen-specific clone of the original file.

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


diff -r b7fea0d6bf23 -r 2748f5d7597d arch/x86_64/lib/memset-xen.S
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/arch/x86_64/lib/memset-xen.S	Mon Mar 26 11:37:49 2012 +0200
@@ -0,0 +1,122 @@
+/* Copyright 2002 Andi Kleen, SuSE Labs */
+/*
+ * ISO C memset - set a memory block to a byte value.
+ *
+ * rdi   destination
+ * rsi   value (char)
+ * rdx   count (bytes)
+ *
+ * rax   original destination
+ */
+	.globl __memset
+	.globl memset
+	.p2align 4
+memset:
+__memset:
+	movq %rdi,%r10
+
+	/* expand byte value  */
+	movzbl %sil,%ecx
+	movabs $0x0101010101010101,%rax
+	imulq  %rcx,%rax
+
+	/* align dst */
+	movl  %edi,%r9d
+	andl  $7,%r9d
+	jnz  .Lbad_alignment
+.Lafter_bad_alignment:
+
+	movq  %rdx,%rcx
+	shrq  $6,%rcx
+	jz	 .Lhandle_tail
+
+	.p2align 4
+.Lloop_64:
+	decq  %rcx
+	movq  %rax,(%rdi)
+	movq  %rax,8(%rdi)
+	movq  %rax,16(%rdi)
+	movq  %rax,24(%rdi)
+	movq  %rax,32(%rdi)
+	movq  %rax,40(%rdi)
+	movq  %rax,48(%rdi)
+	movq  %rax,56(%rdi)
+	leaq  64(%rdi),%rdi
+	jnz    .Lloop_64
+
+	/* Handle tail in loops. The loops should be faster than hard
+	   to predict jump tables. */
+	.p2align 4
+.Lhandle_tail:
+	movl	%edx,%ecx
+	andl    $63&(~7),%ecx
+	jz 		.Lhandle_7
+	shrl	$3,%ecx
+	.p2align 4
+.Lloop_8:
+	decl   %ecx
+	movq  %rax,(%rdi)
+	leaq  8(%rdi),%rdi
+	jnz    .Lloop_8
+
+.Lhandle_7:
+	andl	$7,%edx
+	jz      .Lende
+	.p2align 4
+.Lloop_1:
+	decl    %edx
+	movb 	%al,(%rdi)
+	leaq	1(%rdi),%rdi
+	jnz     .Lloop_1
+
+.Lende:
+	movq	%r10,%rax
+	ret
+
+.Lbad_alignment:
+	cmpq $7,%rdx
+	jbe	.Lhandle_7
+	movq %rax,(%rdi)	/* unaligned store */
+	movq $8,%r8
+	subq %r9,%r8
+	addq %r8,%rdi
+	subq %r8,%rdx
+	jmp .Lafter_bad_alignment
+
+	/* Some CPUs run faster using the string instructions.
+	   It is also a lot simpler. Use this when possible */
+
+#include <asm/cpufeature.h>
+
+	.section .altinstructions,"a"
+	.align 8
+	.quad  memset
+	.quad  memset_c
+	.byte  X86_FEATURE_REP_GOOD
+	.byte  memset_c_end-memset_c
+	.byte  memset_c_end-memset_c
+	.previous
+
+	.section .altinstr_replacement,"ax"
+ /* rdi	destination
+  * rsi value
+  * rdx count
+  */
+memset_c:
+	movq %rdi,%r9
+	movq %rdx,%rcx
+	andl $7,%edx
+	shrq $3,%rcx
+	/* expand byte value  */
+	movzbl %sil,%esi
+	movabs $0x0101010101010101,%rax
+	imulq %rsi,%rax
+	rep
+	stosq
+	movl %edx,%ecx
+	rep
+	stosb
+	movq %r9,%rax
+	ret
+memset_c_end:
+	.previous

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

From xen-changelog-bounces@lists.xen.org Mon Mar 26 09:44:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Mar 2012 09:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SC6TH-0004ym-8c; Mon, 26 Mar 2012 09: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 1SC6TF-0004yN-Oi
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:13 +0000
Received: from [85.158.143.35:10269] by server-2.bemta-4.messagelabs.com id
	6D/AC-17550-C6A307F4; Mon, 26 Mar 2012 09:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1332755046!12990535!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3650 invoked from network); 26 Mar 2012 09:44:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Mar 2012 09:44:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SC6T8-0005L2-AW
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SC6T7-0001KM-QQ
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:06 +0000
Message-Id: <E1SC6T7-0001KM-QQ@xenbits.xen.org>
Date: Mon, 26 Mar 2012 09:44:05 +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] block backends: simplify
	protocol negotiation and 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332754718 -7200
# Node ID 8940ccd0a425346845bd102c4bc049eb58b550b6
# Parent  2748f5d7597de35e59318f4bad8ed762e8ce32aa
block backends: simplify protocol negotiation and initialization

In the negotiation code we can use the simpler (and type safe)
xenbus_read() instead of xenbus_gather() for reading the "protocol"
node.

The initialization code can be considerably shrunk by using a macro to
abstract out the code common for all variants.

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


diff -r 2748f5d7597d -r 8940ccd0a425 drivers/xen/blkback/interface.c
--- a/drivers/xen/blkback/interface.c	Mon Mar 26 11:37:49 2012 +0200
+++ b/drivers/xen/blkback/interface.c	Mon Mar 26 11:38:38 2012 +0200
@@ -70,29 +70,22 @@
 	blkif->blk_ring_area = area;
 
 	switch (blkif->blk_protocol) {
+#define BLKBK_RING_INIT(p) ({ \
+		struct blkif_##p##_sring *sring = area->addr; \
+		BACK_RING_INIT(&blkif->blk_rings.p, sring, PAGE_SIZE); \
+	})
 	case BLKIF_PROTOCOL_NATIVE:
-	{
-		blkif_sring_t *sring;
-		sring = (blkif_sring_t *)area->addr;
-		BACK_RING_INIT(&blkif->blk_rings.native, sring, PAGE_SIZE);
+		BLKBK_RING_INIT(native);
 		break;
-	}
 	case BLKIF_PROTOCOL_X86_32:
-	{
-		blkif_x86_32_sring_t *sring_x86_32;
-		sring_x86_32 = (blkif_x86_32_sring_t *)area->addr;
-		BACK_RING_INIT(&blkif->blk_rings.x86_32, sring_x86_32, PAGE_SIZE);
+		BLKBK_RING_INIT(x86_32);
 		break;
-	}
 	case BLKIF_PROTOCOL_X86_64:
-	{
-		blkif_x86_64_sring_t *sring_x86_64;
-		sring_x86_64 = (blkif_x86_64_sring_t *)area->addr;
-		BACK_RING_INIT(&blkif->blk_rings.x86_64, sring_x86_64, PAGE_SIZE);
+		BLKBK_RING_INIT(x86_64);
 		break;
-	}
 	default:
 		BUG();
+#undef BLKBK_RING_INIT
 	}
 
 	err = bind_interdomain_evtchn_to_irqhandler(
diff -r 2748f5d7597d -r 8940ccd0a425 drivers/xen/blkback/xenbus.c
--- a/drivers/xen/blkback/xenbus.c	Mon Mar 26 11:37:49 2012 +0200
+++ b/drivers/xen/blkback/xenbus.c	Mon Mar 26 11:38:38 2012 +0200
@@ -494,17 +494,14 @@
 	}
 
 	be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE;
-	err = xenbus_gather(XBT_NIL, dev->otherend, "protocol",
-			    NULL, &protocol, NULL);
-	if (err)
+	protocol = xenbus_read(XBT_NIL, dev->otherend, "protocol", NULL);
+	if (IS_ERR(protocol))
 		protocol = NULL;
-	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE))
-		be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE;
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_32;
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_64))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_64;
-	else {
+	else if (0 != strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE)) {
 		xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol);
 		kfree(protocol);
 		return -1;
diff -r 2748f5d7597d -r 8940ccd0a425 drivers/xen/blktap/interface.c
--- a/drivers/xen/blktap/interface.c	Mon Mar 26 11:37:49 2012 +0200
+++ b/drivers/xen/blktap/interface.c	Mon Mar 26 11:38:38 2012 +0200
@@ -71,29 +71,22 @@
 	blkif->blk_ring_area = area;
 
 	switch (blkif->blk_protocol) {
+#define BLKTAP_RING_INIT(p) ({ \
+		struct blkif_##p##_sring *sring = area->addr; \
+		BACK_RING_INIT(&blkif->blk_rings.p, sring, PAGE_SIZE); \
+	})
 	case BLKIF_PROTOCOL_NATIVE:
-	{
-		blkif_sring_t *sring;
-		sring = (blkif_sring_t *)area->addr;
-		BACK_RING_INIT(&blkif->blk_rings.native, sring, PAGE_SIZE);
+		BLKTAP_RING_INIT(native);
 		break;
-	}
 	case BLKIF_PROTOCOL_X86_32:
-	{
-		blkif_x86_32_sring_t *sring_x86_32;
-		sring_x86_32 = (blkif_x86_32_sring_t *)area->addr;
-		BACK_RING_INIT(&blkif->blk_rings.x86_32, sring_x86_32, PAGE_SIZE);
+		BLKTAP_RING_INIT(x86_32);
 		break;
-	}
 	case BLKIF_PROTOCOL_X86_64:
-	{
-		blkif_x86_64_sring_t *sring_x86_64;
-		sring_x86_64 = (blkif_x86_64_sring_t *)area->addr;
-		BACK_RING_INIT(&blkif->blk_rings.x86_64, sring_x86_64, PAGE_SIZE);
+		BLKTAP_RING_INIT(x86_64);
 		break;
-	}
 	default:
 		BUG();
+#undef BLKTAP_RING_INIT
 	}
 
 	err = bind_interdomain_evtchn_to_irqhandler(
diff -r 2748f5d7597d -r 8940ccd0a425 drivers/xen/blktap/xenbus.c
--- a/drivers/xen/blktap/xenbus.c	Mon Mar 26 11:37:49 2012 +0200
+++ b/drivers/xen/blktap/xenbus.c	Mon Mar 26 11:38:38 2012 +0200
@@ -447,17 +447,14 @@
 	}
 
 	be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE;
-	err = xenbus_gather(XBT_NIL, dev->otherend, "protocol",
-			    NULL, &protocol, NULL);
-	if (err)
+	protocol = xenbus_read(XBT_NIL, dev->otherend, "protocol", NULL);
+	if (IS_ERR(protocol))
 		protocol = NULL;
-	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE))
-		be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE;
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_32;
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_64))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_64;
-	else {
+	else if (0 != strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE)) {
 		xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol);
 		kfree(protocol);
 		return -1;
diff -r 2748f5d7597d -r 8940ccd0a425 include/xen/blkif.h
--- a/include/xen/blkif.h	Mon Mar 26 11:37:49 2012 +0200
+++ b/include/xen/blkif.h	Mon Mar 26 11:38:38 2012 +0200
@@ -72,6 +72,7 @@
 typedef struct blkif_x86_64_request blkif_x86_64_request_t;
 typedef struct blkif_x86_64_response blkif_x86_64_response_t;
 
+#define blkif_native_sring blkif_sring
 DEFINE_RING_TYPES(blkif_common, struct blkif_common_request, struct blkif_common_response);
 DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request, struct blkif_x86_32_response);
 DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request, struct blkif_x86_64_response);

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

From xen-changelog-bounces@lists.xen.org Mon Mar 26 09:44:17 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Mar 2012 09:44:17 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SC6TH-0004ym-8c; Mon, 26 Mar 2012 09: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 1SC6TF-0004yN-Oi
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:13 +0000
Received: from [85.158.143.35:10269] by server-2.bemta-4.messagelabs.com id
	6D/AC-17550-C6A307F4; Mon, 26 Mar 2012 09:44:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-21.messagelabs.com!1332755046!12990535!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3650 invoked from network); 26 Mar 2012 09:44:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	26 Mar 2012 09:44:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SC6T8-0005L2-AW
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:06 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SC6T7-0001KM-QQ
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:44:06 +0000
Message-Id: <E1SC6T7-0001KM-QQ@xenbits.xen.org>
Date: Mon, 26 Mar 2012 09:44:05 +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] block backends: simplify
	protocol negotiation and 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332754718 -7200
# Node ID 8940ccd0a425346845bd102c4bc049eb58b550b6
# Parent  2748f5d7597de35e59318f4bad8ed762e8ce32aa
block backends: simplify protocol negotiation and initialization

In the negotiation code we can use the simpler (and type safe)
xenbus_read() instead of xenbus_gather() for reading the "protocol"
node.

The initialization code can be considerably shrunk by using a macro to
abstract out the code common for all variants.

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


diff -r 2748f5d7597d -r 8940ccd0a425 drivers/xen/blkback/interface.c
--- a/drivers/xen/blkback/interface.c	Mon Mar 26 11:37:49 2012 +0200
+++ b/drivers/xen/blkback/interface.c	Mon Mar 26 11:38:38 2012 +0200
@@ -70,29 +70,22 @@
 	blkif->blk_ring_area = area;
 
 	switch (blkif->blk_protocol) {
+#define BLKBK_RING_INIT(p) ({ \
+		struct blkif_##p##_sring *sring = area->addr; \
+		BACK_RING_INIT(&blkif->blk_rings.p, sring, PAGE_SIZE); \
+	})
 	case BLKIF_PROTOCOL_NATIVE:
-	{
-		blkif_sring_t *sring;
-		sring = (blkif_sring_t *)area->addr;
-		BACK_RING_INIT(&blkif->blk_rings.native, sring, PAGE_SIZE);
+		BLKBK_RING_INIT(native);
 		break;
-	}
 	case BLKIF_PROTOCOL_X86_32:
-	{
-		blkif_x86_32_sring_t *sring_x86_32;
-		sring_x86_32 = (blkif_x86_32_sring_t *)area->addr;
-		BACK_RING_INIT(&blkif->blk_rings.x86_32, sring_x86_32, PAGE_SIZE);
+		BLKBK_RING_INIT(x86_32);
 		break;
-	}
 	case BLKIF_PROTOCOL_X86_64:
-	{
-		blkif_x86_64_sring_t *sring_x86_64;
-		sring_x86_64 = (blkif_x86_64_sring_t *)area->addr;
-		BACK_RING_INIT(&blkif->blk_rings.x86_64, sring_x86_64, PAGE_SIZE);
+		BLKBK_RING_INIT(x86_64);
 		break;
-	}
 	default:
 		BUG();
+#undef BLKBK_RING_INIT
 	}
 
 	err = bind_interdomain_evtchn_to_irqhandler(
diff -r 2748f5d7597d -r 8940ccd0a425 drivers/xen/blkback/xenbus.c
--- a/drivers/xen/blkback/xenbus.c	Mon Mar 26 11:37:49 2012 +0200
+++ b/drivers/xen/blkback/xenbus.c	Mon Mar 26 11:38:38 2012 +0200
@@ -494,17 +494,14 @@
 	}
 
 	be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE;
-	err = xenbus_gather(XBT_NIL, dev->otherend, "protocol",
-			    NULL, &protocol, NULL);
-	if (err)
+	protocol = xenbus_read(XBT_NIL, dev->otherend, "protocol", NULL);
+	if (IS_ERR(protocol))
 		protocol = NULL;
-	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE))
-		be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE;
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_32;
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_64))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_64;
-	else {
+	else if (0 != strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE)) {
 		xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol);
 		kfree(protocol);
 		return -1;
diff -r 2748f5d7597d -r 8940ccd0a425 drivers/xen/blktap/interface.c
--- a/drivers/xen/blktap/interface.c	Mon Mar 26 11:37:49 2012 +0200
+++ b/drivers/xen/blktap/interface.c	Mon Mar 26 11:38:38 2012 +0200
@@ -71,29 +71,22 @@
 	blkif->blk_ring_area = area;
 
 	switch (blkif->blk_protocol) {
+#define BLKTAP_RING_INIT(p) ({ \
+		struct blkif_##p##_sring *sring = area->addr; \
+		BACK_RING_INIT(&blkif->blk_rings.p, sring, PAGE_SIZE); \
+	})
 	case BLKIF_PROTOCOL_NATIVE:
-	{
-		blkif_sring_t *sring;
-		sring = (blkif_sring_t *)area->addr;
-		BACK_RING_INIT(&blkif->blk_rings.native, sring, PAGE_SIZE);
+		BLKTAP_RING_INIT(native);
 		break;
-	}
 	case BLKIF_PROTOCOL_X86_32:
-	{
-		blkif_x86_32_sring_t *sring_x86_32;
-		sring_x86_32 = (blkif_x86_32_sring_t *)area->addr;
-		BACK_RING_INIT(&blkif->blk_rings.x86_32, sring_x86_32, PAGE_SIZE);
+		BLKTAP_RING_INIT(x86_32);
 		break;
-	}
 	case BLKIF_PROTOCOL_X86_64:
-	{
-		blkif_x86_64_sring_t *sring_x86_64;
-		sring_x86_64 = (blkif_x86_64_sring_t *)area->addr;
-		BACK_RING_INIT(&blkif->blk_rings.x86_64, sring_x86_64, PAGE_SIZE);
+		BLKTAP_RING_INIT(x86_64);
 		break;
-	}
 	default:
 		BUG();
+#undef BLKTAP_RING_INIT
 	}
 
 	err = bind_interdomain_evtchn_to_irqhandler(
diff -r 2748f5d7597d -r 8940ccd0a425 drivers/xen/blktap/xenbus.c
--- a/drivers/xen/blktap/xenbus.c	Mon Mar 26 11:37:49 2012 +0200
+++ b/drivers/xen/blktap/xenbus.c	Mon Mar 26 11:38:38 2012 +0200
@@ -447,17 +447,14 @@
 	}
 
 	be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE;
-	err = xenbus_gather(XBT_NIL, dev->otherend, "protocol",
-			    NULL, &protocol, NULL);
-	if (err)
+	protocol = xenbus_read(XBT_NIL, dev->otherend, "protocol", NULL);
+	if (IS_ERR(protocol))
 		protocol = NULL;
-	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE))
-		be->blkif->blk_protocol = BLKIF_PROTOCOL_NATIVE;
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_32;
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_64))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_64;
-	else {
+	else if (0 != strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE)) {
 		xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol);
 		kfree(protocol);
 		return -1;
diff -r 2748f5d7597d -r 8940ccd0a425 include/xen/blkif.h
--- a/include/xen/blkif.h	Mon Mar 26 11:37:49 2012 +0200
+++ b/include/xen/blkif.h	Mon Mar 26 11:38:38 2012 +0200
@@ -72,6 +72,7 @@
 typedef struct blkif_x86_64_request blkif_x86_64_request_t;
 typedef struct blkif_x86_64_response blkif_x86_64_response_t;
 
+#define blkif_native_sring blkif_sring
 DEFINE_RING_TYPES(blkif_common, struct blkif_common_request, struct blkif_common_response);
 DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request, struct blkif_x86_32_response);
 DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request, struct blkif_x86_64_response);

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

From xen-changelog-bounces@lists.xen.org Mon Mar 26 09:55:35 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Mar 2012 09:55:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SC6eB-0005AV-5J; Mon, 26 Mar 2012 09:55: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 1SC6e9-0005AQ-QS
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:55:30 +0000
Received: from [193.109.254.147:63678] by server-2.bemta-14.messagelabs.com id
	D0/F9-19409-11D307F4; Mon, 26 Mar 2012 09:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1332755712!2052176!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26892 invoked from network); 26 Mar 2012 09: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;
	26 Mar 2012 09: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 1SC6dl-0005SF-Qq
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SC6dl-0006YE-Ha
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:55:05 +0000
Message-Id: <E1SC6dl-0006YE-Ha@xenbits.xen.org>
Date: Mon, 26 Mar 2012 09:55: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] 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332755402 -7200
# Node ID f8805d3fc263d247e1e27666a8c2e092956ccf21
# Parent  8940ccd0a425346845bd102c4bc049eb58b550b6
Sync Xen public headers

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


diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/arch-arm.h
--- a/include/xen/interface/arch-arm.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/arch-arm.h	Mon Mar 26 11:50:02 2012 +0200
@@ -27,6 +27,29 @@
 #ifndef __XEN_PUBLIC_ARCH_ARM_H__
 #define __XEN_PUBLIC_ARCH_ARM_H__
 
+/* hypercall calling convention
+ * ----------------------------
+ *
+ * A hypercall is issued using the ARM HVC instruction.
+ *
+ * A hypercall can take up to 5 arguments. These are passed in
+ * registers, the first argument in r0, the second argument in r1, the
+ * third in r2, the forth in r3 and the fifth in r4.
+ *
+ * The hypercall number is passed in r12.
+ *
+ * The HVC ISS must contain a Xen specific TAG: XEN_HYPERCALL_TAG.
+ *
+ * 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.
+ *
+ */
+
+#define XEN_HYPERCALL_TAG   0XEA1
+
+
 #ifndef __ASSEMBLY__
 #define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
     typedef struct { type *p; } __guest_handle_ ## name
@@ -63,7 +86,12 @@
     uint32_t r12;
 
     uint32_t sp; /* r13 - SP: Valid for Hyp. frames only, o/w banked (see below) */
-    uint32_t lr; /* r14 - LR: Valid for Hyp. Same physical register as lr_usr. */
+
+    /* r14 - LR: is the same physical register as LR_usr */
+    union {
+        uint32_t lr; /* r14 - LR: Valid for Hyp. Same physical register as lr_usr. */
+        uint32_t lr_usr;
+    };
 
     uint32_t pc; /* Return IP */
     uint32_t cpsr; /* Return mode */
@@ -73,10 +101,14 @@
 
     uint32_t r8_fiq, r9_fiq, r10_fiq, r11_fiq, r12_fiq;
 
-    uint32_t sp_usr, sp_svc, sp_abt, sp_und, sp_irq, sp_fiq;
-    uint32_t lr_usr, lr_svc, lr_abt, lr_und, lr_irq, lr_fiq;
+    uint32_t sp_usr; /* LR_usr is the same register as LR, see above */
+
+    uint32_t sp_svc, sp_abt, sp_und, sp_irq, sp_fiq;
+    uint32_t lr_svc, lr_abt, lr_und, lr_irq, lr_fiq;
 
     uint32_t spsr_svc, spsr_abt, spsr_und, spsr_irq, spsr_fiq;
+
+    uint32_t pad1; /* Doubleword-align the user half of the frame */
 };
 typedef struct cpu_user_regs cpu_user_regs_t;
 DEFINE_XEN_GUEST_HANDLE(cpu_user_regs_t);
@@ -110,6 +142,8 @@
 
 struct arch_shared_info { };
 typedef struct arch_shared_info arch_shared_info_t;
+typedef uint64_t xen_callback_t;
+
 #endif
 
 #endif /*  __XEN_PUBLIC_ARCH_ARM_H__ */
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/arch-arm/hvm/save.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/arch-arm/hvm/save.h	Mon Mar 26 11:50:02 2012 +0200
@@ -0,0 +1,39 @@
+/*
+ * Structure definitions for HVM state that is held by Xen and must
+ * be saved along with the domain's memory and device-model state.
+ *
+ * Copyright (c) 2012 Citrix Systems Ltd.
+ *
+ * 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_HVM_SAVE_ARM_H__
+#define __XEN_PUBLIC_HVM_SAVE_ARM_H__
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/arch-x86/hvm/save.h
--- a/include/xen/interface/arch-x86/hvm/save.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/arch-x86/hvm/save.h	Mon Mar 26 11:50:02 2012 +0200
@@ -575,9 +575,15 @@
 
 DECLARE_HVM_SAVE_TYPE(VIRIDIAN_VCPU, 17, struct hvm_viridian_vcpu_context);
 
+struct hvm_vmce_vcpu {
+    uint64_t caps;
+};
+
+DECLARE_HVM_SAVE_TYPE(VMCE_VCPU, 18, struct hvm_vmce_vcpu);
+
 /* 
  * Largest type-code in use
  */
-#define HVM_SAVE_CODE_MAX 17
+#define HVM_SAVE_CODE_MAX 18
 
 #endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/domctl.h
--- a/include/xen/interface/domctl.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/domctl.h	Mon Mar 26 11:50:02 2012 +0200
@@ -559,7 +559,7 @@
     uint32_t         vcpu;
     /*
      * SET: Size of struct (IN)
-     * GET: Size of struct (OUT)
+     * GET: Size of struct (OUT, up to 128 bytes)
      */
     uint32_t         size;
 #if defined(__i386__) || defined(__x86_64__)
@@ -571,6 +571,7 @@
     uint16_t         sysenter_callback_cs;
     uint8_t          syscall32_disables_events;
     uint8_t          sysenter_disables_events;
+    uint64_aligned_t mcg_cap;
 #endif
 };
 typedef struct xen_domctl_ext_vcpucontext xen_domctl_ext_vcpucontext_t;
@@ -710,48 +711,61 @@
 /* XEN_DOMCTL_mem_event_op */
 
 /*
-* Domain memory paging
- * Page memory in and out. 
+ * Domain memory paging
+ * Page memory in and out.
+ * Domctl interface to set up and tear down the 
+ * pager<->hypervisor interface. Use XENMEM_paging_op*
+ * to perform per-page operations.
  */
 #define XEN_DOMCTL_MEM_EVENT_OP_PAGING            1
 
 #define XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE     0
 #define XEN_DOMCTL_MEM_EVENT_OP_PAGING_DISABLE    1
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_NOMINATE   2
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_EVICT      3
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_PREP       4
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_RESUME     5
 
 /*
  * Access permissions.
  *
+ * As with paging, use the domctl for teardown/setup of the
+ * helper<->hypervisor interface.
+ *
  * There are HVM hypercalls to set the per-page access permissions of every
  * page in a domain.  When one of these permissions--independent, read, 
  * write, and execute--is violated, the VCPU is paused and a memory event 
- * is sent with what happened.  (See public/mem_event.h)  The memory event 
- * handler can then resume the VCPU and redo the access with an 
- * ACCESS_RESUME mode for the following domctl.
+ * is sent with what happened.  (See public/mem_event.h) .
+ *
+ * The memory event handler can then resume the VCPU and redo the access 
+ * with a XENMEM_access_op_resume hypercall.
  */
 #define XEN_DOMCTL_MEM_EVENT_OP_ACCESS            2
 
 #define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE     0
 #define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_DISABLE    1
-#define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_RESUME     2
 
+/*
+ * Sharing ENOMEM helper.
+ *
+ * As with paging, use the domctl for teardown/setup of the
+ * helper<->hypervisor interface.
+ *
+ * If setup, this ring is used to communicate failed allocations
+ * in the unshare path. XENMEM_sharing_op_resume is used to wake up
+ * vcpus that could not unshare.
+ *
+ * Note that shring can be turned on (as per the domctl below)
+ * *without* this ring being setup.
+ */
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING           3
+
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_ENABLE    0
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DISABLE   1
+
+/* Use for teardown/setup of helper<->hypervisor interface for paging, 
+ * access and sharing.*/
 struct xen_domctl_mem_event_op {
     uint32_t       op;           /* XEN_DOMCTL_MEM_EVENT_OP_*_* */
     uint32_t       mode;         /* XEN_DOMCTL_MEM_EVENT_OP_* */
 
-    union {
-        /* OP_ENABLE IN:  Virtual address of shared page */
-        uint64_aligned_t shared_addr;  
-        /* PAGING_PREP IN: buffer to immediately fill page in */
-        uint64_aligned_t buffer;
-    } u;
-    uint64_aligned_t ring_addr;    /* IN:  Virtual address of ring page */
-
-    /* Other OPs */
-    uint64_aligned_t gfn;          /* IN:  gfn of page being operated on */
+    uint32_t port;              /* OUT: event channel for ring */
 };
 typedef struct xen_domctl_mem_event_op xen_domctl_mem_event_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_mem_event_op_t);
@@ -759,63 +773,15 @@
 /*
  * Memory sharing operations
  */
-/* XEN_DOMCTL_mem_sharing_op */
-
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING                3
-
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_CONTROL        0
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_NOMINATE_GFN   1
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_NOMINATE_GREF  2
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_SHARE          3
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_RESUME         4
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GFN      5
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_MFN      6
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GREF     7
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_ADD_PHYSMAP    8
-
-#define XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID  (-10)
-#define XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID  (-9)
-
-/* The following allows sharing of grant refs. This is useful
- * for sharing utilities sitting as "filters" in IO backends
- * (e.g. memshr + blktap(2)). The IO backend is only exposed 
- * to grant references, and this allows sharing of the grefs */
-#define XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG   (1ULL << 62)
-
-#define XEN_DOMCTL_MEM_SHARING_FIELD_MAKE_GREF(field, val)  \
-    (field) = (XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG | val)
-#define XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF(field)         \
-    ((field) & XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG)
-#define XEN_DOMCTL_MEM_SHARING_FIELD_GET_GREF(field)        \
-    ((field) & (~XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG))
+/* XEN_DOMCTL_mem_sharing_op.
+ * The CONTROL sub-domctl is used for bringup/teardown. */
+#define XEN_DOMCTL_MEM_SHARING_CONTROL          0
 
 struct xen_domctl_mem_sharing_op {
-    uint8_t op; /* XEN_DOMCTL_MEM_EVENT_OP_* */
+    uint8_t op; /* XEN_DOMCTL_MEM_SHARING_* */
 
     union {
-        uint8_t enable;                   /* OP_CONTROL                */
-
-        struct mem_sharing_op_nominate {  /* OP_NOMINATE_xxx           */
-            union {
-                uint64_aligned_t gfn;     /* IN: gfn to nominate       */
-                uint32_t      grant_ref;  /* IN: grant ref to nominate */
-            } u;
-            uint64_aligned_t  handle;     /* OUT: the handle           */
-        } nominate;
-        struct mem_sharing_op_share {     /* OP_SHARE/ADD_PHYSMAP */
-            uint64_aligned_t source_gfn;    /* IN: the gfn of the source page */
-            uint64_aligned_t source_handle; /* IN: handle to the source page */
-            domid_t          client_domain; /* IN: the client domain id */
-            uint64_aligned_t client_gfn;    /* IN: the client gfn */
-            uint64_aligned_t client_handle; /* IN: handle to the client page */
-        } share; 
-        struct mem_sharing_op_debug {     /* OP_DEBUG_xxx */
-            union {
-                uint64_aligned_t gfn;      /* IN: gfn to debug          */
-                uint64_aligned_t mfn;      /* IN: mfn to debug          */
-                grant_ref_t    gref;       /* IN: gref to debug         */
-            } u;
-        } debug;
+        uint8_t enable;                   /* CONTROL */
     } u;
 };
 typedef struct xen_domctl_mem_sharing_op xen_domctl_mem_sharing_op_t;
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/event_channel.h
--- a/include/xen/interface/event_channel.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/event_channel.h	Mon Mar 26 11:50:02 2012 +0200
@@ -1,8 +1,8 @@
 /******************************************************************************
  * event_channel.h
- * 
+ *
  * Event channels between domains.
- * 
+ *
  * 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,12 +30,49 @@
 #include "xen.h"
 
 /*
- * Prototype for this hypercall is:
- *  int event_channel_op(int cmd, void *args)
- * @cmd  == EVTCHNOP_??? (event-channel operation).
- * @args == Operation-specific extra arguments (NULL if none).
+ * `incontents 150 evtchn Event Channels
+ *
+ * Event channels are the basic primitive provided by Xen for event
+ * notifications. An event is the Xen equivalent of a hardware
+ * interrupt. They essentially store one bit of information, the event
+ * of interest is signalled by transitioning this bit from 0 to 1.
+ *
+ * Notifications are received by a guest via an upcall from Xen,
+ * indicating when an event arrives (setting the bit). Further
+ * notifications are masked until the bit is cleared again (therefore,
+ * guests must check the value of the bit after re-enabling event
+ * delivery to ensure no missed notifications).
+ *
+ * Event notifications can be masked by setting a flag; this is
+ * equivalent to disabling interrupts and can be used to ensure
+ * atomicity of certain operations in the guest kernel.
+ *
+ * Event channels are represented by the evtchn_* fields in
+ * struct shared_info and struct vcpu_info.
  */
 
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_event_channel_op(enum event_channel_op cmd, void *args)
+ * `
+ * @cmd  == EVTCHNOP_* (event-channel operation).
+ * @args == struct evtchn_* Operation-specific extra arguments (NULL if none).
+ */
+
+/* ` enum event_channel_op { // EVTCHNOP_* => struct evtchn_* */
+#define EVTCHNOP_bind_interdomain 0
+#define EVTCHNOP_bind_virq        1
+#define EVTCHNOP_bind_pirq        2
+#define EVTCHNOP_close            3
+#define EVTCHNOP_send             4
+#define EVTCHNOP_status           5
+#define EVTCHNOP_alloc_unbound    6
+#define EVTCHNOP_bind_ipi         7
+#define EVTCHNOP_bind_vcpu        8
+#define EVTCHNOP_unmask           9
+#define EVTCHNOP_reset           10
+/* ` } */
+
 typedef uint32_t evtchn_port_t;
 DEFINE_XEN_GUEST_HANDLE(evtchn_port_t);
 
@@ -47,7 +84,6 @@
  *  1. If the caller is unprivileged then <dom> must be DOMID_SELF.
  *  2. <rdom> may be DOMID_SELF, allowing loopback connections.
  */
-#define EVTCHNOP_alloc_unbound    6
 struct evtchn_alloc_unbound {
     /* IN parameters */
     domid_t dom, remote_dom;
@@ -63,9 +99,8 @@
  * domain. A fresh port is allocated in the calling domain and returned as
  * <local_port>.
  * NOTES:
- *  2. <remote_dom> may be DOMID_SELF, allowing loopback connections.
+ *  1. <remote_dom> may be DOMID_SELF, allowing loopback connections.
  */
-#define EVTCHNOP_bind_interdomain 0
 struct evtchn_bind_interdomain {
     /* IN parameters. */
     domid_t remote_dom;
@@ -87,10 +122,9 @@
  *     The allocated event channel is bound to the specified vcpu and the
  *     binding cannot be changed.
  */
-#define EVTCHNOP_bind_virq        1
 struct evtchn_bind_virq {
     /* IN parameters. */
-    uint32_t virq;
+    uint32_t virq; /* enum virq */
     uint32_t vcpu;
     /* OUT parameters. */
     evtchn_port_t port;
@@ -98,12 +132,11 @@
 typedef struct evtchn_bind_virq evtchn_bind_virq_t;
 
 /*
- * EVTCHNOP_bind_pirq: Bind a local event channel to PIRQ <irq>.
+ * EVTCHNOP_bind_pirq: Bind a local event channel to a real IRQ (PIRQ <irq>).
  * NOTES:
  *  1. A physical IRQ may be bound to at most one event channel per domain.
  *  2. Only a sufficiently-privileged domain may bind to a physical IRQ.
  */
-#define EVTCHNOP_bind_pirq        2
 struct evtchn_bind_pirq {
     /* IN parameters. */
     uint32_t pirq;
@@ -120,7 +153,6 @@
  *  1. The allocated event channel is bound to the specified vcpu. The binding
  *     may not be changed.
  */
-#define EVTCHNOP_bind_ipi         7
 struct evtchn_bind_ipi {
     uint32_t vcpu;
     /* OUT parameters. */
@@ -133,7 +165,6 @@
  * interdomain then the remote end is placed in the unbound state
  * (EVTCHNSTAT_unbound), awaiting a new connection.
  */
-#define EVTCHNOP_close            3
 struct evtchn_close {
     /* IN parameters. */
     evtchn_port_t port;
@@ -144,7 +175,6 @@
  * EVTCHNOP_send: Send an event to the remote end of the channel whose local
  * endpoint is <port>.
  */
-#define EVTCHNOP_send             4
 struct evtchn_send {
     /* IN parameters. */
     evtchn_port_t port;
@@ -159,7 +189,6 @@
  *  2. Only a sufficiently-privileged domain may obtain the status of an event
  *     channel for which <dom> is not DOMID_SELF.
  */
-#define EVTCHNOP_status           5
 struct evtchn_status {
     /* IN parameters */
     domid_t  dom;
@@ -176,13 +205,13 @@
     union {
         struct {
             domid_t dom;
-        } unbound; /* EVTCHNSTAT_unbound */
+        } unbound;                 /* EVTCHNSTAT_unbound */
         struct {
             domid_t dom;
             evtchn_port_t port;
-        } interdomain; /* EVTCHNSTAT_interdomain */
-        uint32_t pirq;      /* EVTCHNSTAT_pirq        */
-        uint32_t virq;      /* EVTCHNSTAT_virq        */
+        } interdomain;             /* EVTCHNSTAT_interdomain */
+        uint32_t pirq;             /* EVTCHNSTAT_pirq        */
+        uint32_t virq;             /* EVTCHNSTAT_virq        */
     } u;
 };
 typedef struct evtchn_status evtchn_status_t;
@@ -199,7 +228,6 @@
  *     the channel is allocated (a port that is freed and subsequently reused
  *     has its binding reset to vcpu0).
  */
-#define EVTCHNOP_bind_vcpu        8
 struct evtchn_bind_vcpu {
     /* IN parameters. */
     evtchn_port_t port;
@@ -211,7 +239,6 @@
  * EVTCHNOP_unmask: Unmask the specified local event-channel port and deliver
  * a notification to the appropriate VCPU if an event is pending.
  */
-#define EVTCHNOP_unmask           9
 struct evtchn_unmask {
     /* IN parameters. */
     evtchn_port_t port;
@@ -224,7 +251,6 @@
  *  1. <dom> may be specified as DOMID_SELF.
  *  2. Only a sufficiently-privileged domain may specify other than DOMID_SELF.
  */
-#define EVTCHNOP_reset           10
 struct evtchn_reset {
     /* IN parameters. */
     domid_t dom;
@@ -232,11 +258,13 @@
 typedef struct evtchn_reset evtchn_reset_t;
 
 /*
- * Argument to event_channel_op_compat() hypercall. Superceded by new
- * event_channel_op() hypercall since 0x00030202.
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_event_channel_op_compat(struct evtchn_op *op)
+ * `
+ * Superceded by new event_channel_op() hypercall since 0x00030202.
  */
 struct evtchn_op {
-    uint32_t cmd; /* EVTCHNOP_* */
+    uint32_t cmd; /* enum event_channel_op */
     union {
         struct evtchn_alloc_unbound    alloc_unbound;
         struct evtchn_bind_interdomain bind_interdomain;
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/hvm/params.h
--- a/include/xen/interface/hvm/params.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/hvm/params.h	Mon Mar 26 11:50:02 2012 +0200
@@ -142,6 +142,11 @@
 /* Boolean: Enable nestedhvm (hvm only) */
 #define HVM_PARAM_NESTEDHVM    24
 
-#define HVM_NR_PARAMS          27
+/* Params for the mem event rings */
+#define HVM_PARAM_PAGING_RING_PFN   27
+#define HVM_PARAM_ACCESS_RING_PFN   28
+#define HVM_PARAM_SHARING_RING_PFN  29
+
+#define HVM_NR_PARAMS          30
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/hvm/save.h
--- a/include/xen/interface/hvm/save.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/hvm/save.h	Mon Mar 26 11:50:02 2012 +0200
@@ -104,6 +104,8 @@
 #include "../arch-x86/hvm/save.h"
 #elif defined(__ia64__)
 #include "../arch-ia64/hvm/save.h"
+#elif defined(__arm__)
+#include "../arch-arm/hvm/save.h"
 #else
 #error "unsupported architecture"
 #endif
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/io/blkif.h
--- a/include/xen/interface/io/blkif.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/io/blkif.h	Mon Mar 26 11:50:02 2012 +0200
@@ -1,8 +1,8 @@
 /******************************************************************************
  * blkif.h
- * 
+ *
  * Unified block-device I/O interface for Xen guest OSes.
- * 
+ *
  * 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
@@ -22,6 +22,7 @@
  * DEALINGS IN THE SOFTWARE.
  *
  * Copyright (c) 2003-2004, Keir Fraser
+ * Copyright (c) 2012, Spectra Logic Corporation
  */
 
 #ifndef __XEN_PUBLIC_IO_BLKIF_H__
@@ -35,7 +36,7 @@
  * notification can be made conditional on req_event (i.e., the generic
  * hold-off mechanism provided by the ring macros). Backends must set
  * req_event appropriately (e.g., using RING_FINAL_CHECK_FOR_REQUESTS()).
- * 
+ *
  * Back->front notifications: When enqueuing a new response, sending a
  * notification can be made conditional on rsp_event (i.e., the generic
  * hold-off mechanism provided by the ring macros). Frontends must set
@@ -48,32 +49,330 @@
 #define blkif_sector_t uint64_t
 
 /*
+ * Feature and Parameter Negotiation
+ * =================================
+ * The two halves of a Xen block driver utilize nodes within the XenStore to
+ * communicate capabilities and to negotiate operating parameters.  This
+ * section enumerates these nodes which reside in the respective front and
+ * backend portions of the XenStore, following the XenBus convention.
+ *
+ * All data in the XenStore is stored as strings.  Nodes specifying numeric
+ * values are encoded in decimal.  Integer value ranges listed below are
+ * expressed as fixed sized integer types capable of storing the conversion
+ * of a properly formated node string, without loss of information.
+ *
+ * Any specified default value is in effect if the corresponding XenBus node
+ * is not present in the XenStore.
+ *
+ * XenStore nodes in sections marked "PRIVATE" are solely for use by the
+ * driver side whose XenBus tree contains them.
+ *
+ * XenStore nodes marked "DEPRECATED" in their notes section should only be
+ * used to provide interoperability with legacy implementations.
+ *
+ * See the XenBus state transition diagram below for details on when XenBus
+ * nodes must be published and when they can be queried.
+ *
+ *****************************************************************************
+ *                            Backend XenBus Nodes
+ *****************************************************************************
+ *
+ *------------------ Backend Device Identification (PRIVATE) ------------------
+ *
+ * mode
+ *      Values:         "r" (read only), "w" (writable)
+ *
+ *      The read or write access permissions to the backing store to be
+ *      granted to the frontend.
+ *
+ * params
+ *      Values:         string
+ *
+ *      A free formatted string providing sufficient information for the
+ *      backend driver to open the backing device.  (e.g. the path to the
+ *      file or block device representing the backing store.)
+ *
+ * type
+ *      Values:         "file", "phy", "tap"
+ *
+ *      The type of the backing device/object.
+ *
+ *--------------------------------- Features ---------------------------------
+ *
+ * feature-barrier
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *
+ *      A value of "1" indicates that the backend can process requests
+ *      containing the BLKIF_OP_WRITE_BARRIER request opcode.  Requests
+ *      of this type may still be returned at any time with the
+ *      BLKIF_RSP_EOPNOTSUPP result code.
+ *
+ * feature-flush-cache
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *
+ *      A value of "1" indicates that the backend can process requests
+ *      containing the BLKIF_OP_FLUSH_DISKCACHE request opcode.  Requests
+ *      of this type may still be returned at any time with the
+ *      BLKIF_RSP_EOPNOTSUPP result code.
+ *
+ * feature-discard
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *
+ *      A value of "1" indicates that the backend can process requests
+ *      containing the BLKIF_OP_DISCARD request opcode.  Requests
+ *      of this type may still be returned at any time with the
+ *      BLKIF_RSP_EOPNOTSUPP result code.
+ *
+ *----------------------- Request Transport Parameters ------------------------
+ *
+ * max-ring-page-order
+ *      Values:         <uint32_t>
+ *      Default Value:  0
+ *      Notes:          1, 3
+ *
+ *      The maximum supported size of the request ring buffer in units of
+ *      lb(machine pages). (e.g. 0 == 1 page,  1 = 2 pages, 2 == 4 pages,
+ *      etc.).
+ *
+ * max-ring-pages
+ *      Values:         <uint32_t>
+ *      Default Value:  1
+ *      Notes:          DEPRECATED, 2, 3
+ *
+ *      The maximum supported size of the request ring buffer in units of
+ *      machine pages.  The value must be a power of 2.
+ *
+ *------------------------- Backend Device Properties -------------------------
+ *
+ * discard-aligment
+ *      Values:         <uint32_t>
+ *      Default Value:  0
+ *      Notes:          4, 5
+ *
+ *      The offset, in bytes from the beginning of the virtual block device,
+ *      to the first, addressable, discard extent on the underlying device.
+ *
+ * discard-granularity
+ *      Values:         <uint32_t>
+ *      Default Value:  <"sector-size">
+ *      Notes:          4
+ *
+ *      The size, in bytes, of the individually addressable discard extents
+ *      of the underlying device.
+ *
+ * discard-secure
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *
+ *      A value of "1" indicates that the backend can process BLKIF_OP_DISCARD
+ *      requests with the BLKIF_DISCARD_SECURE flag set.
+ *
+ * info
+ *      Values:         <uint32_t> (bitmap)
+ *
+ *      A collection of bit flags describing attributes of the backing
+ *      device.  The VDISK_* macros define the meaning of each bit
+ *      location.
+ *
+ * sector-size
+ *      Values:         <uint32_t>
+ *
+ *      The native sector size, in bytes, of the backend device.
+ *
+ * sectors
+ *      Values:         <uint64_t>
+ *
+ *      The size of the backend device, expressed in units of its native
+ *      sector size ("sector-size").
+ *
+ *****************************************************************************
+ *                            Frontend XenBus Nodes
+ *****************************************************************************
+ *
+ *----------------------- Request Transport Parameters -----------------------
+ *
+ * event-channel
+ *      Values:         <uint32_t>
+ *
+ *      The identifier of the Xen event channel used to signal activity
+ *      in the ring buffer.
+ *
+ * ring-ref
+ *      Values:         <uint32_t>
+ *      Notes:          6
+ *
+ *      The Xen grant reference granting permission for the backend to map
+ *      the sole page in a single page sized ring buffer.
+ *
+ * ring-ref%u
+ *      Values:         <uint32_t>
+ *      Notes:          6
+ *
+ *      For a frontend providing a multi-page ring, a "number of ring pages"
+ *      sized list of nodes, each containing a Xen grant reference granting
+ *      permission for the backend to map the page of the ring located
+ *      at page index "%u".  Page indexes are zero based.
+ *
+ * protocol
+ *      Values:         string (XEN_IO_PROTO_ABI_*)
+ *      Default Value:  XEN_IO_PROTO_ABI_NATIVE
+ *
+ *      The machine ABI rules governing the format of all ring request and
+ *      response structures.
+ *
+ * ring-page-order
+ *      Values:         <uint32_t>
+ *      Default Value:  0
+ *      Maximum Value:  MAX(ffs(max-ring-pages) - 1, max-ring-page-order)
+ *      Notes:          1, 3
+ *
+ *      The size of the frontend allocated request ring buffer in units
+ *      of lb(machine pages). (e.g. 0 == 1 page, 1 = 2 pages, 2 == 4 pages,
+ *      etc.).
+ *
+ * num-ring-pages
+ *      Values:         <uint32_t>
+ *      Default Value:  1
+ *      Maximum Value:  MAX(max-ring-pages,(0x1 << max-ring-page-order))
+ *      Notes:          DEPRECATED, 2, 3
+ *
+ *      The size of the frontend allocated request ring buffer in units of
+ *      machine pages.  The value must be a power of 2.
+ *
+ *------------------------- Virtual Device Properties -------------------------
+ *
+ * device-type
+ *      Values:         "disk", "cdrom", "floppy", etc.
+ *
+ * virtual-device
+ *      Values:         <uint32_t>
+ *
+ *      A value indicating the physical device to virtualize within the
+ *      frontend's domain.  (e.g. "The first ATA disk", "The third SCSI
+ *      disk", etc.)
+ *
+ *      See docs/misc/vbd-interface.txt for details on the format of this
+ *      value.
+ *
+ * Notes
+ * -----
+ * (1) Multi-page ring buffer scheme first developed in the Citrix XenServer
+ *     PV drivers.
+ * (2) Multi-page ring buffer scheme first used in some RedHat distributions
+ *     including a distribution deployed on certain nodes of the Amazon
+ *     EC2 cluster.
+ * (3) Support for multi-page ring buffers was implemented independently,
+ *     in slightly different forms, by both Citrix and RedHat/Amazon.
+ *     For full interoperability, block front and backends should publish
+ *     identical ring parameters, adjusted for unit differences, to the
+ *     XenStore nodes used in both schemes.
+ * (4) Devices that support discard functionality may internally allocate
+ *     space (discardable extents) in units that are larger than the
+ *     exported logical block size.
+ * (5) The discard-alignment parameter allows a physical device to be
+ *     partitioned into virtual devices that do not necessarily begin or
+ *     end on a discardable extent boundary.
+ * (6) When there is only a single page allocated to the request ring,
+ *     '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.
+ */
+
+/*
+ * STATE DIAGRAMS
+ *
+ *****************************************************************************
+ *                                   Startup                                 *
+ *****************************************************************************
+ *
+ * Tool stack creates front and back nodes with state XenbusStateInitialising.
+ *
+ * Front                                Back
+ * =================================    =====================================
+ * XenbusStateInitialising              XenbusStateInitialising
+ *  o Query virtual device               o Query backend device identification
+ *    properties.                          data.
+ *  o Setup OS device instance.          o Open and validate backend device.
+ *                                       o Publish backend features and
+ *                                         transport parameters.
+ *                                                      |
+ *                                                      |
+ *                                                      V
+ *                                      XenbusStateInitWait
+ *
+ * o Query backend features and
+ *   transport parameters.
+ * o Allocate and initialize the
+ *   request ring.
+ * o Publish transport parameters
+ *   that will be in effect during
+ *   this connection.
+ *              |
+ *              |
+ *              V
+ * XenbusStateInitialised
+ *
+ *                                       o Query frontend transport parameters.
+ *                                       o Connect to the request ring and
+ *                                         event channel.
+ *                                       o Publish backend device properties.
+ *                                                      |
+ *                                                      |
+ *                                                      V
+ *                                      XenbusStateConnected
+ *
+ *  o Query backend device properties.
+ *  o Finalize OS virtual device
+ *    instance.
+ *              |
+ *              |
+ *              V
+ * XenbusStateConnected
+ *
+ * Note: Drivers that do not support any optional features, or the negotiation
+ *       of transport parameters, can skip certain states in the state machine:
+ *
+ *       o A frontend may transition to XenbusStateInitialised without
+ *         waiting for the backend to enter XenbusStateInitWait.  In this
+ *         case, default transport parameters are in effect and any
+ *         transport parameters published by the frontend must contain
+ *         their default values.
+ *
+ *       o A backend may transition to XenbusStateInitialised, bypassing
+ *         XenbusStateInitWait, without waiting for the frontend to first
+ *         enter the XenbusStateInitialised state.  In this case, default
+ *         transport parameters are in effect and any transport parameters
+ *         published by the backend must contain their default values.
+ *
+ *       Drivers that support optional features and/or transport parameter
+ *       negotiation must tolerate these additional state transition paths.
+ *       In general this means performing the work of any skipped state
+ *       transition, if it has not already been performed, in addition to the
+ *       work associated with entry into the current state.
+ */
+
+/*
  * REQUEST CODES.
  */
 #define BLKIF_OP_READ              0
 #define BLKIF_OP_WRITE             1
 /*
- * Recognised only if "feature-barrier" is present in backend xenbus info.
- * The "feature-barrier" node contains a boolean indicating whether barrier
- * requests are likely to succeed or fail. Either way, a barrier request
- * may fail at any time with BLKIF_RSP_EOPNOTSUPP if it is unsupported by
- * the underlying block-device hardware. The boolean simply indicates whether
- * or not it is worthwhile for the frontend to attempt barrier requests.
- * If a backend does not recognise BLKIF_OP_WRITE_BARRIER, it should *not*
- * create the "feature-barrier" node!
+ * All writes issued prior to a request with the BLKIF_OP_WRITE_BARRIER
+ * operation code ("barrier request") must be completed prior to the
+ * execution of the barrier request.  All writes issued after the barrier
+ * request must not execute until after the completion of the barrier request.
+ *
+ * Optional.  See "feature-barrier" XenBus node documentation above.
  */
 #define BLKIF_OP_WRITE_BARRIER     2
 /*
- * Recognised if "feature-flush-cache" is present in backend xenbus
- * info.  A flush will ask the underlying storage hardware to flush its
- * non-volatile caches as appropriate.  The "feature-flush-cache" node
- * contains a boolean indicating whether flush requests are likely to
- * succeed or fail. Either way, a flush request may fail at any time
- * with BLKIF_RSP_EOPNOTSUPP if it is unsupported by the underlying
- * block-device hardware. The boolean simply indicates whether or not it
- * is worthwhile for the frontend to attempt flushes.  If a backend does
- * not recognise BLKIF_OP_WRITE_FLUSH_CACHE, it should *not* create the
- * "feature-flush-cache" node!
+ * Commit any uncommitted contents of the backing device's volatile cache
+ * to stable storage.
+ *
+ * Optional.  See "feature-flush-cache" XenBus node documentation above.
  */
 #define BLKIF_OP_FLUSH_DISKCACHE   3
 /*
@@ -82,47 +381,24 @@
  */
 #define BLKIF_OP_RESERVED_1        4
 /*
- * Recognised only if "feature-discard" is present in backend xenbus info.
- * The "feature-discard" node contains a boolean indicating whether trim
- * (ATA) or unmap (SCSI) - conviently called discard requests are likely
- * to succeed or fail. Either way, a discard request
- * may fail at any time with BLKIF_RSP_EOPNOTSUPP if it is unsupported by
- * the underlying block-device hardware. The boolean simply indicates whether
- * or not it is worthwhile for the frontend to attempt discard requests.
- * If a backend does not recognise BLKIF_OP_DISCARD, it should *not*
- * create the "feature-discard" node!
+ * Indicate to the backend device that a region of storage is no longer in
+ * use, and may be discarded at any time without impact to the client.  If
+ * the BLKIF_DISCARD_SECURE flag is set on the request, all copies of the
+ * discarded region on the device must be rendered unrecoverable before the
+ * command returns.
  *
- * Discard operation is a request for the underlying block device to mark
- * extents to be erased. However, discard does not guarantee that the blocks
- * will be erased from the device - it is just a hint to the device
- * controller that these blocks are no longer in use. What the device
- * controller does with that information is left to the controller.
- * Discard operations are passed with sector_number as the
- * sector index to begin discard operations at and nr_sectors as the number of
- * sectors to be discarded. The specified sectors should be discarded if the
- * underlying block device supports trim (ATA) or unmap (SCSI) operations,
- * or a BLKIF_RSP_EOPNOTSUPP  should be returned.
- * More information about trim/unmap operations at:
+ * This operation is analogous to performing a trim (ATA) or unamp (SCSI),
+ * command on a native device.
+ *
+ * More information about trim/unmap operations can be found at:
  * http://t13.org/Documents/UploadedDocuments/docs2008/
  *     e07154r6-Data_Set_Management_Proposal_for_ATA-ACS2.doc
  * http://www.seagate.com/staticfiles/support/disc/manuals/
  *     Interface%20manuals/100293068c.pdf
- * The backend can optionally provide these extra XenBus attributes to
- * further optimize the discard functionality:
- * 'discard-aligment' - Devices that support discard functionality may
- * internally allocate space in units that are bigger than the exported
- * logical block size. The discard-alignment parameter indicates how many bytes
- * the beginning of the partition is offset from the internal allocation unit's
- * natural alignment. Do not confuse this with natural disk alignment offset.
- * 'discard-granularity'  - Devices that support discard functionality may
- * internally allocate space using units that are bigger than the logical block
- * size. The discard-granularity parameter indicates the size of the internal
- * allocation unit in bytes if reported by the device. Otherwise the
- * discard-granularity will be set to match the device's physical block size.
- * It is the minimum size you can discard.
- * 'discard-secure' - All copies of the discarded sectors (potentially created
- * by garbage collection) must also be erased.  To use this feature, the flag
- * BLKIF_DISCARD_SECURE must be set in the blkif_request_discard.
+ *
+ * Optional.  See "feature-discard", "discard-alignment",
+ * "discard-granularity", and "discard-secure" in the XenBus node
+ * documentation above.
  */
 #define BLKIF_OP_DISCARD           5
 
@@ -133,7 +409,7 @@
  */
 #define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
 
-/* 
+/*
  * NB. first_sect and last_sect in blkif_request_segment, as well as
  * sector_number in blkif_request, are always expressed in 512-byte units.
  * However they must be properly aligned to the real sector size of the
@@ -147,6 +423,9 @@
     uint8_t     first_sect, last_sect;
 };
 
+/*
+ * Starting ring element for any I/O request.
+ */
 struct blkif_request {
     uint8_t        operation;    /* BLKIF_OP_???                         */
     uint8_t        nr_segments;  /* number of segments                   */
@@ -158,7 +437,7 @@
 typedef struct blkif_request blkif_request_t;
 
 /*
- * Cast to this structure when blkif_request.operation == BLKIF_OP_TRIM
+ * Cast to this structure when blkif_request.operation == BLKIF_OP_DISCARD
  * sizeof(struct blkif_request_discard) <= sizeof(struct blkif_request)
  */
 struct blkif_request_discard {
@@ -192,7 +471,6 @@
 /*
  * Generate blkif ring structures and types.
  */
-
 DEFINE_RING_TYPES(blkif, struct blkif_request, struct blkif_response);
 
 #define VDISK_CDROM        0x1
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/io/protocols.h
--- a/include/xen/interface/io/protocols.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/io/protocols.h	Mon Mar 26 11:50:02 2012 +0200
@@ -26,6 +26,7 @@
 #define XEN_IO_PROTO_ABI_X86_32     "x86_32-abi"
 #define XEN_IO_PROTO_ABI_X86_64     "x86_64-abi"
 #define XEN_IO_PROTO_ABI_IA64       "ia64-abi"
+#define XEN_IO_PROTO_ABI_ARM        "arm-abi"
 
 #if defined(__i386__)
 # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_32
@@ -33,6 +34,8 @@
 # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_64
 #elif defined(__ia64__)
 # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_IA64
+#elif defined(__arm__)
+# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_ARM
 #else
 # error arch fixup needed here
 #endif
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/mem_event.h
--- a/include/xen/interface/mem_event.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/mem_event.h	Mon Mar 26 11:50:02 2012 +0200
@@ -30,11 +30,6 @@
 #include "xen.h"
 #include "io/ring.h"
 
-/* Memory event type */
-#define MEM_EVENT_TYPE_SHARED   0
-#define MEM_EVENT_TYPE_PAGING   1
-#define MEM_EVENT_TYPE_ACCESS   2
-
 /* Memory event flags */
 #define MEM_EVENT_FLAG_VCPU_PAUSED  (1 << 0)
 #define MEM_EVENT_FLAG_DROP_PAGE    (1 << 1)
@@ -51,13 +46,8 @@
 #define MEM_EVENT_REASON_INT3        5    /* int3 was hit: gla/gfn are RIP */
 #define MEM_EVENT_REASON_SINGLESTEP  6    /* single step was invoked: gla/gfn are RIP */
 
-typedef struct mem_event_shared_page {
-    uint32_t port;
-} mem_event_shared_page_t;
-
 typedef struct mem_event_st {
-    uint16_t type;
-    uint16_t flags;
+    uint32_t flags;
     uint32_t vcpu_id;
 
     uint64_t gfn;
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/memory.h
--- a/include/xen/interface/memory.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/memory.h	Mon Mar 26 11:50:02 2012 +0200
@@ -305,6 +305,12 @@
 };
 typedef struct xen_pod_target xen_pod_target_t;
 
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
+
+#ifndef uint64_aligned_t
+#define uint64_aligned_t uint64_t
+#endif
+
 /*
  * Get the number of MFNs saved through memory sharing.
  * The call never fails. 
@@ -312,6 +318,87 @@
 #define XENMEM_get_sharing_freed_pages    18
 #define XENMEM_get_sharing_shared_pages   19
 
+#define XENMEM_paging_op                    20
+#define XENMEM_paging_op_nominate           0
+#define XENMEM_paging_op_evict              1
+#define XENMEM_paging_op_prep               2
+
+#define XENMEM_access_op                    21
+#define XENMEM_access_op_resume             0
+
+struct xen_mem_event_op {
+    uint8_t     op;         /* XENMEM_*_op_* */
+    domid_t     domain;
+    
+
+    /* PAGING_PREP IN: buffer to immediately fill page in */
+    uint64_aligned_t    buffer;
+    /* Other OPs */
+    uint64_aligned_t    gfn;           /* IN:  gfn of page being operated on */
+};
+typedef struct xen_mem_event_op xen_mem_event_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_mem_event_op_t);
+
+#define XENMEM_sharing_op                   22
+#define XENMEM_sharing_op_nominate_gfn      0
+#define XENMEM_sharing_op_nominate_gref     1
+#define XENMEM_sharing_op_share             2
+#define XENMEM_sharing_op_resume            3
+#define XENMEM_sharing_op_debug_gfn         4
+#define XENMEM_sharing_op_debug_mfn         5
+#define XENMEM_sharing_op_debug_gref        6
+#define XENMEM_sharing_op_add_physmap       7
+#define XENMEM_sharing_op_audit             8
+
+#define XENMEM_SHARING_OP_S_HANDLE_INVALID  (-10)
+#define XENMEM_SHARING_OP_C_HANDLE_INVALID  (-9)
+
+/* The following allows sharing of grant refs. This is useful
+ * for sharing utilities sitting as "filters" in IO backends
+ * (e.g. memshr + blktap(2)). The IO backend is only exposed 
+ * to grant references, and this allows sharing of the grefs */
+#define XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG   (1ULL << 62)
+
+#define XENMEM_SHARING_OP_FIELD_MAKE_GREF(field, val)  \
+    (field) = (XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG | val)
+#define XENMEM_SHARING_OP_FIELD_IS_GREF(field)         \
+    ((field) & XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG)
+#define XENMEM_SHARING_OP_FIELD_GET_GREF(field)        \
+    ((field) & (~XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG))
+
+struct xen_mem_sharing_op {
+    uint8_t     op;     /* XENMEM_sharing_op_* */
+    domid_t     domain;
+
+    union {
+        struct mem_sharing_op_nominate {  /* OP_NOMINATE_xxx           */
+            union {
+                uint64_aligned_t gfn;     /* IN: gfn to nominate       */
+                uint32_t      grant_ref;  /* IN: grant ref to nominate */
+            } u;
+            uint64_aligned_t  handle;     /* OUT: the handle           */
+        } nominate;
+        struct mem_sharing_op_share {     /* OP_SHARE/ADD_PHYSMAP */
+            uint64_aligned_t source_gfn;    /* IN: the gfn of the source page */
+            uint64_aligned_t source_handle; /* IN: handle to the source page */
+            uint64_aligned_t client_gfn;    /* IN: the client gfn */
+            uint64_aligned_t client_handle; /* IN: handle to the client page */
+            domid_t  client_domain; /* IN: the client domain id */
+        } share; 
+        struct mem_sharing_op_debug {     /* OP_DEBUG_xxx */
+            union {
+                uint64_aligned_t gfn;      /* IN: gfn to debug          */
+                uint64_aligned_t mfn;      /* IN: mfn to debug          */
+                uint32_t gref;     /* IN: gref to debug         */
+            } u;
+        } debug;
+    } u;
+};
+typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
+
+#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
+
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
 
 /*
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/platform.h
--- a/include/xen/interface/platform.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/platform.h	Mon Mar 26 11:50:02 2012 +0200
@@ -490,6 +490,20 @@
     uint32_t flags;
 };
 
+#define XENPF_core_parking  60
+
+#define XEN_CORE_PARKING_SET 1
+#define XEN_CORE_PARKING_GET 2
+struct xenpf_core_parking {
+    /* IN variables */
+    uint32_t type;
+    /* IN variables:  set cpu nums expected to be idled */
+    /* OUT variables: get cpu nums actually be idled */
+    uint32_t idle_nums;
+};
+typedef struct xenpf_core_parking xenpf_core_parking_t;
+DEFINE_XEN_GUEST_HANDLE(xenpf_core_parking_t);
+
 struct xen_platform_op {
     uint32_t cmd;
     uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -511,6 +525,7 @@
         struct xenpf_cpu_ol            cpu_ol;
         struct xenpf_cpu_hotadd        cpu_add;
         struct xenpf_mem_hotadd        mem_add;
+        struct xenpf_core_parking      core_parking;
         uint8_t                        pad[128];
     } u;
 };
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/sysctl.h
--- a/include/xen/interface/sysctl.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/sysctl.h	Mon Mar 26 11:50:02 2012 +0200
@@ -564,6 +564,19 @@
 typedef struct xen_sysctl_arinc653_schedule xen_sysctl_arinc653_schedule_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_arinc653_schedule_t);
 
+struct xen_sysctl_credit_schedule {
+    /* Length of timeslice in milliseconds */
+#define XEN_SYSCTL_CSCHED_TSLICE_MAX 1000
+#define XEN_SYSCTL_CSCHED_TSLICE_MIN 1
+    unsigned tslice_ms;
+    /* Rate limit (minimum timeslice) in microseconds */
+#define XEN_SYSCTL_SCHED_RATELIMIT_MAX 500000
+#define XEN_SYSCTL_SCHED_RATELIMIT_MIN 100
+    unsigned ratelimit_us;
+};
+typedef struct xen_sysctl_credit_schedule xen_sysctl_credit_schedule_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_credit_schedule_t);
+
 /* XEN_SYSCTL_scheduler_op */
 /* Set or get info? */
 #define XEN_SYSCTL_SCHEDOP_putinfo 0
@@ -576,6 +589,7 @@
         struct xen_sysctl_sched_arinc653 {
             XEN_GUEST_HANDLE_64(xen_sysctl_arinc653_schedule_t) schedule;
         } sched_arinc653;
+        struct xen_sysctl_credit_schedule sched_credit;
     } u;
 };
 typedef struct xen_sysctl_scheduler_op xen_sysctl_scheduler_op_t;
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/xen.h
--- a/include/xen/interface/xen.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/xen.h	Mon Mar 26 11:50:02 2012 +0200
@@ -146,6 +146,7 @@
  * The latter can be allocated only once per guest: they must initially be
  * allocated to VCPU0 but can subsequently be re-bound.
  */
+/* ` enum virq { */
 #define VIRQ_TIMER      0  /* V. Timebase update, and/or requested timeout.  */
 #define VIRQ_DEBUG      1  /* V. Request guest to dump debug info.           */
 #define VIRQ_CONSOLE    2  /* G. (DOM0) Bytes received on emergency console. */
@@ -157,6 +158,7 @@
 #define VIRQ_PCPU_STATE 9  /* G. (DOM0) PCPU state changed                   */
 #define VIRQ_MEM_EVENT  10 /* G. (DOM0) A memory event has occured           */
 #define VIRQ_XC_RESERVED 11 /* G. Reserved for XenClient                     */
+#define VIRQ_ENOMEM     12 /* G. (DOM0) Low on heap memory       */
 
 /* Architecture-specific VIRQ definitions. */
 #define VIRQ_ARCH_0    16
@@ -167,6 +169,7 @@
 #define VIRQ_ARCH_5    21
 #define VIRQ_ARCH_6    22
 #define VIRQ_ARCH_7    23
+/* ` } */
 
 #define NR_VIRQS       24
 
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/xsm/flask_op.h
--- a/include/xen/interface/xsm/flask_op.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/xsm/flask_op.h	Mon Mar 26 11:50:02 2012 +0200
@@ -135,6 +135,13 @@
     uint64_t low, high;
 };
 
+struct xen_flask_peersid {
+    /* IN */
+    evtchn_port_t evtchn;
+    /* OUT */
+    uint32_t sid;
+};
+
 struct xen_flask_op {
     uint32_t cmd;
 #define FLASK_LOAD              1
@@ -159,6 +166,7 @@
 #define FLASK_MEMBER            20
 #define FLASK_ADD_OCONTEXT      21
 #define FLASK_DEL_OCONTEXT      22
+#define FLASK_GET_PEER_SID      23
     uint32_t interface_version; /* XEN_FLASK_INTERFACE_VERSION */
     union {
         struct xen_flask_load load;
@@ -176,6 +184,7 @@
         struct xen_flask_cache_stats cache_stats;
         /* FLASK_ADD_OCONTEXT, FLASK_DEL_OCONTEXT */
         struct xen_flask_ocontext ocontext;
+        struct xen_flask_peersid peersid;
     } u;
 };
 typedef struct xen_flask_op xen_flask_op_t;

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

From xen-changelog-bounces@lists.xen.org Mon Mar 26 09:55:35 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Mon, 26 Mar 2012 09:55:35 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SC6eB-0005AV-5J; Mon, 26 Mar 2012 09:55: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 1SC6e9-0005AQ-QS
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:55:30 +0000
Received: from [193.109.254.147:63678] by server-2.bemta-14.messagelabs.com id
	D0/F9-19409-11D307F4; Mon, 26 Mar 2012 09:55:29 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1332755712!2052176!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26892 invoked from network); 26 Mar 2012 09: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;
	26 Mar 2012 09: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 1SC6dl-0005SF-Qq
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SC6dl-0006YE-Ha
	for xen-changelog@lists.xensource.com; Mon, 26 Mar 2012 09:55:05 +0000
Message-Id: <E1SC6dl-0006YE-Ha@xenbits.xen.org>
Date: Mon, 26 Mar 2012 09:55: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] 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332755402 -7200
# Node ID f8805d3fc263d247e1e27666a8c2e092956ccf21
# Parent  8940ccd0a425346845bd102c4bc049eb58b550b6
Sync Xen public headers

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


diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/arch-arm.h
--- a/include/xen/interface/arch-arm.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/arch-arm.h	Mon Mar 26 11:50:02 2012 +0200
@@ -27,6 +27,29 @@
 #ifndef __XEN_PUBLIC_ARCH_ARM_H__
 #define __XEN_PUBLIC_ARCH_ARM_H__
 
+/* hypercall calling convention
+ * ----------------------------
+ *
+ * A hypercall is issued using the ARM HVC instruction.
+ *
+ * A hypercall can take up to 5 arguments. These are passed in
+ * registers, the first argument in r0, the second argument in r1, the
+ * third in r2, the forth in r3 and the fifth in r4.
+ *
+ * The hypercall number is passed in r12.
+ *
+ * The HVC ISS must contain a Xen specific TAG: XEN_HYPERCALL_TAG.
+ *
+ * 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.
+ *
+ */
+
+#define XEN_HYPERCALL_TAG   0XEA1
+
+
 #ifndef __ASSEMBLY__
 #define ___DEFINE_XEN_GUEST_HANDLE(name, type) \
     typedef struct { type *p; } __guest_handle_ ## name
@@ -63,7 +86,12 @@
     uint32_t r12;
 
     uint32_t sp; /* r13 - SP: Valid for Hyp. frames only, o/w banked (see below) */
-    uint32_t lr; /* r14 - LR: Valid for Hyp. Same physical register as lr_usr. */
+
+    /* r14 - LR: is the same physical register as LR_usr */
+    union {
+        uint32_t lr; /* r14 - LR: Valid for Hyp. Same physical register as lr_usr. */
+        uint32_t lr_usr;
+    };
 
     uint32_t pc; /* Return IP */
     uint32_t cpsr; /* Return mode */
@@ -73,10 +101,14 @@
 
     uint32_t r8_fiq, r9_fiq, r10_fiq, r11_fiq, r12_fiq;
 
-    uint32_t sp_usr, sp_svc, sp_abt, sp_und, sp_irq, sp_fiq;
-    uint32_t lr_usr, lr_svc, lr_abt, lr_und, lr_irq, lr_fiq;
+    uint32_t sp_usr; /* LR_usr is the same register as LR, see above */
+
+    uint32_t sp_svc, sp_abt, sp_und, sp_irq, sp_fiq;
+    uint32_t lr_svc, lr_abt, lr_und, lr_irq, lr_fiq;
 
     uint32_t spsr_svc, spsr_abt, spsr_und, spsr_irq, spsr_fiq;
+
+    uint32_t pad1; /* Doubleword-align the user half of the frame */
 };
 typedef struct cpu_user_regs cpu_user_regs_t;
 DEFINE_XEN_GUEST_HANDLE(cpu_user_regs_t);
@@ -110,6 +142,8 @@
 
 struct arch_shared_info { };
 typedef struct arch_shared_info arch_shared_info_t;
+typedef uint64_t xen_callback_t;
+
 #endif
 
 #endif /*  __XEN_PUBLIC_ARCH_ARM_H__ */
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/arch-arm/hvm/save.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/include/xen/interface/arch-arm/hvm/save.h	Mon Mar 26 11:50:02 2012 +0200
@@ -0,0 +1,39 @@
+/*
+ * Structure definitions for HVM state that is held by Xen and must
+ * be saved along with the domain's memory and device-model state.
+ *
+ * Copyright (c) 2012 Citrix Systems Ltd.
+ *
+ * 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_HVM_SAVE_ARM_H__
+#define __XEN_PUBLIC_HVM_SAVE_ARM_H__
+
+#endif
+
+/*
+ * Local variables:
+ * mode: C
+ * c-set-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/arch-x86/hvm/save.h
--- a/include/xen/interface/arch-x86/hvm/save.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/arch-x86/hvm/save.h	Mon Mar 26 11:50:02 2012 +0200
@@ -575,9 +575,15 @@
 
 DECLARE_HVM_SAVE_TYPE(VIRIDIAN_VCPU, 17, struct hvm_viridian_vcpu_context);
 
+struct hvm_vmce_vcpu {
+    uint64_t caps;
+};
+
+DECLARE_HVM_SAVE_TYPE(VMCE_VCPU, 18, struct hvm_vmce_vcpu);
+
 /* 
  * Largest type-code in use
  */
-#define HVM_SAVE_CODE_MAX 17
+#define HVM_SAVE_CODE_MAX 18
 
 #endif /* __XEN_PUBLIC_HVM_SAVE_X86_H__ */
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/domctl.h
--- a/include/xen/interface/domctl.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/domctl.h	Mon Mar 26 11:50:02 2012 +0200
@@ -559,7 +559,7 @@
     uint32_t         vcpu;
     /*
      * SET: Size of struct (IN)
-     * GET: Size of struct (OUT)
+     * GET: Size of struct (OUT, up to 128 bytes)
      */
     uint32_t         size;
 #if defined(__i386__) || defined(__x86_64__)
@@ -571,6 +571,7 @@
     uint16_t         sysenter_callback_cs;
     uint8_t          syscall32_disables_events;
     uint8_t          sysenter_disables_events;
+    uint64_aligned_t mcg_cap;
 #endif
 };
 typedef struct xen_domctl_ext_vcpucontext xen_domctl_ext_vcpucontext_t;
@@ -710,48 +711,61 @@
 /* XEN_DOMCTL_mem_event_op */
 
 /*
-* Domain memory paging
- * Page memory in and out. 
+ * Domain memory paging
+ * Page memory in and out.
+ * Domctl interface to set up and tear down the 
+ * pager<->hypervisor interface. Use XENMEM_paging_op*
+ * to perform per-page operations.
  */
 #define XEN_DOMCTL_MEM_EVENT_OP_PAGING            1
 
 #define XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE     0
 #define XEN_DOMCTL_MEM_EVENT_OP_PAGING_DISABLE    1
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_NOMINATE   2
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_EVICT      3
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_PREP       4
-#define XEN_DOMCTL_MEM_EVENT_OP_PAGING_RESUME     5
 
 /*
  * Access permissions.
  *
+ * As with paging, use the domctl for teardown/setup of the
+ * helper<->hypervisor interface.
+ *
  * There are HVM hypercalls to set the per-page access permissions of every
  * page in a domain.  When one of these permissions--independent, read, 
  * write, and execute--is violated, the VCPU is paused and a memory event 
- * is sent with what happened.  (See public/mem_event.h)  The memory event 
- * handler can then resume the VCPU and redo the access with an 
- * ACCESS_RESUME mode for the following domctl.
+ * is sent with what happened.  (See public/mem_event.h) .
+ *
+ * The memory event handler can then resume the VCPU and redo the access 
+ * with a XENMEM_access_op_resume hypercall.
  */
 #define XEN_DOMCTL_MEM_EVENT_OP_ACCESS            2
 
 #define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_ENABLE     0
 #define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_DISABLE    1
-#define XEN_DOMCTL_MEM_EVENT_OP_ACCESS_RESUME     2
 
+/*
+ * Sharing ENOMEM helper.
+ *
+ * As with paging, use the domctl for teardown/setup of the
+ * helper<->hypervisor interface.
+ *
+ * If setup, this ring is used to communicate failed allocations
+ * in the unshare path. XENMEM_sharing_op_resume is used to wake up
+ * vcpus that could not unshare.
+ *
+ * Note that shring can be turned on (as per the domctl below)
+ * *without* this ring being setup.
+ */
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING           3
+
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_ENABLE    0
+#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DISABLE   1
+
+/* Use for teardown/setup of helper<->hypervisor interface for paging, 
+ * access and sharing.*/
 struct xen_domctl_mem_event_op {
     uint32_t       op;           /* XEN_DOMCTL_MEM_EVENT_OP_*_* */
     uint32_t       mode;         /* XEN_DOMCTL_MEM_EVENT_OP_* */
 
-    union {
-        /* OP_ENABLE IN:  Virtual address of shared page */
-        uint64_aligned_t shared_addr;  
-        /* PAGING_PREP IN: buffer to immediately fill page in */
-        uint64_aligned_t buffer;
-    } u;
-    uint64_aligned_t ring_addr;    /* IN:  Virtual address of ring page */
-
-    /* Other OPs */
-    uint64_aligned_t gfn;          /* IN:  gfn of page being operated on */
+    uint32_t port;              /* OUT: event channel for ring */
 };
 typedef struct xen_domctl_mem_event_op xen_domctl_mem_event_op_t;
 DEFINE_XEN_GUEST_HANDLE(xen_domctl_mem_event_op_t);
@@ -759,63 +773,15 @@
 /*
  * Memory sharing operations
  */
-/* XEN_DOMCTL_mem_sharing_op */
-
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING                3
-
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_CONTROL        0
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_NOMINATE_GFN   1
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_NOMINATE_GREF  2
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_SHARE          3
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_RESUME         4
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GFN      5
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_MFN      6
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_DEBUG_GREF     7
-#define XEN_DOMCTL_MEM_EVENT_OP_SHARING_ADD_PHYSMAP    8
-
-#define XEN_DOMCTL_MEM_SHARING_S_HANDLE_INVALID  (-10)
-#define XEN_DOMCTL_MEM_SHARING_C_HANDLE_INVALID  (-9)
-
-/* The following allows sharing of grant refs. This is useful
- * for sharing utilities sitting as "filters" in IO backends
- * (e.g. memshr + blktap(2)). The IO backend is only exposed 
- * to grant references, and this allows sharing of the grefs */
-#define XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG   (1ULL << 62)
-
-#define XEN_DOMCTL_MEM_SHARING_FIELD_MAKE_GREF(field, val)  \
-    (field) = (XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG | val)
-#define XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF(field)         \
-    ((field) & XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG)
-#define XEN_DOMCTL_MEM_SHARING_FIELD_GET_GREF(field)        \
-    ((field) & (~XEN_DOMCTL_MEM_SHARING_FIELD_IS_GREF_FLAG))
+/* XEN_DOMCTL_mem_sharing_op.
+ * The CONTROL sub-domctl is used for bringup/teardown. */
+#define XEN_DOMCTL_MEM_SHARING_CONTROL          0
 
 struct xen_domctl_mem_sharing_op {
-    uint8_t op; /* XEN_DOMCTL_MEM_EVENT_OP_* */
+    uint8_t op; /* XEN_DOMCTL_MEM_SHARING_* */
 
     union {
-        uint8_t enable;                   /* OP_CONTROL                */
-
-        struct mem_sharing_op_nominate {  /* OP_NOMINATE_xxx           */
-            union {
-                uint64_aligned_t gfn;     /* IN: gfn to nominate       */
-                uint32_t      grant_ref;  /* IN: grant ref to nominate */
-            } u;
-            uint64_aligned_t  handle;     /* OUT: the handle           */
-        } nominate;
-        struct mem_sharing_op_share {     /* OP_SHARE/ADD_PHYSMAP */
-            uint64_aligned_t source_gfn;    /* IN: the gfn of the source page */
-            uint64_aligned_t source_handle; /* IN: handle to the source page */
-            domid_t          client_domain; /* IN: the client domain id */
-            uint64_aligned_t client_gfn;    /* IN: the client gfn */
-            uint64_aligned_t client_handle; /* IN: handle to the client page */
-        } share; 
-        struct mem_sharing_op_debug {     /* OP_DEBUG_xxx */
-            union {
-                uint64_aligned_t gfn;      /* IN: gfn to debug          */
-                uint64_aligned_t mfn;      /* IN: mfn to debug          */
-                grant_ref_t    gref;       /* IN: gref to debug         */
-            } u;
-        } debug;
+        uint8_t enable;                   /* CONTROL */
     } u;
 };
 typedef struct xen_domctl_mem_sharing_op xen_domctl_mem_sharing_op_t;
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/event_channel.h
--- a/include/xen/interface/event_channel.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/event_channel.h	Mon Mar 26 11:50:02 2012 +0200
@@ -1,8 +1,8 @@
 /******************************************************************************
  * event_channel.h
- * 
+ *
  * Event channels between domains.
- * 
+ *
  * 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,12 +30,49 @@
 #include "xen.h"
 
 /*
- * Prototype for this hypercall is:
- *  int event_channel_op(int cmd, void *args)
- * @cmd  == EVTCHNOP_??? (event-channel operation).
- * @args == Operation-specific extra arguments (NULL if none).
+ * `incontents 150 evtchn Event Channels
+ *
+ * Event channels are the basic primitive provided by Xen for event
+ * notifications. An event is the Xen equivalent of a hardware
+ * interrupt. They essentially store one bit of information, the event
+ * of interest is signalled by transitioning this bit from 0 to 1.
+ *
+ * Notifications are received by a guest via an upcall from Xen,
+ * indicating when an event arrives (setting the bit). Further
+ * notifications are masked until the bit is cleared again (therefore,
+ * guests must check the value of the bit after re-enabling event
+ * delivery to ensure no missed notifications).
+ *
+ * Event notifications can be masked by setting a flag; this is
+ * equivalent to disabling interrupts and can be used to ensure
+ * atomicity of certain operations in the guest kernel.
+ *
+ * Event channels are represented by the evtchn_* fields in
+ * struct shared_info and struct vcpu_info.
  */
 
+/*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_event_channel_op(enum event_channel_op cmd, void *args)
+ * `
+ * @cmd  == EVTCHNOP_* (event-channel operation).
+ * @args == struct evtchn_* Operation-specific extra arguments (NULL if none).
+ */
+
+/* ` enum event_channel_op { // EVTCHNOP_* => struct evtchn_* */
+#define EVTCHNOP_bind_interdomain 0
+#define EVTCHNOP_bind_virq        1
+#define EVTCHNOP_bind_pirq        2
+#define EVTCHNOP_close            3
+#define EVTCHNOP_send             4
+#define EVTCHNOP_status           5
+#define EVTCHNOP_alloc_unbound    6
+#define EVTCHNOP_bind_ipi         7
+#define EVTCHNOP_bind_vcpu        8
+#define EVTCHNOP_unmask           9
+#define EVTCHNOP_reset           10
+/* ` } */
+
 typedef uint32_t evtchn_port_t;
 DEFINE_XEN_GUEST_HANDLE(evtchn_port_t);
 
@@ -47,7 +84,6 @@
  *  1. If the caller is unprivileged then <dom> must be DOMID_SELF.
  *  2. <rdom> may be DOMID_SELF, allowing loopback connections.
  */
-#define EVTCHNOP_alloc_unbound    6
 struct evtchn_alloc_unbound {
     /* IN parameters */
     domid_t dom, remote_dom;
@@ -63,9 +99,8 @@
  * domain. A fresh port is allocated in the calling domain and returned as
  * <local_port>.
  * NOTES:
- *  2. <remote_dom> may be DOMID_SELF, allowing loopback connections.
+ *  1. <remote_dom> may be DOMID_SELF, allowing loopback connections.
  */
-#define EVTCHNOP_bind_interdomain 0
 struct evtchn_bind_interdomain {
     /* IN parameters. */
     domid_t remote_dom;
@@ -87,10 +122,9 @@
  *     The allocated event channel is bound to the specified vcpu and the
  *     binding cannot be changed.
  */
-#define EVTCHNOP_bind_virq        1
 struct evtchn_bind_virq {
     /* IN parameters. */
-    uint32_t virq;
+    uint32_t virq; /* enum virq */
     uint32_t vcpu;
     /* OUT parameters. */
     evtchn_port_t port;
@@ -98,12 +132,11 @@
 typedef struct evtchn_bind_virq evtchn_bind_virq_t;
 
 /*
- * EVTCHNOP_bind_pirq: Bind a local event channel to PIRQ <irq>.
+ * EVTCHNOP_bind_pirq: Bind a local event channel to a real IRQ (PIRQ <irq>).
  * NOTES:
  *  1. A physical IRQ may be bound to at most one event channel per domain.
  *  2. Only a sufficiently-privileged domain may bind to a physical IRQ.
  */
-#define EVTCHNOP_bind_pirq        2
 struct evtchn_bind_pirq {
     /* IN parameters. */
     uint32_t pirq;
@@ -120,7 +153,6 @@
  *  1. The allocated event channel is bound to the specified vcpu. The binding
  *     may not be changed.
  */
-#define EVTCHNOP_bind_ipi         7
 struct evtchn_bind_ipi {
     uint32_t vcpu;
     /* OUT parameters. */
@@ -133,7 +165,6 @@
  * interdomain then the remote end is placed in the unbound state
  * (EVTCHNSTAT_unbound), awaiting a new connection.
  */
-#define EVTCHNOP_close            3
 struct evtchn_close {
     /* IN parameters. */
     evtchn_port_t port;
@@ -144,7 +175,6 @@
  * EVTCHNOP_send: Send an event to the remote end of the channel whose local
  * endpoint is <port>.
  */
-#define EVTCHNOP_send             4
 struct evtchn_send {
     /* IN parameters. */
     evtchn_port_t port;
@@ -159,7 +189,6 @@
  *  2. Only a sufficiently-privileged domain may obtain the status of an event
  *     channel for which <dom> is not DOMID_SELF.
  */
-#define EVTCHNOP_status           5
 struct evtchn_status {
     /* IN parameters */
     domid_t  dom;
@@ -176,13 +205,13 @@
     union {
         struct {
             domid_t dom;
-        } unbound; /* EVTCHNSTAT_unbound */
+        } unbound;                 /* EVTCHNSTAT_unbound */
         struct {
             domid_t dom;
             evtchn_port_t port;
-        } interdomain; /* EVTCHNSTAT_interdomain */
-        uint32_t pirq;      /* EVTCHNSTAT_pirq        */
-        uint32_t virq;      /* EVTCHNSTAT_virq        */
+        } interdomain;             /* EVTCHNSTAT_interdomain */
+        uint32_t pirq;             /* EVTCHNSTAT_pirq        */
+        uint32_t virq;             /* EVTCHNSTAT_virq        */
     } u;
 };
 typedef struct evtchn_status evtchn_status_t;
@@ -199,7 +228,6 @@
  *     the channel is allocated (a port that is freed and subsequently reused
  *     has its binding reset to vcpu0).
  */
-#define EVTCHNOP_bind_vcpu        8
 struct evtchn_bind_vcpu {
     /* IN parameters. */
     evtchn_port_t port;
@@ -211,7 +239,6 @@
  * EVTCHNOP_unmask: Unmask the specified local event-channel port and deliver
  * a notification to the appropriate VCPU if an event is pending.
  */
-#define EVTCHNOP_unmask           9
 struct evtchn_unmask {
     /* IN parameters. */
     evtchn_port_t port;
@@ -224,7 +251,6 @@
  *  1. <dom> may be specified as DOMID_SELF.
  *  2. Only a sufficiently-privileged domain may specify other than DOMID_SELF.
  */
-#define EVTCHNOP_reset           10
 struct evtchn_reset {
     /* IN parameters. */
     domid_t dom;
@@ -232,11 +258,13 @@
 typedef struct evtchn_reset evtchn_reset_t;
 
 /*
- * Argument to event_channel_op_compat() hypercall. Superceded by new
- * event_channel_op() hypercall since 0x00030202.
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_event_channel_op_compat(struct evtchn_op *op)
+ * `
+ * Superceded by new event_channel_op() hypercall since 0x00030202.
  */
 struct evtchn_op {
-    uint32_t cmd; /* EVTCHNOP_* */
+    uint32_t cmd; /* enum event_channel_op */
     union {
         struct evtchn_alloc_unbound    alloc_unbound;
         struct evtchn_bind_interdomain bind_interdomain;
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/hvm/params.h
--- a/include/xen/interface/hvm/params.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/hvm/params.h	Mon Mar 26 11:50:02 2012 +0200
@@ -142,6 +142,11 @@
 /* Boolean: Enable nestedhvm (hvm only) */
 #define HVM_PARAM_NESTEDHVM    24
 
-#define HVM_NR_PARAMS          27
+/* Params for the mem event rings */
+#define HVM_PARAM_PAGING_RING_PFN   27
+#define HVM_PARAM_ACCESS_RING_PFN   28
+#define HVM_PARAM_SHARING_RING_PFN  29
+
+#define HVM_NR_PARAMS          30
 
 #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/hvm/save.h
--- a/include/xen/interface/hvm/save.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/hvm/save.h	Mon Mar 26 11:50:02 2012 +0200
@@ -104,6 +104,8 @@
 #include "../arch-x86/hvm/save.h"
 #elif defined(__ia64__)
 #include "../arch-ia64/hvm/save.h"
+#elif defined(__arm__)
+#include "../arch-arm/hvm/save.h"
 #else
 #error "unsupported architecture"
 #endif
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/io/blkif.h
--- a/include/xen/interface/io/blkif.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/io/blkif.h	Mon Mar 26 11:50:02 2012 +0200
@@ -1,8 +1,8 @@
 /******************************************************************************
  * blkif.h
- * 
+ *
  * Unified block-device I/O interface for Xen guest OSes.
- * 
+ *
  * 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
@@ -22,6 +22,7 @@
  * DEALINGS IN THE SOFTWARE.
  *
  * Copyright (c) 2003-2004, Keir Fraser
+ * Copyright (c) 2012, Spectra Logic Corporation
  */
 
 #ifndef __XEN_PUBLIC_IO_BLKIF_H__
@@ -35,7 +36,7 @@
  * notification can be made conditional on req_event (i.e., the generic
  * hold-off mechanism provided by the ring macros). Backends must set
  * req_event appropriately (e.g., using RING_FINAL_CHECK_FOR_REQUESTS()).
- * 
+ *
  * Back->front notifications: When enqueuing a new response, sending a
  * notification can be made conditional on rsp_event (i.e., the generic
  * hold-off mechanism provided by the ring macros). Frontends must set
@@ -48,32 +49,330 @@
 #define blkif_sector_t uint64_t
 
 /*
+ * Feature and Parameter Negotiation
+ * =================================
+ * The two halves of a Xen block driver utilize nodes within the XenStore to
+ * communicate capabilities and to negotiate operating parameters.  This
+ * section enumerates these nodes which reside in the respective front and
+ * backend portions of the XenStore, following the XenBus convention.
+ *
+ * All data in the XenStore is stored as strings.  Nodes specifying numeric
+ * values are encoded in decimal.  Integer value ranges listed below are
+ * expressed as fixed sized integer types capable of storing the conversion
+ * of a properly formated node string, without loss of information.
+ *
+ * Any specified default value is in effect if the corresponding XenBus node
+ * is not present in the XenStore.
+ *
+ * XenStore nodes in sections marked "PRIVATE" are solely for use by the
+ * driver side whose XenBus tree contains them.
+ *
+ * XenStore nodes marked "DEPRECATED" in their notes section should only be
+ * used to provide interoperability with legacy implementations.
+ *
+ * See the XenBus state transition diagram below for details on when XenBus
+ * nodes must be published and when they can be queried.
+ *
+ *****************************************************************************
+ *                            Backend XenBus Nodes
+ *****************************************************************************
+ *
+ *------------------ Backend Device Identification (PRIVATE) ------------------
+ *
+ * mode
+ *      Values:         "r" (read only), "w" (writable)
+ *
+ *      The read or write access permissions to the backing store to be
+ *      granted to the frontend.
+ *
+ * params
+ *      Values:         string
+ *
+ *      A free formatted string providing sufficient information for the
+ *      backend driver to open the backing device.  (e.g. the path to the
+ *      file or block device representing the backing store.)
+ *
+ * type
+ *      Values:         "file", "phy", "tap"
+ *
+ *      The type of the backing device/object.
+ *
+ *--------------------------------- Features ---------------------------------
+ *
+ * feature-barrier
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *
+ *      A value of "1" indicates that the backend can process requests
+ *      containing the BLKIF_OP_WRITE_BARRIER request opcode.  Requests
+ *      of this type may still be returned at any time with the
+ *      BLKIF_RSP_EOPNOTSUPP result code.
+ *
+ * feature-flush-cache
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *
+ *      A value of "1" indicates that the backend can process requests
+ *      containing the BLKIF_OP_FLUSH_DISKCACHE request opcode.  Requests
+ *      of this type may still be returned at any time with the
+ *      BLKIF_RSP_EOPNOTSUPP result code.
+ *
+ * feature-discard
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *
+ *      A value of "1" indicates that the backend can process requests
+ *      containing the BLKIF_OP_DISCARD request opcode.  Requests
+ *      of this type may still be returned at any time with the
+ *      BLKIF_RSP_EOPNOTSUPP result code.
+ *
+ *----------------------- Request Transport Parameters ------------------------
+ *
+ * max-ring-page-order
+ *      Values:         <uint32_t>
+ *      Default Value:  0
+ *      Notes:          1, 3
+ *
+ *      The maximum supported size of the request ring buffer in units of
+ *      lb(machine pages). (e.g. 0 == 1 page,  1 = 2 pages, 2 == 4 pages,
+ *      etc.).
+ *
+ * max-ring-pages
+ *      Values:         <uint32_t>
+ *      Default Value:  1
+ *      Notes:          DEPRECATED, 2, 3
+ *
+ *      The maximum supported size of the request ring buffer in units of
+ *      machine pages.  The value must be a power of 2.
+ *
+ *------------------------- Backend Device Properties -------------------------
+ *
+ * discard-aligment
+ *      Values:         <uint32_t>
+ *      Default Value:  0
+ *      Notes:          4, 5
+ *
+ *      The offset, in bytes from the beginning of the virtual block device,
+ *      to the first, addressable, discard extent on the underlying device.
+ *
+ * discard-granularity
+ *      Values:         <uint32_t>
+ *      Default Value:  <"sector-size">
+ *      Notes:          4
+ *
+ *      The size, in bytes, of the individually addressable discard extents
+ *      of the underlying device.
+ *
+ * discard-secure
+ *      Values:         0/1 (boolean)
+ *      Default Value:  0
+ *
+ *      A value of "1" indicates that the backend can process BLKIF_OP_DISCARD
+ *      requests with the BLKIF_DISCARD_SECURE flag set.
+ *
+ * info
+ *      Values:         <uint32_t> (bitmap)
+ *
+ *      A collection of bit flags describing attributes of the backing
+ *      device.  The VDISK_* macros define the meaning of each bit
+ *      location.
+ *
+ * sector-size
+ *      Values:         <uint32_t>
+ *
+ *      The native sector size, in bytes, of the backend device.
+ *
+ * sectors
+ *      Values:         <uint64_t>
+ *
+ *      The size of the backend device, expressed in units of its native
+ *      sector size ("sector-size").
+ *
+ *****************************************************************************
+ *                            Frontend XenBus Nodes
+ *****************************************************************************
+ *
+ *----------------------- Request Transport Parameters -----------------------
+ *
+ * event-channel
+ *      Values:         <uint32_t>
+ *
+ *      The identifier of the Xen event channel used to signal activity
+ *      in the ring buffer.
+ *
+ * ring-ref
+ *      Values:         <uint32_t>
+ *      Notes:          6
+ *
+ *      The Xen grant reference granting permission for the backend to map
+ *      the sole page in a single page sized ring buffer.
+ *
+ * ring-ref%u
+ *      Values:         <uint32_t>
+ *      Notes:          6
+ *
+ *      For a frontend providing a multi-page ring, a "number of ring pages"
+ *      sized list of nodes, each containing a Xen grant reference granting
+ *      permission for the backend to map the page of the ring located
+ *      at page index "%u".  Page indexes are zero based.
+ *
+ * protocol
+ *      Values:         string (XEN_IO_PROTO_ABI_*)
+ *      Default Value:  XEN_IO_PROTO_ABI_NATIVE
+ *
+ *      The machine ABI rules governing the format of all ring request and
+ *      response structures.
+ *
+ * ring-page-order
+ *      Values:         <uint32_t>
+ *      Default Value:  0
+ *      Maximum Value:  MAX(ffs(max-ring-pages) - 1, max-ring-page-order)
+ *      Notes:          1, 3
+ *
+ *      The size of the frontend allocated request ring buffer in units
+ *      of lb(machine pages). (e.g. 0 == 1 page, 1 = 2 pages, 2 == 4 pages,
+ *      etc.).
+ *
+ * num-ring-pages
+ *      Values:         <uint32_t>
+ *      Default Value:  1
+ *      Maximum Value:  MAX(max-ring-pages,(0x1 << max-ring-page-order))
+ *      Notes:          DEPRECATED, 2, 3
+ *
+ *      The size of the frontend allocated request ring buffer in units of
+ *      machine pages.  The value must be a power of 2.
+ *
+ *------------------------- Virtual Device Properties -------------------------
+ *
+ * device-type
+ *      Values:         "disk", "cdrom", "floppy", etc.
+ *
+ * virtual-device
+ *      Values:         <uint32_t>
+ *
+ *      A value indicating the physical device to virtualize within the
+ *      frontend's domain.  (e.g. "The first ATA disk", "The third SCSI
+ *      disk", etc.)
+ *
+ *      See docs/misc/vbd-interface.txt for details on the format of this
+ *      value.
+ *
+ * Notes
+ * -----
+ * (1) Multi-page ring buffer scheme first developed in the Citrix XenServer
+ *     PV drivers.
+ * (2) Multi-page ring buffer scheme first used in some RedHat distributions
+ *     including a distribution deployed on certain nodes of the Amazon
+ *     EC2 cluster.
+ * (3) Support for multi-page ring buffers was implemented independently,
+ *     in slightly different forms, by both Citrix and RedHat/Amazon.
+ *     For full interoperability, block front and backends should publish
+ *     identical ring parameters, adjusted for unit differences, to the
+ *     XenStore nodes used in both schemes.
+ * (4) Devices that support discard functionality may internally allocate
+ *     space (discardable extents) in units that are larger than the
+ *     exported logical block size.
+ * (5) The discard-alignment parameter allows a physical device to be
+ *     partitioned into virtual devices that do not necessarily begin or
+ *     end on a discardable extent boundary.
+ * (6) When there is only a single page allocated to the request ring,
+ *     '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.
+ */
+
+/*
+ * STATE DIAGRAMS
+ *
+ *****************************************************************************
+ *                                   Startup                                 *
+ *****************************************************************************
+ *
+ * Tool stack creates front and back nodes with state XenbusStateInitialising.
+ *
+ * Front                                Back
+ * =================================    =====================================
+ * XenbusStateInitialising              XenbusStateInitialising
+ *  o Query virtual device               o Query backend device identification
+ *    properties.                          data.
+ *  o Setup OS device instance.          o Open and validate backend device.
+ *                                       o Publish backend features and
+ *                                         transport parameters.
+ *                                                      |
+ *                                                      |
+ *                                                      V
+ *                                      XenbusStateInitWait
+ *
+ * o Query backend features and
+ *   transport parameters.
+ * o Allocate and initialize the
+ *   request ring.
+ * o Publish transport parameters
+ *   that will be in effect during
+ *   this connection.
+ *              |
+ *              |
+ *              V
+ * XenbusStateInitialised
+ *
+ *                                       o Query frontend transport parameters.
+ *                                       o Connect to the request ring and
+ *                                         event channel.
+ *                                       o Publish backend device properties.
+ *                                                      |
+ *                                                      |
+ *                                                      V
+ *                                      XenbusStateConnected
+ *
+ *  o Query backend device properties.
+ *  o Finalize OS virtual device
+ *    instance.
+ *              |
+ *              |
+ *              V
+ * XenbusStateConnected
+ *
+ * Note: Drivers that do not support any optional features, or the negotiation
+ *       of transport parameters, can skip certain states in the state machine:
+ *
+ *       o A frontend may transition to XenbusStateInitialised without
+ *         waiting for the backend to enter XenbusStateInitWait.  In this
+ *         case, default transport parameters are in effect and any
+ *         transport parameters published by the frontend must contain
+ *         their default values.
+ *
+ *       o A backend may transition to XenbusStateInitialised, bypassing
+ *         XenbusStateInitWait, without waiting for the frontend to first
+ *         enter the XenbusStateInitialised state.  In this case, default
+ *         transport parameters are in effect and any transport parameters
+ *         published by the backend must contain their default values.
+ *
+ *       Drivers that support optional features and/or transport parameter
+ *       negotiation must tolerate these additional state transition paths.
+ *       In general this means performing the work of any skipped state
+ *       transition, if it has not already been performed, in addition to the
+ *       work associated with entry into the current state.
+ */
+
+/*
  * REQUEST CODES.
  */
 #define BLKIF_OP_READ              0
 #define BLKIF_OP_WRITE             1
 /*
- * Recognised only if "feature-barrier" is present in backend xenbus info.
- * The "feature-barrier" node contains a boolean indicating whether barrier
- * requests are likely to succeed or fail. Either way, a barrier request
- * may fail at any time with BLKIF_RSP_EOPNOTSUPP if it is unsupported by
- * the underlying block-device hardware. The boolean simply indicates whether
- * or not it is worthwhile for the frontend to attempt barrier requests.
- * If a backend does not recognise BLKIF_OP_WRITE_BARRIER, it should *not*
- * create the "feature-barrier" node!
+ * All writes issued prior to a request with the BLKIF_OP_WRITE_BARRIER
+ * operation code ("barrier request") must be completed prior to the
+ * execution of the barrier request.  All writes issued after the barrier
+ * request must not execute until after the completion of the barrier request.
+ *
+ * Optional.  See "feature-barrier" XenBus node documentation above.
  */
 #define BLKIF_OP_WRITE_BARRIER     2
 /*
- * Recognised if "feature-flush-cache" is present in backend xenbus
- * info.  A flush will ask the underlying storage hardware to flush its
- * non-volatile caches as appropriate.  The "feature-flush-cache" node
- * contains a boolean indicating whether flush requests are likely to
- * succeed or fail. Either way, a flush request may fail at any time
- * with BLKIF_RSP_EOPNOTSUPP if it is unsupported by the underlying
- * block-device hardware. The boolean simply indicates whether or not it
- * is worthwhile for the frontend to attempt flushes.  If a backend does
- * not recognise BLKIF_OP_WRITE_FLUSH_CACHE, it should *not* create the
- * "feature-flush-cache" node!
+ * Commit any uncommitted contents of the backing device's volatile cache
+ * to stable storage.
+ *
+ * Optional.  See "feature-flush-cache" XenBus node documentation above.
  */
 #define BLKIF_OP_FLUSH_DISKCACHE   3
 /*
@@ -82,47 +381,24 @@
  */
 #define BLKIF_OP_RESERVED_1        4
 /*
- * Recognised only if "feature-discard" is present in backend xenbus info.
- * The "feature-discard" node contains a boolean indicating whether trim
- * (ATA) or unmap (SCSI) - conviently called discard requests are likely
- * to succeed or fail. Either way, a discard request
- * may fail at any time with BLKIF_RSP_EOPNOTSUPP if it is unsupported by
- * the underlying block-device hardware. The boolean simply indicates whether
- * or not it is worthwhile for the frontend to attempt discard requests.
- * If a backend does not recognise BLKIF_OP_DISCARD, it should *not*
- * create the "feature-discard" node!
+ * Indicate to the backend device that a region of storage is no longer in
+ * use, and may be discarded at any time without impact to the client.  If
+ * the BLKIF_DISCARD_SECURE flag is set on the request, all copies of the
+ * discarded region on the device must be rendered unrecoverable before the
+ * command returns.
  *
- * Discard operation is a request for the underlying block device to mark
- * extents to be erased. However, discard does not guarantee that the blocks
- * will be erased from the device - it is just a hint to the device
- * controller that these blocks are no longer in use. What the device
- * controller does with that information is left to the controller.
- * Discard operations are passed with sector_number as the
- * sector index to begin discard operations at and nr_sectors as the number of
- * sectors to be discarded. The specified sectors should be discarded if the
- * underlying block device supports trim (ATA) or unmap (SCSI) operations,
- * or a BLKIF_RSP_EOPNOTSUPP  should be returned.
- * More information about trim/unmap operations at:
+ * This operation is analogous to performing a trim (ATA) or unamp (SCSI),
+ * command on a native device.
+ *
+ * More information about trim/unmap operations can be found at:
  * http://t13.org/Documents/UploadedDocuments/docs2008/
  *     e07154r6-Data_Set_Management_Proposal_for_ATA-ACS2.doc
  * http://www.seagate.com/staticfiles/support/disc/manuals/
  *     Interface%20manuals/100293068c.pdf
- * The backend can optionally provide these extra XenBus attributes to
- * further optimize the discard functionality:
- * 'discard-aligment' - Devices that support discard functionality may
- * internally allocate space in units that are bigger than the exported
- * logical block size. The discard-alignment parameter indicates how many bytes
- * the beginning of the partition is offset from the internal allocation unit's
- * natural alignment. Do not confuse this with natural disk alignment offset.
- * 'discard-granularity'  - Devices that support discard functionality may
- * internally allocate space using units that are bigger than the logical block
- * size. The discard-granularity parameter indicates the size of the internal
- * allocation unit in bytes if reported by the device. Otherwise the
- * discard-granularity will be set to match the device's physical block size.
- * It is the minimum size you can discard.
- * 'discard-secure' - All copies of the discarded sectors (potentially created
- * by garbage collection) must also be erased.  To use this feature, the flag
- * BLKIF_DISCARD_SECURE must be set in the blkif_request_discard.
+ *
+ * Optional.  See "feature-discard", "discard-alignment",
+ * "discard-granularity", and "discard-secure" in the XenBus node
+ * documentation above.
  */
 #define BLKIF_OP_DISCARD           5
 
@@ -133,7 +409,7 @@
  */
 #define BLKIF_MAX_SEGMENTS_PER_REQUEST 11
 
-/* 
+/*
  * NB. first_sect and last_sect in blkif_request_segment, as well as
  * sector_number in blkif_request, are always expressed in 512-byte units.
  * However they must be properly aligned to the real sector size of the
@@ -147,6 +423,9 @@
     uint8_t     first_sect, last_sect;
 };
 
+/*
+ * Starting ring element for any I/O request.
+ */
 struct blkif_request {
     uint8_t        operation;    /* BLKIF_OP_???                         */
     uint8_t        nr_segments;  /* number of segments                   */
@@ -158,7 +437,7 @@
 typedef struct blkif_request blkif_request_t;
 
 /*
- * Cast to this structure when blkif_request.operation == BLKIF_OP_TRIM
+ * Cast to this structure when blkif_request.operation == BLKIF_OP_DISCARD
  * sizeof(struct blkif_request_discard) <= sizeof(struct blkif_request)
  */
 struct blkif_request_discard {
@@ -192,7 +471,6 @@
 /*
  * Generate blkif ring structures and types.
  */
-
 DEFINE_RING_TYPES(blkif, struct blkif_request, struct blkif_response);
 
 #define VDISK_CDROM        0x1
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/io/protocols.h
--- a/include/xen/interface/io/protocols.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/io/protocols.h	Mon Mar 26 11:50:02 2012 +0200
@@ -26,6 +26,7 @@
 #define XEN_IO_PROTO_ABI_X86_32     "x86_32-abi"
 #define XEN_IO_PROTO_ABI_X86_64     "x86_64-abi"
 #define XEN_IO_PROTO_ABI_IA64       "ia64-abi"
+#define XEN_IO_PROTO_ABI_ARM        "arm-abi"
 
 #if defined(__i386__)
 # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_32
@@ -33,6 +34,8 @@
 # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_X86_64
 #elif defined(__ia64__)
 # define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_IA64
+#elif defined(__arm__)
+# define XEN_IO_PROTO_ABI_NATIVE XEN_IO_PROTO_ABI_ARM
 #else
 # error arch fixup needed here
 #endif
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/mem_event.h
--- a/include/xen/interface/mem_event.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/mem_event.h	Mon Mar 26 11:50:02 2012 +0200
@@ -30,11 +30,6 @@
 #include "xen.h"
 #include "io/ring.h"
 
-/* Memory event type */
-#define MEM_EVENT_TYPE_SHARED   0
-#define MEM_EVENT_TYPE_PAGING   1
-#define MEM_EVENT_TYPE_ACCESS   2
-
 /* Memory event flags */
 #define MEM_EVENT_FLAG_VCPU_PAUSED  (1 << 0)
 #define MEM_EVENT_FLAG_DROP_PAGE    (1 << 1)
@@ -51,13 +46,8 @@
 #define MEM_EVENT_REASON_INT3        5    /* int3 was hit: gla/gfn are RIP */
 #define MEM_EVENT_REASON_SINGLESTEP  6    /* single step was invoked: gla/gfn are RIP */
 
-typedef struct mem_event_shared_page {
-    uint32_t port;
-} mem_event_shared_page_t;
-
 typedef struct mem_event_st {
-    uint16_t type;
-    uint16_t flags;
+    uint32_t flags;
     uint32_t vcpu_id;
 
     uint64_t gfn;
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/memory.h
--- a/include/xen/interface/memory.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/memory.h	Mon Mar 26 11:50:02 2012 +0200
@@ -305,6 +305,12 @@
 };
 typedef struct xen_pod_target xen_pod_target_t;
 
+#if defined(__XEN__) || defined(__XEN_TOOLS__)
+
+#ifndef uint64_aligned_t
+#define uint64_aligned_t uint64_t
+#endif
+
 /*
  * Get the number of MFNs saved through memory sharing.
  * The call never fails. 
@@ -312,6 +318,87 @@
 #define XENMEM_get_sharing_freed_pages    18
 #define XENMEM_get_sharing_shared_pages   19
 
+#define XENMEM_paging_op                    20
+#define XENMEM_paging_op_nominate           0
+#define XENMEM_paging_op_evict              1
+#define XENMEM_paging_op_prep               2
+
+#define XENMEM_access_op                    21
+#define XENMEM_access_op_resume             0
+
+struct xen_mem_event_op {
+    uint8_t     op;         /* XENMEM_*_op_* */
+    domid_t     domain;
+    
+
+    /* PAGING_PREP IN: buffer to immediately fill page in */
+    uint64_aligned_t    buffer;
+    /* Other OPs */
+    uint64_aligned_t    gfn;           /* IN:  gfn of page being operated on */
+};
+typedef struct xen_mem_event_op xen_mem_event_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_mem_event_op_t);
+
+#define XENMEM_sharing_op                   22
+#define XENMEM_sharing_op_nominate_gfn      0
+#define XENMEM_sharing_op_nominate_gref     1
+#define XENMEM_sharing_op_share             2
+#define XENMEM_sharing_op_resume            3
+#define XENMEM_sharing_op_debug_gfn         4
+#define XENMEM_sharing_op_debug_mfn         5
+#define XENMEM_sharing_op_debug_gref        6
+#define XENMEM_sharing_op_add_physmap       7
+#define XENMEM_sharing_op_audit             8
+
+#define XENMEM_SHARING_OP_S_HANDLE_INVALID  (-10)
+#define XENMEM_SHARING_OP_C_HANDLE_INVALID  (-9)
+
+/* The following allows sharing of grant refs. This is useful
+ * for sharing utilities sitting as "filters" in IO backends
+ * (e.g. memshr + blktap(2)). The IO backend is only exposed 
+ * to grant references, and this allows sharing of the grefs */
+#define XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG   (1ULL << 62)
+
+#define XENMEM_SHARING_OP_FIELD_MAKE_GREF(field, val)  \
+    (field) = (XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG | val)
+#define XENMEM_SHARING_OP_FIELD_IS_GREF(field)         \
+    ((field) & XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG)
+#define XENMEM_SHARING_OP_FIELD_GET_GREF(field)        \
+    ((field) & (~XENMEM_SHARING_OP_FIELD_IS_GREF_FLAG))
+
+struct xen_mem_sharing_op {
+    uint8_t     op;     /* XENMEM_sharing_op_* */
+    domid_t     domain;
+
+    union {
+        struct mem_sharing_op_nominate {  /* OP_NOMINATE_xxx           */
+            union {
+                uint64_aligned_t gfn;     /* IN: gfn to nominate       */
+                uint32_t      grant_ref;  /* IN: grant ref to nominate */
+            } u;
+            uint64_aligned_t  handle;     /* OUT: the handle           */
+        } nominate;
+        struct mem_sharing_op_share {     /* OP_SHARE/ADD_PHYSMAP */
+            uint64_aligned_t source_gfn;    /* IN: the gfn of the source page */
+            uint64_aligned_t source_handle; /* IN: handle to the source page */
+            uint64_aligned_t client_gfn;    /* IN: the client gfn */
+            uint64_aligned_t client_handle; /* IN: handle to the client page */
+            domid_t  client_domain; /* IN: the client domain id */
+        } share; 
+        struct mem_sharing_op_debug {     /* OP_DEBUG_xxx */
+            union {
+                uint64_aligned_t gfn;      /* IN: gfn to debug          */
+                uint64_aligned_t mfn;      /* IN: mfn to debug          */
+                uint32_t gref;     /* IN: gref to debug         */
+            } u;
+        } debug;
+    } u;
+};
+typedef struct xen_mem_sharing_op xen_mem_sharing_op_t;
+DEFINE_XEN_GUEST_HANDLE(xen_mem_sharing_op_t);
+
+#endif /* defined(__XEN__) || defined(__XEN_TOOLS__) */
+
 #endif /* __XEN_PUBLIC_MEMORY_H__ */
 
 /*
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/platform.h
--- a/include/xen/interface/platform.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/platform.h	Mon Mar 26 11:50:02 2012 +0200
@@ -490,6 +490,20 @@
     uint32_t flags;
 };
 
+#define XENPF_core_parking  60
+
+#define XEN_CORE_PARKING_SET 1
+#define XEN_CORE_PARKING_GET 2
+struct xenpf_core_parking {
+    /* IN variables */
+    uint32_t type;
+    /* IN variables:  set cpu nums expected to be idled */
+    /* OUT variables: get cpu nums actually be idled */
+    uint32_t idle_nums;
+};
+typedef struct xenpf_core_parking xenpf_core_parking_t;
+DEFINE_XEN_GUEST_HANDLE(xenpf_core_parking_t);
+
 struct xen_platform_op {
     uint32_t cmd;
     uint32_t interface_version; /* XENPF_INTERFACE_VERSION */
@@ -511,6 +525,7 @@
         struct xenpf_cpu_ol            cpu_ol;
         struct xenpf_cpu_hotadd        cpu_add;
         struct xenpf_mem_hotadd        mem_add;
+        struct xenpf_core_parking      core_parking;
         uint8_t                        pad[128];
     } u;
 };
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/sysctl.h
--- a/include/xen/interface/sysctl.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/sysctl.h	Mon Mar 26 11:50:02 2012 +0200
@@ -564,6 +564,19 @@
 typedef struct xen_sysctl_arinc653_schedule xen_sysctl_arinc653_schedule_t;
 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_arinc653_schedule_t);
 
+struct xen_sysctl_credit_schedule {
+    /* Length of timeslice in milliseconds */
+#define XEN_SYSCTL_CSCHED_TSLICE_MAX 1000
+#define XEN_SYSCTL_CSCHED_TSLICE_MIN 1
+    unsigned tslice_ms;
+    /* Rate limit (minimum timeslice) in microseconds */
+#define XEN_SYSCTL_SCHED_RATELIMIT_MAX 500000
+#define XEN_SYSCTL_SCHED_RATELIMIT_MIN 100
+    unsigned ratelimit_us;
+};
+typedef struct xen_sysctl_credit_schedule xen_sysctl_credit_schedule_t;
+DEFINE_XEN_GUEST_HANDLE(xen_sysctl_credit_schedule_t);
+
 /* XEN_SYSCTL_scheduler_op */
 /* Set or get info? */
 #define XEN_SYSCTL_SCHEDOP_putinfo 0
@@ -576,6 +589,7 @@
         struct xen_sysctl_sched_arinc653 {
             XEN_GUEST_HANDLE_64(xen_sysctl_arinc653_schedule_t) schedule;
         } sched_arinc653;
+        struct xen_sysctl_credit_schedule sched_credit;
     } u;
 };
 typedef struct xen_sysctl_scheduler_op xen_sysctl_scheduler_op_t;
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/xen.h
--- a/include/xen/interface/xen.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/xen.h	Mon Mar 26 11:50:02 2012 +0200
@@ -146,6 +146,7 @@
  * The latter can be allocated only once per guest: they must initially be
  * allocated to VCPU0 but can subsequently be re-bound.
  */
+/* ` enum virq { */
 #define VIRQ_TIMER      0  /* V. Timebase update, and/or requested timeout.  */
 #define VIRQ_DEBUG      1  /* V. Request guest to dump debug info.           */
 #define VIRQ_CONSOLE    2  /* G. (DOM0) Bytes received on emergency console. */
@@ -157,6 +158,7 @@
 #define VIRQ_PCPU_STATE 9  /* G. (DOM0) PCPU state changed                   */
 #define VIRQ_MEM_EVENT  10 /* G. (DOM0) A memory event has occured           */
 #define VIRQ_XC_RESERVED 11 /* G. Reserved for XenClient                     */
+#define VIRQ_ENOMEM     12 /* G. (DOM0) Low on heap memory       */
 
 /* Architecture-specific VIRQ definitions. */
 #define VIRQ_ARCH_0    16
@@ -167,6 +169,7 @@
 #define VIRQ_ARCH_5    21
 #define VIRQ_ARCH_6    22
 #define VIRQ_ARCH_7    23
+/* ` } */
 
 #define NR_VIRQS       24
 
diff -r 8940ccd0a425 -r f8805d3fc263 include/xen/interface/xsm/flask_op.h
--- a/include/xen/interface/xsm/flask_op.h	Mon Mar 26 11:38:38 2012 +0200
+++ b/include/xen/interface/xsm/flask_op.h	Mon Mar 26 11:50:02 2012 +0200
@@ -135,6 +135,13 @@
     uint64_t low, high;
 };
 
+struct xen_flask_peersid {
+    /* IN */
+    evtchn_port_t evtchn;
+    /* OUT */
+    uint32_t sid;
+};
+
 struct xen_flask_op {
     uint32_t cmd;
 #define FLASK_LOAD              1
@@ -159,6 +166,7 @@
 #define FLASK_MEMBER            20
 #define FLASK_ADD_OCONTEXT      21
 #define FLASK_DEL_OCONTEXT      22
+#define FLASK_GET_PEER_SID      23
     uint32_t interface_version; /* XEN_FLASK_INTERFACE_VERSION */
     union {
         struct xen_flask_load load;
@@ -176,6 +184,7 @@
         struct xen_flask_cache_stats cache_stats;
         /* FLASK_ADD_OCONTEXT, FLASK_DEL_OCONTEXT */
         struct xen_flask_ocontext ocontext;
+        struct xen_flask_peersid peersid;
     } u;
 };
 typedef struct xen_flask_op xen_flask_op_t;

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

From xen-changelog-bounces@lists.xen.org Wed Mar 28 02:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Mar 2012 02: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 1SCiM1-000601-A0; Wed, 28 Mar 2012 02:11: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 1SCiM0-0005zZ-1a
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:16 +0000
Received: from [85.158.143.35:13143] by server-3.bemta-4.messagelabs.com id
	0A/D6-05853-343727F4; Wed, 28 Mar 2012 02:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1332900673!6429521!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11269 invoked from network); 28 Mar 2012 02:11:14 -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;
	28 Mar 2012 02: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 1SCiLw-0003qy-Nw
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCiLw-0006HU-8r
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:12 +0000
Message-Id: <E1SCiLw-0006HU-8r@xenbits.xen.org>
Date: Wed, 28 Mar 2012 02:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hpet: replace disabling of
	legacy broadcast
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332854574 -7200
# Node ID 790cfd7a4a8176e37bbe5a80aa1d30f1b8eb6d0b
# Parent  f06ff3dfde08ee563970cffba502742249ff5820
x86/hpet: replace disabling of legacy broadcast

... by the call to hpet_disable() added in the immediately preceding
patch.

In order to retain the behavior intended by c/s 23776:0ddb4481f883,
implement one of the alternative options pointed out there: remove CPUs
from the online map in __stop_this_cpu() (and hence doing so in
stop_this_cpu() is no longer needed).

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


diff -r f06ff3dfde08 -r 790cfd7a4a81 xen/arch/x86/crash.c
--- a/xen/arch/x86/crash.c	Tue Mar 27 15:20:23 2012 +0200
+++ b/xen/arch/x86/crash.c	Tue Mar 27 15:22:54 2012 +0200
@@ -61,9 +61,6 @@ static void nmi_shootdown_cpus(void)
 
     local_irq_disable();
 
-    if ( hpet_broadcast_is_available() )
-        hpet_disable_legacy_broadcast();
-
     crashing_cpu = smp_processor_id();
     local_irq_count(crashing_cpu) = 0;
 
diff -r f06ff3dfde08 -r 790cfd7a4a81 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Tue Mar 27 15:20:23 2012 +0200
+++ b/xen/arch/x86/hpet.c	Tue Mar 27 15:22:54 2012 +0200
@@ -779,7 +779,11 @@ void hpet_disable(void)
     u32 id;
 
     if ( !hpet_boot_cfg )
+    {
+        if ( hpet_broadcast_is_available() )
+            hpet_disable_legacy_broadcast();
         return;
+    }
 
     hpet_write32(*hpet_boot_cfg & ~HPET_CFG_ENABLE, HPET_CFG);
 
diff -r f06ff3dfde08 -r 790cfd7a4a81 xen/arch/x86/smp.c
--- a/xen/arch/x86/smp.c	Tue Mar 27 15:20:23 2012 +0200
+++ b/xen/arch/x86/smp.c	Tue Mar 27 15:22:54 2012 +0200
@@ -349,12 +349,13 @@ void __stop_this_cpu(void)
      */
     clts();
     asm volatile ( "fninit" );
+
+    cpumask_clear_cpu(smp_processor_id(), &cpu_online_map);
 }
 
 static void stop_this_cpu(void *dummy)
 {
     __stop_this_cpu();
-    cpumask_clear_cpu(smp_processor_id(), &cpu_online_map);
     for ( ; ; )
         halt();
 }

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

From xen-changelog-bounces@lists.xen.org Wed Mar 28 02:11:23 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Mar 2012 02: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 1SCiM1-000601-A0; Wed, 28 Mar 2012 02:11: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 1SCiM0-0005zZ-1a
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:16 +0000
Received: from [85.158.143.35:13143] by server-3.bemta-4.messagelabs.com id
	0A/D6-05853-343727F4; Wed, 28 Mar 2012 02:11:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1332900673!6429521!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11269 invoked from network); 28 Mar 2012 02:11:14 -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;
	28 Mar 2012 02: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 1SCiLw-0003qy-Nw
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCiLw-0006HU-8r
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:12 +0000
Message-Id: <E1SCiLw-0006HU-8r@xenbits.xen.org>
Date: Wed, 28 Mar 2012 02:11:11 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hpet: replace disabling of
	legacy broadcast
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332854574 -7200
# Node ID 790cfd7a4a8176e37bbe5a80aa1d30f1b8eb6d0b
# Parent  f06ff3dfde08ee563970cffba502742249ff5820
x86/hpet: replace disabling of legacy broadcast

... by the call to hpet_disable() added in the immediately preceding
patch.

In order to retain the behavior intended by c/s 23776:0ddb4481f883,
implement one of the alternative options pointed out there: remove CPUs
from the online map in __stop_this_cpu() (and hence doing so in
stop_this_cpu() is no longer needed).

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


diff -r f06ff3dfde08 -r 790cfd7a4a81 xen/arch/x86/crash.c
--- a/xen/arch/x86/crash.c	Tue Mar 27 15:20:23 2012 +0200
+++ b/xen/arch/x86/crash.c	Tue Mar 27 15:22:54 2012 +0200
@@ -61,9 +61,6 @@ static void nmi_shootdown_cpus(void)
 
     local_irq_disable();
 
-    if ( hpet_broadcast_is_available() )
-        hpet_disable_legacy_broadcast();
-
     crashing_cpu = smp_processor_id();
     local_irq_count(crashing_cpu) = 0;
 
diff -r f06ff3dfde08 -r 790cfd7a4a81 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Tue Mar 27 15:20:23 2012 +0200
+++ b/xen/arch/x86/hpet.c	Tue Mar 27 15:22:54 2012 +0200
@@ -779,7 +779,11 @@ void hpet_disable(void)
     u32 id;
 
     if ( !hpet_boot_cfg )
+    {
+        if ( hpet_broadcast_is_available() )
+            hpet_disable_legacy_broadcast();
         return;
+    }
 
     hpet_write32(*hpet_boot_cfg & ~HPET_CFG_ENABLE, HPET_CFG);
 
diff -r f06ff3dfde08 -r 790cfd7a4a81 xen/arch/x86/smp.c
--- a/xen/arch/x86/smp.c	Tue Mar 27 15:20:23 2012 +0200
+++ b/xen/arch/x86/smp.c	Tue Mar 27 15:22:54 2012 +0200
@@ -349,12 +349,13 @@ void __stop_this_cpu(void)
      */
     clts();
     asm volatile ( "fninit" );
+
+    cpumask_clear_cpu(smp_processor_id(), &cpu_online_map);
 }
 
 static void stop_this_cpu(void *dummy)
 {
     __stop_this_cpu();
-    cpumask_clear_cpu(smp_processor_id(), &cpu_online_map);
     for ( ; ; )
         halt();
 }

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

From xen-changelog-bounces@lists.xen.org Wed Mar 28 02:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Mar 2012 02: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 1SCiM3-00060e-Hx; Wed, 28 Mar 2012 02:11: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 1SCiM1-0005zx-Nf
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:18 +0000
Received: from [85.158.143.35:13184] by server-2.bemta-4.messagelabs.com id
	1A/12-17550-543727F4; Wed, 28 Mar 2012 02:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1332900674!6429525!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11367 invoked from network); 28 Mar 2012 02:11: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;
	28 Mar 2012 02: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 1SCiLy-0003r4-2k
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCiLy-0006Hy-0P
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:14 +0000
Message-Id: <E1SCiLy-0006Hy-0P@xenbits.xen.org>
Date: Wed, 28 Mar 2012 02:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hpet: use asm/hpet.h in HVM
	emulation 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332854707 -7200
# Node ID d35a117afa2f71ce67af2306940a47ed7734b9e4
# Parent  0b0e42dc4f0a40a4ad76db1021ec6d17dee5d21b
x86/hpet: use asm/hpet.h in HVM emulation code

Also replace some plain numbers by using suitable defines (to make
clear what they are standing for).

Generated code is identical (apart from line number changes and
functions possibly getting ordered differently).

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


diff -r 0b0e42dc4f0a -r d35a117afa2f xen/arch/x86/hvm/hpet.c
--- a/xen/arch/x86/hvm/hpet.c	Tue Mar 27 15:23:43 2012 +0200
+++ b/xen/arch/x86/hvm/hpet.c	Tue Mar 27 15:25:07 2012 +0200
@@ -21,6 +21,7 @@
 #include <asm/hvm/io.h>
 #include <asm/hvm/support.h>
 #include <asm/current.h>
+#include <asm/hpet.h>
 #include <xen/sched.h>
 #include <xen/event.h>
 
@@ -40,34 +41,6 @@
 #define guest_time_hpet(hpet) \
     (hvm_get_guest_time(vhpet_vcpu(hpet)) / STIME_PER_HPET_TICK)
 
-#define HPET_ID         0x000
-#define HPET_PERIOD     0x004
-#define HPET_CFG        0x010
-#define HPET_STATUS     0x020
-#define HPET_COUNTER    0x0f0
-#define HPET_T0_CFG     0x100
-#define HPET_T0_CMP     0x108
-#define HPET_T0_ROUTE   0x110
-#define HPET_T1_CFG     0x120
-#define HPET_T1_CMP     0x128
-#define HPET_T1_ROUTE   0x130
-#define HPET_T2_CFG     0x140
-#define HPET_T2_CMP     0x148
-#define HPET_T2_ROUTE   0x150
-#define HPET_T3_CFG     0x160
-
-#define HPET_CFG_ENABLE          0x001
-#define HPET_CFG_LEGACY          0x002
-
-#define HPET_TN_INT_TYPE_LEVEL   0x002
-#define HPET_TN_ENABLE           0x004
-#define HPET_TN_PERIODIC         0x008
-#define HPET_TN_PERIODIC_CAP     0x010
-#define HPET_TN_SIZE_CAP         0x020
-#define HPET_TN_SETVAL           0x040
-#define HPET_TN_32BIT            0x100
-#define HPET_TN_INT_ROUTE_MASK  0x3e00
-#define HPET_TN_INT_ROUTE_SHIFT      9
 #define HPET_TN_INT_ROUTE_CAP_SHIFT 32
 #define HPET_TN_CFG_BITS_READONLY_OR_RESERVED 0xffff80b1U
 
@@ -78,6 +51,9 @@
 #define HPET_TN_INT_ROUTE_CAP_MASK (0xffffffffULL \
                     << HPET_TN_INT_ROUTE_CAP_SHIFT)
 
+#define HPET_TN(reg, addr) (((addr) - HPET_Tn_##reg(0)) / \
+                            (HPET_Tn_##reg(1) - HPET_Tn_##reg(0)))
+
 #define hpet_tick_to_ns(h, tick)                        \
     ((s_time_t)((((tick) > (h)->hpet_to_ns_limit) ?     \
         ~0ULL : (tick) * (h)->hpet_to_ns_scale) >> 10))
@@ -87,10 +63,10 @@
 #define timer_is_periodic(h, n)  (timer_config(h, n) & HPET_TN_PERIODIC)
 #define timer_is_32bit(h, n)     (timer_config(h, n) & HPET_TN_32BIT)
 #define hpet_enabled(h)          (h->hpet.config & HPET_CFG_ENABLE)
-#define timer_level(h, n)        (timer_config(h, n) & HPET_TN_INT_TYPE_LEVEL)
+#define timer_level(h, n)        (timer_config(h, n) & HPET_TN_LEVEL)
 
 #define timer_int_route(h, n)   \
-    ((timer_config(h, n) & HPET_TN_INT_ROUTE_MASK) >> HPET_TN_INT_ROUTE_SHIFT)
+    ((timer_config(h, n) & HPET_TN_ROUTE) >> HPET_TN_ROUTE_SHIFT)
 
 #define timer_int_route_cap(h, n)   \
     ((timer_config(h, n) & HPET_TN_INT_ROUTE_CAP_MASK) \
@@ -144,18 +120,18 @@ static inline uint64_t hpet_read64(HPETS
         return h->hpet.isr;
     case HPET_COUNTER:
         return hpet_read_maincounter(h);
-    case HPET_T0_CFG:
-    case HPET_T1_CFG:
-    case HPET_T2_CFG:
-        return h->hpet.timers[(addr - HPET_T0_CFG) >> 5].config;
-    case HPET_T0_CMP:
-    case HPET_T1_CMP:
-    case HPET_T2_CMP:
-        return hpet_get_comparator(h, (addr - HPET_T0_CMP) >> 5);
-    case HPET_T0_ROUTE:
-    case HPET_T1_ROUTE:
-    case HPET_T2_ROUTE:
-        return h->hpet.timers[(addr - HPET_T0_ROUTE) >> 5].fsb;
+    case HPET_Tn_CFG(0):
+    case HPET_Tn_CFG(1):
+    case HPET_Tn_CFG(2):
+        return h->hpet.timers[HPET_TN(CFG, addr)].config;
+    case HPET_Tn_CMP(0):
+    case HPET_Tn_CMP(1):
+    case HPET_Tn_CMP(2):
+        return hpet_get_comparator(h, HPET_TN(CMP, addr));
+    case HPET_Tn_ROUTE(0):
+    case HPET_Tn_ROUTE(1):
+    case HPET_Tn_ROUTE(2):
+        return h->hpet.timers[HPET_TN(ROUTE, addr)].fsb;
     }
 
     return 0;
@@ -362,10 +338,10 @@ static int hpet_write(
         }
         break;
 
-    case HPET_T0_CFG:
-    case HPET_T1_CFG:
-    case HPET_T2_CFG:
-        tn = (addr - HPET_T0_CFG) >> 5;
+    case HPET_Tn_CFG(0):
+    case HPET_Tn_CFG(1):
+    case HPET_Tn_CFG(2):
+        tn = HPET_TN(CFG, addr);
 
         h->hpet.timers[tn].config = hpet_fixup_reg(new_val, old_val, 0x3f4e);
 
@@ -406,10 +382,10 @@ static int hpet_write(
         }
         break;
 
-    case HPET_T0_CMP:
-    case HPET_T1_CMP:
-    case HPET_T2_CMP:
-        tn = (addr - HPET_T0_CMP) >> 5;
+    case HPET_Tn_CMP(0):
+    case HPET_Tn_CMP(1):
+    case HPET_Tn_CMP(2):
+        tn = HPET_TN(CMP, addr);
         if ( timer_is_32bit(h, tn) )
             new_val = (uint32_t)new_val;
         h->hpet.timers[tn].cmp = new_val;
@@ -440,10 +416,10 @@ static int hpet_write(
             set_restart_timer(tn);
         break;
 
-    case HPET_T0_ROUTE:
-    case HPET_T1_ROUTE:
-    case HPET_T2_ROUTE:
-        tn = (addr - HPET_T0_ROUTE) >> 5;
+    case HPET_Tn_ROUTE(0):
+    case HPET_Tn_ROUTE(1):
+    case HPET_Tn_ROUTE(2):
+        tn = HPET_TN(ROUTE, addr);
         h->hpet.timers[tn].fsb = new_val;
         break;
 
@@ -608,8 +584,9 @@ void hpet_init(struct vcpu *v)
     h->hpet_to_ns_scale = ((S_TO_NS * STIME_PER_HPET_TICK) << 10) / h->stime_freq;
     h->hpet_to_ns_limit = ~0ULL / h->hpet_to_ns_scale;
 
-    /* 64-bit main counter; 3 timers supported; LegacyReplacementRoute. */
-    h->hpet.capability = 0x8086A201ULL;
+    h->hpet.capability = 0x80860001ULL |
+                         ((HPET_TIMER_NUM - 1) << HPET_ID_NUMBER_SHIFT) |
+                         HPET_ID_64BIT | HPET_ID_LEGSUP;
 
     /* This is the number of femptoseconds per HPET tick. */
     /* Here we define HPET's frequency to be 1/16 of Xen system time */
@@ -618,7 +595,7 @@ void hpet_init(struct vcpu *v)
     for ( i = 0; i < HPET_TIMER_NUM; i++ )
     {
         h->hpet.timers[i].config = 
-            HPET_TN_INT_ROUTE_CAP | HPET_TN_SIZE_CAP | HPET_TN_PERIODIC_CAP;
+            HPET_TN_INT_ROUTE_CAP | HPET_TN_64BIT_CAP | HPET_TN_PERIODIC_CAP;
         h->hpet.timers[i].cmp = ~0ULL;
         h->pt[i].source = PTSRC_isa;
     }
diff -r 0b0e42dc4f0a -r d35a117afa2f xen/include/asm-x86/hpet.h
--- a/xen/include/asm-x86/hpet.h	Tue Mar 27 15:23:43 2012 +0200
+++ b/xen/include/asm-x86/hpet.h	Tue Mar 27 15:25:07 2012 +0200
@@ -20,6 +20,7 @@
 
 #define HPET_ID_VENDOR	0xffff0000
 #define HPET_ID_LEGSUP	0x00008000
+#define HPET_ID_64BIT	0x00002000
 #define HPET_ID_NUMBER	0x00001f00
 #define HPET_ID_REV	0x000000ff
 #define	HPET_ID_NUMBER_SHIFT	8

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

From xen-changelog-bounces@lists.xen.org Wed Mar 28 02:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Mar 2012 02: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 1SCiM2-00060N-Cu; Wed, 28 Mar 2012 02: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 1SCiM1-0005zo-4i
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:17 +0000
Received: from [85.158.143.99:16073] by server-1.bemta-4.messagelabs.com id
	9B/1E-20925-443727F4; Wed, 28 Mar 2012 02:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1332900674!14841403!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26291 invoked from network); 28 Mar 2012 02:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Mar 2012 02: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 1SCiLx-0003r1-Py
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCiLw-0006Hj-Sq
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:12 +0000
Message-Id: <E1SCiLw-0006Hj-Sq@xenbits.xen.org>
Date: Wed, 28 Mar 2012 02:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hpet: clear unwanted bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332854623 -7200
# Node ID 0b0e42dc4f0a40a4ad76db1021ec6d17dee5d21b
# Parent  790cfd7a4a8176e37bbe5a80aa1d30f1b8eb6d0b
x86/hpet: clear unwanted bits

Leaving certain bits set when being started from an environment where
the HPET was already in use can affect functionality. Clear those bits
to be on the safe side.

We should also consider ignoring the HPET altogether if any reserved
bits are found to be set.

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


diff -r 790cfd7a4a81 -r 0b0e42dc4f0a xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Tue Mar 27 15:22:54 2012 +0200
+++ b/xen/arch/x86/hpet.c	Tue Mar 27 15:23:43 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_PERIODIC;
+        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB);
         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_PERIODIC;
+        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB);
         cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
 
diff -r 790cfd7a4a81 -r 0b0e42dc4f0a xen/include/asm-x86/hpet.h
--- a/xen/include/asm-x86/hpet.h	Tue Mar 27 15:22:54 2012 +0200
+++ b/xen/include/asm-x86/hpet.h	Tue Mar 27 15:23:43 2012 +0200
@@ -32,9 +32,11 @@
 #define	HPET_LEGACY_8254	2
 #define	HPET_LEGACY_RTC		8
 
+#define HPET_TN_LEVEL		0x002
 #define HPET_TN_ENABLE		0x004
 #define HPET_TN_PERIODIC	0x008
 #define HPET_TN_PERIODIC_CAP	0x010
+#define HPET_TN_64BIT_CAP	0x020
 #define HPET_TN_SETVAL		0x040
 #define HPET_TN_32BIT		0x100
 #define HPET_TN_ROUTE		0x3e00

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

From xen-changelog-bounces@lists.xen.org Wed Mar 28 02:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Mar 2012 02: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 1SCiM3-00060e-Hx; Wed, 28 Mar 2012 02:11: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 1SCiM1-0005zx-Nf
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:18 +0000
Received: from [85.158.143.35:13184] by server-2.bemta-4.messagelabs.com id
	1A/12-17550-543727F4; Wed, 28 Mar 2012 02:11:17 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-21.messagelabs.com!1332900674!6429525!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11367 invoked from network); 28 Mar 2012 02:11: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;
	28 Mar 2012 02: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 1SCiLy-0003r4-2k
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:14 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCiLy-0006Hy-0P
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:14 +0000
Message-Id: <E1SCiLy-0006Hy-0P@xenbits.xen.org>
Date: Wed, 28 Mar 2012 02:11:13 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hpet: use asm/hpet.h in HVM
	emulation 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332854707 -7200
# Node ID d35a117afa2f71ce67af2306940a47ed7734b9e4
# Parent  0b0e42dc4f0a40a4ad76db1021ec6d17dee5d21b
x86/hpet: use asm/hpet.h in HVM emulation code

Also replace some plain numbers by using suitable defines (to make
clear what they are standing for).

Generated code is identical (apart from line number changes and
functions possibly getting ordered differently).

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


diff -r 0b0e42dc4f0a -r d35a117afa2f xen/arch/x86/hvm/hpet.c
--- a/xen/arch/x86/hvm/hpet.c	Tue Mar 27 15:23:43 2012 +0200
+++ b/xen/arch/x86/hvm/hpet.c	Tue Mar 27 15:25:07 2012 +0200
@@ -21,6 +21,7 @@
 #include <asm/hvm/io.h>
 #include <asm/hvm/support.h>
 #include <asm/current.h>
+#include <asm/hpet.h>
 #include <xen/sched.h>
 #include <xen/event.h>
 
@@ -40,34 +41,6 @@
 #define guest_time_hpet(hpet) \
     (hvm_get_guest_time(vhpet_vcpu(hpet)) / STIME_PER_HPET_TICK)
 
-#define HPET_ID         0x000
-#define HPET_PERIOD     0x004
-#define HPET_CFG        0x010
-#define HPET_STATUS     0x020
-#define HPET_COUNTER    0x0f0
-#define HPET_T0_CFG     0x100
-#define HPET_T0_CMP     0x108
-#define HPET_T0_ROUTE   0x110
-#define HPET_T1_CFG     0x120
-#define HPET_T1_CMP     0x128
-#define HPET_T1_ROUTE   0x130
-#define HPET_T2_CFG     0x140
-#define HPET_T2_CMP     0x148
-#define HPET_T2_ROUTE   0x150
-#define HPET_T3_CFG     0x160
-
-#define HPET_CFG_ENABLE          0x001
-#define HPET_CFG_LEGACY          0x002
-
-#define HPET_TN_INT_TYPE_LEVEL   0x002
-#define HPET_TN_ENABLE           0x004
-#define HPET_TN_PERIODIC         0x008
-#define HPET_TN_PERIODIC_CAP     0x010
-#define HPET_TN_SIZE_CAP         0x020
-#define HPET_TN_SETVAL           0x040
-#define HPET_TN_32BIT            0x100
-#define HPET_TN_INT_ROUTE_MASK  0x3e00
-#define HPET_TN_INT_ROUTE_SHIFT      9
 #define HPET_TN_INT_ROUTE_CAP_SHIFT 32
 #define HPET_TN_CFG_BITS_READONLY_OR_RESERVED 0xffff80b1U
 
@@ -78,6 +51,9 @@
 #define HPET_TN_INT_ROUTE_CAP_MASK (0xffffffffULL \
                     << HPET_TN_INT_ROUTE_CAP_SHIFT)
 
+#define HPET_TN(reg, addr) (((addr) - HPET_Tn_##reg(0)) / \
+                            (HPET_Tn_##reg(1) - HPET_Tn_##reg(0)))
+
 #define hpet_tick_to_ns(h, tick)                        \
     ((s_time_t)((((tick) > (h)->hpet_to_ns_limit) ?     \
         ~0ULL : (tick) * (h)->hpet_to_ns_scale) >> 10))
@@ -87,10 +63,10 @@
 #define timer_is_periodic(h, n)  (timer_config(h, n) & HPET_TN_PERIODIC)
 #define timer_is_32bit(h, n)     (timer_config(h, n) & HPET_TN_32BIT)
 #define hpet_enabled(h)          (h->hpet.config & HPET_CFG_ENABLE)
-#define timer_level(h, n)        (timer_config(h, n) & HPET_TN_INT_TYPE_LEVEL)
+#define timer_level(h, n)        (timer_config(h, n) & HPET_TN_LEVEL)
 
 #define timer_int_route(h, n)   \
-    ((timer_config(h, n) & HPET_TN_INT_ROUTE_MASK) >> HPET_TN_INT_ROUTE_SHIFT)
+    ((timer_config(h, n) & HPET_TN_ROUTE) >> HPET_TN_ROUTE_SHIFT)
 
 #define timer_int_route_cap(h, n)   \
     ((timer_config(h, n) & HPET_TN_INT_ROUTE_CAP_MASK) \
@@ -144,18 +120,18 @@ static inline uint64_t hpet_read64(HPETS
         return h->hpet.isr;
     case HPET_COUNTER:
         return hpet_read_maincounter(h);
-    case HPET_T0_CFG:
-    case HPET_T1_CFG:
-    case HPET_T2_CFG:
-        return h->hpet.timers[(addr - HPET_T0_CFG) >> 5].config;
-    case HPET_T0_CMP:
-    case HPET_T1_CMP:
-    case HPET_T2_CMP:
-        return hpet_get_comparator(h, (addr - HPET_T0_CMP) >> 5);
-    case HPET_T0_ROUTE:
-    case HPET_T1_ROUTE:
-    case HPET_T2_ROUTE:
-        return h->hpet.timers[(addr - HPET_T0_ROUTE) >> 5].fsb;
+    case HPET_Tn_CFG(0):
+    case HPET_Tn_CFG(1):
+    case HPET_Tn_CFG(2):
+        return h->hpet.timers[HPET_TN(CFG, addr)].config;
+    case HPET_Tn_CMP(0):
+    case HPET_Tn_CMP(1):
+    case HPET_Tn_CMP(2):
+        return hpet_get_comparator(h, HPET_TN(CMP, addr));
+    case HPET_Tn_ROUTE(0):
+    case HPET_Tn_ROUTE(1):
+    case HPET_Tn_ROUTE(2):
+        return h->hpet.timers[HPET_TN(ROUTE, addr)].fsb;
     }
 
     return 0;
@@ -362,10 +338,10 @@ static int hpet_write(
         }
         break;
 
-    case HPET_T0_CFG:
-    case HPET_T1_CFG:
-    case HPET_T2_CFG:
-        tn = (addr - HPET_T0_CFG) >> 5;
+    case HPET_Tn_CFG(0):
+    case HPET_Tn_CFG(1):
+    case HPET_Tn_CFG(2):
+        tn = HPET_TN(CFG, addr);
 
         h->hpet.timers[tn].config = hpet_fixup_reg(new_val, old_val, 0x3f4e);
 
@@ -406,10 +382,10 @@ static int hpet_write(
         }
         break;
 
-    case HPET_T0_CMP:
-    case HPET_T1_CMP:
-    case HPET_T2_CMP:
-        tn = (addr - HPET_T0_CMP) >> 5;
+    case HPET_Tn_CMP(0):
+    case HPET_Tn_CMP(1):
+    case HPET_Tn_CMP(2):
+        tn = HPET_TN(CMP, addr);
         if ( timer_is_32bit(h, tn) )
             new_val = (uint32_t)new_val;
         h->hpet.timers[tn].cmp = new_val;
@@ -440,10 +416,10 @@ static int hpet_write(
             set_restart_timer(tn);
         break;
 
-    case HPET_T0_ROUTE:
-    case HPET_T1_ROUTE:
-    case HPET_T2_ROUTE:
-        tn = (addr - HPET_T0_ROUTE) >> 5;
+    case HPET_Tn_ROUTE(0):
+    case HPET_Tn_ROUTE(1):
+    case HPET_Tn_ROUTE(2):
+        tn = HPET_TN(ROUTE, addr);
         h->hpet.timers[tn].fsb = new_val;
         break;
 
@@ -608,8 +584,9 @@ void hpet_init(struct vcpu *v)
     h->hpet_to_ns_scale = ((S_TO_NS * STIME_PER_HPET_TICK) << 10) / h->stime_freq;
     h->hpet_to_ns_limit = ~0ULL / h->hpet_to_ns_scale;
 
-    /* 64-bit main counter; 3 timers supported; LegacyReplacementRoute. */
-    h->hpet.capability = 0x8086A201ULL;
+    h->hpet.capability = 0x80860001ULL |
+                         ((HPET_TIMER_NUM - 1) << HPET_ID_NUMBER_SHIFT) |
+                         HPET_ID_64BIT | HPET_ID_LEGSUP;
 
     /* This is the number of femptoseconds per HPET tick. */
     /* Here we define HPET's frequency to be 1/16 of Xen system time */
@@ -618,7 +595,7 @@ void hpet_init(struct vcpu *v)
     for ( i = 0; i < HPET_TIMER_NUM; i++ )
     {
         h->hpet.timers[i].config = 
-            HPET_TN_INT_ROUTE_CAP | HPET_TN_SIZE_CAP | HPET_TN_PERIODIC_CAP;
+            HPET_TN_INT_ROUTE_CAP | HPET_TN_64BIT_CAP | HPET_TN_PERIODIC_CAP;
         h->hpet.timers[i].cmp = ~0ULL;
         h->pt[i].source = PTSRC_isa;
     }
diff -r 0b0e42dc4f0a -r d35a117afa2f xen/include/asm-x86/hpet.h
--- a/xen/include/asm-x86/hpet.h	Tue Mar 27 15:23:43 2012 +0200
+++ b/xen/include/asm-x86/hpet.h	Tue Mar 27 15:25:07 2012 +0200
@@ -20,6 +20,7 @@
 
 #define HPET_ID_VENDOR	0xffff0000
 #define HPET_ID_LEGSUP	0x00008000
+#define HPET_ID_64BIT	0x00002000
 #define HPET_ID_NUMBER	0x00001f00
 #define HPET_ID_REV	0x000000ff
 #define	HPET_ID_NUMBER_SHIFT	8

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

From xen-changelog-bounces@lists.xen.org Wed Mar 28 02:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Mar 2012 02: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 1SCiM2-00060N-Cu; Wed, 28 Mar 2012 02: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 1SCiM1-0005zo-4i
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:17 +0000
Received: from [85.158.143.99:16073] by server-1.bemta-4.messagelabs.com id
	9B/1E-20925-443727F4; Wed, 28 Mar 2012 02:11:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-14.tower-216.messagelabs.com!1332900674!14841403!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 26291 invoked from network); 28 Mar 2012 02:11:15 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-14.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Mar 2012 02: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 1SCiLx-0003r1-Py
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:13 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCiLw-0006Hj-Sq
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:12 +0000
Message-Id: <E1SCiLw-0006Hj-Sq@xenbits.xen.org>
Date: Wed, 28 Mar 2012 02:11:12 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hpet: clear unwanted bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332854623 -7200
# Node ID 0b0e42dc4f0a40a4ad76db1021ec6d17dee5d21b
# Parent  790cfd7a4a8176e37bbe5a80aa1d30f1b8eb6d0b
x86/hpet: clear unwanted bits

Leaving certain bits set when being started from an environment where
the HPET was already in use can affect functionality. Clear those bits
to be on the safe side.

We should also consider ignoring the HPET altogether if any reserved
bits are found to be set.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r 790cfd7a4a81 -r 0b0e42dc4f0a xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Tue Mar 27 15:22:54 2012 +0200
+++ b/xen/arch/x86/hpet.c	Tue Mar 27 15:23:43 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_PERIODIC;
+        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB);
         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_PERIODIC;
+        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB);
         cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
 
diff -r 790cfd7a4a81 -r 0b0e42dc4f0a xen/include/asm-x86/hpet.h
--- a/xen/include/asm-x86/hpet.h	Tue Mar 27 15:22:54 2012 +0200
+++ b/xen/include/asm-x86/hpet.h	Tue Mar 27 15:23:43 2012 +0200
@@ -32,9 +32,11 @@
 #define	HPET_LEGACY_8254	2
 #define	HPET_LEGACY_RTC		8
 
+#define HPET_TN_LEVEL		0x002
 #define HPET_TN_ENABLE		0x004
 #define HPET_TN_PERIODIC	0x008
 #define HPET_TN_PERIODIC_CAP	0x010
+#define HPET_TN_64BIT_CAP	0x020
 #define HPET_TN_SETVAL		0x040
 #define HPET_TN_32BIT		0x100
 #define HPET_TN_ROUTE		0x3e00

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Mar 28 02:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Mar 2012 02: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 1SCiM1-0005zv-7E; Wed, 28 Mar 2012 02:11: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 1SCiLz-0005za-NK
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:16 +0000
Received: from [85.158.139.83:6931] by server-1.bemta-5.messagelabs.com id
	D3/E0-28458-243727F4; Wed, 28 Mar 2012 02:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1332900672!21288105!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3680 invoked from network); 28 Mar 2012 02:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Mar 2012 02: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 1SCiLv-0003qs-9o
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCiLu-0006Gy-Gc
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:10 +0000
Message-Id: <E1SCiLu-0006Gy-Gc@xenbits.xen.org>
Date: Wed, 28 Mar 2012 02:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hcall: markup the grant table
	hypercalls to improve generated docs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============8689503899866646747=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============8689503899866646747==
Content-Type: text/plain

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1332843238 -3600
# Node ID ed48258053aea953afd28b746b53af7b8b30531b
# Parent  4bd752a4cdf323c41c50f8cd6286f566d67adeae
hcall: markup the grant table hypercalls to improve generated docs

As part of this I looked through the relevant chapter from interfaces.tex (from
4.1, deleted in unstable) to ensure no critical information was missing.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4bd752a4cdf3 -r ed48258053ae xen/include/public/grant_table.h
--- a/xen/include/public/grant_table.h	Fri Mar 23 20:51:48 2012 +0000
+++ b/xen/include/public/grant_table.h	Tue Mar 27 11:13:58 2012 +0100
@@ -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",                                     \


--===============8689503899866646747==
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
--===============8689503899866646747==--

From xen-changelog-bounces@lists.xen.org Wed Mar 28 02:11:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Mar 2012 02: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 1SCiM1-0005zv-7E; Wed, 28 Mar 2012 02:11: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 1SCiLz-0005za-NK
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:16 +0000
Received: from [85.158.139.83:6931] by server-1.bemta-5.messagelabs.com id
	D3/E0-28458-243727F4; Wed, 28 Mar 2012 02:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-182.messagelabs.com!1332900672!21288105!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3680 invoked from network); 28 Mar 2012 02:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Mar 2012 02: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 1SCiLv-0003qs-9o
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCiLu-0006Gy-Gc
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:10 +0000
Message-Id: <E1SCiLu-0006Gy-Gc@xenbits.xen.org>
Date: Wed, 28 Mar 2012 02:11:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] hcall: markup the grant table
	hypercalls to improve generated docs
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://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="===============8689503899866646747=="
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

--===============8689503899866646747==
Content-Type: text/plain

# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1332843238 -3600
# Node ID ed48258053aea953afd28b746b53af7b8b30531b
# Parent  4bd752a4cdf323c41c50f8cd6286f566d67adeae
hcall: markup the grant table hypercalls to improve generated docs

As part of this I looked through the relevant chapter from interfaces.tex (from
4.1, deleted in unstable) to ensure no critical information was missing.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Keir Fraser <keir@xen.org>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
---


diff -r 4bd752a4cdf3 -r ed48258053ae xen/include/public/grant_table.h
--- a/xen/include/public/grant_table.h	Fri Mar 23 20:51:48 2012 +0000
+++ b/xen/include/public/grant_table.h	Tue Mar 27 11:13:58 2012 +0100
@@ -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",                                     \


--===============8689503899866646747==
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
--===============8689503899866646747==--

From xen-changelog-bounces@lists.xen.org Wed Mar 28 02:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Mar 2012 02: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 1SCiM1-0005zp-4T; Wed, 28 Mar 2012 02:11: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 1SCiLz-0005zZ-AX
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:15 +0000
Received: from [85.158.143.35:13096] by server-3.bemta-4.messagelabs.com id
	37/D6-05853-243727F4; Wed, 28 Mar 2012 02:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1332900672!7238883!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32389 invoked from network); 28 Mar 2012 02:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Mar 2012 02: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 1SCiLw-0003qv-3b
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCiLv-0006HD-CQ
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:11 +0000
Message-Id: <E1SCiLv-0006HD-CQ@xenbits.xen.org>
Date: Wed, 28 Mar 2012 02:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hpet: disable before reboot or
	kexec
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332854423 -7200
# Node ID f06ff3dfde08ee563970cffba502742249ff5820
# Parent  ed48258053aea953afd28b746b53af7b8b30531b
x86/hpet: disable before reboot or kexec

Linux up to now is not smart enough to properly clear the HPET when it
boots, which is particularly a problem when a kdump attempt from
running under Xen is being made. Linux itself added code to work around
this to its shutdown paths quite some time ago, so let's do something
similar in Xen: Save the configuration register settings during boot,
and restore them during shutdown. This should cover the majority of
cases where the secondary kernel might not come up because timer
interrupts don't work.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r ed48258053ae -r f06ff3dfde08 xen/arch/x86/crash.c
--- a/xen/arch/x86/crash.c	Tue Mar 27 11:13:58 2012 +0100
+++ b/xen/arch/x86/crash.c	Tue Mar 27 15:20:23 2012 +0200
@@ -94,6 +94,7 @@ static void nmi_shootdown_cpus(void)
     x2apic_enabled = (current_local_apic_mode() == APIC_MODE_X2APIC);
 
     disable_IO_APIC();
+    hpet_disable();
 }
 
 void machine_crash_shutdown(void)
diff -r ed48258053ae -r f06ff3dfde08 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Tue Mar 27 11:13:58 2012 +0100
+++ b/xen/arch/x86/hpet.c	Tue Mar 27 15:20:23 2012 +0200
@@ -562,7 +562,7 @@ void hpet_broadcast_resume(void)
     if ( !hpet_events )
         return;
 
-    hpet_resume();
+    hpet_resume(NULL);
 
     cfg = hpet_read32(HPET_CFG);
 
@@ -700,10 +700,13 @@ int hpet_legacy_irq_tick(void)
     return 1;
 }
 
+static u32 *hpet_boot_cfg;
+
 u64 __init hpet_setup(void)
 {
     static u64 __initdata hpet_rate;
     u32 hpet_id, hpet_period;
+    unsigned int last;
 
     if ( hpet_rate )
         return hpet_rate;
@@ -728,7 +731,9 @@ u64 __init hpet_setup(void)
         return 0;
     }
 
-    hpet_resume();
+    last = (hpet_id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT;
+    hpet_boot_cfg = xmalloc_array(u32, 2 + last);
+    hpet_resume(hpet_boot_cfg);
 
     hpet_rate = 1000000000000000ULL; /* 10^15 */
     (void)do_div(hpet_rate, hpet_period);
@@ -736,24 +741,29 @@ u64 __init hpet_setup(void)
     return hpet_rate;
 }
 
-void hpet_resume(void)
+void hpet_resume(u32 *boot_cfg)
 {
     static u32 system_reset_latch;
     u32 hpet_id, cfg;
-    unsigned int i;
+    unsigned int i, last;
 
     if ( system_reset_latch == system_reset_counter )
         return;
     system_reset_latch = system_reset_counter;
 
     cfg = hpet_read32(HPET_CFG);
+    if ( boot_cfg )
+        *boot_cfg = cfg;
     cfg &= ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY);
     hpet_write32(cfg, HPET_CFG);
 
     hpet_id = hpet_read32(HPET_ID);
-    for ( i = 0; i <= ((hpet_id >> 8) & 31); i++ )
+    last = (hpet_id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT;
+    for ( i = 0; i <= last; ++i )
     {
         cfg = hpet_read32(HPET_Tn_CFG(i));
+        if ( boot_cfg )
+            boot_cfg[i + 1] = cfg;
         cfg &= ~HPET_TN_ENABLE;
         hpet_write32(cfg, HPET_Tn_CFG(i));
     }
@@ -762,3 +772,21 @@ void hpet_resume(void)
     cfg |= HPET_CFG_ENABLE;
     hpet_write32(cfg, HPET_CFG);
 }
+
+void hpet_disable(void)
+{
+    unsigned int i;
+    u32 id;
+
+    if ( !hpet_boot_cfg )
+        return;
+
+    hpet_write32(*hpet_boot_cfg & ~HPET_CFG_ENABLE, HPET_CFG);
+
+    id = hpet_read32(HPET_ID);
+    for ( i = 0; i <= ((id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT); ++i )
+        hpet_write32(hpet_boot_cfg[i + 1], HPET_Tn_CFG(i));
+
+    if ( *hpet_boot_cfg & HPET_CFG_ENABLE )
+        hpet_write32(*hpet_boot_cfg, HPET_CFG);
+}
diff -r ed48258053ae -r f06ff3dfde08 xen/arch/x86/smp.c
--- a/xen/arch/x86/smp.c	Tue Mar 27 11:13:58 2012 +0100
+++ b/xen/arch/x86/smp.c	Tue Mar 27 15:20:23 2012 +0200
@@ -19,6 +19,7 @@
 #include <asm/mc146818rtc.h>
 #include <asm/flushtlb.h>
 #include <asm/hardirq.h>
+#include <asm/hpet.h>
 #include <asm/hvm/support.h>
 #include <mach_apic.h>
 
@@ -375,6 +376,7 @@ void smp_send_stop(void)
     local_irq_disable();
     __stop_this_cpu();
     disable_IO_APIC();
+    hpet_disable();
     local_irq_enable();
 }
 
diff -r ed48258053ae -r f06ff3dfde08 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c	Tue Mar 27 11:13:58 2012 +0100
+++ b/xen/arch/x86/time.c	Tue Mar 27 15:20:23 2012 +0200
@@ -377,7 +377,7 @@ static int __init init_hpet(struct platf
 
 static void resume_hpet(struct platform_timesource *pts)
 {
-    hpet_resume();
+    hpet_resume(NULL);
 }
 
 static struct platform_timesource __initdata plt_hpet =
diff -r ed48258053ae -r f06ff3dfde08 xen/include/asm-x86/hpet.h
--- a/xen/include/asm-x86/hpet.h	Tue Mar 27 11:13:58 2012 +0100
+++ b/xen/include/asm-x86/hpet.h	Tue Mar 27 15:20:23 2012 +0200
@@ -55,7 +55,12 @@ extern unsigned long hpet_address;
  * Return value is zero if HPET is unavailable.
  */
 u64 hpet_setup(void);
-void hpet_resume(void);
+void hpet_resume(u32 *);
+
+/*
+ * Disable HPET hardware: restore it to boot time state.
+ */
+void hpet_disable(void);
 
 /*
  * Callback from legacy timer (PIT channel 0) IRQ handler.

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Mar 28 02:11:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Mar 2012 02: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 1SCiM1-0005zp-4T; Wed, 28 Mar 2012 02:11: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 1SCiLz-0005zZ-AX
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:15 +0000
Received: from [85.158.143.35:13096] by server-3.bemta-4.messagelabs.com id
	37/D6-05853-243727F4; Wed, 28 Mar 2012 02:11:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-4.tower-21.messagelabs.com!1332900672!7238883!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 32389 invoked from network); 28 Mar 2012 02:11:13 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-4.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Mar 2012 02: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 1SCiLw-0003qv-3b
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCiLv-0006HD-CQ
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 02:11:11 +0000
Message-Id: <E1SCiLv-0006HD-CQ@xenbits.xen.org>
Date: Wed, 28 Mar 2012 02:11:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hpet: disable before reboot or
	kexec
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332854423 -7200
# Node ID f06ff3dfde08ee563970cffba502742249ff5820
# Parent  ed48258053aea953afd28b746b53af7b8b30531b
x86/hpet: disable before reboot or kexec

Linux up to now is not smart enough to properly clear the HPET when it
boots, which is particularly a problem when a kdump attempt from
running under Xen is being made. Linux itself added code to work around
this to its shutdown paths quite some time ago, so let's do something
similar in Xen: Save the configuration register settings during boot,
and restore them during shutdown. This should cover the majority of
cases where the secondary kernel might not come up because timer
interrupts don't work.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r ed48258053ae -r f06ff3dfde08 xen/arch/x86/crash.c
--- a/xen/arch/x86/crash.c	Tue Mar 27 11:13:58 2012 +0100
+++ b/xen/arch/x86/crash.c	Tue Mar 27 15:20:23 2012 +0200
@@ -94,6 +94,7 @@ static void nmi_shootdown_cpus(void)
     x2apic_enabled = (current_local_apic_mode() == APIC_MODE_X2APIC);
 
     disable_IO_APIC();
+    hpet_disable();
 }
 
 void machine_crash_shutdown(void)
diff -r ed48258053ae -r f06ff3dfde08 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Tue Mar 27 11:13:58 2012 +0100
+++ b/xen/arch/x86/hpet.c	Tue Mar 27 15:20:23 2012 +0200
@@ -562,7 +562,7 @@ void hpet_broadcast_resume(void)
     if ( !hpet_events )
         return;
 
-    hpet_resume();
+    hpet_resume(NULL);
 
     cfg = hpet_read32(HPET_CFG);
 
@@ -700,10 +700,13 @@ int hpet_legacy_irq_tick(void)
     return 1;
 }
 
+static u32 *hpet_boot_cfg;
+
 u64 __init hpet_setup(void)
 {
     static u64 __initdata hpet_rate;
     u32 hpet_id, hpet_period;
+    unsigned int last;
 
     if ( hpet_rate )
         return hpet_rate;
@@ -728,7 +731,9 @@ u64 __init hpet_setup(void)
         return 0;
     }
 
-    hpet_resume();
+    last = (hpet_id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT;
+    hpet_boot_cfg = xmalloc_array(u32, 2 + last);
+    hpet_resume(hpet_boot_cfg);
 
     hpet_rate = 1000000000000000ULL; /* 10^15 */
     (void)do_div(hpet_rate, hpet_period);
@@ -736,24 +741,29 @@ u64 __init hpet_setup(void)
     return hpet_rate;
 }
 
-void hpet_resume(void)
+void hpet_resume(u32 *boot_cfg)
 {
     static u32 system_reset_latch;
     u32 hpet_id, cfg;
-    unsigned int i;
+    unsigned int i, last;
 
     if ( system_reset_latch == system_reset_counter )
         return;
     system_reset_latch = system_reset_counter;
 
     cfg = hpet_read32(HPET_CFG);
+    if ( boot_cfg )
+        *boot_cfg = cfg;
     cfg &= ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY);
     hpet_write32(cfg, HPET_CFG);
 
     hpet_id = hpet_read32(HPET_ID);
-    for ( i = 0; i <= ((hpet_id >> 8) & 31); i++ )
+    last = (hpet_id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT;
+    for ( i = 0; i <= last; ++i )
     {
         cfg = hpet_read32(HPET_Tn_CFG(i));
+        if ( boot_cfg )
+            boot_cfg[i + 1] = cfg;
         cfg &= ~HPET_TN_ENABLE;
         hpet_write32(cfg, HPET_Tn_CFG(i));
     }
@@ -762,3 +772,21 @@ void hpet_resume(void)
     cfg |= HPET_CFG_ENABLE;
     hpet_write32(cfg, HPET_CFG);
 }
+
+void hpet_disable(void)
+{
+    unsigned int i;
+    u32 id;
+
+    if ( !hpet_boot_cfg )
+        return;
+
+    hpet_write32(*hpet_boot_cfg & ~HPET_CFG_ENABLE, HPET_CFG);
+
+    id = hpet_read32(HPET_ID);
+    for ( i = 0; i <= ((id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT); ++i )
+        hpet_write32(hpet_boot_cfg[i + 1], HPET_Tn_CFG(i));
+
+    if ( *hpet_boot_cfg & HPET_CFG_ENABLE )
+        hpet_write32(*hpet_boot_cfg, HPET_CFG);
+}
diff -r ed48258053ae -r f06ff3dfde08 xen/arch/x86/smp.c
--- a/xen/arch/x86/smp.c	Tue Mar 27 11:13:58 2012 +0100
+++ b/xen/arch/x86/smp.c	Tue Mar 27 15:20:23 2012 +0200
@@ -19,6 +19,7 @@
 #include <asm/mc146818rtc.h>
 #include <asm/flushtlb.h>
 #include <asm/hardirq.h>
+#include <asm/hpet.h>
 #include <asm/hvm/support.h>
 #include <mach_apic.h>
 
@@ -375,6 +376,7 @@ void smp_send_stop(void)
     local_irq_disable();
     __stop_this_cpu();
     disable_IO_APIC();
+    hpet_disable();
     local_irq_enable();
 }
 
diff -r ed48258053ae -r f06ff3dfde08 xen/arch/x86/time.c
--- a/xen/arch/x86/time.c	Tue Mar 27 11:13:58 2012 +0100
+++ b/xen/arch/x86/time.c	Tue Mar 27 15:20:23 2012 +0200
@@ -377,7 +377,7 @@ static int __init init_hpet(struct platf
 
 static void resume_hpet(struct platform_timesource *pts)
 {
-    hpet_resume();
+    hpet_resume(NULL);
 }
 
 static struct platform_timesource __initdata plt_hpet =
diff -r ed48258053ae -r f06ff3dfde08 xen/include/asm-x86/hpet.h
--- a/xen/include/asm-x86/hpet.h	Tue Mar 27 11:13:58 2012 +0100
+++ b/xen/include/asm-x86/hpet.h	Tue Mar 27 15:20:23 2012 +0200
@@ -55,7 +55,12 @@ extern unsigned long hpet_address;
  * Return value is zero if HPET is unavailable.
  */
 u64 hpet_setup(void);
-void hpet_resume(void);
+void hpet_resume(u32 *);
+
+/*
+ * Disable HPET hardware: restore it to boot time state.
+ */
+void hpet_disable(void);
 
 /*
  * Callback from legacy timer (PIT channel 0) IRQ handler.

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Mar 28 13:33:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Mar 2012 13: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 1SCszs-00020A-T3; Wed, 28 Mar 2012 13:33:08 +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 1SCszr-0001zy-Fc
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 13:33:07 +0000
Received: from [85.158.139.83:18354] by server-3.bemta-5.messagelabs.com id
	3C/39-25237-213137F4; Wed, 28 Mar 2012 13:33:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1332941584!17511630!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16199 invoked from network); 28 Mar 2012 13:33:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Mar 2012 13:33:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCszo-0003jA-8P
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 13:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCszo-0005lC-1M
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 13:33:04 +0000
Message-Id: <E1SCszo-0005lC-1M@xenbits.xen.org>
Date: Wed, 28 Mar 2012 13:33:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] block backends: adjust protocol
	negotiation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332940071 -7200
# Node ID 56e7b5175d61e16d4da6ad89c2929513da479f6c
# Parent  f8805d3fc263d247e1e27666a8c2e092956ccf21
block backends: adjust protocol negotiation

The changes in c/s 1168:8940ccd0a425 resulted in the native not getting
selected anymore, resulting in more involved copying of individual
requests. Adjust the negotiation code so that it'll pick the native one
again if the frontend matches.

The initialization code can be considerably shrunk by using a macro to
abstract out the code common for all variants.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r f8805d3fc263 -r 56e7b5175d61 drivers/xen/blkback/xenbus.c
--- a/drivers/xen/blkback/xenbus.c	Mon Mar 26 11:50:02 2012 +0200
+++ b/drivers/xen/blkback/xenbus.c	Wed Mar 28 15:07:51 2012 +0200
@@ -497,10 +497,14 @@ static int connect_ring(struct backend_i
 	protocol = xenbus_read(XBT_NIL, dev->otherend, "protocol", NULL);
 	if (IS_ERR(protocol))
 		protocol = NULL;
+#ifndef CONFIG_X86_32
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_32;
+#endif
+#ifndef CONFIG_X86_64
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_64))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_64;
+#endif
 	else if (0 != strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE)) {
 		xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol);
 		kfree(protocol);
diff -r f8805d3fc263 -r 56e7b5175d61 drivers/xen/blktap/xenbus.c
--- a/drivers/xen/blktap/xenbus.c	Mon Mar 26 11:50:02 2012 +0200
+++ b/drivers/xen/blktap/xenbus.c	Wed Mar 28 15:07:51 2012 +0200
@@ -450,10 +450,14 @@ static int connect_ring(struct backend_i
 	protocol = xenbus_read(XBT_NIL, dev->otherend, "protocol", NULL);
 	if (IS_ERR(protocol))
 		protocol = NULL;
+#ifndef CONFIG_X86_32
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_32;
+#endif
+#ifndef CONFIG_X86_64
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_64))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_64;
+#endif
 	else if (0 != strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE)) {
 		xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol);
 		kfree(protocol);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Mar 28 13:33:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Mar 2012 13: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 1SCszs-00020A-T3; Wed, 28 Mar 2012 13:33:08 +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 1SCszr-0001zy-Fc
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 13:33:07 +0000
Received: from [85.158.139.83:18354] by server-3.bemta-5.messagelabs.com id
	3C/39-25237-213137F4; Wed, 28 Mar 2012 13:33:06 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-182.messagelabs.com!1332941584!17511630!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 16199 invoked from network); 28 Mar 2012 13:33:05 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-6.tower-182.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Mar 2012 13:33:05 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCszo-0003jA-8P
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 13:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCszo-0005lC-1M
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 13:33:04 +0000
Message-Id: <E1SCszo-0005lC-1M@xenbits.xen.org>
Date: Wed, 28 Mar 2012 13:33:03 +0000
From: Xen patchbot-linux-2.6.18-xen <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [linux-2.6.18-xen] block backends: adjust protocol
	negotiation
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332940071 -7200
# Node ID 56e7b5175d61e16d4da6ad89c2929513da479f6c
# Parent  f8805d3fc263d247e1e27666a8c2e092956ccf21
block backends: adjust protocol negotiation

The changes in c/s 1168:8940ccd0a425 resulted in the native not getting
selected anymore, resulting in more involved copying of individual
requests. Adjust the negotiation code so that it'll pick the native one
again if the frontend matches.

The initialization code can be considerably shrunk by using a macro to
abstract out the code common for all variants.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r f8805d3fc263 -r 56e7b5175d61 drivers/xen/blkback/xenbus.c
--- a/drivers/xen/blkback/xenbus.c	Mon Mar 26 11:50:02 2012 +0200
+++ b/drivers/xen/blkback/xenbus.c	Wed Mar 28 15:07:51 2012 +0200
@@ -497,10 +497,14 @@ static int connect_ring(struct backend_i
 	protocol = xenbus_read(XBT_NIL, dev->otherend, "protocol", NULL);
 	if (IS_ERR(protocol))
 		protocol = NULL;
+#ifndef CONFIG_X86_32
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_32;
+#endif
+#ifndef CONFIG_X86_64
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_64))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_64;
+#endif
 	else if (0 != strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE)) {
 		xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol);
 		kfree(protocol);
diff -r f8805d3fc263 -r 56e7b5175d61 drivers/xen/blktap/xenbus.c
--- a/drivers/xen/blktap/xenbus.c	Mon Mar 26 11:50:02 2012 +0200
+++ b/drivers/xen/blktap/xenbus.c	Wed Mar 28 15:07:51 2012 +0200
@@ -450,10 +450,14 @@ static int connect_ring(struct backend_i
 	protocol = xenbus_read(XBT_NIL, dev->otherend, "protocol", NULL);
 	if (IS_ERR(protocol))
 		protocol = NULL;
+#ifndef CONFIG_X86_32
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_32))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_32;
+#endif
+#ifndef CONFIG_X86_64
 	else if (0 == strcmp(protocol, XEN_IO_PROTO_ABI_X86_64))
 		be->blkif->blk_protocol = BLKIF_PROTOCOL_X86_64;
+#endif
 	else if (0 != strcmp(protocol, XEN_IO_PROTO_ABI_NATIVE)) {
 		xenbus_dev_fatal(dev, err, "unknown fe protocol %s", protocol);
 		kfree(protocol);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Mar 28 13:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Mar 2012 13:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SCt02-00021E-Vp; Wed, 28 Mar 2012 13:33: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 1SCt01-000210-L6
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 13:33:17 +0000
Received: from [85.158.143.35:28635] by server-3.bemta-4.messagelabs.com id
	E4/C7-05853-C13137F4; Wed, 28 Mar 2012 13:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1332941586!4320090!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19679 invoked from network); 28 Mar 2012 13:33:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Mar 2012 13:33:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCszo-0003jD-Rq
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 13:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCszo-0005lR-G1
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 13:33:04 +0000
Message-Id: <E1SCszo-0005lR-G1@xenbits.xen.org>
Date: Wed, 28 Mar 2012 13:33: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] blkback: streamline main
	processing loop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332940883 -7200
# Node ID 80a3bc79579e55efaece795656a0c08d854f8280
# Parent  56e7b5175d61e16d4da6ad89c2929513da479f6c
blkback: streamline main processing loop

- move stats updates into dispatch_rw_block_io(), allowing to fold
  common cases
- don't alloc pending_req_t instance when none is going to be needed
  (particularly relevant since they are a global resource)
- use type-safe assignment rather than memcpy() for obtaining native
  requests from ring

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 56e7b5175d61 -r 80a3bc79579e drivers/xen/blkback/blkback.c
--- a/drivers/xen/blkback/blkback.c	Wed Mar 28 15:07:51 2012 +0200
+++ b/drivers/xen/blkback/blkback.c	Wed Mar 28 15:21:23 2012 +0200
@@ -315,32 +315,21 @@ static int _do_block_io_op(blkif_t *blki
 	blkif_request_t req;
 	pending_req_t *pending_req;
 	RING_IDX rc, rp;
-	int more_to_do = 0;
 
 	rc = blk_rings->common.req_cons;
 	rp = blk_rings->common.sring->req_prod;
 	rmb(); /* Ensure we see queued requests up to 'rp'. */
 
-	while ((rc != rp)) {
-
+	while (rc != rp) {
 		if (RING_REQUEST_CONS_OVERFLOW(&blk_rings->common, rc))
 			break;
 
-		if (kthread_should_stop()) {
-			more_to_do = 1;
-			break;
-		}
-
-		pending_req = alloc_req();
-		if (NULL == pending_req) {
-			blkif->st_oo_req++;
-			more_to_do = 1;
-			break;
-		}
+		if (kthread_should_stop())
+			return 1;
 
 		switch (blkif->blk_protocol) {
 		case BLKIF_PROTOCOL_NATIVE:
-			memcpy(&req, RING_GET_REQUEST(&blk_rings->native, rc), sizeof(req));
+			req = *RING_GET_REQUEST(&blk_rings->native, rc);
 			break;
 		case BLKIF_PROTOCOL_X86_32:
 			blkif_get_x86_32_req(&req, RING_GET_REQUEST(&blk_rings->x86_32, rc));
@@ -350,33 +339,39 @@ static int _do_block_io_op(blkif_t *blki
 			break;
 		default:
 			BUG();
+			return 0; /* make compiler happy */
 		}
-		blk_rings->common.req_cons = ++rc; /* before make_response() */
 
-		/* Apply all sanity checks to /private copy/ of request. */
-		barrier();
+		++rc;
 
 		switch (req.operation) {
 		case BLKIF_OP_READ:
-			blkif->st_rd_req++;
-			dispatch_rw_block_io(blkif, &req, pending_req);
-			break;
+		case BLKIF_OP_WRITE:
 		case BLKIF_OP_WRITE_BARRIER:
-			blkif->st_br_req++;
-			/* fall through */
-		case BLKIF_OP_WRITE:
-			blkif->st_wr_req++;
+			pending_req = alloc_req();
+			if (!pending_req) {
+				blkif->st_oo_req++;
+				return 1;
+			}
+
+			/* before make_response() */
+			blk_rings->common.req_cons = rc;
+
+			/* Apply all sanity checks to /private copy/ of request. */
+			barrier();
+
 			dispatch_rw_block_io(blkif, &req, pending_req);
 			break;
 		default:
 			/* A good sign something is wrong: sleep for a while to
 			 * avoid excessive CPU consumption by a bad guest. */
 			msleep(1);
+			blk_rings->common.req_cons = rc;
+			barrier();
 			DPRINTK("error: unknown block io operation [%d]\n",
 				req.operation);
 			make_response(blkif, req.id, req.operation,
 				      BLKIF_RSP_ERROR);
-			free_req(pending_req);
 			break;
 		}
 
@@ -384,7 +379,7 @@ static int _do_block_io_op(blkif_t *blki
 		cond_resched();
 	}
 
-	return more_to_do;
+	return 0;
 }
 
 static int
@@ -421,12 +416,15 @@ static void dispatch_rw_block_io(blkif_t
 
 	switch (req->operation) {
 	case BLKIF_OP_READ:
+		blkif->st_rd_req++;
 		operation = READ;
 		break;
 	case BLKIF_OP_WRITE:
+		blkif->st_wr_req++;
 		operation = WRITE;
 		break;
 	case BLKIF_OP_WRITE_BARRIER:
+		blkif->st_br_req++;
 		operation = WRITE_BARRIER;
 		break;
 	default:
@@ -559,7 +557,7 @@ static void dispatch_rw_block_io(blkif_t
 
 	if (operation == READ)
 		blkif->st_rd_sect += preq.nr_sects;
-	else if (operation == WRITE || operation == WRITE_BARRIER)
+	else
 		blkif->st_wr_sect += preq.nr_sects;
 
 	return;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Wed Mar 28 13:33:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Wed, 28 Mar 2012 13:33:24 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SCt02-00021E-Vp; Wed, 28 Mar 2012 13:33: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 1SCt01-000210-L6
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 13:33:17 +0000
Received: from [85.158.143.35:28635] by server-3.bemta-4.messagelabs.com id
	E4/C7-05853-C13137F4; Wed, 28 Mar 2012 13:33:16 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-21.messagelabs.com!1332941586!4320090!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 19679 invoked from network); 28 Mar 2012 13:33:08 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-5.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	28 Mar 2012 13:33:08 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCszo-0003jD-Rq
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 13:33:04 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SCszo-0005lR-G1
	for xen-changelog@lists.xensource.com; Wed, 28 Mar 2012 13:33:04 +0000
Message-Id: <E1SCszo-0005lR-G1@xenbits.xen.org>
Date: Wed, 28 Mar 2012 13:33: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] blkback: streamline main
	processing loop
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332940883 -7200
# Node ID 80a3bc79579e55efaece795656a0c08d854f8280
# Parent  56e7b5175d61e16d4da6ad89c2929513da479f6c
blkback: streamline main processing loop

- move stats updates into dispatch_rw_block_io(), allowing to fold
  common cases
- don't alloc pending_req_t instance when none is going to be needed
  (particularly relevant since they are a global resource)
- use type-safe assignment rather than memcpy() for obtaining native
  requests from ring

Signed-off-by: Jan Beulich <jbeulich@suse.com>
---


diff -r 56e7b5175d61 -r 80a3bc79579e drivers/xen/blkback/blkback.c
--- a/drivers/xen/blkback/blkback.c	Wed Mar 28 15:07:51 2012 +0200
+++ b/drivers/xen/blkback/blkback.c	Wed Mar 28 15:21:23 2012 +0200
@@ -315,32 +315,21 @@ static int _do_block_io_op(blkif_t *blki
 	blkif_request_t req;
 	pending_req_t *pending_req;
 	RING_IDX rc, rp;
-	int more_to_do = 0;
 
 	rc = blk_rings->common.req_cons;
 	rp = blk_rings->common.sring->req_prod;
 	rmb(); /* Ensure we see queued requests up to 'rp'. */
 
-	while ((rc != rp)) {
-
+	while (rc != rp) {
 		if (RING_REQUEST_CONS_OVERFLOW(&blk_rings->common, rc))
 			break;
 
-		if (kthread_should_stop()) {
-			more_to_do = 1;
-			break;
-		}
-
-		pending_req = alloc_req();
-		if (NULL == pending_req) {
-			blkif->st_oo_req++;
-			more_to_do = 1;
-			break;
-		}
+		if (kthread_should_stop())
+			return 1;
 
 		switch (blkif->blk_protocol) {
 		case BLKIF_PROTOCOL_NATIVE:
-			memcpy(&req, RING_GET_REQUEST(&blk_rings->native, rc), sizeof(req));
+			req = *RING_GET_REQUEST(&blk_rings->native, rc);
 			break;
 		case BLKIF_PROTOCOL_X86_32:
 			blkif_get_x86_32_req(&req, RING_GET_REQUEST(&blk_rings->x86_32, rc));
@@ -350,33 +339,39 @@ static int _do_block_io_op(blkif_t *blki
 			break;
 		default:
 			BUG();
+			return 0; /* make compiler happy */
 		}
-		blk_rings->common.req_cons = ++rc; /* before make_response() */
 
-		/* Apply all sanity checks to /private copy/ of request. */
-		barrier();
+		++rc;
 
 		switch (req.operation) {
 		case BLKIF_OP_READ:
-			blkif->st_rd_req++;
-			dispatch_rw_block_io(blkif, &req, pending_req);
-			break;
+		case BLKIF_OP_WRITE:
 		case BLKIF_OP_WRITE_BARRIER:
-			blkif->st_br_req++;
-			/* fall through */
-		case BLKIF_OP_WRITE:
-			blkif->st_wr_req++;
+			pending_req = alloc_req();
+			if (!pending_req) {
+				blkif->st_oo_req++;
+				return 1;
+			}
+
+			/* before make_response() */
+			blk_rings->common.req_cons = rc;
+
+			/* Apply all sanity checks to /private copy/ of request. */
+			barrier();
+
 			dispatch_rw_block_io(blkif, &req, pending_req);
 			break;
 		default:
 			/* A good sign something is wrong: sleep for a while to
 			 * avoid excessive CPU consumption by a bad guest. */
 			msleep(1);
+			blk_rings->common.req_cons = rc;
+			barrier();
 			DPRINTK("error: unknown block io operation [%d]\n",
 				req.operation);
 			make_response(blkif, req.id, req.operation,
 				      BLKIF_RSP_ERROR);
-			free_req(pending_req);
 			break;
 		}
 
@@ -384,7 +379,7 @@ static int _do_block_io_op(blkif_t *blki
 		cond_resched();
 	}
 
-	return more_to_do;
+	return 0;
 }
 
 static int
@@ -421,12 +416,15 @@ static void dispatch_rw_block_io(blkif_t
 
 	switch (req->operation) {
 	case BLKIF_OP_READ:
+		blkif->st_rd_req++;
 		operation = READ;
 		break;
 	case BLKIF_OP_WRITE:
+		blkif->st_wr_req++;
 		operation = WRITE;
 		break;
 	case BLKIF_OP_WRITE_BARRIER:
+		blkif->st_br_req++;
 		operation = WRITE_BARRIER;
 		break;
 	default:
@@ -559,7 +557,7 @@ static void dispatch_rw_block_io(blkif_t
 
 	if (operation == READ)
 		blkif->st_rd_sect += preq.nr_sects;
-	else if (operation == WRITE || operation == WRITE_BARRIER)
+	else
 		blkif->st_wr_sect += preq.nr_sects;
 
 	return;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Mar 29 03:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Mar 2012 03: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 1SD6SD-0006Lp-L5; Thu, 29 Mar 2012 03: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 1SD6SC-0006Lc-5e
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 03:55:16 +0000
Received: from [85.158.138.51:6001] by server-12.bemta-3.messagelabs.com id
	EE/2F-30663-32DD37F4; Thu, 29 Mar 2012 03:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1332993313!17966461!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3670 invoked from network); 29 Mar 2012 03:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Mar 2012 03: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 1SD6S8-0006Am-BS
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 03:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SD6S7-0000qV-QE
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 03:55:11 +0000
Message-Id: <E1SD6S7-0000qV-QE@xenbits.xen.org>
Date: Thu, 29 Mar 2012 03:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hpet: warn about and clear
	reserved set config register bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332946742 -7200
# Node ID 74d2af0b56ea7e6072bdfd6e493be5f108808bb7
# Parent  d35a117afa2f71ce67af2306940a47ed7734b9e4
x86/hpet: warn about and clear reserved set config register bits

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r d35a117afa2f -r 74d2af0b56ea xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Tue Mar 27 15:25:07 2012 +0200
+++ b/xen/arch/x86/hpet.c	Wed Mar 28 16:59:02 2012 +0200
@@ -755,6 +755,13 @@ void hpet_resume(u32 *boot_cfg)
     if ( boot_cfg )
         *boot_cfg = cfg;
     cfg &= ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY);
+    if ( cfg )
+    {
+        printk(XENLOG_WARNING
+               "HPET: reserved bits %#x set in global config register\n",
+               cfg);
+        cfg = 0;
+    }
     hpet_write32(cfg, HPET_CFG);
 
     hpet_id = hpet_read32(HPET_ID);
@@ -765,6 +772,13 @@ void hpet_resume(u32 *boot_cfg)
         if ( boot_cfg )
             boot_cfg[i + 1] = cfg;
         cfg &= ~HPET_TN_ENABLE;
+        if ( cfg & HPET_TN_RESERVED )
+        {
+            printk(XENLOG_WARNING
+                   "HPET: reserved bits %#x set in channel %u config register\n",
+                   cfg & HPET_TN_RESERVED, i);
+            cfg &= ~HPET_TN_RESERVED;
+        }
         hpet_write32(cfg, HPET_Tn_CFG(i));
     }
 
diff -r d35a117afa2f -r 74d2af0b56ea xen/arch/x86/hvm/hpet.c
--- a/xen/arch/x86/hvm/hpet.c	Tue Mar 27 15:25:07 2012 +0200
+++ b/xen/arch/x86/hvm/hpet.c	Wed Mar 28 16:59:02 2012 +0200
@@ -42,7 +42,8 @@
     (hvm_get_guest_time(vhpet_vcpu(hpet)) / STIME_PER_HPET_TICK)
 
 #define HPET_TN_INT_ROUTE_CAP_SHIFT 32
-#define HPET_TN_CFG_BITS_READONLY_OR_RESERVED 0xffff80b1U
+#define HPET_TN_CFG_BITS_READONLY_OR_RESERVED (HPET_TN_RESERVED | \
+    HPET_TN_PERIODIC_CAP | HPET_TN_64BIT_CAP | HPET_TN_FSB_CAP)
 
 /* can be routed to IOAPIC.redirect_table[23..20] */
 #define HPET_TN_INT_ROUTE_CAP      (0x00f00000ULL \
diff -r d35a117afa2f -r 74d2af0b56ea xen/include/asm-x86/hpet.h
--- a/xen/include/asm-x86/hpet.h	Tue Mar 27 15:25:07 2012 +0200
+++ b/xen/include/asm-x86/hpet.h	Wed Mar 28 16:59:02 2012 +0200
@@ -43,6 +43,7 @@
 #define HPET_TN_ROUTE		0x3e00
 #define HPET_TN_FSB		0x4000
 #define HPET_TN_FSB_CAP		0x8000
+#define HPET_TN_RESERVED	0xffff0081
 #define HPET_TN_ROUTE_SHIFT	9
 
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Mar 29 03:55:25 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Mar 2012 03: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 1SD6SD-0006Lp-L5; Thu, 29 Mar 2012 03: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 1SD6SC-0006Lc-5e
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 03:55:16 +0000
Received: from [85.158.138.51:6001] by server-12.bemta-3.messagelabs.com id
	EE/2F-30663-32DD37F4; Thu, 29 Mar 2012 03:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-15.tower-174.messagelabs.com!1332993313!17966461!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=UPPERCASE_25_50
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 3670 invoked from network); 29 Mar 2012 03:55:14 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-15.tower-174.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Mar 2012 03: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 1SD6S8-0006Am-BS
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 03:55:12 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SD6S7-0000qV-QE
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 03:55:11 +0000
Message-Id: <E1SD6S7-0000qV-QE@xenbits.xen.org>
Date: Thu, 29 Mar 2012 03:55:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/hpet: warn about and clear
	reserved set config register bits
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1332946742 -7200
# Node ID 74d2af0b56ea7e6072bdfd6e493be5f108808bb7
# Parent  d35a117afa2f71ce67af2306940a47ed7734b9e4
x86/hpet: warn about and clear reserved set config register bits

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
---


diff -r d35a117afa2f -r 74d2af0b56ea xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c	Tue Mar 27 15:25:07 2012 +0200
+++ b/xen/arch/x86/hpet.c	Wed Mar 28 16:59:02 2012 +0200
@@ -755,6 +755,13 @@ void hpet_resume(u32 *boot_cfg)
     if ( boot_cfg )
         *boot_cfg = cfg;
     cfg &= ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY);
+    if ( cfg )
+    {
+        printk(XENLOG_WARNING
+               "HPET: reserved bits %#x set in global config register\n",
+               cfg);
+        cfg = 0;
+    }
     hpet_write32(cfg, HPET_CFG);
 
     hpet_id = hpet_read32(HPET_ID);
@@ -765,6 +772,13 @@ void hpet_resume(u32 *boot_cfg)
         if ( boot_cfg )
             boot_cfg[i + 1] = cfg;
         cfg &= ~HPET_TN_ENABLE;
+        if ( cfg & HPET_TN_RESERVED )
+        {
+            printk(XENLOG_WARNING
+                   "HPET: reserved bits %#x set in channel %u config register\n",
+                   cfg & HPET_TN_RESERVED, i);
+            cfg &= ~HPET_TN_RESERVED;
+        }
         hpet_write32(cfg, HPET_Tn_CFG(i));
     }
 
diff -r d35a117afa2f -r 74d2af0b56ea xen/arch/x86/hvm/hpet.c
--- a/xen/arch/x86/hvm/hpet.c	Tue Mar 27 15:25:07 2012 +0200
+++ b/xen/arch/x86/hvm/hpet.c	Wed Mar 28 16:59:02 2012 +0200
@@ -42,7 +42,8 @@
     (hvm_get_guest_time(vhpet_vcpu(hpet)) / STIME_PER_HPET_TICK)
 
 #define HPET_TN_INT_ROUTE_CAP_SHIFT 32
-#define HPET_TN_CFG_BITS_READONLY_OR_RESERVED 0xffff80b1U
+#define HPET_TN_CFG_BITS_READONLY_OR_RESERVED (HPET_TN_RESERVED | \
+    HPET_TN_PERIODIC_CAP | HPET_TN_64BIT_CAP | HPET_TN_FSB_CAP)
 
 /* can be routed to IOAPIC.redirect_table[23..20] */
 #define HPET_TN_INT_ROUTE_CAP      (0x00f00000ULL \
diff -r d35a117afa2f -r 74d2af0b56ea xen/include/asm-x86/hpet.h
--- a/xen/include/asm-x86/hpet.h	Tue Mar 27 15:25:07 2012 +0200
+++ b/xen/include/asm-x86/hpet.h	Wed Mar 28 16:59:02 2012 +0200
@@ -43,6 +43,7 @@
 #define HPET_TN_ROUTE		0x3e00
 #define HPET_TN_FSB		0x4000
 #define HPET_TN_FSB_CAP		0x8000
+#define HPET_TN_RESERVED	0xffff0081
 #define HPET_TN_ROUTE_SHIFT	9
 
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Mar 29 21:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Mar 2012 21: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 1SDMy3-0006Oz-Uo; Thu, 29 Mar 2012 21:33: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 1SDMy2-0006OS-BP
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:14 +0000
Received: from [85.158.143.99:40579] by server-2.bemta-4.messagelabs.com id
	7E/19-17550-915D47F4; Thu, 29 Mar 2012 21:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1333056791!20918997!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8058 invoked from network); 29 Mar 2012 21:33:12 -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;
	29 Mar 2012 21:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDMxy-0003Vk-S4
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDMxy-0001uD-Mh
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:10 +0000
Message-Id: <E1SDMxy-0001uD-Mh@xenbits.xen.org>
Date: Thu, 29 Mar 2012 21:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] IOMMU: clean up handling of 'foo'
	and 'no-foo' 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333019321 -3600
# Node ID bf12b6236d32cc69e6ffd0f21a178849a263fa2e
# Parent  fb658789d83a47dd82e3b20b64b2aa8725447205
IOMMU: clean up handling of 'foo' and 'no-foo' command-line options

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r fb658789d83a -r bf12b6236d32 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Thu Mar 29 12:01:33 2012 +0100
+++ b/xen/drivers/passthrough/iommu.c	Thu Mar 29 12:08:41 2012 +0100
@@ -57,8 +57,13 @@ DEFINE_PER_CPU(bool_t, iommu_dont_flush_
 static void __init parse_iommu_param(char *s)
 {
     char *ss;
+    int val;
 
     do {
+        val = !!strncmp(s, "no-", 3);
+        if ( !val )
+            s += 3;
+
         ss = strchr(s, ',');
         if ( ss )
             *ss = '\0';
@@ -66,27 +71,27 @@ static void __init parse_iommu_param(cha
         if ( !parse_bool(s) )
             iommu_enabled = 0;
         else if ( !strcmp(s, "force") || !strcmp(s, "required") )
-            force_iommu = 1;
+            force_iommu = val;
         else if ( !strcmp(s, "workaround_bios_bug") )
-            iommu_workaround_bios_bug = 1;
+            iommu_workaround_bios_bug = val;
         else if ( !strcmp(s, "verbose") )
-            iommu_verbose = 1;
-        else if ( !strcmp(s, "no-snoop") )
-            iommu_snoop = 0;
-        else if ( !strcmp(s, "no-qinval") )
-            iommu_qinval = 0;
-        else if ( !strcmp(s, "no-intremap") )
-            iommu_intremap = 0;
+            iommu_verbose = val;
+        else if ( !strcmp(s, "snoop") )
+            iommu_snoop = val;
+        else if ( !strcmp(s, "qinval") )
+            iommu_qinval = val;
+        else if ( !strcmp(s, "intremap") )
+            iommu_intremap = val;
         else if ( !strcmp(s, "debug") )
-            iommu_debug = 1;
+            iommu_debug = val;
         else if ( !strcmp(s, "amd-iommu-perdev-intremap") )
-            amd_iommu_perdev_intremap = 1;
+            amd_iommu_perdev_intremap = val;
         else if ( !strcmp(s, "dom0-passthrough") )
-            iommu_passthrough = 1;
+            iommu_passthrough = val;
         else if ( !strcmp(s, "dom0-strict") )
-            iommu_dom0_strict = 1;
+            iommu_dom0_strict = val;
         else if ( !strcmp(s, "sharept") )
-            iommu_hap_pt_share = 1;
+            iommu_hap_pt_share = val;
 
         s = ss + 1;
     } while ( ss );

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Mar 29 21:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Mar 2012 21: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 1SDMy3-0006Oz-Uo; Thu, 29 Mar 2012 21:33: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 1SDMy2-0006OS-BP
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:14 +0000
Received: from [85.158.143.99:40579] by server-2.bemta-4.messagelabs.com id
	7E/19-17550-915D47F4; Thu, 29 Mar 2012 21:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-3.tower-216.messagelabs.com!1333056791!20918997!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8058 invoked from network); 29 Mar 2012 21:33:12 -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;
	29 Mar 2012 21:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDMxy-0003Vk-S4
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDMxy-0001uD-Mh
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:10 +0000
Message-Id: <E1SDMxy-0001uD-Mh@xenbits.xen.org>
Date: Thu, 29 Mar 2012 21:33:10 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] IOMMU: clean up handling of 'foo'
	and 'no-foo' 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333019321 -3600
# Node ID bf12b6236d32cc69e6ffd0f21a178849a263fa2e
# Parent  fb658789d83a47dd82e3b20b64b2aa8725447205
IOMMU: clean up handling of 'foo' and 'no-foo' command-line options

Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r fb658789d83a -r bf12b6236d32 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Thu Mar 29 12:01:33 2012 +0100
+++ b/xen/drivers/passthrough/iommu.c	Thu Mar 29 12:08:41 2012 +0100
@@ -57,8 +57,13 @@ DEFINE_PER_CPU(bool_t, iommu_dont_flush_
 static void __init parse_iommu_param(char *s)
 {
     char *ss;
+    int val;
 
     do {
+        val = !!strncmp(s, "no-", 3);
+        if ( !val )
+            s += 3;
+
         ss = strchr(s, ',');
         if ( ss )
             *ss = '\0';
@@ -66,27 +71,27 @@ static void __init parse_iommu_param(cha
         if ( !parse_bool(s) )
             iommu_enabled = 0;
         else if ( !strcmp(s, "force") || !strcmp(s, "required") )
-            force_iommu = 1;
+            force_iommu = val;
         else if ( !strcmp(s, "workaround_bios_bug") )
-            iommu_workaround_bios_bug = 1;
+            iommu_workaround_bios_bug = val;
         else if ( !strcmp(s, "verbose") )
-            iommu_verbose = 1;
-        else if ( !strcmp(s, "no-snoop") )
-            iommu_snoop = 0;
-        else if ( !strcmp(s, "no-qinval") )
-            iommu_qinval = 0;
-        else if ( !strcmp(s, "no-intremap") )
-            iommu_intremap = 0;
+            iommu_verbose = val;
+        else if ( !strcmp(s, "snoop") )
+            iommu_snoop = val;
+        else if ( !strcmp(s, "qinval") )
+            iommu_qinval = val;
+        else if ( !strcmp(s, "intremap") )
+            iommu_intremap = val;
         else if ( !strcmp(s, "debug") )
-            iommu_debug = 1;
+            iommu_debug = val;
         else if ( !strcmp(s, "amd-iommu-perdev-intremap") )
-            amd_iommu_perdev_intremap = 1;
+            amd_iommu_perdev_intremap = val;
         else if ( !strcmp(s, "dom0-passthrough") )
-            iommu_passthrough = 1;
+            iommu_passthrough = val;
         else if ( !strcmp(s, "dom0-strict") )
-            iommu_dom0_strict = 1;
+            iommu_dom0_strict = val;
         else if ( !strcmp(s, "sharept") )
-            iommu_hap_pt_share = 1;
+            iommu_hap_pt_share = val;
 
         s = ss + 1;
     } while ( ss );

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Mar 29 21:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Mar 2012 21: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 1SDMy1-0006OP-N7; Thu, 29 Mar 2012 21: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 1SDMy0-0006O3-Ie
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:12 +0000
Received: from [85.158.143.35:33415] by server-1.bemta-4.messagelabs.com id
	37/32-20925-715D47F4; Thu, 29 Mar 2012 21:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1333056789!7668878!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29043 invoked from network); 29 Mar 2012 21:33:10 -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;
	29 Mar 2012 21: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 1SDMxx-0003Vb-EN
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDMxx-0001tU-1O
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:09 +0000
Message-Id: <E1SDMxx-0001tU-1O@xenbits.xen.org>
Date: Thu, 29 Mar 2012 21:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm/p2m-pt: Clip mfn to allowable
	width when building a PTE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333016964 -3600
# Node ID 6be5875ce735c581769febadf94d38f9853b3fa8
# Parent  74d2af0b56ea7e6072bdfd6e493be5f108808bb7
x86/mm/p2m-pt: Clip mfn to allowable width when building a PTE

Otherwise, INVALID_MFN tramples over high order bits used for additional flags.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 74d2af0b56ea -r 6be5875ce735 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Wed Mar 28 16:59:02 2012 +0200
+++ b/xen/arch/x86/mm/p2m-pt.c	Thu Mar 29 11:29:24 2012 +0100
@@ -48,6 +48,13 @@
 #undef page_to_mfn
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
+/* We may store INVALID_MFN in l1 PTEs. We need to clip this
+ * to avoid trampling over higher-order bits (NX, p2m type, IOMMU flags).  We
+ * seem to not need to unclip on the return path, as callers are concerned only
+ * with p2m type in such cases. 
+ */
+#define p2m_l1e_from_pfn(pfn, flags)    \
+    l1e_from_pfn((pfn) & (PADDR_MASK >> PAGE_SHIFT), (flags))
 
 /* PTE flags for the various types of p2m entry */
 #define P2M_BASE_FLAGS \
@@ -385,8 +392,8 @@ p2m_set_entry(struct p2m_domain *p2m, un
         ASSERT(p2m_entry);
         
         if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct) )
-            entry_content = l1e_from_pfn(mfn_x(mfn),
-                                         p2m_type_to_flags(p2mt, mfn));
+            entry_content = p2m_l1e_from_pfn(mfn_x(mfn),
+                                             p2m_type_to_flags(p2mt, mfn));
         else
             entry_content = l1e_empty();
 
@@ -923,7 +930,7 @@ static void p2m_change_type_global(struc
                            * L2_PAGETABLE_ENTRIES) * L1_PAGETABLE_ENTRIES; 
                     /* create a new 1le entry with the new type */
                     flags = p2m_type_to_flags(nt, _mfn(mfn));
-                    l1e_content = l1e_from_pfn(mfn, flags);
+                    l1e_content = p2m_l1e_from_pfn(mfn, flags);
                     p2m->write_p2m_entry(p2m, gfn, &l1e[i1],
                                          l1mfn, l1e_content, 1);
                 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Mar 29 21:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Mar 2012 21: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 1SDMy1-0006OP-N7; Thu, 29 Mar 2012 21: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 1SDMy0-0006O3-Ie
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:12 +0000
Received: from [85.158.143.35:33415] by server-1.bemta-4.messagelabs.com id
	37/32-20925-715D47F4; Thu, 29 Mar 2012 21:33:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-2.tower-21.messagelabs.com!1333056789!7668878!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 29043 invoked from network); 29 Mar 2012 21:33:10 -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;
	29 Mar 2012 21: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 1SDMxx-0003Vb-EN
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDMxx-0001tU-1O
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:09 +0000
Message-Id: <E1SDMxx-0001tU-1O@xenbits.xen.org>
Date: Thu, 29 Mar 2012 21:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm/p2m-pt: Clip mfn to allowable
	width when building a PTE
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333016964 -3600
# Node ID 6be5875ce735c581769febadf94d38f9853b3fa8
# Parent  74d2af0b56ea7e6072bdfd6e493be5f108808bb7
x86/mm/p2m-pt: Clip mfn to allowable width when building a PTE

Otherwise, INVALID_MFN tramples over high order bits used for additional flags.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 74d2af0b56ea -r 6be5875ce735 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Wed Mar 28 16:59:02 2012 +0200
+++ b/xen/arch/x86/mm/p2m-pt.c	Thu Mar 29 11:29:24 2012 +0100
@@ -48,6 +48,13 @@
 #undef page_to_mfn
 #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg))
 
+/* We may store INVALID_MFN in l1 PTEs. We need to clip this
+ * to avoid trampling over higher-order bits (NX, p2m type, IOMMU flags).  We
+ * seem to not need to unclip on the return path, as callers are concerned only
+ * with p2m type in such cases. 
+ */
+#define p2m_l1e_from_pfn(pfn, flags)    \
+    l1e_from_pfn((pfn) & (PADDR_MASK >> PAGE_SHIFT), (flags))
 
 /* PTE flags for the various types of p2m entry */
 #define P2M_BASE_FLAGS \
@@ -385,8 +392,8 @@ p2m_set_entry(struct p2m_domain *p2m, un
         ASSERT(p2m_entry);
         
         if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct) )
-            entry_content = l1e_from_pfn(mfn_x(mfn),
-                                         p2m_type_to_flags(p2mt, mfn));
+            entry_content = p2m_l1e_from_pfn(mfn_x(mfn),
+                                             p2m_type_to_flags(p2mt, mfn));
         else
             entry_content = l1e_empty();
 
@@ -923,7 +930,7 @@ static void p2m_change_type_global(struc
                            * L2_PAGETABLE_ENTRIES) * L1_PAGETABLE_ENTRIES; 
                     /* create a new 1le entry with the new type */
                     flags = p2m_type_to_flags(nt, _mfn(mfn));
-                    l1e_content = l1e_from_pfn(mfn, flags);
+                    l1e_content = p2m_l1e_from_pfn(mfn, flags);
                     p2m->write_p2m_entry(p2m, gfn, &l1e[i1],
                                          l1mfn, l1e_content, 1);
                 }

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Mar 29 21:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Mar 2012 21: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 1SDMy2-0006Ol-SL; Thu, 29 Mar 2012 21:33:14 +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 1SDMy1-0006O8-8B
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:13 +0000
Received: from [193.109.254.147:2221] by server-4.bemta-14.messagelabs.com id
	41/29-11570-815D47F4; Thu, 29 Mar 2012 21:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1333056790!2643558!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11824 invoked from network); 29 Mar 2012 21:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Mar 2012 21:33: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 1SDMxy-0003Vh-E0
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDMxy-0001ty-5E
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:10 +0000
Message-Id: <E1SDMxy-0001ty-5E@xenbits.xen.org>
Date: Thu, 29 Mar 2012 21:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Make iommu passthrough and
	mem paging/sharing mutually exclusive
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333018893 -3600
# Node ID fb658789d83a47dd82e3b20b64b2aa8725447205
# Parent  d52833fd69f86226703cfbc0fc6265e9b65eb39f
x86/mm: Make iommu passthrough and mem paging/sharing mutually exclusive

Regardless of table sharing or processor vendor, these features cannot coexist
since iommu's don't expect gfn->mfn mappings to change, and sharing and paging
depend on trapping all accesses.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r d52833fd69f8 -r fb658789d83a xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 29 12:01:33 2012 +0100
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 29 12:01:33 2012 +0100
@@ -567,7 +567,11 @@ int mem_event_domctl(struct domain *d, x
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
                 break;
 
+            /* No paging if iommu is used */
             rc = -EXDEV;
+            if ( unlikely(need_iommu(d)) )
+                break;
+
             /* Disallow paging in a PoD guest */
             if ( p2m->pod.entry_count )
                 break;
diff -r d52833fd69f8 -r fb658789d83a xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Mar 29 12:01:33 2012 +0100
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Mar 29 12:01:33 2012 +0100
@@ -1205,8 +1205,11 @@ int mem_sharing_domctl(struct domain *d,
     {
         case XEN_DOMCTL_MEM_SHARING_CONTROL:
         {
-            d->arch.hvm_domain.mem_sharing_enabled = mec->u.enable;
             rc = 0;
+            if ( unlikely(need_iommu(d) && mec->u.enable) )
+                rc = -EXDEV;
+            else
+                d->arch.hvm_domain.mem_sharing_enabled = mec->u.enable;
         }
         break;
 
diff -r d52833fd69f8 -r fb658789d83a xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Thu Mar 29 12:01:33 2012 +0100
+++ b/xen/drivers/passthrough/iommu.c	Thu Mar 29 12:01:33 2012 +0100
@@ -205,6 +205,13 @@ static int assign_device(struct domain *
     if ( !iommu_enabled || !hd->platform_ops )
         return 0;
 
+    /* Prevent device assign if mem paging or mem sharing have been 
+     * enabled for this domain */
+    if ( unlikely(!need_iommu(d) &&
+            (d->arch.hvm_domain.mem_sharing_enabled ||
+             d->mem_event->paging.ring_page)) )
+        return -EXDEV;
+
     spin_lock(&pcidevs_lock);
     if ( (rc = hd->platform_ops->assign_device(d, seg, bus, devfn)) )
         goto done;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Mar 29 21:33:18 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Mar 2012 21: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 1SDMy2-0006Ol-SL; Thu, 29 Mar 2012 21:33:14 +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 1SDMy1-0006O8-8B
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:13 +0000
Received: from [193.109.254.147:2221] by server-4.bemta-14.messagelabs.com id
	41/29-11570-815D47F4; Thu, 29 Mar 2012 21:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-27.messagelabs.com!1333056790!2643558!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 11824 invoked from network); 29 Mar 2012 21:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-27.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Mar 2012 21:33: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 1SDMxy-0003Vh-E0
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDMxy-0001ty-5E
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:10 +0000
Message-Id: <E1SDMxy-0001ty-5E@xenbits.xen.org>
Date: Thu, 29 Mar 2012 21:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Make iommu passthrough and
	mem paging/sharing mutually exclusive
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333018893 -3600
# Node ID fb658789d83a47dd82e3b20b64b2aa8725447205
# Parent  d52833fd69f86226703cfbc0fc6265e9b65eb39f
x86/mm: Make iommu passthrough and mem paging/sharing mutually exclusive

Regardless of table sharing or processor vendor, these features cannot coexist
since iommu's don't expect gfn->mfn mappings to change, and sharing and paging
depend on trapping all accesses.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r d52833fd69f8 -r fb658789d83a xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 29 12:01:33 2012 +0100
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 29 12:01:33 2012 +0100
@@ -567,7 +567,11 @@ int mem_event_domctl(struct domain *d, x
             if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
                 break;
 
+            /* No paging if iommu is used */
             rc = -EXDEV;
+            if ( unlikely(need_iommu(d)) )
+                break;
+
             /* Disallow paging in a PoD guest */
             if ( p2m->pod.entry_count )
                 break;
diff -r d52833fd69f8 -r fb658789d83a xen/arch/x86/mm/mem_sharing.c
--- a/xen/arch/x86/mm/mem_sharing.c	Thu Mar 29 12:01:33 2012 +0100
+++ b/xen/arch/x86/mm/mem_sharing.c	Thu Mar 29 12:01:33 2012 +0100
@@ -1205,8 +1205,11 @@ int mem_sharing_domctl(struct domain *d,
     {
         case XEN_DOMCTL_MEM_SHARING_CONTROL:
         {
-            d->arch.hvm_domain.mem_sharing_enabled = mec->u.enable;
             rc = 0;
+            if ( unlikely(need_iommu(d) && mec->u.enable) )
+                rc = -EXDEV;
+            else
+                d->arch.hvm_domain.mem_sharing_enabled = mec->u.enable;
         }
         break;
 
diff -r d52833fd69f8 -r fb658789d83a xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c	Thu Mar 29 12:01:33 2012 +0100
+++ b/xen/drivers/passthrough/iommu.c	Thu Mar 29 12:01:33 2012 +0100
@@ -205,6 +205,13 @@ static int assign_device(struct domain *
     if ( !iommu_enabled || !hd->platform_ops )
         return 0;
 
+    /* Prevent device assign if mem paging or mem sharing have been 
+     * enabled for this domain */
+    if ( unlikely(!need_iommu(d) &&
+            (d->arch.hvm_domain.mem_sharing_enabled ||
+             d->mem_event->paging.ring_page)) )
+        return -EXDEV;
+
     spin_lock(&pcidevs_lock);
     if ( (rc = hd->platform_ops->assign_device(d, seg, bus, devfn)) )
         goto done;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Mar 29 21:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Mar 2012 21:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDMy2-0006Og-Pf; Thu, 29 Mar 2012 21:33: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 1SDMy1-0006O3-4Y
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:13 +0000
Received: from [85.158.143.35:24547] by server-1.bemta-4.messagelabs.com id
	B7/32-20925-815D47F4; Thu, 29 Mar 2012 21:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1333056790!14327241!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13174 invoked from network); 29 Mar 2012 21:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Mar 2012 21:33: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 1SDMxx-0003Ve-Vo
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDMxx-0001tj-KF
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:09 +0000
Message-Id: <E1SDMxx-0001tj-KF@xenbits.xen.org>
Date: Thu, 29 Mar 2012 21:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Teach paging to page
	table-based p2m
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333018893 -3600
# Node ID d52833fd69f86226703cfbc0fc6265e9b65eb39f
# Parent  6be5875ce735c581769febadf94d38f9853b3fa8
x86/mm: Teach paging to page table-based p2m

The p2m-pt.c code, used by both shadow and AMD NPT modes, was not aware of
paging types, and the implications those types have on p2m entries. Add support
to the page table-based p2m to understand the paging types. This is a necessary
step towards enabling memory paging on AMD NPT mode, but not yet the full
solution.

Tested not to break neither shadow mode nor "normal" (i.e. no paging) AMD NPT
mode.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 6be5875ce735 -r d52833fd69f8 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Thu Mar 29 11:29:24 2012 +0100
+++ b/xen/arch/x86/mm/p2m-pt.c	Thu Mar 29 12:01:33 2012 +0100
@@ -84,6 +84,9 @@ static unsigned long p2m_type_to_flags(p
     case p2m_invalid:
     case p2m_mmio_dm:
     case p2m_populate_on_demand:
+    case p2m_ram_paging_out:
+    case p2m_ram_paged:
+    case p2m_ram_paging_in:
     default:
         return flags;
     case p2m_ram_ro:
@@ -175,7 +178,7 @@ p2m_next_level(struct p2m_domain *p2m, m
                                       shift, max)) )
         return 0;
 
-    /* PoD: Not present doesn't imply empty. */
+    /* PoD/paging: Not present doesn't imply empty. */
     if ( !l1e_get_flags(*p2m_entry) )
     {
         struct page_info *pg;
@@ -391,7 +394,8 @@ p2m_set_entry(struct p2m_domain *p2m, un
                                    0, L1_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
         
-        if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct) )
+        if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct)
+                            || p2m_is_paging(p2mt) )
             entry_content = p2m_l1e_from_pfn(mfn_x(mfn),
                                              p2m_type_to_flags(p2mt, mfn));
         else
@@ -622,11 +626,12 @@ pod_retry_l1:
                            sizeof(l1e));
             
     if ( ret == 0 ) {
+        unsigned long l1e_mfn = l1e_get_pfn(l1e);
         p2mt = p2m_flags_to_type(l1e_get_flags(l1e));
-        ASSERT(l1e_get_pfn(l1e) != INVALID_MFN || !p2m_is_ram(p2mt));
+        ASSERT( mfn_valid(_mfn(l1e_mfn)) || !p2m_is_ram(p2mt) ||
+                p2m_is_paging(p2mt) );
 
-        if ( p2m_flags_to_type(l1e_get_flags(l1e))
-             == p2m_populate_on_demand )
+        if ( p2mt == p2m_populate_on_demand )
         {
             /* The read has succeeded, so we know that the mapping
              * exits at this point.  */
@@ -648,7 +653,7 @@ pod_retry_l1:
         }
 
         if ( p2m_is_valid(p2mt) || p2m_is_grant(p2mt) )
-            mfn = _mfn(l1e_get_pfn(l1e));
+            mfn = _mfn(l1e_mfn);
         else 
             /* XXX see above */
             p2mt = p2m_mmio_dm;
@@ -670,6 +675,8 @@ p2m_gfn_to_mfn(struct p2m_domain *p2m, u
     paddr_t addr = ((paddr_t)gfn) << PAGE_SHIFT;
     l2_pgentry_t *l2e;
     l1_pgentry_t *l1e;
+    unsigned long l1e_flags;
+    p2m_type_t l1t;
 
     ASSERT(paging_mode_translate(p2m->domain));
 
@@ -788,10 +795,12 @@ pod_retry_l2:
     l1e = map_domain_page(mfn_x(mfn));
     l1e += l1_table_offset(addr);
 pod_retry_l1:
-    if ( (l1e_get_flags(*l1e) & _PAGE_PRESENT) == 0 )
+    l1e_flags = l1e_get_flags(*l1e);
+    l1t = p2m_flags_to_type(l1e_flags);
+    if ( ((l1e_flags & _PAGE_PRESENT) == 0) && (!p2m_is_paging(l1t)) )
     {
         /* PoD: Try to populate */
-        if ( p2m_flags_to_type(l1e_get_flags(*l1e)) == p2m_populate_on_demand )
+        if ( l1t == p2m_populate_on_demand )
         {
             if ( q & P2M_ALLOC ) {
                 if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_4K, q) )
@@ -804,10 +813,10 @@ pod_retry_l1:
         return _mfn(INVALID_MFN);
     }
     mfn = _mfn(l1e_get_pfn(*l1e));
-    *t = p2m_flags_to_type(l1e_get_flags(*l1e));
+    *t = l1t;
     unmap_domain_page(l1e);
 
-    ASSERT(mfn_valid(mfn) || !p2m_is_ram(*t));
+    ASSERT(mfn_valid(mfn) || !p2m_is_ram(*t) || p2m_is_paging(*t));
     if ( page_order )
         *page_order = PAGE_ORDER_4K;
     return (p2m_is_valid(*t) || p2m_is_grant(*t)) ? mfn : _mfn(INVALID_MFN);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Thu Mar 29 21:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Thu, 29 Mar 2012 21:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDMy2-0006Og-Pf; Thu, 29 Mar 2012 21:33: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 1SDMy1-0006O3-4Y
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:13 +0000
Received: from [85.158.143.35:24547] by server-1.bemta-4.messagelabs.com id
	B7/32-20925-815D47F4; Thu, 29 Mar 2012 21:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1333056790!14327241!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 13174 invoked from network); 29 Mar 2012 21:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	29 Mar 2012 21:33: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 1SDMxx-0003Ve-Vo
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDMxx-0001tj-KF
	for xen-changelog@lists.xensource.com; Thu, 29 Mar 2012 21:33:09 +0000
Message-Id: <E1SDMxx-0001tj-KF@xenbits.xen.org>
Date: Thu, 29 Mar 2012 21:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: Teach paging to page
	table-based p2m
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333018893 -3600
# Node ID d52833fd69f86226703cfbc0fc6265e9b65eb39f
# Parent  6be5875ce735c581769febadf94d38f9853b3fa8
x86/mm: Teach paging to page table-based p2m

The p2m-pt.c code, used by both shadow and AMD NPT modes, was not aware of
paging types, and the implications those types have on p2m entries. Add support
to the page table-based p2m to understand the paging types. This is a necessary
step towards enabling memory paging on AMD NPT mode, but not yet the full
solution.

Tested not to break neither shadow mode nor "normal" (i.e. no paging) AMD NPT
mode.

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavilla.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r 6be5875ce735 -r d52833fd69f8 xen/arch/x86/mm/p2m-pt.c
--- a/xen/arch/x86/mm/p2m-pt.c	Thu Mar 29 11:29:24 2012 +0100
+++ b/xen/arch/x86/mm/p2m-pt.c	Thu Mar 29 12:01:33 2012 +0100
@@ -84,6 +84,9 @@ static unsigned long p2m_type_to_flags(p
     case p2m_invalid:
     case p2m_mmio_dm:
     case p2m_populate_on_demand:
+    case p2m_ram_paging_out:
+    case p2m_ram_paged:
+    case p2m_ram_paging_in:
     default:
         return flags;
     case p2m_ram_ro:
@@ -175,7 +178,7 @@ p2m_next_level(struct p2m_domain *p2m, m
                                       shift, max)) )
         return 0;
 
-    /* PoD: Not present doesn't imply empty. */
+    /* PoD/paging: Not present doesn't imply empty. */
     if ( !l1e_get_flags(*p2m_entry) )
     {
         struct page_info *pg;
@@ -391,7 +394,8 @@ p2m_set_entry(struct p2m_domain *p2m, un
                                    0, L1_PAGETABLE_ENTRIES);
         ASSERT(p2m_entry);
         
-        if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct) )
+        if ( mfn_valid(mfn) || (p2mt == p2m_mmio_direct)
+                            || p2m_is_paging(p2mt) )
             entry_content = p2m_l1e_from_pfn(mfn_x(mfn),
                                              p2m_type_to_flags(p2mt, mfn));
         else
@@ -622,11 +626,12 @@ pod_retry_l1:
                            sizeof(l1e));
             
     if ( ret == 0 ) {
+        unsigned long l1e_mfn = l1e_get_pfn(l1e);
         p2mt = p2m_flags_to_type(l1e_get_flags(l1e));
-        ASSERT(l1e_get_pfn(l1e) != INVALID_MFN || !p2m_is_ram(p2mt));
+        ASSERT( mfn_valid(_mfn(l1e_mfn)) || !p2m_is_ram(p2mt) ||
+                p2m_is_paging(p2mt) );
 
-        if ( p2m_flags_to_type(l1e_get_flags(l1e))
-             == p2m_populate_on_demand )
+        if ( p2mt == p2m_populate_on_demand )
         {
             /* The read has succeeded, so we know that the mapping
              * exits at this point.  */
@@ -648,7 +653,7 @@ pod_retry_l1:
         }
 
         if ( p2m_is_valid(p2mt) || p2m_is_grant(p2mt) )
-            mfn = _mfn(l1e_get_pfn(l1e));
+            mfn = _mfn(l1e_mfn);
         else 
             /* XXX see above */
             p2mt = p2m_mmio_dm;
@@ -670,6 +675,8 @@ p2m_gfn_to_mfn(struct p2m_domain *p2m, u
     paddr_t addr = ((paddr_t)gfn) << PAGE_SHIFT;
     l2_pgentry_t *l2e;
     l1_pgentry_t *l1e;
+    unsigned long l1e_flags;
+    p2m_type_t l1t;
 
     ASSERT(paging_mode_translate(p2m->domain));
 
@@ -788,10 +795,12 @@ pod_retry_l2:
     l1e = map_domain_page(mfn_x(mfn));
     l1e += l1_table_offset(addr);
 pod_retry_l1:
-    if ( (l1e_get_flags(*l1e) & _PAGE_PRESENT) == 0 )
+    l1e_flags = l1e_get_flags(*l1e);
+    l1t = p2m_flags_to_type(l1e_flags);
+    if ( ((l1e_flags & _PAGE_PRESENT) == 0) && (!p2m_is_paging(l1t)) )
     {
         /* PoD: Try to populate */
-        if ( p2m_flags_to_type(l1e_get_flags(*l1e)) == p2m_populate_on_demand )
+        if ( l1t == p2m_populate_on_demand )
         {
             if ( q & P2M_ALLOC ) {
                 if ( !p2m_pod_demand_populate(p2m, gfn, PAGE_ORDER_4K, q) )
@@ -804,10 +813,10 @@ pod_retry_l1:
         return _mfn(INVALID_MFN);
     }
     mfn = _mfn(l1e_get_pfn(*l1e));
-    *t = p2m_flags_to_type(l1e_get_flags(*l1e));
+    *t = l1t;
     unmap_domain_page(l1e);
 
-    ASSERT(mfn_valid(mfn) || !p2m_is_ram(*t));
+    ASSERT(mfn_valid(mfn) || !p2m_is_ram(*t) || p2m_is_paging(*t));
     if ( page_order )
         *page_order = PAGE_ORDER_4K;
     return (p2m_is_valid(*t) || p2m_is_grant(*t)) ? mfn : _mfn(INVALID_MFN);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Mar 30 11:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Mar 2012 11:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDaQF-0005wu-Cv; Fri, 30 Mar 2012 11: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 1SDaQE-0005wm-Sk
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:14 +0000
Received: from [85.158.143.99:5183] by server-3.bemta-4.messagelabs.com id
	B1/2A-05853-22F957F4; Fri, 30 Mar 2012 11:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1333108511!21533029!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5189 invoked from network); 30 Mar 2012 11:55: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;
	30 Mar 2012 11: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 1SDaQB-0006Nm-32
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDaQA-0005vZ-Om
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:10 +0000
Message-Id: <E1SDaQA-0005vZ-Om@xenbits.xen.org>
Date: Fri, 30 Mar 2012 11:55:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86,
	hvm: enable VCPUOP_register_vcpu_info op in hvm hypercall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Zhenzhong Duan <zhenzhong.duan@oracle.com>
# Date 1333012858 -3600
# Node ID 13741fd6253bd74abd8fe6253838327745f23806
# Parent  c7729c73fefc776e82f574df445289cd6c6e0077
x86,hvm: enable VCPUOP_register_vcpu_info op in hvm hypercall

pvhvm running with more than 32 vcpus and pv_irq/pv_time enabled
need vcpu placement to work, or else it will softlockup.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24013:c4ed56a102dc
xen-unstable date:        Fri Oct 28 17:20:21 2011 +0100
---


diff -r c7729c73fefc -r 13741fd6253b xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 29 10:19:56 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Thu Mar 29 10:20:58 2012 +0100
@@ -2586,6 +2586,7 @@ static long hvm_vcpu_op(
     case VCPUOP_stop_periodic_timer:
     case VCPUOP_set_singleshot_timer:
     case VCPUOP_stop_singleshot_timer:
+    case VCPUOP_register_vcpu_info:
         rc = do_vcpu_op(cmd, vcpuid, arg);
         break;
     default:
@@ -2651,6 +2652,7 @@ static long hvm_vcpu_op_compat32(
     case VCPUOP_stop_periodic_timer:
     case VCPUOP_set_singleshot_timer:
     case VCPUOP_stop_singleshot_timer:
+    case VCPUOP_register_vcpu_info:
         rc = compat_vcpu_op(cmd, vcpuid, arg);
         break;
     default:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Mar 30 11:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Mar 2012 11:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDaQF-0005wu-Cv; Fri, 30 Mar 2012 11: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 1SDaQE-0005wm-Sk
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:14 +0000
Received: from [85.158.143.99:5183] by server-3.bemta-4.messagelabs.com id
	B1/2A-05853-22F957F4; Fri, 30 Mar 2012 11:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-6.tower-216.messagelabs.com!1333108511!21533029!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 5189 invoked from network); 30 Mar 2012 11:55: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;
	30 Mar 2012 11: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 1SDaQB-0006Nm-32
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDaQA-0005vZ-Om
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:10 +0000
Message-Id: <E1SDaQA-0005vZ-Om@xenbits.xen.org>
Date: Fri, 30 Mar 2012 11:55:10 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86,
	hvm: enable VCPUOP_register_vcpu_info op in hvm hypercall
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Zhenzhong Duan <zhenzhong.duan@oracle.com>
# Date 1333012858 -3600
# Node ID 13741fd6253bd74abd8fe6253838327745f23806
# Parent  c7729c73fefc776e82f574df445289cd6c6e0077
x86,hvm: enable VCPUOP_register_vcpu_info op in hvm hypercall

pvhvm running with more than 32 vcpus and pv_irq/pv_time enabled
need vcpu placement to work, or else it will softlockup.

Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24013:c4ed56a102dc
xen-unstable date:        Fri Oct 28 17:20:21 2011 +0100
---


diff -r c7729c73fefc -r 13741fd6253b xen/arch/x86/hvm/hvm.c
--- a/xen/arch/x86/hvm/hvm.c	Thu Mar 29 10:19:56 2012 +0100
+++ b/xen/arch/x86/hvm/hvm.c	Thu Mar 29 10:20:58 2012 +0100
@@ -2586,6 +2586,7 @@ static long hvm_vcpu_op(
     case VCPUOP_stop_periodic_timer:
     case VCPUOP_set_singleshot_timer:
     case VCPUOP_stop_singleshot_timer:
+    case VCPUOP_register_vcpu_info:
         rc = do_vcpu_op(cmd, vcpuid, arg);
         break;
     default:
@@ -2651,6 +2652,7 @@ static long hvm_vcpu_op_compat32(
     case VCPUOP_stop_periodic_timer:
     case VCPUOP_set_singleshot_timer:
     case VCPUOP_stop_singleshot_timer:
+    case VCPUOP_register_vcpu_info:
         rc = compat_vcpu_op(cmd, vcpuid, arg);
         break;
     default:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Mar 30 11:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Mar 2012 11:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDaQG-0005x8-FY; Fri, 30 Mar 2012 11: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 1SDaQF-0005wn-8L
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:15 +0000
Received: from [85.158.138.51:51106] by server-12.bemta-3.messagelabs.com id
	B4/E2-30663-22F957F4; Fri, 30 Mar 2012 11:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1333108512!15842392!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12493 invoked from network); 30 Mar 2012 11:55:13 -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;
	30 Mar 2012 11: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 1SDaQB-0006Np-Oq
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDaQB-0005vo-Lm
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:11 +0000
Message-Id: <E1SDaQB-0005vo-Lm@xenbits.xen.org>
Date: Fri, 30 Mar 2012 11: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] Fix backport of
	23225:3f00c5faa12a.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
# Date 1333038709 -3600
# Node ID 54b4ae0dfb60c635001f56916de2de552b1c1072
# Parent  13741fd6253bd74abd8fe6253838327745f23806
Fix backport of 23225:3f00c5faa12a.

From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 13741fd6253b -r 54b4ae0dfb60 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Thu Mar 29 10:20:58 2012 +0100
+++ b/xen/arch/x86/domain.c	Thu Mar 29 17:31:49 2012 +0100
@@ -558,9 +558,9 @@ int arch_domain_create(struct domain *d,
         d->arch.is_32bit_pv = d->arch.has_32bit_shinfo =
             (CONFIG_PAGING_LEVELS != 4);
 
-        spin_lock_init(&d->arch.e820_lock);
     }
 
+    spin_lock_init(&d->arch.e820_lock);
     memset(d->arch.cpuids, 0, sizeof(d->arch.cpuids));
     for ( i = 0; i < MAX_CPUID_INPUT; i++ )
     {
@@ -605,8 +605,8 @@ void arch_domain_destroy(struct domain *
 
     if ( is_hvm_domain(d) )
         hvm_domain_destroy(d);
-    else
-        xfree(d->arch.e820);
+
+    xfree(d->arch.e820);
 
     vmce_destroy_msr(d);
     free_domain_pirqs(d);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Mar 30 11:55:22 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Mar 2012 11:55:22 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDaQG-0005x8-FY; Fri, 30 Mar 2012 11: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 1SDaQF-0005wn-8L
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:15 +0000
Received: from [85.158.138.51:51106] by server-12.bemta-3.messagelabs.com id
	B4/E2-30663-22F957F4; Fri, 30 Mar 2012 11:55:14 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-7.tower-174.messagelabs.com!1333108512!15842392!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 12493 invoked from network); 30 Mar 2012 11:55:13 -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;
	30 Mar 2012 11: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 1SDaQB-0006Np-Oq
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:11 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDaQB-0005vo-Lm
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:11 +0000
Message-Id: <E1SDaQB-0005vo-Lm@xenbits.xen.org>
Date: Fri, 30 Mar 2012 11: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] Fix backport of
	23225:3f00c5faa12a.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
# Date 1333038709 -3600
# Node ID 54b4ae0dfb60c635001f56916de2de552b1c1072
# Parent  13741fd6253bd74abd8fe6253838327745f23806
Fix backport of 23225:3f00c5faa12a.

From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 13741fd6253b -r 54b4ae0dfb60 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Thu Mar 29 10:20:58 2012 +0100
+++ b/xen/arch/x86/domain.c	Thu Mar 29 17:31:49 2012 +0100
@@ -558,9 +558,9 @@ int arch_domain_create(struct domain *d,
         d->arch.is_32bit_pv = d->arch.has_32bit_shinfo =
             (CONFIG_PAGING_LEVELS != 4);
 
-        spin_lock_init(&d->arch.e820_lock);
     }
 
+    spin_lock_init(&d->arch.e820_lock);
     memset(d->arch.cpuids, 0, sizeof(d->arch.cpuids));
     for ( i = 0; i < MAX_CPUID_INPUT; i++ )
     {
@@ -605,8 +605,8 @@ void arch_domain_destroy(struct domain *
 
     if ( is_hvm_domain(d) )
         hvm_domain_destroy(d);
-    else
-        xfree(d->arch.e820);
+
+    xfree(d->arch.e820);
 
     vmce_destroy_msr(d);
     free_domain_pirqs(d);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Mar 30 11:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Mar 2012 11: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 1SDaQG-0005xD-I2; Fri, 30 Mar 2012 11: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 1SDaQF-0005ws-Ly
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:15 +0000
Received: from [85.158.143.35:31515] by server-1.bemta-4.messagelabs.com id
	6E/1E-20925-32F957F4; Fri, 30 Mar 2012 11:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1333108510!14420778!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10413 invoked from network); 30 Mar 2012 11:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Mar 2012 11: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 1SDaQA-0006Nj-Ga
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDaQ9-0005vK-Vf
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:10 +0000
Message-Id: <E1SDaQ9-0005vK-Vf@xenbits.xen.org>
Date: Fri, 30 Mar 2012 11:55:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: make the pv-only e820 array
	be dynamic.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
# Date 1333012796 -3600
# Node ID c7729c73fefc776e82f574df445289cd6c6e0077
# Parent  d67e4d12723f26bd12a787f998718d535ca07098
x86: make the pv-only e820 array be dynamic.

During creation of the PV domain we allocate the E820 structure to
have the amount of E820 entries on the machine, plus the number three.

This will allow the tool stack to fill the E820 with more than three
entries. Specifically the use cases is , where the toolstack retrieves
the E820, sanitizes it, and then sets it for the PV guest (for PCI
passthrough), this dynamic number of E820 is just right.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23225:3f00c5faa12a
xen-unstable date:        Wed Apr 13 16:10:26 2011 +0100
---


diff -r d67e4d12723f -r c7729c73fefc xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Fri Mar 23 14:01:05 2012 +0000
+++ b/xen/arch/x86/domain.c	Thu Mar 29 10:19:56 2012 +0100
@@ -557,6 +557,8 @@ int arch_domain_create(struct domain *d,
         /* 32-bit PV guest by default only if Xen is not 64-bit. */
         d->arch.is_32bit_pv = d->arch.has_32bit_shinfo =
             (CONFIG_PAGING_LEVELS != 4);
+
+        spin_lock_init(&d->arch.e820_lock);
     }
 
     memset(d->arch.cpuids, 0, sizeof(d->arch.cpuids));
@@ -603,6 +605,8 @@ void arch_domain_destroy(struct domain *
 
     if ( is_hvm_domain(d) )
         hvm_domain_destroy(d);
+    else
+        xfree(d->arch.e820);
 
     vmce_destroy_msr(d);
     free_domain_pirqs(d);
diff -r d67e4d12723f -r c7729c73fefc xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Mar 23 14:01:05 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Mar 29 10:19:56 2012 +0100
@@ -99,6 +99,7 @@
 #include <xen/event.h>
 #include <xen/iocap.h>
 #include <xen/guest_access.h>
+#include <xen/xmalloc.h>
 #include <asm/paging.h>
 #include <asm/shadow.h>
 #include <asm/page.h>
@@ -4667,11 +4668,12 @@ long arch_memory_op(int op, XEN_GUEST_HA
     {
         struct xen_foreign_memory_map fmap;
         struct domain *d;
+        struct e820entry *e820;
 
         if ( copy_from_guest(&fmap, arg, 1) )
             return -EFAULT;
 
-        if ( fmap.map.nr_entries > ARRAY_SIZE(d->arch.e820) )
+        if ( fmap.map.nr_entries > E820MAX )
             return -EINVAL;
 
         rc = rcu_lock_target_domain_by_id(fmap.domid, &d);
@@ -4685,9 +4687,25 @@ long arch_memory_op(int op, XEN_GUEST_HA
             return rc;
         }
 
-        rc = copy_from_guest(d->arch.e820, fmap.map.buffer,
-                             fmap.map.nr_entries) ? -EFAULT : 0;
+        e820 = xmalloc_array(e820entry_t, fmap.map.nr_entries);
+        if ( e820 == NULL )
+        {
+            rcu_unlock_domain(d);
+            return -ENOMEM;
+        }
+
+        if ( copy_from_guest(e820, fmap.map.buffer, fmap.map.nr_entries) )
+        {
+            xfree(e820);
+            rcu_unlock_domain(d);
+            return -EFAULT;
+        }
+
+        spin_lock(&d->arch.e820_lock);
+        xfree(d->arch.e820);
+        d->arch.e820 = e820;
         d->arch.nr_e820 = fmap.map.nr_entries;
+	spin_unlock(&d->arch.e820_lock);
 
         rcu_unlock_domain(d);
         return rc;
@@ -4698,18 +4716,28 @@ long arch_memory_op(int op, XEN_GUEST_HA
         struct xen_memory_map map;
         struct domain *d = current->domain;
 
-        /* Backwards compatibility. */
-        if ( d->arch.nr_e820 == 0 )
-            return -ENOSYS;
-
         if ( copy_from_guest(&map, arg, 1) )
             return -EFAULT;
 
+        spin_lock(&d->arch.e820_lock);
+
+        /* Backwards compatibility. */
+        if ( (d->arch.nr_e820 == 0) ||
+             (d->arch.e820 == NULL) )
+        {
+            spin_unlock(&d->arch.e820_lock);
+            return -ENOSYS;
+        }
+
         map.nr_entries = min(map.nr_entries, d->arch.nr_e820);
         if ( copy_to_guest(map.buffer, d->arch.e820, map.nr_entries) ||
              copy_to_guest(arg, &map, 1) )
+        {
+            spin_unlock(&d->arch.e820_lock);
             return -EFAULT;
-
+        }
+
+        spin_unlock(&d->arch.e820_lock);
         return 0;
     }
 
diff -r d67e4d12723f -r c7729c73fefc xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h	Fri Mar 23 14:01:05 2012 +0000
+++ b/xen/include/asm-x86/domain.h	Thu Mar 29 10:19:56 2012 +0100
@@ -270,7 +270,8 @@ struct arch_domain
     unsigned long pirq_eoi_map_mfn;
 
     /* Pseudophysical e820 map (XENMEM_memory_map).  */
-    struct e820entry e820[3];
+    spinlock_t e820_lock;
+    struct e820entry *e820;
     unsigned int nr_e820;
 
     /* Maximum physical-address bitwidth supported by this guest. */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Mar 30 11:55:24 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Mar 2012 11: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 1SDaQG-0005xD-I2; Fri, 30 Mar 2012 11: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 1SDaQF-0005ws-Ly
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:15 +0000
Received: from [85.158.143.35:31515] by server-1.bemta-4.messagelabs.com id
	6E/1E-20925-32F957F4; Fri, 30 Mar 2012 11:55:15 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-8.tower-21.messagelabs.com!1333108510!14420778!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10413 invoked from network); 30 Mar 2012 11:55:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-8.tower-21.messagelabs.com with AES256-SHA encrypted SMTP;
	30 Mar 2012 11: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 1SDaQA-0006Nj-Ga
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDaQ9-0005vK-Vf
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 11:55:10 +0000
Message-Id: <E1SDaQ9-0005vK-Vf@xenbits.xen.org>
Date: Fri, 30 Mar 2012 11:55:09 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] x86: make the pv-only e820 array
	be dynamic.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-changelog-bounces@lists.xen.org
Errors-To: xen-changelog-bounces@lists.xen.org

# HG changeset patch
# User Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
# Date 1333012796 -3600
# Node ID c7729c73fefc776e82f574df445289cd6c6e0077
# Parent  d67e4d12723f26bd12a787f998718d535ca07098
x86: make the pv-only e820 array be dynamic.

During creation of the PV domain we allocate the E820 structure to
have the amount of E820 entries on the machine, plus the number three.

This will allow the tool stack to fill the E820 with more than three
entries. Specifically the use cases is , where the toolstack retrieves
the E820, sanitizes it, and then sets it for the PV guest (for PCI
passthrough), this dynamic number of E820 is just right.

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   23225:3f00c5faa12a
xen-unstable date:        Wed Apr 13 16:10:26 2011 +0100
---


diff -r d67e4d12723f -r c7729c73fefc xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Fri Mar 23 14:01:05 2012 +0000
+++ b/xen/arch/x86/domain.c	Thu Mar 29 10:19:56 2012 +0100
@@ -557,6 +557,8 @@ int arch_domain_create(struct domain *d,
         /* 32-bit PV guest by default only if Xen is not 64-bit. */
         d->arch.is_32bit_pv = d->arch.has_32bit_shinfo =
             (CONFIG_PAGING_LEVELS != 4);
+
+        spin_lock_init(&d->arch.e820_lock);
     }
 
     memset(d->arch.cpuids, 0, sizeof(d->arch.cpuids));
@@ -603,6 +605,8 @@ void arch_domain_destroy(struct domain *
 
     if ( is_hvm_domain(d) )
         hvm_domain_destroy(d);
+    else
+        xfree(d->arch.e820);
 
     vmce_destroy_msr(d);
     free_domain_pirqs(d);
diff -r d67e4d12723f -r c7729c73fefc xen/arch/x86/mm.c
--- a/xen/arch/x86/mm.c	Fri Mar 23 14:01:05 2012 +0000
+++ b/xen/arch/x86/mm.c	Thu Mar 29 10:19:56 2012 +0100
@@ -99,6 +99,7 @@
 #include <xen/event.h>
 #include <xen/iocap.h>
 #include <xen/guest_access.h>
+#include <xen/xmalloc.h>
 #include <asm/paging.h>
 #include <asm/shadow.h>
 #include <asm/page.h>
@@ -4667,11 +4668,12 @@ long arch_memory_op(int op, XEN_GUEST_HA
     {
         struct xen_foreign_memory_map fmap;
         struct domain *d;
+        struct e820entry *e820;
 
         if ( copy_from_guest(&fmap, arg, 1) )
             return -EFAULT;
 
-        if ( fmap.map.nr_entries > ARRAY_SIZE(d->arch.e820) )
+        if ( fmap.map.nr_entries > E820MAX )
             return -EINVAL;
 
         rc = rcu_lock_target_domain_by_id(fmap.domid, &d);
@@ -4685,9 +4687,25 @@ long arch_memory_op(int op, XEN_GUEST_HA
             return rc;
         }
 
-        rc = copy_from_guest(d->arch.e820, fmap.map.buffer,
-                             fmap.map.nr_entries) ? -EFAULT : 0;
+        e820 = xmalloc_array(e820entry_t, fmap.map.nr_entries);
+        if ( e820 == NULL )
+        {
+            rcu_unlock_domain(d);
+            return -ENOMEM;
+        }
+
+        if ( copy_from_guest(e820, fmap.map.buffer, fmap.map.nr_entries) )
+        {
+            xfree(e820);
+            rcu_unlock_domain(d);
+            return -EFAULT;
+        }
+
+        spin_lock(&d->arch.e820_lock);
+        xfree(d->arch.e820);
+        d->arch.e820 = e820;
         d->arch.nr_e820 = fmap.map.nr_entries;
+	spin_unlock(&d->arch.e820_lock);
 
         rcu_unlock_domain(d);
         return rc;
@@ -4698,18 +4716,28 @@ long arch_memory_op(int op, XEN_GUEST_HA
         struct xen_memory_map map;
         struct domain *d = current->domain;
 
-        /* Backwards compatibility. */
-        if ( d->arch.nr_e820 == 0 )
-            return -ENOSYS;
-
         if ( copy_from_guest(&map, arg, 1) )
             return -EFAULT;
 
+        spin_lock(&d->arch.e820_lock);
+
+        /* Backwards compatibility. */
+        if ( (d->arch.nr_e820 == 0) ||
+             (d->arch.e820 == NULL) )
+        {
+            spin_unlock(&d->arch.e820_lock);
+            return -ENOSYS;
+        }
+
         map.nr_entries = min(map.nr_entries, d->arch.nr_e820);
         if ( copy_to_guest(map.buffer, d->arch.e820, map.nr_entries) ||
              copy_to_guest(arg, &map, 1) )
+        {
+            spin_unlock(&d->arch.e820_lock);
             return -EFAULT;
-
+        }
+
+        spin_unlock(&d->arch.e820_lock);
         return 0;
     }
 
diff -r d67e4d12723f -r c7729c73fefc xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h	Fri Mar 23 14:01:05 2012 +0000
+++ b/xen/include/asm-x86/domain.h	Thu Mar 29 10:19:56 2012 +0100
@@ -270,7 +270,8 @@ struct arch_domain
     unsigned long pirq_eoi_map_mfn;
 
     /* Pseudophysical e820 map (XENMEM_memory_map).  */
-    struct e820entry e820[3];
+    spinlock_t e820_lock;
+    struct e820entry *e820;
     unsigned int nr_e820;
 
     /* Maximum physical-address bitwidth supported by this guest. */

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Mar 30 14:22:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Mar 2012 14: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 1SDciS-000192-Sm; Fri, 30 Mar 2012 14: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 1SDciR-00018t-Mh
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 14:22:11 +0000
Received: from [85.158.139.83:17645] by server-5.bemta-5.messagelabs.com id
	48/60-13566-291C57F4; Fri, 30 Mar 2012 14:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1333117328!21079589!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25555 invoked from network); 30 Mar 2012 14:22:09 -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;
	30 Mar 2012 14: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 1SDciO-0008ED-Cy
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 14:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDciO-00011b-4w
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 14:22:08 +0000
Message-Id: <E1SDciO-00011b-4w@xenbits.xen.org>
Date: Fri, 30 Mar 2012 14:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: allow mem_event ops on AMD
	processors too.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333036773 -3600
# Node ID 58b5b500ba40d1563c804c9e00246c904d56991b
# Parent  bf12b6236d32cc69e6ffd0f21a178849a263fa2e
x86/mm: allow mem_event ops on AMD processors too.

(Experimental, for now).

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r bf12b6236d32 -r 58b5b500ba40 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 29 12:08:41 2012 +0100
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 29 16:59:33 2012 +0100
@@ -563,10 +563,6 @@ int mem_event_domctl(struct domain *d, x
             if ( !hap_enabled(d) )
                 break;
 
-            /* Currently only EPT is supported */
-            if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
-                break;
-
             /* No paging if iommu is used */
             rc = -EXDEV;
             if ( unlikely(need_iommu(d)) )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Fri Mar 30 14:22:16 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 30 Mar 2012 14: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 1SDciS-000192-Sm; Fri, 30 Mar 2012 14: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 1SDciR-00018t-Mh
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 14:22:11 +0000
Received: from [85.158.139.83:17645] by server-5.bemta-5.messagelabs.com id
	48/60-13566-291C57F4; Fri, 30 Mar 2012 14:22:10 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-9.tower-182.messagelabs.com!1333117328!21079589!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 25555 invoked from network); 30 Mar 2012 14:22:09 -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;
	30 Mar 2012 14: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 1SDciO-0008ED-Cy
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 14:22:08 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDciO-00011b-4w
	for xen-changelog@lists.xensource.com; Fri, 30 Mar 2012 14:22:08 +0000
Message-Id: <E1SDciO-00011b-4w@xenbits.xen.org>
Date: Fri, 30 Mar 2012 14:22:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86/mm: allow mem_event ops on AMD
	processors too.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333036773 -3600
# Node ID 58b5b500ba40d1563c804c9e00246c904d56991b
# Parent  bf12b6236d32cc69e6ffd0f21a178849a263fa2e
x86/mm: allow mem_event ops on AMD processors too.

(Experimental, for now).

Signed-off-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
---


diff -r bf12b6236d32 -r 58b5b500ba40 xen/arch/x86/mm/mem_event.c
--- a/xen/arch/x86/mm/mem_event.c	Thu Mar 29 12:08:41 2012 +0100
+++ b/xen/arch/x86/mm/mem_event.c	Thu Mar 29 16:59:33 2012 +0100
@@ -563,10 +563,6 @@ int mem_event_domctl(struct domain *d, x
             if ( !hap_enabled(d) )
                 break;
 
-            /* Currently only EPT is supported */
-            if ( boot_cpu_data.x86_vendor != X86_VENDOR_INTEL )
-                break;
-
             /* No paging if iommu is used */
             rc = -EXDEV;
             if ( unlikely(need_iommu(d)) )

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Mar 31 05:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Mar 2012 05:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDqw5-0001RO-G6; Sat, 31 Mar 2012 05: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 1SDqw4-0001RC-Vw
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:13 +0000
Received: from [85.158.143.99:49749] by server-3.bemta-4.messagelabs.com id
	89/7B-05853-817967F4; Sat, 31 Mar 2012 05:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1333171990!20771475!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8067 invoked from network); 31 Mar 2012 05:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Mar 2012 05:33: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 1SDqw1-0002xt-Kd
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDqw1-0005uV-9Y
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:09 +0000
Message-Id: <E1SDqw1-0005uV-9Y@xenbits.xen.org>
Date: Sat, 31 Mar 2012 05:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Remove single use of fastcall from
	hypervisor common 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333093939 -3600
# Node ID d698f46b4be9f149291d0955a07a4170352997d7
# Parent  adf1112309cf63a5897716face0a6441eff7b610
Remove single use of fastcall from hypervisor common code.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r adf1112309cf -r d698f46b4be9 xen/common/rcupdate.c
--- a/xen/common/rcupdate.c	Fri Mar 30 08:50:33 2012 +0100
+++ b/xen/common/rcupdate.c	Fri Mar 30 08:52:19 2012 +0100
@@ -175,8 +175,8 @@ static void force_quiescent_state(struct
  * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
  * and may be nested.
  */
-void fastcall call_rcu(struct rcu_head *head,
-                       void (*func)(struct rcu_head *rcu))
+void call_rcu(struct rcu_head *head,
+              void (*func)(struct rcu_head *rcu))
 {
     unsigned long flags;
     struct rcu_data *rdp;
diff -r adf1112309cf -r d698f46b4be9 xen/include/xen/rcupdate.h
--- a/xen/include/xen/rcupdate.h	Fri Mar 30 08:50:33 2012 +0100
+++ b/xen/include/xen/rcupdate.h	Fri Mar 30 08:52:19 2012 +0100
@@ -142,8 +142,8 @@ void rcu_init(void);
 void rcu_check_callbacks(int cpu);
 
 /* Exported interfaces */
-void fastcall call_rcu(struct rcu_head *head, 
-                       void (*func)(struct rcu_head *head));
+void call_rcu(struct rcu_head *head, 
+              void (*func)(struct rcu_head *head));
 
 int rcu_barrier(void);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Mar 31 05:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Mar 2012 05:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDqw5-0001RO-G6; Sat, 31 Mar 2012 05: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 1SDqw4-0001RC-Vw
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:13 +0000
Received: from [85.158.143.99:49749] by server-3.bemta-4.messagelabs.com id
	89/7B-05853-817967F4; Sat, 31 Mar 2012 05:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-216.messagelabs.com!1333171990!20771475!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8067 invoked from network); 31 Mar 2012 05:33:11 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-13.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Mar 2012 05:33: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 1SDqw1-0002xt-Kd
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDqw1-0005uV-9Y
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:09 +0000
Message-Id: <E1SDqw1-0005uV-9Y@xenbits.xen.org>
Date: Sat, 31 Mar 2012 05:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] Remove single use of fastcall from
	hypervisor common 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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333093939 -3600
# Node ID d698f46b4be9f149291d0955a07a4170352997d7
# Parent  adf1112309cf63a5897716face0a6441eff7b610
Remove single use of fastcall from hypervisor common code.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r adf1112309cf -r d698f46b4be9 xen/common/rcupdate.c
--- a/xen/common/rcupdate.c	Fri Mar 30 08:50:33 2012 +0100
+++ b/xen/common/rcupdate.c	Fri Mar 30 08:52:19 2012 +0100
@@ -175,8 +175,8 @@ static void force_quiescent_state(struct
  * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
  * and may be nested.
  */
-void fastcall call_rcu(struct rcu_head *head,
-                       void (*func)(struct rcu_head *rcu))
+void call_rcu(struct rcu_head *head,
+              void (*func)(struct rcu_head *rcu))
 {
     unsigned long flags;
     struct rcu_data *rdp;
diff -r adf1112309cf -r d698f46b4be9 xen/include/xen/rcupdate.h
--- a/xen/include/xen/rcupdate.h	Fri Mar 30 08:50:33 2012 +0100
+++ b/xen/include/xen/rcupdate.h	Fri Mar 30 08:52:19 2012 +0100
@@ -142,8 +142,8 @@ void rcu_init(void);
 void rcu_check_callbacks(int cpu);
 
 /* Exported interfaces */
-void fastcall call_rcu(struct rcu_head *head, 
-                       void (*func)(struct rcu_head *head));
+void call_rcu(struct rcu_head *head, 
+              void (*func)(struct rcu_head *head));
 
 int rcu_barrier(void);
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Mar 31 05:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Mar 2012 05:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDqw6-0001Rd-Io; Sat, 31 Mar 2012 05:33:14 +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 1SDqw5-0001RD-1b
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:13 +0000
Received: from [193.109.254.147:19621] by server-2.bemta-14.messagelabs.com id
	28/B4-19409-817967F4; Sat, 31 Mar 2012 05:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1333171989!2816548!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24432 invoked from network); 31 Mar 2012 05:33: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;
	31 Mar 2012 05: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 1SDqw1-0002xq-92
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDqw0-0005uG-O7
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:08 +0000
Message-Id: <E1SDqw0-0005uG-O7@xenbits.xen.org>
Date: Sat, 31 Mar 2012 05:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: All vectored interrupts go
	through do_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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333093833 -3600
# Node ID adf1112309cf63a5897716face0a6441eff7b610
# Parent  58b5b500ba40d1563c804c9e00246c904d56991b
x86: All vectored interrupts go through do_IRQ().

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 58b5b500ba40 -r adf1112309cf xen/arch/x86/apic.c
--- a/xen/arch/x86/apic.c	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/arch/x86/apic.c	Fri Mar 30 08:50:33 2012 +0100
@@ -34,7 +34,6 @@
 #include <asm/hardirq.h>
 #include <asm/apic.h>
 #include <asm/io_apic.h>
-#include <asm/asm_defns.h> /* for BUILD_SMP_INTERRUPT */
 #include <mach_apic.h>
 #include <io_ports.h>
 #include <xen/kexec.h>
@@ -84,33 +83,6 @@ static enum apic_mode apic_boot_mode = A
 bool_t __read_mostly x2apic_enabled = 0;
 bool_t __read_mostly directed_eoi_enabled = 0;
 
-/*
- * The following vectors are part of the Linux architecture, there
- * is no hardware IRQ pin equivalent for them, they are triggered
- * through the ICC by us (IPIs)
- */
-__asm__(".section .text");
-BUILD_SMP_INTERRUPT(irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR)
-BUILD_SMP_INTERRUPT(event_check_interrupt,EVENT_CHECK_VECTOR)
-BUILD_SMP_INTERRUPT(invalidate_interrupt,INVALIDATE_TLB_VECTOR)
-BUILD_SMP_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR)
-
-/*
- * Every pentium local APIC has two 'local interrupts', with a
- * soft-definable vector attached to both interrupts, one of
- * which is a timer interrupt, the other one is error counter
- * overflow. Linux uses the local APIC timer interrupt to get
- * a much simpler SMP time architecture:
- */
-BUILD_SMP_INTERRUPT(apic_timer_interrupt,LOCAL_TIMER_VECTOR)
-BUILD_SMP_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR)
-BUILD_SMP_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR)
-BUILD_SMP_INTERRUPT(pmu_apic_interrupt,PMU_APIC_VECTOR)
-BUILD_SMP_INTERRUPT(cmci_interrupt, CMCI_APIC_VECTOR)
-#ifdef CONFIG_X86_MCE_THERMAL
-BUILD_SMP_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR)
-#endif
-
 static int modern_apic(void)
 {
     unsigned int lvr, version;
@@ -148,21 +120,21 @@ void __init apic_intr_init(void)
     smp_intr_init();
 
     /* self generated IPI for local APIC timer */
-    set_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt);
+    set_direct_apic_vector(LOCAL_TIMER_VECTOR, apic_timer_interrupt);
 
     /* IPI vectors for APIC spurious and error interrupts */
-    set_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt);
-    set_intr_gate(ERROR_APIC_VECTOR, error_interrupt);
+    set_direct_apic_vector(SPURIOUS_APIC_VECTOR, spurious_interrupt);
+    set_direct_apic_vector(ERROR_APIC_VECTOR, error_interrupt);
 
     /* Performance Counters Interrupt */
-    set_intr_gate(PMU_APIC_VECTOR, pmu_apic_interrupt);
+    set_direct_apic_vector(PMU_APIC_VECTOR, pmu_apic_interrupt);
 
     /* CMCI Correctable Machine Check Interrupt */
-    set_intr_gate(CMCI_APIC_VECTOR, cmci_interrupt);
+    set_direct_apic_vector(CMCI_APIC_VECTOR, cmci_interrupt);
 
     /* thermal monitor LVT interrupt, for P4 and latest Intel CPU*/
 #ifdef CONFIG_X86_MCE_THERMAL
-    set_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt);
+    set_direct_apic_vector(THERMAL_APIC_VECTOR, thermal_interrupt);
 #endif
 }
 
@@ -1332,14 +1304,11 @@ int reprogram_timer(s_time_t timeout)
     return apic_tmict || !timeout;
 }
 
-fastcall void smp_apic_timer_interrupt(struct cpu_user_regs * regs)
+void apic_timer_interrupt(struct cpu_user_regs * regs)
 {
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
     ack_APIC_irq();
     perfc_incr(apic_timer);
-    this_cpu(irq_count)++;
     raise_softirq(TIMER_SOFTIRQ);
-    set_irq_regs(old_regs);
 }
 
 static DEFINE_PER_CPU(bool_t, state_dump_pending);
@@ -1354,13 +1323,9 @@ void smp_send_state_dump(unsigned int cp
 /*
  * Spurious interrupts should _never_ happen with our APIC/SMP architecture.
  */
-fastcall void smp_spurious_interrupt(struct cpu_user_regs *regs)
+void spurious_interrupt(struct cpu_user_regs *regs)
 {
     unsigned long v;
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
-
-    this_cpu(irq_count)++;
-    irq_enter();
 
     /*
      * Check if this is a vectored interrupt (most likely, as this is probably
@@ -1381,22 +1346,17 @@ fastcall void smp_spurious_interrupt(str
     printk(KERN_INFO "spurious APIC interrupt on CPU#%d, should "
            "never happen.\n", smp_processor_id());
 
- out:
-    irq_exit();
-    set_irq_regs(old_regs);
+out: ;
 }
 
 /*
  * This interrupt should never happen with our APIC/SMP architecture
  */
 
-fastcall void smp_error_interrupt(struct cpu_user_regs *regs)
+void error_interrupt(struct cpu_user_regs *regs)
 {
     unsigned long v, v1;
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
 
-    this_cpu(irq_count)++;
-    irq_enter();
     /* First tickle the hardware, only then report what went on. -- REW */
     v = apic_read(APIC_ESR);
     apic_write(APIC_ESR, 0);
@@ -1415,21 +1375,16 @@ fastcall void smp_error_interrupt(struct
     */
     printk (KERN_DEBUG "APIC error on CPU%d: %02lx(%02lx)\n",
             smp_processor_id(), v , v1);
-    irq_exit();
-    set_irq_regs(old_regs);
 }
 
 /*
  * This interrupt handles performance counters interrupt
  */
 
-fastcall void smp_pmu_apic_interrupt(struct cpu_user_regs *regs)
+void pmu_apic_interrupt(struct cpu_user_regs *regs)
 {
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
     ack_APIC_irq();
-    this_cpu(irq_count)++;
     hvm_do_pmu_interrupt(regs);
-    set_irq_regs(old_regs);
 }
 
 /*
diff -r 58b5b500ba40 -r adf1112309cf xen/arch/x86/cpu/mcheck/k7.c
--- a/xen/arch/x86/cpu/mcheck/k7.c	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/k7.c	Fri Mar 30 08:50:33 2012 +0100
@@ -17,7 +17,7 @@
 #include "x86_mca.h"
 
 /* Machine Check Handler For AMD Athlon/Duron */
-static fastcall void k7_machine_check(struct cpu_user_regs * regs, long error_code)
+static void k7_machine_check(struct cpu_user_regs * regs, long error_code)
 {
 	int recover = 1;
 	uint64_t msr_content, mcgst;
diff -r 58b5b500ba40 -r adf1112309cf xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Fri Mar 30 08:50:33 2012 +0100
@@ -62,7 +62,6 @@ static void intel_thermal_interrupt(stru
     unsigned int cpu = smp_processor_id();
     static DEFINE_PER_CPU(s_time_t, next);
 
-    ack_APIC_irq();
     if (NOW() < per_cpu(next, cpu))
         return;
 
@@ -79,17 +78,13 @@ static void intel_thermal_interrupt(stru
 }
 
 /* Thermal interrupt handler for this CPU setup */
-static void (*__read_mostly vendor_thermal_interrupt)(struct cpu_user_regs *regs)
-        = unexpected_thermal_interrupt;
+static void (*__read_mostly vendor_thermal_interrupt)(
+    struct cpu_user_regs *regs) = unexpected_thermal_interrupt;
 
-fastcall void smp_thermal_interrupt(struct cpu_user_regs *regs)
+void thermal_interrupt(struct cpu_user_regs *regs)
 {
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
-    this_cpu(irq_count)++;
-    irq_enter();
+    ack_APIC_irq();
     vendor_thermal_interrupt(regs);
-    irq_exit();
-    set_irq_regs(old_regs);
 }
 
 /* Thermal monitoring depends on APIC, ACPI and clock modulation */
@@ -1188,15 +1183,12 @@ static void intel_init_cmci(struct cpuin
     mce_set_owner();
 }
 
-fastcall void smp_cmci_interrupt(struct cpu_user_regs *regs)
+void cmci_interrupt(struct cpu_user_regs *regs)
 {
     mctelem_cookie_t mctc;
     struct mca_summary bs;
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
 
     ack_APIC_irq();
-    this_cpu(irq_count)++;
-    irq_enter();
 
     mctc = mcheck_mca_logout(
         MCA_CMCI_HANDLER, __get_cpu_var(mce_banks_owned), &bs, NULL);
@@ -1212,9 +1204,6 @@ fastcall void smp_cmci_interrupt(struct 
        }
     } else if (mctc != NULL)
         mctelem_dismiss(mctc);
-
-    irq_exit();
-    set_irq_regs(old_regs);
 }
 
 /* MCA */
diff -r 58b5b500ba40 -r adf1112309cf xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Mar 30 08:50:33 2012 +0100
@@ -2042,45 +2042,8 @@ static void vmx_do_extint(struct cpu_use
     vector &= INTR_INFO_VECTOR_MASK;
     HVMTRACE_1D(INTR, vector);
 
-    switch ( vector )
-    {
-    case IRQ_MOVE_CLEANUP_VECTOR:
-        smp_irq_move_cleanup_interrupt(regs);
-        break;
-    case LOCAL_TIMER_VECTOR:
-        smp_apic_timer_interrupt(regs);
-        break;
-    case EVENT_CHECK_VECTOR:
-        smp_event_check_interrupt(regs);
-        break;
-    case INVALIDATE_TLB_VECTOR:
-        smp_invalidate_interrupt();
-        break;
-    case CALL_FUNCTION_VECTOR:
-        smp_call_function_interrupt(regs);
-        break;
-    case SPURIOUS_APIC_VECTOR:
-        smp_spurious_interrupt(regs);
-        break;
-    case ERROR_APIC_VECTOR:
-        smp_error_interrupt(regs);
-        break;
-    case CMCI_APIC_VECTOR:
-        smp_cmci_interrupt(regs);
-        break;
-    case PMU_APIC_VECTOR:
-        smp_pmu_apic_interrupt(regs);
-        break;
-#ifdef CONFIG_X86_MCE_THERMAL
-    case THERMAL_APIC_VECTOR:
-        smp_thermal_interrupt(regs);
-        break;
-#endif
-    default:
-        regs->entry_vector = vector;
-        do_IRQ(regs);
-        break;
-    }
+    regs->entry_vector = vector;
+    do_IRQ(regs);
 }
 
 static void wbinvd_ipi(void *info)
diff -r 58b5b500ba40 -r adf1112309cf xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/arch/x86/irq.c	Fri Mar 30 08:50:33 2012 +0100
@@ -610,14 +610,11 @@ void move_native_irq(struct irq_desc *de
 
 static void dump_irqs(unsigned char key);
 
-fastcall void smp_irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
+void irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
 {
     unsigned vector, me;
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
 
     ack_APIC_irq();
-    this_cpu(irq_count)++;
-    irq_enter();
 
     me = smp_processor_id();
     for (vector = FIRST_DYNAMIC_VECTOR; vector < NR_VECTORS; vector++) {
@@ -687,9 +684,6 @@ fastcall void smp_irq_move_cleanup_inter
 unlock:
         spin_unlock(&desc->lock);
     }
-
-    irq_exit();
-    set_irq_regs(old_regs);
 }
 
 static void send_cleanup_vector(struct irq_desc *desc)
@@ -770,6 +764,14 @@ void pirq_set_affinity(struct domain *d,
 
 DEFINE_PER_CPU(unsigned int, irq_count);
 
+static void (*direct_apic_vector[NR_VECTORS])(struct cpu_user_regs *);
+void set_direct_apic_vector(
+    uint8_t vector, void (*handler)(struct cpu_user_regs *))
+{
+    BUG_ON(direct_apic_vector[vector] != NULL);
+    direct_apic_vector[vector] = handler;
+}
+
 void do_IRQ(struct cpu_user_regs *regs)
 {
     struct irqaction *action;
@@ -780,20 +782,21 @@ void do_IRQ(struct cpu_user_regs *regs)
     struct cpu_user_regs *old_regs = set_irq_regs(regs);
     
     perfc_incr(irqs);
-
     this_cpu(irq_count)++;
+    irq_enter();
 
     if (irq < 0) {
-        ack_APIC_irq();
-        printk("%s: %d.%d No irq handler for vector (irq %d)\n",
-                __func__, smp_processor_id(), vector, irq);
-        set_irq_regs(old_regs);
-        TRACE_1D(TRC_HW_IRQ_UNMAPPED_VECTOR, vector);
-        return;
+        if (direct_apic_vector[vector] != NULL) {
+            (*direct_apic_vector[vector])(regs);
+        } else {
+            ack_APIC_irq();
+            printk("%s: %d.%d No irq handler for vector (irq %d)\n",
+                   __func__, smp_processor_id(), vector, irq);
+            TRACE_1D(TRC_HW_IRQ_UNMAPPED_VECTOR, vector);
+        }
+        goto out_no_unlock;
     }
 
-    irq_enter();
-
     desc = irq_to_desc(irq);
 
     spin_lock(&desc->lock);
@@ -863,6 +866,7 @@ void do_IRQ(struct cpu_user_regs *regs)
         desc->handler->end(desc, regs->entry_vector);
  out_no_end:
     spin_unlock(&desc->lock);
+ out_no_unlock:
     irq_exit();
     set_irq_regs(old_regs);
 }
diff -r 58b5b500ba40 -r adf1112309cf xen/arch/x86/smp.c
--- a/xen/arch/x86/smp.c	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/arch/x86/smp.c	Fri Mar 30 08:50:33 2012 +0100
@@ -218,17 +218,14 @@ static cpumask_t flush_cpumask;
 static const void *flush_va;
 static unsigned int flush_flags;
 
-fastcall void smp_invalidate_interrupt(void)
+void invalidate_interrupt(struct cpu_user_regs *regs)
 {
     ack_APIC_irq();
     perfc_incr(ipis);
-    this_cpu(irq_count)++;
-    irq_enter();
     if ( !__sync_local_execstate() ||
          (flush_flags & (FLUSH_TLB_GLOBAL | FLUSH_CACHE)) )
         flush_area_local(flush_va, flush_flags);
     cpumask_clear_cpu(smp_processor_id(), &flush_cpumask);
-    irq_exit();
 }
 
 void flush_area_mask(const cpumask_t *mask, const void *va, unsigned int flags)
@@ -386,13 +383,11 @@ void smp_send_nmi_allbutself(void)
     send_IPI_mask(&cpu_online_map, APIC_DM_NMI);
 }
 
-fastcall void smp_event_check_interrupt(struct cpu_user_regs *regs)
+void event_check_interrupt(struct cpu_user_regs *regs)
 {
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
     ack_APIC_irq();
     perfc_incr(ipis);
     this_cpu(irq_count)++;
-    set_irq_regs(old_regs);
 }
 
 static void __smp_call_function_interrupt(void)
@@ -422,13 +417,9 @@ static void __smp_call_function_interrup
     irq_exit();
 }
 
-fastcall void smp_call_function_interrupt(struct cpu_user_regs *regs)
+void call_function_interrupt(struct cpu_user_regs *regs)
 {
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
-
     ack_APIC_irq();
     perfc_incr(ipis);
-    this_cpu(irq_count)++;
     __smp_call_function_interrupt();
-    set_irq_regs(old_regs);
 }
diff -r 58b5b500ba40 -r adf1112309cf xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/arch/x86/smpboot.c	Fri Mar 30 08:50:33 2012 +0100
@@ -1026,15 +1026,9 @@ void __init smp_intr_init(void)
         cpumask_copy(irq_to_desc(irq)->arch.cpu_mask, &cpu_online_map);
     }
 
-    /* IPI for cleanuping vectors after irq move */
-    set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt);
-
-    /* IPI for event checking. */
-    set_intr_gate(EVENT_CHECK_VECTOR, event_check_interrupt);
-
-    /* IPI for invalidation */
-    set_intr_gate(INVALIDATE_TLB_VECTOR, invalidate_interrupt);
-
-    /* IPI for generic function call */
-    set_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt);
+    /* Direct IPI vectors. */
+    set_direct_apic_vector(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt);
+    set_direct_apic_vector(EVENT_CHECK_VECTOR, event_check_interrupt);
+    set_direct_apic_vector(INVALIDATE_TLB_VECTOR, invalidate_interrupt);
+    set_direct_apic_vector(CALL_FUNCTION_VECTOR, call_function_interrupt);
 }
diff -r 58b5b500ba40 -r adf1112309cf xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/include/asm-x86/irq.h	Fri Mar 30 08:50:33 2012 +0100
@@ -79,27 +79,19 @@ static inline struct cpu_user_regs *set_
 
 #define platform_legacy_irq(irq)	((irq) < 16)
 
-fastcall void event_check_interrupt(void);
-fastcall void invalidate_interrupt(void);
-fastcall void call_function_interrupt(void);
-fastcall void apic_timer_interrupt(void);
-fastcall void error_interrupt(void);
-fastcall void pmu_apic_interrupt(void);
-fastcall void spurious_interrupt(void);
-fastcall void thermal_interrupt(void);
-fastcall void cmci_interrupt(void);
-fastcall void irq_move_cleanup_interrupt(void);
+void event_check_interrupt(struct cpu_user_regs *regs);
+void invalidate_interrupt(struct cpu_user_regs *regs);
+void call_function_interrupt(struct cpu_user_regs *regs);
+void apic_timer_interrupt(struct cpu_user_regs *regs);
+void error_interrupt(struct cpu_user_regs *regs);
+void pmu_apic_interrupt(struct cpu_user_regs *regs);
+void spurious_interrupt(struct cpu_user_regs *regs);
+void thermal_interrupt(struct cpu_user_regs *regs);
+void cmci_interrupt(struct cpu_user_regs *regs);
+void irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
 
-fastcall void smp_event_check_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_invalidate_interrupt(void);
-fastcall void smp_call_function_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_apic_timer_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_error_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_pmu_apic_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_spurious_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_thermal_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_cmci_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
+void set_direct_apic_vector(
+    uint8_t vector, void (*handler)(struct cpu_user_regs *));
 
 void do_IRQ(struct cpu_user_regs *regs);
 
diff -r 58b5b500ba40 -r adf1112309cf xen/include/asm-x86/x86_32/asm_defns.h
--- a/xen/include/asm-x86/x86_32/asm_defns.h	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/include/asm-x86/x86_32/asm_defns.h	Fri Mar 30 08:50:33 2012 +0100
@@ -107,21 +107,6 @@ 1:      addl  $4,%esp;
 #define FIXUP_RING0_GUEST_STACK
 #endif
 
-#define BUILD_SMP_INTERRUPT(x,v) XBUILD_SMP_INTERRUPT(x,v)
-#define XBUILD_SMP_INTERRUPT(x,v)               \
-__asm__(                                        \
-    "\n"__ALIGN_STR"\n"                         \
-    ".globl " STR(x) "\n\t"                     \
-    STR(x) ":\n\t"                              \
-    "pushl $"#v"<<16\n\t"                       \
-    STR(FIXUP_RING0_GUEST_STACK)                \
-    STR(SAVE_ALL(1f,1f)) "\n\t"                 \
-    "1:movl %esp,%eax\n\t"                      \
-    "pushl %eax\n\t"                            \
-    "call "STR(smp_##x)"\n\t"                   \
-    "addl $4,%esp\n\t"                          \
-    "jmp ret_from_intr\n");
-
 #define BUILD_COMMON_IRQ()                      \
 __asm__(                                        \
     "\n" __ALIGN_STR"\n"                        \
diff -r 58b5b500ba40 -r adf1112309cf xen/include/asm-x86/x86_64/asm_defns.h
--- a/xen/include/asm-x86/x86_64/asm_defns.h	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/include/asm-x86/x86_64/asm_defns.h	Fri Mar 30 08:50:33 2012 +0100
@@ -90,19 +90,6 @@ 1:      addq  $8,%rsp;
 #define REX64_PREFIX "rex64/"
 #endif
 
-#define BUILD_SMP_INTERRUPT(x,v) XBUILD_SMP_INTERRUPT(x,v)
-#define XBUILD_SMP_INTERRUPT(x,v)               \
-__asm__(                                        \
-    "\n"__ALIGN_STR"\n"                         \
-    ".globl " STR(x) "\n\t"                     \
-    STR(x) ":\n\t"                              \
-    "pushq $0\n\t"                              \
-    "movl $"#v",4(%rsp)\n\t"                    \
-    STR(SAVE_ALL)                               \
-    "movq %rsp,%rdi\n\t"                        \
-    "callq "STR(smp_##x)"\n\t"                  \
-    "jmp ret_from_intr\n");
-
 #define BUILD_COMMON_IRQ()                      \
 __asm__(                                        \
     "\n" __ALIGN_STR"\n"                        \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Mar 31 05:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Mar 2012 05:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDqw6-0001Rd-Io; Sat, 31 Mar 2012 05:33:14 +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 1SDqw5-0001RD-1b
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:13 +0000
Received: from [193.109.254.147:19621] by server-2.bemta-14.messagelabs.com id
	28/B4-19409-817967F4; Sat, 31 Mar 2012 05:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-27.messagelabs.com!1333171989!2816548!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24432 invoked from network); 31 Mar 2012 05:33: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;
	31 Mar 2012 05: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 1SDqw1-0002xq-92
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDqw0-0005uG-O7
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:08 +0000
Message-Id: <E1SDqw0-0005uG-O7@xenbits.xen.org>
Date: Sat, 31 Mar 2012 05:33:08 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: All vectored interrupts go
	through do_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: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333093833 -3600
# Node ID adf1112309cf63a5897716face0a6441eff7b610
# Parent  58b5b500ba40d1563c804c9e00246c904d56991b
x86: All vectored interrupts go through do_IRQ().

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 58b5b500ba40 -r adf1112309cf xen/arch/x86/apic.c
--- a/xen/arch/x86/apic.c	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/arch/x86/apic.c	Fri Mar 30 08:50:33 2012 +0100
@@ -34,7 +34,6 @@
 #include <asm/hardirq.h>
 #include <asm/apic.h>
 #include <asm/io_apic.h>
-#include <asm/asm_defns.h> /* for BUILD_SMP_INTERRUPT */
 #include <mach_apic.h>
 #include <io_ports.h>
 #include <xen/kexec.h>
@@ -84,33 +83,6 @@ static enum apic_mode apic_boot_mode = A
 bool_t __read_mostly x2apic_enabled = 0;
 bool_t __read_mostly directed_eoi_enabled = 0;
 
-/*
- * The following vectors are part of the Linux architecture, there
- * is no hardware IRQ pin equivalent for them, they are triggered
- * through the ICC by us (IPIs)
- */
-__asm__(".section .text");
-BUILD_SMP_INTERRUPT(irq_move_cleanup_interrupt,IRQ_MOVE_CLEANUP_VECTOR)
-BUILD_SMP_INTERRUPT(event_check_interrupt,EVENT_CHECK_VECTOR)
-BUILD_SMP_INTERRUPT(invalidate_interrupt,INVALIDATE_TLB_VECTOR)
-BUILD_SMP_INTERRUPT(call_function_interrupt,CALL_FUNCTION_VECTOR)
-
-/*
- * Every pentium local APIC has two 'local interrupts', with a
- * soft-definable vector attached to both interrupts, one of
- * which is a timer interrupt, the other one is error counter
- * overflow. Linux uses the local APIC timer interrupt to get
- * a much simpler SMP time architecture:
- */
-BUILD_SMP_INTERRUPT(apic_timer_interrupt,LOCAL_TIMER_VECTOR)
-BUILD_SMP_INTERRUPT(error_interrupt,ERROR_APIC_VECTOR)
-BUILD_SMP_INTERRUPT(spurious_interrupt,SPURIOUS_APIC_VECTOR)
-BUILD_SMP_INTERRUPT(pmu_apic_interrupt,PMU_APIC_VECTOR)
-BUILD_SMP_INTERRUPT(cmci_interrupt, CMCI_APIC_VECTOR)
-#ifdef CONFIG_X86_MCE_THERMAL
-BUILD_SMP_INTERRUPT(thermal_interrupt,THERMAL_APIC_VECTOR)
-#endif
-
 static int modern_apic(void)
 {
     unsigned int lvr, version;
@@ -148,21 +120,21 @@ void __init apic_intr_init(void)
     smp_intr_init();
 
     /* self generated IPI for local APIC timer */
-    set_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt);
+    set_direct_apic_vector(LOCAL_TIMER_VECTOR, apic_timer_interrupt);
 
     /* IPI vectors for APIC spurious and error interrupts */
-    set_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt);
-    set_intr_gate(ERROR_APIC_VECTOR, error_interrupt);
+    set_direct_apic_vector(SPURIOUS_APIC_VECTOR, spurious_interrupt);
+    set_direct_apic_vector(ERROR_APIC_VECTOR, error_interrupt);
 
     /* Performance Counters Interrupt */
-    set_intr_gate(PMU_APIC_VECTOR, pmu_apic_interrupt);
+    set_direct_apic_vector(PMU_APIC_VECTOR, pmu_apic_interrupt);
 
     /* CMCI Correctable Machine Check Interrupt */
-    set_intr_gate(CMCI_APIC_VECTOR, cmci_interrupt);
+    set_direct_apic_vector(CMCI_APIC_VECTOR, cmci_interrupt);
 
     /* thermal monitor LVT interrupt, for P4 and latest Intel CPU*/
 #ifdef CONFIG_X86_MCE_THERMAL
-    set_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt);
+    set_direct_apic_vector(THERMAL_APIC_VECTOR, thermal_interrupt);
 #endif
 }
 
@@ -1332,14 +1304,11 @@ int reprogram_timer(s_time_t timeout)
     return apic_tmict || !timeout;
 }
 
-fastcall void smp_apic_timer_interrupt(struct cpu_user_regs * regs)
+void apic_timer_interrupt(struct cpu_user_regs * regs)
 {
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
     ack_APIC_irq();
     perfc_incr(apic_timer);
-    this_cpu(irq_count)++;
     raise_softirq(TIMER_SOFTIRQ);
-    set_irq_regs(old_regs);
 }
 
 static DEFINE_PER_CPU(bool_t, state_dump_pending);
@@ -1354,13 +1323,9 @@ void smp_send_state_dump(unsigned int cp
 /*
  * Spurious interrupts should _never_ happen with our APIC/SMP architecture.
  */
-fastcall void smp_spurious_interrupt(struct cpu_user_regs *regs)
+void spurious_interrupt(struct cpu_user_regs *regs)
 {
     unsigned long v;
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
-
-    this_cpu(irq_count)++;
-    irq_enter();
 
     /*
      * Check if this is a vectored interrupt (most likely, as this is probably
@@ -1381,22 +1346,17 @@ fastcall void smp_spurious_interrupt(str
     printk(KERN_INFO "spurious APIC interrupt on CPU#%d, should "
            "never happen.\n", smp_processor_id());
 
- out:
-    irq_exit();
-    set_irq_regs(old_regs);
+out: ;
 }
 
 /*
  * This interrupt should never happen with our APIC/SMP architecture
  */
 
-fastcall void smp_error_interrupt(struct cpu_user_regs *regs)
+void error_interrupt(struct cpu_user_regs *regs)
 {
     unsigned long v, v1;
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
 
-    this_cpu(irq_count)++;
-    irq_enter();
     /* First tickle the hardware, only then report what went on. -- REW */
     v = apic_read(APIC_ESR);
     apic_write(APIC_ESR, 0);
@@ -1415,21 +1375,16 @@ fastcall void smp_error_interrupt(struct
     */
     printk (KERN_DEBUG "APIC error on CPU%d: %02lx(%02lx)\n",
             smp_processor_id(), v , v1);
-    irq_exit();
-    set_irq_regs(old_regs);
 }
 
 /*
  * This interrupt handles performance counters interrupt
  */
 
-fastcall void smp_pmu_apic_interrupt(struct cpu_user_regs *regs)
+void pmu_apic_interrupt(struct cpu_user_regs *regs)
 {
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
     ack_APIC_irq();
-    this_cpu(irq_count)++;
     hvm_do_pmu_interrupt(regs);
-    set_irq_regs(old_regs);
 }
 
 /*
diff -r 58b5b500ba40 -r adf1112309cf xen/arch/x86/cpu/mcheck/k7.c
--- a/xen/arch/x86/cpu/mcheck/k7.c	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/k7.c	Fri Mar 30 08:50:33 2012 +0100
@@ -17,7 +17,7 @@
 #include "x86_mca.h"
 
 /* Machine Check Handler For AMD Athlon/Duron */
-static fastcall void k7_machine_check(struct cpu_user_regs * regs, long error_code)
+static void k7_machine_check(struct cpu_user_regs * regs, long error_code)
 {
 	int recover = 1;
 	uint64_t msr_content, mcgst;
diff -r 58b5b500ba40 -r adf1112309cf xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Fri Mar 30 08:50:33 2012 +0100
@@ -62,7 +62,6 @@ static void intel_thermal_interrupt(stru
     unsigned int cpu = smp_processor_id();
     static DEFINE_PER_CPU(s_time_t, next);
 
-    ack_APIC_irq();
     if (NOW() < per_cpu(next, cpu))
         return;
 
@@ -79,17 +78,13 @@ static void intel_thermal_interrupt(stru
 }
 
 /* Thermal interrupt handler for this CPU setup */
-static void (*__read_mostly vendor_thermal_interrupt)(struct cpu_user_regs *regs)
-        = unexpected_thermal_interrupt;
+static void (*__read_mostly vendor_thermal_interrupt)(
+    struct cpu_user_regs *regs) = unexpected_thermal_interrupt;
 
-fastcall void smp_thermal_interrupt(struct cpu_user_regs *regs)
+void thermal_interrupt(struct cpu_user_regs *regs)
 {
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
-    this_cpu(irq_count)++;
-    irq_enter();
+    ack_APIC_irq();
     vendor_thermal_interrupt(regs);
-    irq_exit();
-    set_irq_regs(old_regs);
 }
 
 /* Thermal monitoring depends on APIC, ACPI and clock modulation */
@@ -1188,15 +1183,12 @@ static void intel_init_cmci(struct cpuin
     mce_set_owner();
 }
 
-fastcall void smp_cmci_interrupt(struct cpu_user_regs *regs)
+void cmci_interrupt(struct cpu_user_regs *regs)
 {
     mctelem_cookie_t mctc;
     struct mca_summary bs;
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
 
     ack_APIC_irq();
-    this_cpu(irq_count)++;
-    irq_enter();
 
     mctc = mcheck_mca_logout(
         MCA_CMCI_HANDLER, __get_cpu_var(mce_banks_owned), &bs, NULL);
@@ -1212,9 +1204,6 @@ fastcall void smp_cmci_interrupt(struct 
        }
     } else if (mctc != NULL)
         mctelem_dismiss(mctc);
-
-    irq_exit();
-    set_irq_regs(old_regs);
 }
 
 /* MCA */
diff -r 58b5b500ba40 -r adf1112309cf xen/arch/x86/hvm/vmx/vmx.c
--- a/xen/arch/x86/hvm/vmx/vmx.c	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/arch/x86/hvm/vmx/vmx.c	Fri Mar 30 08:50:33 2012 +0100
@@ -2042,45 +2042,8 @@ static void vmx_do_extint(struct cpu_use
     vector &= INTR_INFO_VECTOR_MASK;
     HVMTRACE_1D(INTR, vector);
 
-    switch ( vector )
-    {
-    case IRQ_MOVE_CLEANUP_VECTOR:
-        smp_irq_move_cleanup_interrupt(regs);
-        break;
-    case LOCAL_TIMER_VECTOR:
-        smp_apic_timer_interrupt(regs);
-        break;
-    case EVENT_CHECK_VECTOR:
-        smp_event_check_interrupt(regs);
-        break;
-    case INVALIDATE_TLB_VECTOR:
-        smp_invalidate_interrupt();
-        break;
-    case CALL_FUNCTION_VECTOR:
-        smp_call_function_interrupt(regs);
-        break;
-    case SPURIOUS_APIC_VECTOR:
-        smp_spurious_interrupt(regs);
-        break;
-    case ERROR_APIC_VECTOR:
-        smp_error_interrupt(regs);
-        break;
-    case CMCI_APIC_VECTOR:
-        smp_cmci_interrupt(regs);
-        break;
-    case PMU_APIC_VECTOR:
-        smp_pmu_apic_interrupt(regs);
-        break;
-#ifdef CONFIG_X86_MCE_THERMAL
-    case THERMAL_APIC_VECTOR:
-        smp_thermal_interrupt(regs);
-        break;
-#endif
-    default:
-        regs->entry_vector = vector;
-        do_IRQ(regs);
-        break;
-    }
+    regs->entry_vector = vector;
+    do_IRQ(regs);
 }
 
 static void wbinvd_ipi(void *info)
diff -r 58b5b500ba40 -r adf1112309cf xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/arch/x86/irq.c	Fri Mar 30 08:50:33 2012 +0100
@@ -610,14 +610,11 @@ void move_native_irq(struct irq_desc *de
 
 static void dump_irqs(unsigned char key);
 
-fastcall void smp_irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
+void irq_move_cleanup_interrupt(struct cpu_user_regs *regs)
 {
     unsigned vector, me;
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
 
     ack_APIC_irq();
-    this_cpu(irq_count)++;
-    irq_enter();
 
     me = smp_processor_id();
     for (vector = FIRST_DYNAMIC_VECTOR; vector < NR_VECTORS; vector++) {
@@ -687,9 +684,6 @@ fastcall void smp_irq_move_cleanup_inter
 unlock:
         spin_unlock(&desc->lock);
     }
-
-    irq_exit();
-    set_irq_regs(old_regs);
 }
 
 static void send_cleanup_vector(struct irq_desc *desc)
@@ -770,6 +764,14 @@ void pirq_set_affinity(struct domain *d,
 
 DEFINE_PER_CPU(unsigned int, irq_count);
 
+static void (*direct_apic_vector[NR_VECTORS])(struct cpu_user_regs *);
+void set_direct_apic_vector(
+    uint8_t vector, void (*handler)(struct cpu_user_regs *))
+{
+    BUG_ON(direct_apic_vector[vector] != NULL);
+    direct_apic_vector[vector] = handler;
+}
+
 void do_IRQ(struct cpu_user_regs *regs)
 {
     struct irqaction *action;
@@ -780,20 +782,21 @@ void do_IRQ(struct cpu_user_regs *regs)
     struct cpu_user_regs *old_regs = set_irq_regs(regs);
     
     perfc_incr(irqs);
-
     this_cpu(irq_count)++;
+    irq_enter();
 
     if (irq < 0) {
-        ack_APIC_irq();
-        printk("%s: %d.%d No irq handler for vector (irq %d)\n",
-                __func__, smp_processor_id(), vector, irq);
-        set_irq_regs(old_regs);
-        TRACE_1D(TRC_HW_IRQ_UNMAPPED_VECTOR, vector);
-        return;
+        if (direct_apic_vector[vector] != NULL) {
+            (*direct_apic_vector[vector])(regs);
+        } else {
+            ack_APIC_irq();
+            printk("%s: %d.%d No irq handler for vector (irq %d)\n",
+                   __func__, smp_processor_id(), vector, irq);
+            TRACE_1D(TRC_HW_IRQ_UNMAPPED_VECTOR, vector);
+        }
+        goto out_no_unlock;
     }
 
-    irq_enter();
-
     desc = irq_to_desc(irq);
 
     spin_lock(&desc->lock);
@@ -863,6 +866,7 @@ void do_IRQ(struct cpu_user_regs *regs)
         desc->handler->end(desc, regs->entry_vector);
  out_no_end:
     spin_unlock(&desc->lock);
+ out_no_unlock:
     irq_exit();
     set_irq_regs(old_regs);
 }
diff -r 58b5b500ba40 -r adf1112309cf xen/arch/x86/smp.c
--- a/xen/arch/x86/smp.c	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/arch/x86/smp.c	Fri Mar 30 08:50:33 2012 +0100
@@ -218,17 +218,14 @@ static cpumask_t flush_cpumask;
 static const void *flush_va;
 static unsigned int flush_flags;
 
-fastcall void smp_invalidate_interrupt(void)
+void invalidate_interrupt(struct cpu_user_regs *regs)
 {
     ack_APIC_irq();
     perfc_incr(ipis);
-    this_cpu(irq_count)++;
-    irq_enter();
     if ( !__sync_local_execstate() ||
          (flush_flags & (FLUSH_TLB_GLOBAL | FLUSH_CACHE)) )
         flush_area_local(flush_va, flush_flags);
     cpumask_clear_cpu(smp_processor_id(), &flush_cpumask);
-    irq_exit();
 }
 
 void flush_area_mask(const cpumask_t *mask, const void *va, unsigned int flags)
@@ -386,13 +383,11 @@ void smp_send_nmi_allbutself(void)
     send_IPI_mask(&cpu_online_map, APIC_DM_NMI);
 }
 
-fastcall void smp_event_check_interrupt(struct cpu_user_regs *regs)
+void event_check_interrupt(struct cpu_user_regs *regs)
 {
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
     ack_APIC_irq();
     perfc_incr(ipis);
     this_cpu(irq_count)++;
-    set_irq_regs(old_regs);
 }
 
 static void __smp_call_function_interrupt(void)
@@ -422,13 +417,9 @@ static void __smp_call_function_interrup
     irq_exit();
 }
 
-fastcall void smp_call_function_interrupt(struct cpu_user_regs *regs)
+void call_function_interrupt(struct cpu_user_regs *regs)
 {
-    struct cpu_user_regs *old_regs = set_irq_regs(regs);
-
     ack_APIC_irq();
     perfc_incr(ipis);
-    this_cpu(irq_count)++;
     __smp_call_function_interrupt();
-    set_irq_regs(old_regs);
 }
diff -r 58b5b500ba40 -r adf1112309cf xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/arch/x86/smpboot.c	Fri Mar 30 08:50:33 2012 +0100
@@ -1026,15 +1026,9 @@ void __init smp_intr_init(void)
         cpumask_copy(irq_to_desc(irq)->arch.cpu_mask, &cpu_online_map);
     }
 
-    /* IPI for cleanuping vectors after irq move */
-    set_intr_gate(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt);
-
-    /* IPI for event checking. */
-    set_intr_gate(EVENT_CHECK_VECTOR, event_check_interrupt);
-
-    /* IPI for invalidation */
-    set_intr_gate(INVALIDATE_TLB_VECTOR, invalidate_interrupt);
-
-    /* IPI for generic function call */
-    set_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt);
+    /* Direct IPI vectors. */
+    set_direct_apic_vector(IRQ_MOVE_CLEANUP_VECTOR, irq_move_cleanup_interrupt);
+    set_direct_apic_vector(EVENT_CHECK_VECTOR, event_check_interrupt);
+    set_direct_apic_vector(INVALIDATE_TLB_VECTOR, invalidate_interrupt);
+    set_direct_apic_vector(CALL_FUNCTION_VECTOR, call_function_interrupt);
 }
diff -r 58b5b500ba40 -r adf1112309cf xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/include/asm-x86/irq.h	Fri Mar 30 08:50:33 2012 +0100
@@ -79,27 +79,19 @@ static inline struct cpu_user_regs *set_
 
 #define platform_legacy_irq(irq)	((irq) < 16)
 
-fastcall void event_check_interrupt(void);
-fastcall void invalidate_interrupt(void);
-fastcall void call_function_interrupt(void);
-fastcall void apic_timer_interrupt(void);
-fastcall void error_interrupt(void);
-fastcall void pmu_apic_interrupt(void);
-fastcall void spurious_interrupt(void);
-fastcall void thermal_interrupt(void);
-fastcall void cmci_interrupt(void);
-fastcall void irq_move_cleanup_interrupt(void);
+void event_check_interrupt(struct cpu_user_regs *regs);
+void invalidate_interrupt(struct cpu_user_regs *regs);
+void call_function_interrupt(struct cpu_user_regs *regs);
+void apic_timer_interrupt(struct cpu_user_regs *regs);
+void error_interrupt(struct cpu_user_regs *regs);
+void pmu_apic_interrupt(struct cpu_user_regs *regs);
+void spurious_interrupt(struct cpu_user_regs *regs);
+void thermal_interrupt(struct cpu_user_regs *regs);
+void cmci_interrupt(struct cpu_user_regs *regs);
+void irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
 
-fastcall void smp_event_check_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_invalidate_interrupt(void);
-fastcall void smp_call_function_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_apic_timer_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_error_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_pmu_apic_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_spurious_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_thermal_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_cmci_interrupt(struct cpu_user_regs *regs);
-fastcall void smp_irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
+void set_direct_apic_vector(
+    uint8_t vector, void (*handler)(struct cpu_user_regs *));
 
 void do_IRQ(struct cpu_user_regs *regs);
 
diff -r 58b5b500ba40 -r adf1112309cf xen/include/asm-x86/x86_32/asm_defns.h
--- a/xen/include/asm-x86/x86_32/asm_defns.h	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/include/asm-x86/x86_32/asm_defns.h	Fri Mar 30 08:50:33 2012 +0100
@@ -107,21 +107,6 @@ 1:      addl  $4,%esp;
 #define FIXUP_RING0_GUEST_STACK
 #endif
 
-#define BUILD_SMP_INTERRUPT(x,v) XBUILD_SMP_INTERRUPT(x,v)
-#define XBUILD_SMP_INTERRUPT(x,v)               \
-__asm__(                                        \
-    "\n"__ALIGN_STR"\n"                         \
-    ".globl " STR(x) "\n\t"                     \
-    STR(x) ":\n\t"                              \
-    "pushl $"#v"<<16\n\t"                       \
-    STR(FIXUP_RING0_GUEST_STACK)                \
-    STR(SAVE_ALL(1f,1f)) "\n\t"                 \
-    "1:movl %esp,%eax\n\t"                      \
-    "pushl %eax\n\t"                            \
-    "call "STR(smp_##x)"\n\t"                   \
-    "addl $4,%esp\n\t"                          \
-    "jmp ret_from_intr\n");
-
 #define BUILD_COMMON_IRQ()                      \
 __asm__(                                        \
     "\n" __ALIGN_STR"\n"                        \
diff -r 58b5b500ba40 -r adf1112309cf xen/include/asm-x86/x86_64/asm_defns.h
--- a/xen/include/asm-x86/x86_64/asm_defns.h	Thu Mar 29 16:59:33 2012 +0100
+++ b/xen/include/asm-x86/x86_64/asm_defns.h	Fri Mar 30 08:50:33 2012 +0100
@@ -90,19 +90,6 @@ 1:      addq  $8,%rsp;
 #define REX64_PREFIX "rex64/"
 #endif
 
-#define BUILD_SMP_INTERRUPT(x,v) XBUILD_SMP_INTERRUPT(x,v)
-#define XBUILD_SMP_INTERRUPT(x,v)               \
-__asm__(                                        \
-    "\n"__ALIGN_STR"\n"                         \
-    ".globl " STR(x) "\n\t"                     \
-    STR(x) ":\n\t"                              \
-    "pushq $0\n\t"                              \
-    "movl $"#v",4(%rsp)\n\t"                    \
-    STR(SAVE_ALL)                               \
-    "movq %rsp,%rdi\n\t"                        \
-    "callq "STR(smp_##x)"\n\t"                  \
-    "jmp ret_from_intr\n");
-
 #define BUILD_COMMON_IRQ()                      \
 __asm__(                                        \
     "\n" __ALIGN_STR"\n"                        \

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Mar 31 05:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Mar 2012 05:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDqw6-0001Rn-Ni; Sat, 31 Mar 2012 05:33: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 1SDqw5-0001RJ-NG
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:14 +0000
Received: from [85.158.138.51:31400] by server-10.bemta-3.messagelabs.com id
	01/97-15637-817967F4; Sat, 31 Mar 2012 05:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1333171990!19992761!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18468 invoked from network); 31 Mar 2012 05:33: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;
	31 Mar 2012 05:33: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 1SDqw2-0002xw-5w
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDqw1-0005uk-RJ
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:09 +0000
Message-Id: <E1SDqw1-0005uk-RJ@xenbits.xen.org>
Date: Sat, 31 Mar 2012 05:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Allow direct vectored
	interrupts to be dynamically allocated.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333095265 -3600
# Node ID 14609be41f369c26e759c5d63cc0d2be2fc5b9b6
# Parent  d698f46b4be9f149291d0955a07a4170352997d7
x86: Allow direct vectored interrupts to be dynamically allocated.

Use this for Intel's CMCI and thermal interrupts.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r d698f46b4be9 -r 14609be41f36 xen/arch/x86/apic.c
--- a/xen/arch/x86/apic.c	Fri Mar 30 08:52:19 2012 +0100
+++ b/xen/arch/x86/apic.c	Fri Mar 30 09:14:25 2012 +0100
@@ -128,14 +128,6 @@ void __init apic_intr_init(void)
 
     /* Performance Counters Interrupt */
     set_direct_apic_vector(PMU_APIC_VECTOR, pmu_apic_interrupt);
-
-    /* CMCI Correctable Machine Check Interrupt */
-    set_direct_apic_vector(CMCI_APIC_VECTOR, cmci_interrupt);
-
-    /* thermal monitor LVT interrupt, for P4 and latest Intel CPU*/
-#ifdef CONFIG_X86_MCE_THERMAL
-    set_direct_apic_vector(THERMAL_APIC_VECTOR, thermal_interrupt);
-#endif
 }
 
 /* Using APIC to generate smp_local_timer_interrupt? */
diff -r d698f46b4be9 -r 14609be41f36 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Fri Mar 30 08:52:19 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Fri Mar 30 09:14:25 2012 +0100
@@ -46,22 +46,15 @@ static int __read_mostly nr_intel_ext_ms
 #define INTEL_SRAR_DATA_LOAD	0x134
 #define INTEL_SRAR_INSTR_FETCH	0x150
 
-/* Thermal Hanlding */
 #ifdef CONFIG_X86_MCE_THERMAL
-static void unexpected_thermal_interrupt(struct cpu_user_regs *regs)
-{
-    printk(KERN_ERR "Thermal: CPU%d: Unexpected LVT TMR interrupt!\n",
-                smp_processor_id());
-    add_taint(TAINT_MACHINE_CHECK);
-}
-
-/* P4/Xeon Thermal transition interrupt handler */
 static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 {
     uint64_t msr_content;
     unsigned int cpu = smp_processor_id();
     static DEFINE_PER_CPU(s_time_t, next);
 
+    ack_APIC_irq();
+
     if (NOW() < per_cpu(next, cpu))
         return;
 
@@ -77,16 +70,6 @@ static void intel_thermal_interrupt(stru
     }
 }
 
-/* Thermal interrupt handler for this CPU setup */
-static void (*__read_mostly vendor_thermal_interrupt)(
-    struct cpu_user_regs *regs) = unexpected_thermal_interrupt;
-
-void thermal_interrupt(struct cpu_user_regs *regs)
-{
-    ack_APIC_irq();
-    vendor_thermal_interrupt(regs);
-}
-
 /* Thermal monitoring depends on APIC, ACPI and clock modulation */
 static int intel_thermal_supported(struct cpuinfo_x86 *c)
 {
@@ -117,6 +100,7 @@ static void intel_init_thermal(struct cp
     uint32_t val;
     int tm2 = 0;
     unsigned int cpu = smp_processor_id();
+    static uint8_t thermal_apic_vector;
 
     if (!intel_thermal_supported(c))
         return; /* -ENODEV */
@@ -159,17 +143,16 @@ static void intel_init_thermal(struct cp
         return; /* -EBUSY */
     }
 
+    alloc_direct_apic_vector(&thermal_apic_vector, intel_thermal_interrupt);
+
     /* The temperature transition interrupt handler setup */
-    val = THERMAL_APIC_VECTOR;    /* our delivery vector */
+    val = thermal_apic_vector;    /* our delivery vector */
     val |= (APIC_DM_FIXED | APIC_LVT_MASKED);  /* we'll mask till we're ready */
     apic_write_around(APIC_LVTTHMR, val);
 
     rdmsrl(MSR_IA32_THERM_INTERRUPT, msr_content);
     wrmsrl(MSR_IA32_THERM_INTERRUPT, msr_content | 0x03);
 
-    /* ok we're good to go... */
-    vendor_thermal_interrupt = intel_thermal_interrupt;
-
     rdmsrl(MSR_IA32_MISC_ENABLE, msr_content);
     wrmsrl(MSR_IA32_MISC_ENABLE, msr_content | (1ULL<<3));
 
@@ -1154,36 +1137,7 @@ static void cpu_mcheck_disable(void)
         clear_cmci();
 }
 
-static void intel_init_cmci(struct cpuinfo_x86 *c)
-{
-    u32 l, apic;
-    int cpu = smp_processor_id();
-
-    if (!mce_available(c) || !cmci_support) {
-        if (opt_cpu_info)
-            mce_printk(MCE_QUIET, "CMCI: CPU%d has no CMCI support\n", cpu);
-        return;
-    }
-
-    apic = apic_read(APIC_CMCI);
-    if ( apic & APIC_VECTOR_MASK )
-    {
-        mce_printk(MCE_QUIET, "CPU%d CMCI LVT vector (%#x) already installed\n",
-            cpu, ( apic & APIC_VECTOR_MASK ));
-        return;
-    }
-
-    apic = CMCI_APIC_VECTOR;
-    apic |= (APIC_DM_FIXED | APIC_LVT_MASKED);
-    apic_write_around(APIC_CMCI, apic);
-
-    l = apic_read(APIC_CMCI);
-    apic_write_around(APIC_CMCI, l & ~APIC_LVT_MASKED);
-
-    mce_set_owner();
-}
-
-void cmci_interrupt(struct cpu_user_regs *regs)
+static void cmci_interrupt(struct cpu_user_regs *regs)
 {
     mctelem_cookie_t mctc;
     struct mca_summary bs;
@@ -1206,6 +1160,38 @@ void cmci_interrupt(struct cpu_user_regs
         mctelem_dismiss(mctc);
 }
 
+static void intel_init_cmci(struct cpuinfo_x86 *c)
+{
+    u32 l, apic;
+    int cpu = smp_processor_id();
+    static uint8_t cmci_apic_vector;
+
+    if (!mce_available(c) || !cmci_support) {
+        if (opt_cpu_info)
+            mce_printk(MCE_QUIET, "CMCI: CPU%d has no CMCI support\n", cpu);
+        return;
+    }
+
+    apic = apic_read(APIC_CMCI);
+    if ( apic & APIC_VECTOR_MASK )
+    {
+        mce_printk(MCE_QUIET, "CPU%d CMCI LVT vector (%#x) already installed\n",
+            cpu, ( apic & APIC_VECTOR_MASK ));
+        return;
+    }
+
+    alloc_direct_apic_vector(&cmci_apic_vector, cmci_interrupt);
+
+    apic = cmci_apic_vector;
+    apic |= (APIC_DM_FIXED | APIC_LVT_MASKED);
+    apic_write_around(APIC_CMCI, apic);
+
+    l = apic_read(APIC_CMCI);
+    apic_write_around(APIC_CMCI, l & ~APIC_LVT_MASKED);
+
+    mce_set_owner();
+}
+
 /* MCA */
 
 static int mce_is_broadcast(struct cpuinfo_x86 *c)
diff -r d698f46b4be9 -r 14609be41f36 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Fri Mar 30 08:52:19 2012 +0100
+++ b/xen/arch/x86/irq.c	Fri Mar 30 09:14:25 2012 +0100
@@ -772,6 +772,21 @@ void set_direct_apic_vector(
     direct_apic_vector[vector] = handler;
 }
 
+void alloc_direct_apic_vector(
+    uint8_t *vector, void (*handler)(struct cpu_user_regs *))
+{
+    static uint8_t next = LAST_HIPRIORITY_VECTOR;
+    static DEFINE_SPINLOCK(lock);
+
+    spin_lock(&lock);
+    if (*vector == 0) {
+        BUG_ON(next == FIRST_HIPRIORITY_VECTOR);
+        set_direct_apic_vector(next, handler);
+        *vector = next--;
+    }
+    spin_unlock(&lock);
+}
+
 void do_IRQ(struct cpu_user_regs *regs)
 {
     struct irqaction *action;
diff -r d698f46b4be9 -r 14609be41f36 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Fri Mar 30 08:52:19 2012 +0100
+++ b/xen/include/asm-x86/irq.h	Fri Mar 30 09:14:25 2012 +0100
@@ -86,12 +86,12 @@ void apic_timer_interrupt(struct cpu_use
 void error_interrupt(struct cpu_user_regs *regs);
 void pmu_apic_interrupt(struct cpu_user_regs *regs);
 void spurious_interrupt(struct cpu_user_regs *regs);
-void thermal_interrupt(struct cpu_user_regs *regs);
-void cmci_interrupt(struct cpu_user_regs *regs);
 void irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
 
 void set_direct_apic_vector(
     uint8_t vector, void (*handler)(struct cpu_user_regs *));
+void alloc_direct_apic_vector(
+    uint8_t *vector, void (*handler)(struct cpu_user_regs *));
 
 void do_IRQ(struct cpu_user_regs *regs);
 
diff -r d698f46b4be9 -r 14609be41f36 xen/include/asm-x86/mach-default/irq_vectors.h
--- a/xen/include/asm-x86/mach-default/irq_vectors.h	Fri Mar 30 08:52:19 2012 +0100
+++ b/xen/include/asm-x86/mach-default/irq_vectors.h	Fri Mar 30 09:14:25 2012 +0100
@@ -7,16 +7,14 @@
 #define INVALIDATE_TLB_VECTOR	0xfd
 #define EVENT_CHECK_VECTOR	0xfc
 #define CALL_FUNCTION_VECTOR	0xfb
-#define THERMAL_APIC_VECTOR	0xfa
-#define LOCAL_TIMER_VECTOR	0xf9
-#define PMU_APIC_VECTOR 	0xf8
-#define CMCI_APIC_VECTOR	0xf7
+#define LOCAL_TIMER_VECTOR	0xfa
+#define PMU_APIC_VECTOR 	0xf9
 /*
  * High-priority dynamically-allocated vectors. For interrupts that
  * must be higher priority than any guest-bound interrupt.
  */
 #define FIRST_HIPRIORITY_VECTOR	0xf0
-#define LAST_HIPRIORITY_VECTOR  0xf6
+#define LAST_HIPRIORITY_VECTOR  0xf8
 
 /* Legacy PIC uses vectors 0xe0-0xef. */
 #define FIRST_LEGACY_VECTOR	0xe0

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Mar 31 05:33:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Mar 2012 05:33:19 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDqw6-0001Rn-Ni; Sat, 31 Mar 2012 05:33: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 1SDqw5-0001RJ-NG
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:14 +0000
Received: from [85.158.138.51:31400] by server-10.bemta-3.messagelabs.com id
	01/97-15637-817967F4; Sat, 31 Mar 2012 05:33:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-16.tower-174.messagelabs.com!1333171990!19992761!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 18468 invoked from network); 31 Mar 2012 05:33: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;
	31 Mar 2012 05:33: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 1SDqw2-0002xw-5w
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDqw1-0005uk-RJ
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:09 +0000
Message-Id: <E1SDqw1-0005uk-RJ@xenbits.xen.org>
Date: Sat, 31 Mar 2012 05:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Allow direct vectored
	interrupts to be dynamically allocated.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333095265 -3600
# Node ID 14609be41f369c26e759c5d63cc0d2be2fc5b9b6
# Parent  d698f46b4be9f149291d0955a07a4170352997d7
x86: Allow direct vectored interrupts to be dynamically allocated.

Use this for Intel's CMCI and thermal interrupts.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r d698f46b4be9 -r 14609be41f36 xen/arch/x86/apic.c
--- a/xen/arch/x86/apic.c	Fri Mar 30 08:52:19 2012 +0100
+++ b/xen/arch/x86/apic.c	Fri Mar 30 09:14:25 2012 +0100
@@ -128,14 +128,6 @@ void __init apic_intr_init(void)
 
     /* Performance Counters Interrupt */
     set_direct_apic_vector(PMU_APIC_VECTOR, pmu_apic_interrupt);
-
-    /* CMCI Correctable Machine Check Interrupt */
-    set_direct_apic_vector(CMCI_APIC_VECTOR, cmci_interrupt);
-
-    /* thermal monitor LVT interrupt, for P4 and latest Intel CPU*/
-#ifdef CONFIG_X86_MCE_THERMAL
-    set_direct_apic_vector(THERMAL_APIC_VECTOR, thermal_interrupt);
-#endif
 }
 
 /* Using APIC to generate smp_local_timer_interrupt? */
diff -r d698f46b4be9 -r 14609be41f36 xen/arch/x86/cpu/mcheck/mce_intel.c
--- a/xen/arch/x86/cpu/mcheck/mce_intel.c	Fri Mar 30 08:52:19 2012 +0100
+++ b/xen/arch/x86/cpu/mcheck/mce_intel.c	Fri Mar 30 09:14:25 2012 +0100
@@ -46,22 +46,15 @@ static int __read_mostly nr_intel_ext_ms
 #define INTEL_SRAR_DATA_LOAD	0x134
 #define INTEL_SRAR_INSTR_FETCH	0x150
 
-/* Thermal Hanlding */
 #ifdef CONFIG_X86_MCE_THERMAL
-static void unexpected_thermal_interrupt(struct cpu_user_regs *regs)
-{
-    printk(KERN_ERR "Thermal: CPU%d: Unexpected LVT TMR interrupt!\n",
-                smp_processor_id());
-    add_taint(TAINT_MACHINE_CHECK);
-}
-
-/* P4/Xeon Thermal transition interrupt handler */
 static void intel_thermal_interrupt(struct cpu_user_regs *regs)
 {
     uint64_t msr_content;
     unsigned int cpu = smp_processor_id();
     static DEFINE_PER_CPU(s_time_t, next);
 
+    ack_APIC_irq();
+
     if (NOW() < per_cpu(next, cpu))
         return;
 
@@ -77,16 +70,6 @@ static void intel_thermal_interrupt(stru
     }
 }
 
-/* Thermal interrupt handler for this CPU setup */
-static void (*__read_mostly vendor_thermal_interrupt)(
-    struct cpu_user_regs *regs) = unexpected_thermal_interrupt;
-
-void thermal_interrupt(struct cpu_user_regs *regs)
-{
-    ack_APIC_irq();
-    vendor_thermal_interrupt(regs);
-}
-
 /* Thermal monitoring depends on APIC, ACPI and clock modulation */
 static int intel_thermal_supported(struct cpuinfo_x86 *c)
 {
@@ -117,6 +100,7 @@ static void intel_init_thermal(struct cp
     uint32_t val;
     int tm2 = 0;
     unsigned int cpu = smp_processor_id();
+    static uint8_t thermal_apic_vector;
 
     if (!intel_thermal_supported(c))
         return; /* -ENODEV */
@@ -159,17 +143,16 @@ static void intel_init_thermal(struct cp
         return; /* -EBUSY */
     }
 
+    alloc_direct_apic_vector(&thermal_apic_vector, intel_thermal_interrupt);
+
     /* The temperature transition interrupt handler setup */
-    val = THERMAL_APIC_VECTOR;    /* our delivery vector */
+    val = thermal_apic_vector;    /* our delivery vector */
     val |= (APIC_DM_FIXED | APIC_LVT_MASKED);  /* we'll mask till we're ready */
     apic_write_around(APIC_LVTTHMR, val);
 
     rdmsrl(MSR_IA32_THERM_INTERRUPT, msr_content);
     wrmsrl(MSR_IA32_THERM_INTERRUPT, msr_content | 0x03);
 
-    /* ok we're good to go... */
-    vendor_thermal_interrupt = intel_thermal_interrupt;
-
     rdmsrl(MSR_IA32_MISC_ENABLE, msr_content);
     wrmsrl(MSR_IA32_MISC_ENABLE, msr_content | (1ULL<<3));
 
@@ -1154,36 +1137,7 @@ static void cpu_mcheck_disable(void)
         clear_cmci();
 }
 
-static void intel_init_cmci(struct cpuinfo_x86 *c)
-{
-    u32 l, apic;
-    int cpu = smp_processor_id();
-
-    if (!mce_available(c) || !cmci_support) {
-        if (opt_cpu_info)
-            mce_printk(MCE_QUIET, "CMCI: CPU%d has no CMCI support\n", cpu);
-        return;
-    }
-
-    apic = apic_read(APIC_CMCI);
-    if ( apic & APIC_VECTOR_MASK )
-    {
-        mce_printk(MCE_QUIET, "CPU%d CMCI LVT vector (%#x) already installed\n",
-            cpu, ( apic & APIC_VECTOR_MASK ));
-        return;
-    }
-
-    apic = CMCI_APIC_VECTOR;
-    apic |= (APIC_DM_FIXED | APIC_LVT_MASKED);
-    apic_write_around(APIC_CMCI, apic);
-
-    l = apic_read(APIC_CMCI);
-    apic_write_around(APIC_CMCI, l & ~APIC_LVT_MASKED);
-
-    mce_set_owner();
-}
-
-void cmci_interrupt(struct cpu_user_regs *regs)
+static void cmci_interrupt(struct cpu_user_regs *regs)
 {
     mctelem_cookie_t mctc;
     struct mca_summary bs;
@@ -1206,6 +1160,38 @@ void cmci_interrupt(struct cpu_user_regs
         mctelem_dismiss(mctc);
 }
 
+static void intel_init_cmci(struct cpuinfo_x86 *c)
+{
+    u32 l, apic;
+    int cpu = smp_processor_id();
+    static uint8_t cmci_apic_vector;
+
+    if (!mce_available(c) || !cmci_support) {
+        if (opt_cpu_info)
+            mce_printk(MCE_QUIET, "CMCI: CPU%d has no CMCI support\n", cpu);
+        return;
+    }
+
+    apic = apic_read(APIC_CMCI);
+    if ( apic & APIC_VECTOR_MASK )
+    {
+        mce_printk(MCE_QUIET, "CPU%d CMCI LVT vector (%#x) already installed\n",
+            cpu, ( apic & APIC_VECTOR_MASK ));
+        return;
+    }
+
+    alloc_direct_apic_vector(&cmci_apic_vector, cmci_interrupt);
+
+    apic = cmci_apic_vector;
+    apic |= (APIC_DM_FIXED | APIC_LVT_MASKED);
+    apic_write_around(APIC_CMCI, apic);
+
+    l = apic_read(APIC_CMCI);
+    apic_write_around(APIC_CMCI, l & ~APIC_LVT_MASKED);
+
+    mce_set_owner();
+}
+
 /* MCA */
 
 static int mce_is_broadcast(struct cpuinfo_x86 *c)
diff -r d698f46b4be9 -r 14609be41f36 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Fri Mar 30 08:52:19 2012 +0100
+++ b/xen/arch/x86/irq.c	Fri Mar 30 09:14:25 2012 +0100
@@ -772,6 +772,21 @@ void set_direct_apic_vector(
     direct_apic_vector[vector] = handler;
 }
 
+void alloc_direct_apic_vector(
+    uint8_t *vector, void (*handler)(struct cpu_user_regs *))
+{
+    static uint8_t next = LAST_HIPRIORITY_VECTOR;
+    static DEFINE_SPINLOCK(lock);
+
+    spin_lock(&lock);
+    if (*vector == 0) {
+        BUG_ON(next == FIRST_HIPRIORITY_VECTOR);
+        set_direct_apic_vector(next, handler);
+        *vector = next--;
+    }
+    spin_unlock(&lock);
+}
+
 void do_IRQ(struct cpu_user_regs *regs)
 {
     struct irqaction *action;
diff -r d698f46b4be9 -r 14609be41f36 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Fri Mar 30 08:52:19 2012 +0100
+++ b/xen/include/asm-x86/irq.h	Fri Mar 30 09:14:25 2012 +0100
@@ -86,12 +86,12 @@ void apic_timer_interrupt(struct cpu_use
 void error_interrupt(struct cpu_user_regs *regs);
 void pmu_apic_interrupt(struct cpu_user_regs *regs);
 void spurious_interrupt(struct cpu_user_regs *regs);
-void thermal_interrupt(struct cpu_user_regs *regs);
-void cmci_interrupt(struct cpu_user_regs *regs);
 void irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
 
 void set_direct_apic_vector(
     uint8_t vector, void (*handler)(struct cpu_user_regs *));
+void alloc_direct_apic_vector(
+    uint8_t *vector, void (*handler)(struct cpu_user_regs *));
 
 void do_IRQ(struct cpu_user_regs *regs);
 
diff -r d698f46b4be9 -r 14609be41f36 xen/include/asm-x86/mach-default/irq_vectors.h
--- a/xen/include/asm-x86/mach-default/irq_vectors.h	Fri Mar 30 08:52:19 2012 +0100
+++ b/xen/include/asm-x86/mach-default/irq_vectors.h	Fri Mar 30 09:14:25 2012 +0100
@@ -7,16 +7,14 @@
 #define INVALIDATE_TLB_VECTOR	0xfd
 #define EVENT_CHECK_VECTOR	0xfc
 #define CALL_FUNCTION_VECTOR	0xfb
-#define THERMAL_APIC_VECTOR	0xfa
-#define LOCAL_TIMER_VECTOR	0xf9
-#define PMU_APIC_VECTOR 	0xf8
-#define CMCI_APIC_VECTOR	0xf7
+#define LOCAL_TIMER_VECTOR	0xfa
+#define PMU_APIC_VECTOR 	0xf9
 /*
  * High-priority dynamically-allocated vectors. For interrupts that
  * must be higher priority than any guest-bound interrupt.
  */
 #define FIRST_HIPRIORITY_VECTOR	0xf0
-#define LAST_HIPRIORITY_VECTOR  0xf6
+#define LAST_HIPRIORITY_VECTOR  0xf8
 
 /* Legacy PIC uses vectors 0xe0-0xef. */
 #define FIRST_LEGACY_VECTOR	0xe0

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Mar 31 05:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Mar 2012 05:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDqw6-0001Ri-LQ; Sat, 31 Mar 2012 05:33: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 1SDqw5-0001RC-Gh
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:13 +0000
Received: from [85.158.143.99:49771] by server-3.bemta-4.messagelabs.com id
	EA/7B-05853-917967F4; Sat, 31 Mar 2012 05:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1333171991!16433475!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22407 invoked from network); 31 Mar 2012 05:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Mar 2012 05:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDqw2-0002xz-Ef
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDqw2-0005uz-Cc
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:10 +0000
Message-Id: <E1SDqw2-0005uz-Cc@xenbits.xen.org>
Date: Sat, 31 Mar 2012 05:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Unify direct-apic and hiprio
	irq vector allocations.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333098075 -3600
# Node ID 6765a2510ee7ad899dcb87eefdf206f8c8ae34ae
# Parent  14609be41f369c26e759c5d63cc0d2be2fc5b9b6
x86: Unify direct-apic and hiprio irq vector allocations.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 14609be41f36 -r 6765a2510ee7 xen/arch/x86/i8259.c
--- a/xen/arch/x86/i8259.c	Fri Mar 30 09:14:25 2012 +0100
+++ b/xen/arch/x86/i8259.c	Fri Mar 30 10:01:15 2012 +0100
@@ -402,7 +402,7 @@ void __init init_IRQ(void)
         desc->arch.vector = FIRST_LEGACY_VECTOR + irq;
     }
     
-    per_cpu(vector_irq, cpu)[FIRST_HIPRIORITY_VECTOR] = 0;
+    per_cpu(vector_irq, cpu)[IRQ0_VECTOR] = 0;
 
     apic_intr_init();
 
diff -r 14609be41f36 -r 6765a2510ee7 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Fri Mar 30 09:14:25 2012 +0100
+++ b/xen/arch/x86/io_apic.c	Fri Mar 30 10:01:15 2012 +0100
@@ -1856,7 +1856,7 @@ static void __init check_timer(void)
      * get/set the timer IRQ vector:
      */
     disable_8259A_irq(irq_to_desc(0));
-    vector = FIRST_HIPRIORITY_VECTOR;
+    vector = IRQ0_VECTOR;
     clear_irq_vector(0);
 
     cpumask_setall(&mask_all);
diff -r 14609be41f36 -r 6765a2510ee7 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Fri Mar 30 09:14:25 2012 +0100
+++ b/xen/arch/x86/irq.c	Fri Mar 30 10:01:15 2012 +0100
@@ -764,6 +764,14 @@ void pirq_set_affinity(struct domain *d,
 
 DEFINE_PER_CPU(unsigned int, irq_count);
 
+uint8_t alloc_hipriority_vector(void)
+{
+    static uint8_t next = FIRST_HIPRIORITY_VECTOR;
+    BUG_ON(next < FIRST_HIPRIORITY_VECTOR);
+    BUG_ON(next > LAST_HIPRIORITY_VECTOR);
+    return next++;
+}
+
 static void (*direct_apic_vector[NR_VECTORS])(struct cpu_user_regs *);
 void set_direct_apic_vector(
     uint8_t vector, void (*handler)(struct cpu_user_regs *))
@@ -775,14 +783,12 @@ void set_direct_apic_vector(
 void alloc_direct_apic_vector(
     uint8_t *vector, void (*handler)(struct cpu_user_regs *))
 {
-    static uint8_t next = LAST_HIPRIORITY_VECTOR;
     static DEFINE_SPINLOCK(lock);
 
     spin_lock(&lock);
     if (*vector == 0) {
-        BUG_ON(next == FIRST_HIPRIORITY_VECTOR);
-        set_direct_apic_vector(next, handler);
-        *vector = next--;
+        *vector = alloc_hipriority_vector();
+        set_direct_apic_vector(*vector, handler);
     }
     spin_unlock(&lock);
 }
diff -r 14609be41f36 -r 6765a2510ee7 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Fri Mar 30 09:14:25 2012 +0100
+++ b/xen/arch/x86/smpboot.c	Fri Mar 30 10:01:15 2012 +0100
@@ -1005,13 +1005,13 @@ void __init smp_cpus_done(void)
 
 void __init smp_intr_init(void)
 {
-    int irq, seridx, cpu = smp_processor_id();
+    int irq, vector, seridx, cpu = smp_processor_id();
 
     /*
      * IRQ0 must be given a fixed assignment and initialized,
      * because it's used before the IO-APIC is set up.
      */
-    irq_to_desc(0)->arch.vector = FIRST_HIPRIORITY_VECTOR;
+    irq_to_desc(0)->arch.vector = IRQ0_VECTOR;
 
     /*
      * Also ensure serial interrupts are high priority. We do not
@@ -1021,8 +1021,9 @@ void __init smp_intr_init(void)
     {
         if ( (irq = serial_irq(seridx)) < 0 )
             continue;
-        per_cpu(vector_irq, cpu)[FIRST_HIPRIORITY_VECTOR + seridx + 1] = irq;
-        irq_to_desc(irq)->arch.vector = FIRST_HIPRIORITY_VECTOR + seridx + 1;
+        vector = alloc_hipriority_vector();
+        per_cpu(vector_irq, cpu)[vector] = irq;
+        irq_to_desc(irq)->arch.vector = vector;
         cpumask_copy(irq_to_desc(irq)->arch.cpu_mask, &cpu_online_map);
     }
 
diff -r 14609be41f36 -r 6765a2510ee7 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Fri Mar 30 09:14:25 2012 +0100
+++ b/xen/include/asm-x86/irq.h	Fri Mar 30 10:01:15 2012 +0100
@@ -88,6 +88,8 @@ void pmu_apic_interrupt(struct cpu_user_
 void spurious_interrupt(struct cpu_user_regs *regs);
 void irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
 
+uint8_t alloc_hipriority_vector(void);
+
 void set_direct_apic_vector(
     uint8_t vector, void (*handler)(struct cpu_user_regs *));
 void alloc_direct_apic_vector(
diff -r 14609be41f36 -r 6765a2510ee7 xen/include/asm-x86/mach-default/irq_vectors.h
--- a/xen/include/asm-x86/mach-default/irq_vectors.h	Fri Mar 30 09:14:25 2012 +0100
+++ b/xen/include/asm-x86/mach-default/irq_vectors.h	Fri Mar 30 10:01:15 2012 +0100
@@ -13,8 +13,10 @@
  * High-priority dynamically-allocated vectors. For interrupts that
  * must be higher priority than any guest-bound interrupt.
  */
-#define FIRST_HIPRIORITY_VECTOR	0xf0
+#define FIRST_HIPRIORITY_VECTOR	0xf1
 #define LAST_HIPRIORITY_VECTOR  0xf8
+/* IRQ0 (timer) is statically allocated but must be high priority. */
+#define IRQ0_VECTOR             0xf0
 
 /* Legacy PIC uses vectors 0xe0-0xef. */
 #define FIRST_LEGACY_VECTOR	0xe0

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Mar 31 05:33:20 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Mar 2012 05:33:20 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDqw6-0001Ri-LQ; Sat, 31 Mar 2012 05:33: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 1SDqw5-0001RC-Gh
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:13 +0000
Received: from [85.158.143.99:49771] by server-3.bemta-4.messagelabs.com id
	EA/7B-05853-917967F4; Sat, 31 Mar 2012 05:33:13 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-12.tower-216.messagelabs.com!1333171991!16433475!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22407 invoked from network); 31 Mar 2012 05:33:12 -0000
Received: from mail.xen.org (HELO mail.xen.org) (50.57.168.107)
	by server-12.tower-216.messagelabs.com with AES256-SHA encrypted SMTP;
	31 Mar 2012 05:33:12 -0000
Received: from xenbits.xen.org ([50.57.170.242])
	by mail.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDqw2-0002xz-Ef
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:10 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDqw2-0005uz-Cc
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 05:33:10 +0000
Message-Id: <E1SDqw2-0005uz-Cc@xenbits.xen.org>
Date: Sat, 31 Mar 2012 05:33:09 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] x86: Unify direct-apic and hiprio
	irq vector allocations.
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333098075 -3600
# Node ID 6765a2510ee7ad899dcb87eefdf206f8c8ae34ae
# Parent  14609be41f369c26e759c5d63cc0d2be2fc5b9b6
x86: Unify direct-apic and hiprio irq vector allocations.

Signed-off-by: Keir Fraser <keir@xen.org>
---


diff -r 14609be41f36 -r 6765a2510ee7 xen/arch/x86/i8259.c
--- a/xen/arch/x86/i8259.c	Fri Mar 30 09:14:25 2012 +0100
+++ b/xen/arch/x86/i8259.c	Fri Mar 30 10:01:15 2012 +0100
@@ -402,7 +402,7 @@ void __init init_IRQ(void)
         desc->arch.vector = FIRST_LEGACY_VECTOR + irq;
     }
     
-    per_cpu(vector_irq, cpu)[FIRST_HIPRIORITY_VECTOR] = 0;
+    per_cpu(vector_irq, cpu)[IRQ0_VECTOR] = 0;
 
     apic_intr_init();
 
diff -r 14609be41f36 -r 6765a2510ee7 xen/arch/x86/io_apic.c
--- a/xen/arch/x86/io_apic.c	Fri Mar 30 09:14:25 2012 +0100
+++ b/xen/arch/x86/io_apic.c	Fri Mar 30 10:01:15 2012 +0100
@@ -1856,7 +1856,7 @@ static void __init check_timer(void)
      * get/set the timer IRQ vector:
      */
     disable_8259A_irq(irq_to_desc(0));
-    vector = FIRST_HIPRIORITY_VECTOR;
+    vector = IRQ0_VECTOR;
     clear_irq_vector(0);
 
     cpumask_setall(&mask_all);
diff -r 14609be41f36 -r 6765a2510ee7 xen/arch/x86/irq.c
--- a/xen/arch/x86/irq.c	Fri Mar 30 09:14:25 2012 +0100
+++ b/xen/arch/x86/irq.c	Fri Mar 30 10:01:15 2012 +0100
@@ -764,6 +764,14 @@ void pirq_set_affinity(struct domain *d,
 
 DEFINE_PER_CPU(unsigned int, irq_count);
 
+uint8_t alloc_hipriority_vector(void)
+{
+    static uint8_t next = FIRST_HIPRIORITY_VECTOR;
+    BUG_ON(next < FIRST_HIPRIORITY_VECTOR);
+    BUG_ON(next > LAST_HIPRIORITY_VECTOR);
+    return next++;
+}
+
 static void (*direct_apic_vector[NR_VECTORS])(struct cpu_user_regs *);
 void set_direct_apic_vector(
     uint8_t vector, void (*handler)(struct cpu_user_regs *))
@@ -775,14 +783,12 @@ void set_direct_apic_vector(
 void alloc_direct_apic_vector(
     uint8_t *vector, void (*handler)(struct cpu_user_regs *))
 {
-    static uint8_t next = LAST_HIPRIORITY_VECTOR;
     static DEFINE_SPINLOCK(lock);
 
     spin_lock(&lock);
     if (*vector == 0) {
-        BUG_ON(next == FIRST_HIPRIORITY_VECTOR);
-        set_direct_apic_vector(next, handler);
-        *vector = next--;
+        *vector = alloc_hipriority_vector();
+        set_direct_apic_vector(*vector, handler);
     }
     spin_unlock(&lock);
 }
diff -r 14609be41f36 -r 6765a2510ee7 xen/arch/x86/smpboot.c
--- a/xen/arch/x86/smpboot.c	Fri Mar 30 09:14:25 2012 +0100
+++ b/xen/arch/x86/smpboot.c	Fri Mar 30 10:01:15 2012 +0100
@@ -1005,13 +1005,13 @@ void __init smp_cpus_done(void)
 
 void __init smp_intr_init(void)
 {
-    int irq, seridx, cpu = smp_processor_id();
+    int irq, vector, seridx, cpu = smp_processor_id();
 
     /*
      * IRQ0 must be given a fixed assignment and initialized,
      * because it's used before the IO-APIC is set up.
      */
-    irq_to_desc(0)->arch.vector = FIRST_HIPRIORITY_VECTOR;
+    irq_to_desc(0)->arch.vector = IRQ0_VECTOR;
 
     /*
      * Also ensure serial interrupts are high priority. We do not
@@ -1021,8 +1021,9 @@ void __init smp_intr_init(void)
     {
         if ( (irq = serial_irq(seridx)) < 0 )
             continue;
-        per_cpu(vector_irq, cpu)[FIRST_HIPRIORITY_VECTOR + seridx + 1] = irq;
-        irq_to_desc(irq)->arch.vector = FIRST_HIPRIORITY_VECTOR + seridx + 1;
+        vector = alloc_hipriority_vector();
+        per_cpu(vector_irq, cpu)[vector] = irq;
+        irq_to_desc(irq)->arch.vector = vector;
         cpumask_copy(irq_to_desc(irq)->arch.cpu_mask, &cpu_online_map);
     }
 
diff -r 14609be41f36 -r 6765a2510ee7 xen/include/asm-x86/irq.h
--- a/xen/include/asm-x86/irq.h	Fri Mar 30 09:14:25 2012 +0100
+++ b/xen/include/asm-x86/irq.h	Fri Mar 30 10:01:15 2012 +0100
@@ -88,6 +88,8 @@ void pmu_apic_interrupt(struct cpu_user_
 void spurious_interrupt(struct cpu_user_regs *regs);
 void irq_move_cleanup_interrupt(struct cpu_user_regs *regs);
 
+uint8_t alloc_hipriority_vector(void);
+
 void set_direct_apic_vector(
     uint8_t vector, void (*handler)(struct cpu_user_regs *));
 void alloc_direct_apic_vector(
diff -r 14609be41f36 -r 6765a2510ee7 xen/include/asm-x86/mach-default/irq_vectors.h
--- a/xen/include/asm-x86/mach-default/irq_vectors.h	Fri Mar 30 09:14:25 2012 +0100
+++ b/xen/include/asm-x86/mach-default/irq_vectors.h	Fri Mar 30 10:01:15 2012 +0100
@@ -13,8 +13,10 @@
  * High-priority dynamically-allocated vectors. For interrupts that
  * must be higher priority than any guest-bound interrupt.
  */
-#define FIRST_HIPRIORITY_VECTOR	0xf0
+#define FIRST_HIPRIORITY_VECTOR	0xf1
 #define LAST_HIPRIORITY_VECTOR  0xf8
+/* IRQ0 (timer) is statically allocated but must be high priority. */
+#define IRQ0_VECTOR             0xf0
 
 /* Legacy PIC uses vectors 0xe0-0xef. */
 #define FIRST_LEGACY_VECTOR	0xe0

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Mar 31 06:56:01 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Mar 2012 06:56:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDsDS-0002QC-GW; Sat, 31 Mar 2012 06: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 1SDsDQ-0002Q5-LL
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 06:55:12 +0000
Received: from [85.158.138.51:58856] by server-8.bemta-3.messagelabs.com id
	F0/A4-29305-F4AA67F4; Sat, 31 Mar 2012 06:55:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1333176909!9135915!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7704 invoked from network); 31 Mar 2012 06:55:10 -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;
	31 Mar 2012 06: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 1SDsDN-0003sB-Az
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 06:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDsDN-00088W-2U
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 06:55:09 +0000
Message-Id: <E1SDsDN-00088W-2U@xenbits.xen.org>
Date: Sat, 31 Mar 2012 06:55:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen: introduce
	PHYSDEVOP_pirq_eoi_gmfn_v2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333124358 -3600
# Node ID b574b8b6bb108a7768825471a5f85f40c20b1cec
# Parent  54b4ae0dfb60c635001f56916de2de552b1c1072
xen: introduce PHYSDEVOP_pirq_eoi_gmfn_v2

PHYSDEVOP_pirq_eoi_gmfn changes the semantics of PHYSDEVOP_eoi.
In order to improve the interface this patch:

- renames PHYSDEVOP_pirq_eoi_gmfn to PHYSDEVOP_pirq_eoi_gmfn_v1;

- introduces PHYSDEVOP_pirq_eoi_gmfn_v2, that is like
  PHYSDEVOP_pirq_eoi_gmfn_v1 but it doesn't modify the behaviour of
  another hypercall;

- #define PHYSDEVOP_pirq_eoi_gmfn to PHYSDEVOP_pirq_eoi_gmfn_v1

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24616:3bd3949854ef
xen-unstable date:        Sat Jan 28 13:45:13 2012 +0000
---


diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c	Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/arch/ia64/xen/domain.c	Fri Mar 30 17:19:18 2012 +0100
@@ -1729,6 +1729,7 @@ int domain_relinquish_resources(struct d
 		if (d->arch.pirq_eoi_map != NULL) {
 			put_page(virt_to_page(d->arch.pirq_eoi_map));
 			d->arch.pirq_eoi_map = NULL;
+			d->arch.auto_unmask = 0;
 		}
 
 		/* Tear down shadow mode stuff. */
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c	Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/arch/ia64/xen/hypercall.c	Fri Mar 30 17:19:18 2012 +0100
@@ -65,7 +65,7 @@ static long __do_pirq_guest_eoi(struct d
 {
 	if ( pirq < 0 || pirq >= NR_IRQS )
 		return -EINVAL;
-	if ( d->arch.pirq_eoi_map )
+	if ( d->arch.auto_unmask ) {
 		evtchn_unmask(d->pirq_to_evtchn[pirq]);
 	return pirq_guest_eoi(d, pirq);
 }
@@ -504,7 +504,8 @@ long do_physdev_op(int cmd, XEN_GUEST_HA
         break;
     }
 
-    case PHYSDEVOP_pirq_eoi_gmfn: {
+    case PHYSDEVOP_pirq_eoi_gmfn_v1:
+    case PHYSDEVOP_pirq_eoi_gmfn_v2: {
         struct physdev_pirq_eoi_gmfn info;
         unsigned long mfn;
 
@@ -527,6 +528,8 @@ long do_physdev_op(int cmd, XEN_GUEST_HA
         }
 
         current->domain->arch.pirq_eoi_map = mfn_to_virt(mfn);
+        if ( cmd == PHYSDEVOP_pirq_eoi_gmfn_v1 )
+            current->domain->arch.auto_unmask = 1;
         ret = 0;
         break;
     }
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/arch/x86/domain.c	Fri Mar 30 17:19:18 2012 +0100
@@ -1981,6 +1981,7 @@ int domain_relinquish_resources(struct d
             unmap_domain_page_global(d->arch.pirq_eoi_map);
             put_page_and_type(mfn_to_page(d->arch.pirq_eoi_map_mfn));
             d->arch.pirq_eoi_map = NULL;
+            d->arch.auto_unmask = 0;
         }
 
         d->arch.relmem = RELMEM_xen;
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/arch/x86/physdev.c	Fri Mar 30 17:19:18 2012 +0100
@@ -271,7 +271,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         ret = -EINVAL;
         if ( eoi.irq >= v->domain->nr_pirqs )
             break;
-        if ( v->domain->arch.pirq_eoi_map )
+        if ( v->domain->arch.auto_unmask )
             evtchn_unmask(v->domain->pirq_to_evtchn[eoi.irq]);
         if ( !is_hvm_domain(v->domain) ||
              domain_pirq_to_irq(v->domain, eoi.irq) > 0 )
@@ -295,7 +295,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         break;
     }
 
-    case PHYSDEVOP_pirq_eoi_gmfn: {
+    case PHYSDEVOP_pirq_eoi_gmfn_v2:
+    case PHYSDEVOP_pirq_eoi_gmfn_v1: {
         struct physdev_pirq_eoi_gmfn info;
         unsigned long mfn;
 
@@ -325,6 +326,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             ret = -ENOSPC;
             break;
         }
+        if ( cmd == PHYSDEVOP_pirq_eoi_gmfn_v1 )
+            v->domain->arch.auto_unmask = 1;
 
         ret = 0;
         break;
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h	Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/include/asm-ia64/domain.h	Fri Mar 30 17:19:18 2012 +0100
@@ -182,6 +182,9 @@ struct arch_domain {
     /* Shared page for notifying that explicit PIRQ EOI is required. */
     unsigned long *pirq_eoi_map;
     unsigned long pirq_eoi_map_mfn;
+    /* set auto_unmask to 1 if you want PHYSDEVOP_eoi to automatically
+     * unmask the event channel */
+    bool_t auto_unmask;
 
     /* Address of efi_runtime_services_t (placed in domain memory)  */
     void *efi_runtime;
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h	Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/include/asm-x86/domain.h	Fri Mar 30 17:19:18 2012 +0100
@@ -268,6 +268,9 @@ struct arch_domain
     /* Shared page for notifying that explicit PIRQ EOI is required. */
     unsigned long *pirq_eoi_map;
     unsigned long pirq_eoi_map_mfn;
+    /* set auto_unmask to 1 if you want PHYSDEVOP_eoi to automatically
+     * unmask the event channel */
+    bool_t auto_unmask;
 
     /* Pseudophysical e820 map (XENMEM_memory_map).  */
     spinlock_t e820_lock;
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/include/public/physdev.h
--- a/xen/include/public/physdev.h	Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/include/public/physdev.h	Fri Mar 30 17:19:18 2012 +0100
@@ -49,7 +49,15 @@ DEFINE_XEN_GUEST_HANDLE(physdev_eoi_t);
  * will automatically get unmasked. The page registered is used as a bit
  * array indexed by Xen's PIRQ value.
  */
-#define PHYSDEVOP_pirq_eoi_gmfn         17
+#define PHYSDEVOP_pirq_eoi_gmfn_v1       17
+/*
+ * Register a shared page for the hypervisor to indicate whether the
+ * guest must issue PHYSDEVOP_eoi. This hypercall is very similar to
+ * PHYSDEVOP_pirq_eoi_gmfn_v1 but it doesn't change the semantics of
+ * PHYSDEVOP_eoi. The page registered is used as a bit array indexed by
+ * Xen's PIRQ value.
+ */
+#define PHYSDEVOP_pirq_eoi_gmfn_v2       28
 struct physdev_pirq_eoi_gmfn {
     /* IN */
     xen_pfn_t gmfn;
@@ -276,6 +284,8 @@ DEFINE_XEN_GUEST_HANDLE(physdev_get_free
 #define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY XENIRQSTAT_needs_eoi
 #define PHYSDEVOP_IRQ_SHARED             XENIRQSTAT_shared
 
+#define PHYSDEVOP_pirq_eoi_gmfn PHYSDEVOP_pirq_eoi_gmfn_v1
+
 #endif /* __XEN_PUBLIC_PHYSDEV_H__ */
 
 /*

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Mar 31 06:56:01 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Mar 2012 06:56:01 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-changelog-bounces@lists.xen.org>)
	id 1SDsDS-0002QC-GW; Sat, 31 Mar 2012 06: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 1SDsDQ-0002Q5-LL
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 06:55:12 +0000
Received: from [85.158.138.51:58856] by server-8.bemta-3.messagelabs.com id
	F0/A4-29305-F4AA67F4; Sat, 31 Mar 2012 06:55:11 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-13.tower-174.messagelabs.com!1333176909!9135915!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 7704 invoked from network); 31 Mar 2012 06:55:10 -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;
	31 Mar 2012 06: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 1SDsDN-0003sB-Az
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 06:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SDsDN-00088W-2U
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 06:55:09 +0000
Message-Id: <E1SDsDN-00088W-2U@xenbits.xen.org>
Date: Sat, 31 Mar 2012 06:55:08 +0000
From: Xen patchbot-4.1-testing <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-4.1-testing] xen: introduce
	PHYSDEVOP_pirq_eoi_gmfn_v2
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 1333124358 -3600
# Node ID b574b8b6bb108a7768825471a5f85f40c20b1cec
# Parent  54b4ae0dfb60c635001f56916de2de552b1c1072
xen: introduce PHYSDEVOP_pirq_eoi_gmfn_v2

PHYSDEVOP_pirq_eoi_gmfn changes the semantics of PHYSDEVOP_eoi.
In order to improve the interface this patch:

- renames PHYSDEVOP_pirq_eoi_gmfn to PHYSDEVOP_pirq_eoi_gmfn_v1;

- introduces PHYSDEVOP_pirq_eoi_gmfn_v2, that is like
  PHYSDEVOP_pirq_eoi_gmfn_v1 but it doesn't modify the behaviour of
  another hypercall;

- #define PHYSDEVOP_pirq_eoi_gmfn to PHYSDEVOP_pirq_eoi_gmfn_v1

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
xen-unstable changeset:   24616:3bd3949854ef
xen-unstable date:        Sat Jan 28 13:45:13 2012 +0000
---


diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/arch/ia64/xen/domain.c
--- a/xen/arch/ia64/xen/domain.c	Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/arch/ia64/xen/domain.c	Fri Mar 30 17:19:18 2012 +0100
@@ -1729,6 +1729,7 @@ int domain_relinquish_resources(struct d
 		if (d->arch.pirq_eoi_map != NULL) {
 			put_page(virt_to_page(d->arch.pirq_eoi_map));
 			d->arch.pirq_eoi_map = NULL;
+			d->arch.auto_unmask = 0;
 		}
 
 		/* Tear down shadow mode stuff. */
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/arch/ia64/xen/hypercall.c
--- a/xen/arch/ia64/xen/hypercall.c	Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/arch/ia64/xen/hypercall.c	Fri Mar 30 17:19:18 2012 +0100
@@ -65,7 +65,7 @@ static long __do_pirq_guest_eoi(struct d
 {
 	if ( pirq < 0 || pirq >= NR_IRQS )
 		return -EINVAL;
-	if ( d->arch.pirq_eoi_map )
+	if ( d->arch.auto_unmask ) {
 		evtchn_unmask(d->pirq_to_evtchn[pirq]);
 	return pirq_guest_eoi(d, pirq);
 }
@@ -504,7 +504,8 @@ long do_physdev_op(int cmd, XEN_GUEST_HA
         break;
     }
 
-    case PHYSDEVOP_pirq_eoi_gmfn: {
+    case PHYSDEVOP_pirq_eoi_gmfn_v1:
+    case PHYSDEVOP_pirq_eoi_gmfn_v2: {
         struct physdev_pirq_eoi_gmfn info;
         unsigned long mfn;
 
@@ -527,6 +528,8 @@ long do_physdev_op(int cmd, XEN_GUEST_HA
         }
 
         current->domain->arch.pirq_eoi_map = mfn_to_virt(mfn);
+        if ( cmd == PHYSDEVOP_pirq_eoi_gmfn_v1 )
+            current->domain->arch.auto_unmask = 1;
         ret = 0;
         break;
     }
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/arch/x86/domain.c
--- a/xen/arch/x86/domain.c	Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/arch/x86/domain.c	Fri Mar 30 17:19:18 2012 +0100
@@ -1981,6 +1981,7 @@ int domain_relinquish_resources(struct d
             unmap_domain_page_global(d->arch.pirq_eoi_map);
             put_page_and_type(mfn_to_page(d->arch.pirq_eoi_map_mfn));
             d->arch.pirq_eoi_map = NULL;
+            d->arch.auto_unmask = 0;
         }
 
         d->arch.relmem = RELMEM_xen;
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c	Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/arch/x86/physdev.c	Fri Mar 30 17:19:18 2012 +0100
@@ -271,7 +271,7 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         ret = -EINVAL;
         if ( eoi.irq >= v->domain->nr_pirqs )
             break;
-        if ( v->domain->arch.pirq_eoi_map )
+        if ( v->domain->arch.auto_unmask )
             evtchn_unmask(v->domain->pirq_to_evtchn[eoi.irq]);
         if ( !is_hvm_domain(v->domain) ||
              domain_pirq_to_irq(v->domain, eoi.irq) > 0 )
@@ -295,7 +295,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
         break;
     }
 
-    case PHYSDEVOP_pirq_eoi_gmfn: {
+    case PHYSDEVOP_pirq_eoi_gmfn_v2:
+    case PHYSDEVOP_pirq_eoi_gmfn_v1: {
         struct physdev_pirq_eoi_gmfn info;
         unsigned long mfn;
 
@@ -325,6 +326,8 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
             ret = -ENOSPC;
             break;
         }
+        if ( cmd == PHYSDEVOP_pirq_eoi_gmfn_v1 )
+            v->domain->arch.auto_unmask = 1;
 
         ret = 0;
         break;
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/include/asm-ia64/domain.h
--- a/xen/include/asm-ia64/domain.h	Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/include/asm-ia64/domain.h	Fri Mar 30 17:19:18 2012 +0100
@@ -182,6 +182,9 @@ struct arch_domain {
     /* Shared page for notifying that explicit PIRQ EOI is required. */
     unsigned long *pirq_eoi_map;
     unsigned long pirq_eoi_map_mfn;
+    /* set auto_unmask to 1 if you want PHYSDEVOP_eoi to automatically
+     * unmask the event channel */
+    bool_t auto_unmask;
 
     /* Address of efi_runtime_services_t (placed in domain memory)  */
     void *efi_runtime;
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/include/asm-x86/domain.h
--- a/xen/include/asm-x86/domain.h	Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/include/asm-x86/domain.h	Fri Mar 30 17:19:18 2012 +0100
@@ -268,6 +268,9 @@ struct arch_domain
     /* Shared page for notifying that explicit PIRQ EOI is required. */
     unsigned long *pirq_eoi_map;
     unsigned long pirq_eoi_map_mfn;
+    /* set auto_unmask to 1 if you want PHYSDEVOP_eoi to automatically
+     * unmask the event channel */
+    bool_t auto_unmask;
 
     /* Pseudophysical e820 map (XENMEM_memory_map).  */
     spinlock_t e820_lock;
diff -r 54b4ae0dfb60 -r b574b8b6bb10 xen/include/public/physdev.h
--- a/xen/include/public/physdev.h	Thu Mar 29 17:31:49 2012 +0100
+++ b/xen/include/public/physdev.h	Fri Mar 30 17:19:18 2012 +0100
@@ -49,7 +49,15 @@ DEFINE_XEN_GUEST_HANDLE(physdev_eoi_t);
  * will automatically get unmasked. The page registered is used as a bit
  * array indexed by Xen's PIRQ value.
  */
-#define PHYSDEVOP_pirq_eoi_gmfn         17
+#define PHYSDEVOP_pirq_eoi_gmfn_v1       17
+/*
+ * Register a shared page for the hypervisor to indicate whether the
+ * guest must issue PHYSDEVOP_eoi. This hypercall is very similar to
+ * PHYSDEVOP_pirq_eoi_gmfn_v1 but it doesn't change the semantics of
+ * PHYSDEVOP_eoi. The page registered is used as a bit array indexed by
+ * Xen's PIRQ value.
+ */
+#define PHYSDEVOP_pirq_eoi_gmfn_v2       28
 struct physdev_pirq_eoi_gmfn {
     /* IN */
     xen_pfn_t gmfn;
@@ -276,6 +284,8 @@ DEFINE_XEN_GUEST_HANDLE(physdev_get_free
 #define PHYSDEVOP_IRQ_NEEDS_UNMASK_NOTIFY XENIRQSTAT_needs_eoi
 #define PHYSDEVOP_IRQ_SHARED             XENIRQSTAT_shared
 
+#define PHYSDEVOP_pirq_eoi_gmfn PHYSDEVOP_pirq_eoi_gmfn_v1
+
 #endif /* __XEN_PUBLIC_PHYSDEV_H__ */
 
 /*

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Mar 31 16:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Mar 2012 16: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 1SE1a6-0001W4-8o; Sat, 31 Mar 2012 16:55: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 1SE1a4-0001Vv-W4
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 16:55:13 +0000
Received: from [85.158.143.99:40454] by server-1.bemta-4.messagelabs.com id
	C6/EF-20925-0F6377F4; Sat, 31 Mar 2012 16:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1333212910!21410648!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9881 invoked from network); 31 Mar 2012 16:55: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;
	31 Mar 2012 16: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 1SE1a1-0002gz-8D
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 16:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SE1a0-0005AV-ET
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 16:55:08 +0000
Message-Id: <E1SE1a0-0005AV-ET@xenbits.xen.org>
Date: Sat, 31 Mar 2012 16:55:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] AMD_LWP: add interrupt support for
	AMD LWP
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Huang <wei.huang2@amd.com>
# Date 1333137954 -3600
# Node ID 1088c8557a46ab28e509bb9482e2a73a21590df8
# Parent  6765a2510ee7ad899dcb87eefdf206f8c8ae34ae
AMD_LWP: add interrupt support for AMD LWP

This patch adds interrupt support for AMD lightweight profiling. It
registers interrupt handler using alloc_direct_apic_vector(). When
notified, SVM reinjects virtual interrupts into guest VM using
guest's virtual local APIC.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 6765a2510ee7 -r 1088c8557a46 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Fri Mar 30 10:01:15 2012 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c	Fri Mar 30 21:05:54 2012 +0100
@@ -745,6 +745,17 @@ static void svm_init_hypercall_page(stru
     *(u16 *)(hypercall_page + (__HYPERVISOR_iret * 32)) = 0x0b0f; /* ud2 */
 }
 
+static void svm_lwp_interrupt(struct cpu_user_regs *regs)
+{
+    struct vcpu *curr = current;
+
+    ack_APIC_irq();
+    vlapic_set_irq(
+        vcpu_vlapic(curr),
+        (curr->arch.hvm_svm.guest_lwp_cfg >> 40) && 0xff,
+        0);
+}
+
 static inline void svm_lwp_save(struct vcpu *v)
 {
     /* Don't mess up with other guests. Disable LWP for next VCPU. */
@@ -759,7 +770,7 @@ static inline void svm_lwp_load(struct v
 {
     /* Only LWP_CFG is reloaded. LWP_CBADDR will be reloaded via xrstor. */
    if ( v->arch.hvm_svm.guest_lwp_cfg ) 
-       wrmsrl(MSR_AMD64_LWP_CFG, v->arch.hvm_svm.guest_lwp_cfg);
+       wrmsrl(MSR_AMD64_LWP_CFG, v->arch.hvm_svm.cpu_lwp_cfg);
 }
 
 /* Update LWP_CFG MSR (0xc0000105). Return -1 if error; otherwise returns 0. */
@@ -767,7 +778,8 @@ static int svm_update_lwp_cfg(struct vcp
 {
     unsigned int eax, ebx, ecx, edx;
     uint32_t msr_low;
-    
+    static uint8_t lwp_intr_vector;
+
     if ( xsave_enabled(v) && cpu_has_lwp )
     {
         hvm_cpuid(0x8000001c, &eax, &ebx, &ecx, &edx);
@@ -776,11 +788,23 @@ static int svm_update_lwp_cfg(struct vcp
         /* generate #GP if guest tries to turn on unsupported features. */
         if ( msr_low & ~edx)
             return -1;
+
+        v->arch.hvm_svm.guest_lwp_cfg = msr_content;
+
+        /* setup interrupt handler if needed */
+        if ( (msr_content & 0x80000000) && ((msr_content >> 40) & 0xff) )
+        {
+            alloc_direct_apic_vector(&lwp_intr_vector, svm_lwp_interrupt);
+            v->arch.hvm_svm.cpu_lwp_cfg = (msr_content & 0xffff00ffffffffffULL)
+                | ((uint64_t)lwp_intr_vector << 40);
+        }
+        else
+        {
+            /* otherwise disable it */
+            v->arch.hvm_svm.cpu_lwp_cfg = msr_content & 0xffff00ff7fffffffULL;
+        }
         
-        wrmsrl(MSR_AMD64_LWP_CFG, msr_content);
-        /* CPU might automatically correct reserved bits. So read it back. */
-        rdmsrl(MSR_AMD64_LWP_CFG, msr_content);
-        v->arch.hvm_svm.guest_lwp_cfg = msr_content;
+        wrmsrl(MSR_AMD64_LWP_CFG, v->arch.hvm_svm.cpu_lwp_cfg);
 
         /* track nonalzy state if LWP_CFG is non-zero. */
         v->arch.nonlazy_xstate_used = !!(msr_content);
diff -r 6765a2510ee7 -r 1088c8557a46 xen/include/asm-x86/hvm/svm/vmcb.h
--- a/xen/include/asm-x86/hvm/svm/vmcb.h	Fri Mar 30 10:01:15 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/vmcb.h	Fri Mar 30 21:05:54 2012 +0100
@@ -515,7 +515,8 @@ struct arch_svm_struct {
     uint64_t guest_sysenter_eip;
     
     /* AMD lightweight profiling MSR */
-    uint64_t guest_lwp_cfg;
+    uint64_t guest_lwp_cfg;      /* guest version */
+    uint64_t cpu_lwp_cfg;        /* CPU version */
 
     /* OSVW MSRs */
     struct {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

From xen-changelog-bounces@lists.xen.org Sat Mar 31 16:55:19 2012
Return-path: <xen-changelog-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Sat, 31 Mar 2012 16: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 1SE1a6-0001W4-8o; Sat, 31 Mar 2012 16:55: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 1SE1a4-0001Vv-W4
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 16:55:13 +0000
Received: from [85.158.143.99:40454] by server-1.bemta-4.messagelabs.com id
	C6/EF-20925-0F6377F4; Sat, 31 Mar 2012 16:55:12 +0000
X-Env-Sender: xen@xenbits.xen.org
X-Msg-Ref: server-5.tower-216.messagelabs.com!1333212910!21410648!1
X-Originating-IP: [50.57.168.107]
X-SpamReason: No, hits=0.0 required=7.0 tests=
X-StarScan-Version: 6.5.7; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 9881 invoked from network); 31 Mar 2012 16:55: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;
	31 Mar 2012 16: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 1SE1a1-0002gz-8D
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 16:55:09 +0000
Received: from xen by xenbits.xen.org with local (Exim 4.72)
	(envelope-from <xen@xenbits.xen.org>) id 1SE1a0-0005AV-ET
	for xen-changelog@lists.xensource.com; Sat, 31 Mar 2012 16:55:08 +0000
Message-Id: <E1SE1a0-0005AV-ET@xenbits.xen.org>
Date: Sat, 31 Mar 2012 16:55:07 +0000
From: Xen patchbot-unstable <patchbot@xen.org>
To: xen-changelog@lists.xensource.com
Subject: [Xen-changelog] [xen-unstable] AMD_LWP: add interrupt support for
	AMD LWP
X-BeenThere: xen-changelog@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
Reply-To: xen-devel@lists.xensource.com
List-Id: BK change log <xen-changelog.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-changelog@lists.xen.org>
List-Help: <mailto:xen-changelog-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-changelog>, 
	<mailto:xen-changelog-request@lists.xen.org?subject=subscribe>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-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 Huang <wei.huang2@amd.com>
# Date 1333137954 -3600
# Node ID 1088c8557a46ab28e509bb9482e2a73a21590df8
# Parent  6765a2510ee7ad899dcb87eefdf206f8c8ae34ae
AMD_LWP: add interrupt support for AMD LWP

This patch adds interrupt support for AMD lightweight profiling. It
registers interrupt handler using alloc_direct_apic_vector(). When
notified, SVM reinjects virtual interrupts into guest VM using
guest's virtual local APIC.

Signed-off-by: Wei Huang <wei.huang2@amd.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
---


diff -r 6765a2510ee7 -r 1088c8557a46 xen/arch/x86/hvm/svm/svm.c
--- a/xen/arch/x86/hvm/svm/svm.c	Fri Mar 30 10:01:15 2012 +0100
+++ b/xen/arch/x86/hvm/svm/svm.c	Fri Mar 30 21:05:54 2012 +0100
@@ -745,6 +745,17 @@ static void svm_init_hypercall_page(stru
     *(u16 *)(hypercall_page + (__HYPERVISOR_iret * 32)) = 0x0b0f; /* ud2 */
 }
 
+static void svm_lwp_interrupt(struct cpu_user_regs *regs)
+{
+    struct vcpu *curr = current;
+
+    ack_APIC_irq();
+    vlapic_set_irq(
+        vcpu_vlapic(curr),
+        (curr->arch.hvm_svm.guest_lwp_cfg >> 40) && 0xff,
+        0);
+}
+
 static inline void svm_lwp_save(struct vcpu *v)
 {
     /* Don't mess up with other guests. Disable LWP for next VCPU. */
@@ -759,7 +770,7 @@ static inline void svm_lwp_load(struct v
 {
     /* Only LWP_CFG is reloaded. LWP_CBADDR will be reloaded via xrstor. */
    if ( v->arch.hvm_svm.guest_lwp_cfg ) 
-       wrmsrl(MSR_AMD64_LWP_CFG, v->arch.hvm_svm.guest_lwp_cfg);
+       wrmsrl(MSR_AMD64_LWP_CFG, v->arch.hvm_svm.cpu_lwp_cfg);
 }
 
 /* Update LWP_CFG MSR (0xc0000105). Return -1 if error; otherwise returns 0. */
@@ -767,7 +778,8 @@ static int svm_update_lwp_cfg(struct vcp
 {
     unsigned int eax, ebx, ecx, edx;
     uint32_t msr_low;
-    
+    static uint8_t lwp_intr_vector;
+
     if ( xsave_enabled(v) && cpu_has_lwp )
     {
         hvm_cpuid(0x8000001c, &eax, &ebx, &ecx, &edx);
@@ -776,11 +788,23 @@ static int svm_update_lwp_cfg(struct vcp
         /* generate #GP if guest tries to turn on unsupported features. */
         if ( msr_low & ~edx)
             return -1;
+
+        v->arch.hvm_svm.guest_lwp_cfg = msr_content;
+
+        /* setup interrupt handler if needed */
+        if ( (msr_content & 0x80000000) && ((msr_content >> 40) & 0xff) )
+        {
+            alloc_direct_apic_vector(&lwp_intr_vector, svm_lwp_interrupt);
+            v->arch.hvm_svm.cpu_lwp_cfg = (msr_content & 0xffff00ffffffffffULL)
+                | ((uint64_t)lwp_intr_vector << 40);
+        }
+        else
+        {
+            /* otherwise disable it */
+            v->arch.hvm_svm.cpu_lwp_cfg = msr_content & 0xffff00ff7fffffffULL;
+        }
         
-        wrmsrl(MSR_AMD64_LWP_CFG, msr_content);
-        /* CPU might automatically correct reserved bits. So read it back. */
-        rdmsrl(MSR_AMD64_LWP_CFG, msr_content);
-        v->arch.hvm_svm.guest_lwp_cfg = msr_content;
+        wrmsrl(MSR_AMD64_LWP_CFG, v->arch.hvm_svm.cpu_lwp_cfg);
 
         /* track nonalzy state if LWP_CFG is non-zero. */
         v->arch.nonlazy_xstate_used = !!(msr_content);
diff -r 6765a2510ee7 -r 1088c8557a46 xen/include/asm-x86/hvm/svm/vmcb.h
--- a/xen/include/asm-x86/hvm/svm/vmcb.h	Fri Mar 30 10:01:15 2012 +0100
+++ b/xen/include/asm-x86/hvm/svm/vmcb.h	Fri Mar 30 21:05:54 2012 +0100
@@ -515,7 +515,8 @@ struct arch_svm_struct {
     uint64_t guest_sysenter_eip;
     
     /* AMD lightweight profiling MSR */
-    uint64_t guest_lwp_cfg;
+    uint64_t guest_lwp_cfg;      /* guest version */
+    uint64_t cpu_lwp_cfg;        /* CPU version */
 
     /* OSVW MSRs */
     struct {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xen.org
http://lists.xensource.com/xen-changelog

