ia64/xen-unstable

changeset 11105:d8338b28bcd6

[LINUX] Provide a handy macro for detrmining if we are domain0.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Mon Aug 14 14:44:31 2006 +0100 (2006-08-14)
parents e061f14161b0
children 1b85fbc8c013
files linux-2.6-xen-sparse/arch/i386/kernel/cpu/mtrr/main-xen.c linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c linux-2.6-xen-sparse/arch/i386/mm/init-xen.c linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c linux-2.6-xen-sparse/arch/ia64/kernel/setup.c linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c linux-2.6-xen-sparse/drivers/xen/console/console.c linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c linux-2.6-xen-sparse/drivers/xen/core/evtchn.c linux-2.6-xen-sparse/drivers/xen/core/skbuff.c linux-2.6-xen-sparse/drivers/xen/core/smpboot.c linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/cpu/mtrr/main-xen.c	Mon Aug 14 14:17:26 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/cpu/mtrr/main-xen.c	Mon Aug 14 14:44:31 2006 +0100
     1.3 @@ -178,7 +178,7 @@ static int __init mtrr_init(void)
     1.4  {
     1.5  	struct cpuinfo_x86 *c = &boot_cpu_data;
     1.6  
     1.7 -	if (!(xen_start_info->flags & SIF_PRIVILEGED))
     1.8 +	if (!is_initial_xendomain())
     1.9  		return -ENODEV;
    1.10  
    1.11  	if ((!cpu_has(c, X86_FEATURE_MTRR)) &&
     2.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c	Mon Aug 14 14:17:26 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c	Mon Aug 14 14:44:31 2006 +0100
     2.3 @@ -2480,7 +2480,7 @@ static int __init io_apic_bug_finalize(v
     2.4  {
     2.5  	if(sis_apic_bug == -1)
     2.6  		sis_apic_bug = 0;
     2.7 -	if (xen_start_info->flags & SIF_INITDOMAIN) {
     2.8 +	if (is_initial_xendomain()) {
     2.9  		dom0_op_t op = { .cmd = DOM0_PLATFORM_QUIRK };
    2.10  		op.u.platform_quirk.quirk_id = sis_apic_bug ?
    2.11  			QUIRK_IOAPIC_BAD_REGSEL : QUIRK_IOAPIC_GOOD_REGSEL;
     3.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c	Mon Aug 14 14:17:26 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c	Mon Aug 14 14:44:31 2006 +0100
     3.3 @@ -318,7 +318,7 @@ static void __init probe_roms(void)
     3.4  	int	      i;
     3.5  
     3.6  	/* Nothing to do if not running in dom0. */
     3.7 -	if (!(xen_start_info->flags & SIF_INITDOMAIN))
     3.8 +	if (!is_initial_xendomain())
     3.9  		return;
    3.10  
    3.11  	/* video rom */
    3.12 @@ -1458,7 +1458,7 @@ static void __init register_memory(void)
    3.13  	int	      i;
    3.14  
    3.15  	/* Nothing to do if not running in dom0. */
    3.16 -	if (!(xen_start_info->flags & SIF_INITDOMAIN)) {
    3.17 +	if (!is_initial_xendomain()) {
    3.18  		legacy_init_iomem_resources(e820.map, e820.nr_map,
    3.19  					    &code_resource, &data_resource);
    3.20  		return;
    3.21 @@ -1618,7 +1618,7 @@ void __init setup_arch(char **cmdline_p)
    3.22  
    3.23  	/* Force a quick death if the kernel panics (not domain 0). */
    3.24  	extern int panic_timeout;
    3.25 -	if (!panic_timeout && !(xen_start_info->flags & SIF_INITDOMAIN))
    3.26 +	if (!panic_timeout && !is_initial_xendomain())
    3.27  		panic_timeout = 1;
    3.28  
    3.29  	/* Register a call for panic conditions. */
    3.30 @@ -1661,7 +1661,7 @@ void __init setup_arch(char **cmdline_p)
    3.31  	}
    3.32  	bootloader_type = LOADER_TYPE;
    3.33  
    3.34 -	if (xen_start_info->flags & SIF_INITDOMAIN) {
    3.35 +	if (is_initial_xendomain()) {
    3.36  		/* This is drawn from a dump from vgacon:startup in
    3.37  		 * standard Linux. */
    3.38  		screen_info.orig_video_mode = 3; 
    3.39 @@ -1788,7 +1788,7 @@ void __init setup_arch(char **cmdline_p)
    3.40  	}
    3.41  #endif
    3.42  
    3.43 -	if (xen_start_info->flags & SIF_INITDOMAIN)
    3.44 +	if (is_initial_xendomain())
    3.45  		dmi_scan_machine();
    3.46  
    3.47  #ifdef CONFIG_X86_GENERICARCH
    3.48 @@ -1805,7 +1805,7 @@ void __init setup_arch(char **cmdline_p)
    3.49  #endif
    3.50  
    3.51  #ifdef CONFIG_ACPI
    3.52 -	if (!(xen_start_info->flags & SIF_INITDOMAIN)) {
    3.53 +	if (!is_initial_xendomain()) {
    3.54  		printk(KERN_INFO "ACPI in unprivileged domain disabled\n");
    3.55  		acpi_disabled = 1;
    3.56  		acpi_ht = 0;
    3.57 @@ -1831,11 +1831,7 @@ void __init setup_arch(char **cmdline_p)
    3.58  
    3.59  	register_memory();
    3.60  
    3.61 -	if (xen_start_info->flags & SIF_INITDOMAIN) {
    3.62 -		if (!(xen_start_info->flags & SIF_PRIVILEGED))
    3.63 -			panic("Xen granted us console access "
    3.64 -			      "but not privileged status");
    3.65 -
    3.66 +	if (is_initial_xendomain()) {
    3.67  #ifdef CONFIG_VT
    3.68  #if defined(CONFIG_VGA_CONSOLE)
    3.69  		if (!efi_enabled ||
     4.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c	Mon Aug 14 14:17:26 2006 +0100
     4.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c	Mon Aug 14 14:44:31 2006 +0100
     4.3 @@ -199,7 +199,7 @@ swiotlb_init(void)
     4.4  		swiotlb = 1;
     4.5  	} else if ((swiotlb_force != -1) &&
     4.6  		   is_running_on_xen() &&
     4.7 -		   (xen_start_info->flags & SIF_INITDOMAIN)) {
     4.8 +		   is_initial_xendomain()) {
     4.9  		/* Domain 0 always has a swiotlb. */
    4.10  		ram_end = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
    4.11  		if (ram_end <= 0x7ffff)
     5.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c	Mon Aug 14 14:17:26 2006 +0100
     5.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c	Mon Aug 14 14:44:31 2006 +0100
     5.3 @@ -470,8 +470,7 @@ int do_settimeofday(struct timespec *tv)
     5.4  	sec = tv->tv_sec;
     5.5  	__normalize_time(&sec, &nsec);
     5.6  
     5.7 -	if ((xen_start_info->flags & SIF_INITDOMAIN) &&
     5.8 -	    !independent_wallclock) {
     5.9 +	if (is_initial_xendomain() && !independent_wallclock) {
    5.10  		op.cmd = DOM0_SETTIME;
    5.11  		op.u.settime.secs        = sec;
    5.12  		op.u.settime.nsecs       = nsec;
    5.13 @@ -502,8 +501,7 @@ static void sync_xen_wallclock(unsigned 
    5.14  	s64 nsec;
    5.15  	dom0_op_t op;
    5.16  
    5.17 -	if (!ntp_synced() || independent_wallclock ||
    5.18 -	    !(xen_start_info->flags & SIF_INITDOMAIN))
    5.19 +	if (!ntp_synced() || independent_wallclock || !is_initial_xendomain())
    5.20  		return;
    5.21  
    5.22  	write_seqlock_irq(&xtime_lock);
    5.23 @@ -532,7 +530,7 @@ static int set_rtc_mmss(unsigned long no
    5.24  
    5.25  	WARN_ON(irqs_disabled());
    5.26  
    5.27 -	if (independent_wallclock || !(xen_start_info->flags & SIF_INITDOMAIN))
    5.28 +	if (independent_wallclock || !is_initial_xendomain())
    5.29  		return 0;
    5.30  
    5.31  	/* gets recalled with irq locally disabled */
     6.1 --- a/linux-2.6-xen-sparse/arch/i386/mm/init-xen.c	Mon Aug 14 14:17:26 2006 +0100
     6.2 +++ b/linux-2.6-xen-sparse/arch/i386/mm/init-xen.c	Mon Aug 14 14:44:31 2006 +0100
     6.3 @@ -566,7 +566,7 @@ void __init paging_init(void)
     6.4  
     6.5  	/* Setup mapping of lower 1st MB */
     6.6  	for (i = 0; i < NR_FIX_ISAMAPS; i++)
     6.7 -		if (xen_start_info->flags & SIF_PRIVILEGED)
     6.8 +		if (is_initial_xendomain())
     6.9  			set_fixmap(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE);
    6.10  		else
    6.11  			__set_fixmap(FIX_ISAMAP_BEGIN - i,
     7.1 --- a/linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c	Mon Aug 14 14:17:26 2006 +0100
     7.2 +++ b/linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c	Mon Aug 14 14:44:31 2006 +0100
     7.3 @@ -245,7 +245,7 @@ void __iomem * __ioremap(unsigned long p
     7.4  	/*
     7.5  	 * Don't remap the low PCI/ISA area, it's always mapped..
     7.6  	 */
     7.7 -	if (xen_start_info->flags & SIF_PRIVILEGED &&
     7.8 +	if (is_initial_xendomain() &&
     7.9  	    phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS)
    7.10  		return (void __iomem *) isa_bus_to_virt(phys_addr);
    7.11  
    7.12 @@ -425,7 +425,7 @@ void __init *bt_ioremap(unsigned long ph
    7.13  	/*
    7.14  	 * Don't remap the low PCI/ISA area, it's always mapped..
    7.15  	 */
    7.16 -	if (xen_start_info->flags & SIF_PRIVILEGED &&
    7.17 +	if (is_initial_xendomain() &&
    7.18  	    phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS)
    7.19  		return isa_bus_to_virt(phys_addr);
    7.20  
     8.1 --- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c	Mon Aug 14 14:17:26 2006 +0100
     8.2 +++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c	Mon Aug 14 14:44:31 2006 +0100
     8.3 @@ -545,12 +545,7 @@ setup_arch (char **cmdline_p)
     8.4  		       "flags=0x%x\n", s->arch.start_info_pfn,
     8.5  		       xen_start_info->nr_pages, xen_start_info->flags);
     8.6  
     8.7 -		/* xen_start_info isn't setup yet, get the flags manually */
     8.8 -		if (xen_start_info->flags & SIF_INITDOMAIN) {
     8.9 -			if (!(xen_start_info->flags & SIF_PRIVILEGED))
    8.10 -				panic("Xen granted us console access "
    8.11 -				      "but not privileged status");
    8.12 -		} else {
    8.13 +		if (!is_initial_xendomain()) {
    8.14  			extern int console_use_vt;
    8.15  			conswitchp = NULL;
    8.16  			console_use_vt = 0;
     9.1 --- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c	Mon Aug 14 14:17:26 2006 +0100
     9.2 +++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c	Mon Aug 14 14:44:31 2006 +0100
     9.3 @@ -82,7 +82,7 @@ ia64_xenmem_reservation_op(unsigned long
     9.4  			//    of a non-privileged domain, 
     9.5  			if ((op == XENMEM_increase_reservation ||
     9.6  			     op == XENMEM_populate_physmap) &&
     9.7 -			    !(xen_start_info->flags & SIF_PRIVILEGED) &&
     9.8 +			    !is_initial_xendomain() &&
     9.9  			    reservation.extent_order > 0)
    9.10  				return ret;
    9.11  		}
    10.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c	Mon Aug 14 14:17:26 2006 +0100
    10.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c	Mon Aug 14 14:44:31 2006 +0100
    10.3 @@ -639,7 +639,7 @@ void __init setup_arch(char **cmdline_p)
    10.4  	kernel_end = 0;		/* dummy */
    10.5   	screen_info = SCREEN_INFO;
    10.6  
    10.7 -	if (xen_start_info->flags & SIF_INITDOMAIN) {
    10.8 +	if (is_initial_xendomain()) {
    10.9  		/* This is drawn from a dump from vgacon:startup in
   10.10  		 * standard Linux. */
   10.11  		screen_info.orig_video_mode = 3;
   10.12 @@ -860,8 +860,7 @@ void __init setup_arch(char **cmdline_p)
   10.13  
   10.14  	}
   10.15  
   10.16 -	if ( ! (xen_start_info->flags & SIF_INITDOMAIN))
   10.17 -	{
   10.18 +	if (!is_initial_xendomain()) {
   10.19  		acpi_disabled = 1;
   10.20  #ifdef  CONFIG_ACPI
   10.21  		acpi_ht = 0;
   10.22 @@ -910,7 +909,7 @@ void __init setup_arch(char **cmdline_p)
   10.23  	 */
   10.24  #if defined(CONFIG_XEN_PRIVILEGED_GUEST)
   10.25  	probe_roms();
   10.26 -	if (xen_start_info->flags & SIF_INITDOMAIN) {
   10.27 +	if (is_initial_xendomain()) {
   10.28  		machine_e820 = alloc_bootmem_low_pages(PAGE_SIZE);
   10.29  
   10.30  		memmap.nr_entries = E820MAX;
   10.31 @@ -919,7 +918,7 @@ void __init setup_arch(char **cmdline_p)
   10.32  		BUG_ON(HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap));
   10.33  
   10.34  		e820_reserve_resources(machine_e820, memmap.nr_entries);
   10.35 -	} else if (!(xen_start_info->flags & SIF_INITDOMAIN))
   10.36 +	} else
   10.37  		e820_reserve_resources(e820.map, e820.nr_map);
   10.38  #elif defined(CONFIG_XEN)
   10.39  	e820_reserve_resources(e820.map, e820.nr_map);
   10.40 @@ -938,7 +937,7 @@ void __init setup_arch(char **cmdline_p)
   10.41  	}
   10.42  
   10.43  #if defined(CONFIG_XEN_PRIVILEGED_GUEST)
   10.44 -	if (xen_start_info->flags & SIF_INITDOMAIN) {
   10.45 +	if (is_initial_xendomain()) {
   10.46  		e820_setup_gap(machine_e820, memmap.nr_entries);
   10.47  		free_bootmem(__pa(machine_e820), PAGE_SIZE);
   10.48  	}
   10.49 @@ -957,11 +956,7 @@ void __init setup_arch(char **cmdline_p)
   10.50  		set_iopl.iopl = 1;
   10.51  		HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl);
   10.52  
   10.53 -		if (xen_start_info->flags & SIF_INITDOMAIN) {
   10.54 -			if (!(xen_start_info->flags & SIF_PRIVILEGED))
   10.55 -				panic("Xen granted us console access "
   10.56 -				      "but not privileged status");
   10.57 -		       
   10.58 +		if (is_initial_xendomain()) {
   10.59  #ifdef CONFIG_VT
   10.60  #if defined(CONFIG_VGA_CONSOLE)
   10.61  			conswitchp = &vga_con;
    11.1 --- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	Mon Aug 14 14:17:26 2006 +0100
    11.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	Mon Aug 14 14:44:31 2006 +0100
    11.3 @@ -789,7 +789,7 @@ void __init paging_init(void)
    11.4  
    11.5  	/* Setup mapping of lower 1st MB */
    11.6  	for (i = 0; i < NR_FIX_ISAMAPS; i++)
    11.7 -		if (xen_start_info->flags & SIF_PRIVILEGED)
    11.8 +		if (is_initial_xendomain())
    11.9  			set_fixmap(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE);
   11.10  		else
   11.11  			__set_fixmap(FIX_ISAMAP_BEGIN - i,
    12.1 --- a/linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c	Mon Aug 14 14:17:26 2006 +0100
    12.2 +++ b/linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c	Mon Aug 14 14:44:31 2006 +0100
    12.3 @@ -718,9 +718,8 @@ static int __init tpmif_init(void)
    12.4  	long rc = 0;
    12.5  	struct tpm_private *tp;
    12.6  
    12.7 -	if ((xen_start_info->flags & SIF_INITDOMAIN)) {
    12.8 +	if (is_initial_xendomain())
    12.9  		return -EPERM;
   12.10 -	}
   12.11  
   12.12  	tp = tpm_private_get();
   12.13  	if (!tp) {
    13.1 --- a/linux-2.6-xen-sparse/drivers/xen/console/console.c	Mon Aug 14 14:17:26 2006 +0100
    13.2 +++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c	Mon Aug 14 14:44:31 2006 +0100
    13.3 @@ -188,7 +188,7 @@ static int __init xen_console_init(void)
    13.4  	if (!is_running_on_xen())
    13.5  		return __RETCODE;
    13.6  
    13.7 -	if (xen_start_info->flags & SIF_INITDOMAIN) {
    13.8 +	if (is_initial_xendomain()) {
    13.9  		if (xc_mode == XC_DEFAULT)
   13.10  			xc_mode = XC_SERIAL;
   13.11  		kcons_info.write = kcons_write_dom0;
   13.12 @@ -247,7 +247,7 @@ void xencons_force_flush(void)
   13.13  	int sz;
   13.14  
   13.15  	/* Emergency console is synchronous, so there's nothing to flush. */
   13.16 -	if (xen_start_info->flags & SIF_INITDOMAIN)
   13.17 +	if (is_initial_xendomain())
   13.18  		return;
   13.19  
   13.20  	/* Spin until console data is flushed through to the daemon. */
   13.21 @@ -318,7 +318,7 @@ static void __xencons_tx_flush(void)
   13.22  	int sent, sz, work_done = 0;
   13.23  
   13.24  	if (x_char) {
   13.25 -		if (xen_start_info->flags & SIF_INITDOMAIN)
   13.26 +		if (is_initial_xendomain())
   13.27  			kcons_write_dom0(NULL, &x_char, 1);
   13.28  		else
   13.29  			while (x_char)
   13.30 @@ -332,7 +332,7 @@ static void __xencons_tx_flush(void)
   13.31  		sz = wp - wc;
   13.32  		if (sz > (wbuf_size - WBUF_MASK(wc)))
   13.33  			sz = wbuf_size - WBUF_MASK(wc);
   13.34 -		if (xen_start_info->flags & SIF_INITDOMAIN) {
   13.35 +		if (is_initial_xendomain()) {
   13.36  			kcons_write_dom0(NULL, &wbuf[WBUF_MASK(wc)], sz);
   13.37  			wc += sz;
   13.38  		} else {
   13.39 @@ -622,7 +622,7 @@ static int __init xencons_init(void)
   13.40  		return rc;
   13.41  	}
   13.42  
   13.43 -	if (xen_start_info->flags & SIF_INITDOMAIN) {
   13.44 +	if (is_initial_xendomain()) {
   13.45  		xencons_priv_irq = bind_virq_to_irqhandler(
   13.46  			VIRQ_CONSOLE,
   13.47  			0,
    14.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c	Mon Aug 14 14:17:26 2006 +0100
    14.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c	Mon Aug 14 14:44:31 2006 +0100
    14.3 @@ -92,7 +92,7 @@ static int setup_cpu_watcher(struct noti
    14.4  		.flags = XBWF_new_thread };
    14.5  	(void)register_xenbus_watch(&cpu_watch);
    14.6  
    14.7 -	if (!(xen_start_info->flags & SIF_INITDOMAIN)) {
    14.8 +	if (!is_initial_xendomain()) {
    14.9  		for_each_cpu(i)
   14.10  			vcpu_hotplug(i);
   14.11  		printk(KERN_INFO "Brought up %ld CPUs\n",
    15.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c	Mon Aug 14 14:17:26 2006 +0100
    15.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c	Mon Aug 14 14:44:31 2006 +0100
    15.3 @@ -840,8 +840,7 @@ void __init xen_init_IRQ(void)
    15.4  
    15.5  #ifdef RTC_IRQ
    15.6  		/* If not domain 0, force our RTC driver to fail its probe. */
    15.7 -		if ((i == RTC_IRQ) &&
    15.8 -		    !(xen_start_info->flags & SIF_INITDOMAIN))
    15.9 +		if ((i == RTC_IRQ) && !is_initial_xendomain())
   15.10  			continue;
   15.11  #endif
   15.12  
    16.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/skbuff.c	Mon Aug 14 14:17:26 2006 +0100
    16.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/skbuff.c	Mon Aug 14 14:44:31 2006 +0100
    16.3 @@ -121,8 +121,7 @@ static int __init skbuff_init(void)
    16.4  	for (order = 0; order <= MAX_SKBUFF_ORDER; order++) {
    16.5  		size = PAGE_SIZE << order;
    16.6  		sprintf(name[order], "xen-skb-%lu", size);
    16.7 -		if (is_running_on_xen() &&
    16.8 -		    (xen_start_info->flags & SIF_PRIVILEGED))
    16.9 +		if (is_running_on_xen() && is_initial_xendomain())
   16.10  			skbuff_order_cachep[order] = kmem_cache_create(
   16.11  				name[order], size, size, 0,
   16.12  				skbuff_ctor, skbuff_dtor);
    17.1 --- a/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c	Mon Aug 14 14:17:26 2006 +0100
    17.2 +++ b/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c	Mon Aug 14 14:44:31 2006 +0100
    17.3 @@ -294,7 +294,7 @@ void __init smp_prepare_cpus(unsigned in
    17.4  		irq_ctx_init(cpu);
    17.5  
    17.6  #ifdef CONFIG_HOTPLUG_CPU
    17.7 -		if (xen_start_info->flags & SIF_INITDOMAIN)
    17.8 +		if (is_initial_xendomain())
    17.9  			cpu_set(cpu, cpu_present_map);
   17.10  #else
   17.11  		cpu_set(cpu, cpu_present_map);
    18.1 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Mon Aug 14 14:17:26 2006 +0100
    18.2 +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c	Mon Aug 14 14:44:31 2006 +0100
    18.3 @@ -1818,7 +1818,7 @@ static int __init netif_init(void)
    18.4  	if (!is_running_on_xen())
    18.5  		return -ENODEV;
    18.6  
    18.7 -	if (xen_start_info->flags & SIF_INITDOMAIN)
    18.8 +	if (is_initial_xendomain())
    18.9  		return 0;
   18.10  
   18.11  	IPRINTK("Initialising virtual ethernet driver.\n");
    19.1 --- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Mon Aug 14 14:17:26 2006 +0100
    19.2 +++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c	Mon Aug 14 14:44:31 2006 +0100
    19.3 @@ -246,7 +246,7 @@ static int capabilities_read(char *page,
    19.4  	int len = 0;
    19.5  	*page = 0;
    19.6  
    19.7 -	if (xen_start_info->flags & SIF_INITDOMAIN)
    19.8 +	if (is_initial_xendomain())
    19.9  		len = sprintf( page, "control_d\n" );
   19.10  
   19.11  	*eof = 1;
    20.1 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h	Mon Aug 14 14:17:26 2006 +0100
    20.2 +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h	Mon Aug 14 14:44:31 2006 +0100
    20.3 @@ -58,6 +58,7 @@ extern shared_info_t *HYPERVISOR_shared_
    20.4  
    20.5  /* arch/xen/i386/kernel/setup.c */
    20.6  extern start_info_t *xen_start_info;
    20.7 +#define is_initial_xendomain() (xen_start_info->flags & SIF_INITDOMAIN)
    20.8  
    20.9  /* arch/xen/kernel/evtchn.c */
   20.10  /* Force a proper event-channel callback from Xen. */
    21.1 --- a/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h	Mon Aug 14 14:17:26 2006 +0100
    21.2 +++ b/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h	Mon Aug 14 14:44:31 2006 +0100
    21.3 @@ -59,6 +59,8 @@ extern int running_on_xen;
    21.4  extern shared_info_t *HYPERVISOR_shared_info;
    21.5  extern start_info_t *xen_start_info;
    21.6  
    21.7 +#define is_initial_xendomain() (xen_start_info->flags & SIF_INITDOMAIN)
    21.8 +
    21.9  void force_evtchn_callback(void);
   21.10  
   21.11  /* Turn jiffies into Xen system time. XXX Implement me. */