[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [LINUX] Provide a handy macro for detrmining if we are domain0.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxx
# Node ID d8338b28bcd63444a819867114a57193c64951f8
# Parent  e061f14161b052b3287a1e41222cfa292a194fc2
[LINUX] Provide a handy macro for detrmining if we are domain0.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/arch/i386/kernel/cpu/mtrr/main-xen.c       |    2 -
 linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c             |    2 -
 linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c               |   18 
+++-------
 linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c                 |    2 -
 linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c                |    8 +---
 linux-2.6-xen-sparse/arch/i386/mm/init-xen.c                    |    2 -
 linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c                 |    4 +-
 linux-2.6-xen-sparse/arch/ia64/kernel/setup.c                   |    7 ---
 linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c                 |    2 -
 linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c             |   17 
+++------
 linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c                  |    2 -
 linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c                 |    3 -
 linux-2.6-xen-sparse/drivers/xen/console/console.c              |   10 ++---
 linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c             |    2 -
 linux-2.6-xen-sparse/drivers/xen/core/evtchn.c                  |    3 -
 linux-2.6-xen-sparse/drivers/xen/core/skbuff.c                  |    3 -
 linux-2.6-xen-sparse/drivers/xen/core/smpboot.c                 |    2 -
 linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c            |    2 -
 linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c              |    2 -
 linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h |    1 
 linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h              |    2 +
 21 files changed, 40 insertions(+), 56 deletions(-)

diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/arch/i386/kernel/cpu/mtrr/main-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/kernel/cpu/mtrr/main-xen.c Mon Aug 14 
14:17:26 2006 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/cpu/mtrr/main-xen.c Mon Aug 14 
14:44:31 2006 +0100
@@ -178,7 +178,7 @@ static int __init mtrr_init(void)
 {
        struct cpuinfo_x86 *c = &boot_cpu_data;
 
-       if (!(xen_start_info->flags & SIF_PRIVILEGED))
+       if (!is_initial_xendomain())
                return -ENODEV;
 
        if ((!cpu_has(c, X86_FEATURE_MTRR)) &&
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c       Mon Aug 14 
14:17:26 2006 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/io_apic-xen.c       Mon Aug 14 
14:44:31 2006 +0100
@@ -2480,7 +2480,7 @@ static int __init io_apic_bug_finalize(v
 {
        if(sis_apic_bug == -1)
                sis_apic_bug = 0;
-       if (xen_start_info->flags & SIF_INITDOMAIN) {
+       if (is_initial_xendomain()) {
                dom0_op_t op = { .cmd = DOM0_PLATFORM_QUIRK };
                op.u.platform_quirk.quirk_id = sis_apic_bug ?
                        QUIRK_IOAPIC_BAD_REGSEL : QUIRK_IOAPIC_GOOD_REGSEL;
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Mon Aug 14 14:17:26 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Mon Aug 14 14:44:31 
2006 +0100
@@ -318,7 +318,7 @@ static void __init probe_roms(void)
        int           i;
 
        /* Nothing to do if not running in dom0. */
-       if (!(xen_start_info->flags & SIF_INITDOMAIN))
+       if (!is_initial_xendomain())
                return;
 
        /* video rom */
@@ -1458,7 +1458,7 @@ static void __init register_memory(void)
        int           i;
 
        /* Nothing to do if not running in dom0. */
-       if (!(xen_start_info->flags & SIF_INITDOMAIN)) {
+       if (!is_initial_xendomain()) {
                legacy_init_iomem_resources(e820.map, e820.nr_map,
                                            &code_resource, &data_resource);
                return;
@@ -1618,7 +1618,7 @@ void __init setup_arch(char **cmdline_p)
 
        /* Force a quick death if the kernel panics (not domain 0). */
        extern int panic_timeout;
-       if (!panic_timeout && !(xen_start_info->flags & SIF_INITDOMAIN))
+       if (!panic_timeout && !is_initial_xendomain())
                panic_timeout = 1;
 
        /* Register a call for panic conditions. */
@@ -1661,7 +1661,7 @@ void __init setup_arch(char **cmdline_p)
        }
        bootloader_type = LOADER_TYPE;
 
-       if (xen_start_info->flags & SIF_INITDOMAIN) {
+       if (is_initial_xendomain()) {
                /* This is drawn from a dump from vgacon:startup in
                 * standard Linux. */
                screen_info.orig_video_mode = 3; 
@@ -1788,7 +1788,7 @@ void __init setup_arch(char **cmdline_p)
        }
 #endif
 
-       if (xen_start_info->flags & SIF_INITDOMAIN)
+       if (is_initial_xendomain())
                dmi_scan_machine();
 
 #ifdef CONFIG_X86_GENERICARCH
@@ -1805,7 +1805,7 @@ void __init setup_arch(char **cmdline_p)
 #endif
 
 #ifdef CONFIG_ACPI
-       if (!(xen_start_info->flags & SIF_INITDOMAIN)) {
+       if (!is_initial_xendomain()) {
                printk(KERN_INFO "ACPI in unprivileged domain disabled\n");
                acpi_disabled = 1;
                acpi_ht = 0;
@@ -1831,11 +1831,7 @@ void __init setup_arch(char **cmdline_p)
 
        register_memory();
 
-       if (xen_start_info->flags & SIF_INITDOMAIN) {
-               if (!(xen_start_info->flags & SIF_PRIVILEGED))
-                       panic("Xen granted us console access "
-                             "but not privileged status");
-
+       if (is_initial_xendomain()) {
 #ifdef CONFIG_VT
 #if defined(CONFIG_VGA_CONSOLE)
                if (!efi_enabled ||
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c
--- a/linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c   Mon Aug 14 14:17:26 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/swiotlb.c   Mon Aug 14 14:44:31 
2006 +0100
@@ -199,7 +199,7 @@ swiotlb_init(void)
                swiotlb = 1;
        } else if ((swiotlb_force != -1) &&
                   is_running_on_xen() &&
-                  (xen_start_info->flags & SIF_INITDOMAIN)) {
+                  is_initial_xendomain()) {
                /* Domain 0 always has a swiotlb. */
                ram_end = HYPERVISOR_memory_op(XENMEM_maximum_ram_page, NULL);
                if (ram_end <= 0x7ffff)
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c  Mon Aug 14 14:17:26 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/time-xen.c  Mon Aug 14 14:44:31 
2006 +0100
@@ -470,8 +470,7 @@ int do_settimeofday(struct timespec *tv)
        sec = tv->tv_sec;
        __normalize_time(&sec, &nsec);
 
-       if ((xen_start_info->flags & SIF_INITDOMAIN) &&
-           !independent_wallclock) {
+       if (is_initial_xendomain() && !independent_wallclock) {
                op.cmd = DOM0_SETTIME;
                op.u.settime.secs        = sec;
                op.u.settime.nsecs       = nsec;
@@ -502,8 +501,7 @@ static void sync_xen_wallclock(unsigned 
        s64 nsec;
        dom0_op_t op;
 
-       if (!ntp_synced() || independent_wallclock ||
-           !(xen_start_info->flags & SIF_INITDOMAIN))
+       if (!ntp_synced() || independent_wallclock || !is_initial_xendomain())
                return;
 
        write_seqlock_irq(&xtime_lock);
@@ -532,7 +530,7 @@ static int set_rtc_mmss(unsigned long no
 
        WARN_ON(irqs_disabled());
 
-       if (independent_wallclock || !(xen_start_info->flags & SIF_INITDOMAIN))
+       if (independent_wallclock || !is_initial_xendomain())
                return 0;
 
        /* gets recalled with irq locally disabled */
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/arch/i386/mm/init-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/mm/init-xen.c      Mon Aug 14 14:17:26 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/mm/init-xen.c      Mon Aug 14 14:44:31 
2006 +0100
@@ -566,7 +566,7 @@ void __init paging_init(void)
 
        /* Setup mapping of lower 1st MB */
        for (i = 0; i < NR_FIX_ISAMAPS; i++)
-               if (xen_start_info->flags & SIF_PRIVILEGED)
+               if (is_initial_xendomain())
                        set_fixmap(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE);
                else
                        __set_fixmap(FIX_ISAMAP_BEGIN - i,
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c   Mon Aug 14 14:17:26 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/mm/ioremap-xen.c   Mon Aug 14 14:44:31 
2006 +0100
@@ -245,7 +245,7 @@ void __iomem * __ioremap(unsigned long p
        /*
         * Don't remap the low PCI/ISA area, it's always mapped..
         */
-       if (xen_start_info->flags & SIF_PRIVILEGED &&
+       if (is_initial_xendomain() &&
            phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS)
                return (void __iomem *) isa_bus_to_virt(phys_addr);
 
@@ -425,7 +425,7 @@ void __init *bt_ioremap(unsigned long ph
        /*
         * Don't remap the low PCI/ISA area, it's always mapped..
         */
-       if (xen_start_info->flags & SIF_PRIVILEGED &&
+       if (is_initial_xendomain() &&
            phys_addr >= ISA_START_ADDRESS && last_addr < ISA_END_ADDRESS)
                return isa_bus_to_virt(phys_addr);
 
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/arch/ia64/kernel/setup.c
--- a/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c     Mon Aug 14 14:17:26 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/ia64/kernel/setup.c     Mon Aug 14 14:44:31 
2006 +0100
@@ -545,12 +545,7 @@ setup_arch (char **cmdline_p)
                       "flags=0x%x\n", s->arch.start_info_pfn,
                       xen_start_info->nr_pages, xen_start_info->flags);
 
-               /* xen_start_info isn't setup yet, get the flags manually */
-               if (xen_start_info->flags & SIF_INITDOMAIN) {
-                       if (!(xen_start_info->flags & SIF_PRIVILEGED))
-                               panic("Xen granted us console access "
-                                     "but not privileged status");
-               } else {
+               if (!is_initial_xendomain()) {
                        extern int console_use_vt;
                        conswitchp = NULL;
                        console_use_vt = 0;
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c
--- a/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c   Mon Aug 14 14:17:26 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/ia64/xen/hypervisor.c   Mon Aug 14 14:44:31 
2006 +0100
@@ -82,7 +82,7 @@ ia64_xenmem_reservation_op(unsigned long
                        //    of a non-privileged domain, 
                        if ((op == XENMEM_increase_reservation ||
                             op == XENMEM_populate_physmap) &&
-                           !(xen_start_info->flags & SIF_PRIVILEGED) &&
+                           !is_initial_xendomain() &&
                            reservation.extent_order > 0)
                                return ret;
                }
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c       Mon Aug 14 
14:17:26 2006 +0100
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c       Mon Aug 14 
14:44:31 2006 +0100
@@ -639,7 +639,7 @@ void __init setup_arch(char **cmdline_p)
        kernel_end = 0;         /* dummy */
        screen_info = SCREEN_INFO;
 
-       if (xen_start_info->flags & SIF_INITDOMAIN) {
+       if (is_initial_xendomain()) {
                /* This is drawn from a dump from vgacon:startup in
                 * standard Linux. */
                screen_info.orig_video_mode = 3;
@@ -860,8 +860,7 @@ void __init setup_arch(char **cmdline_p)
 
        }
 
-       if ( ! (xen_start_info->flags & SIF_INITDOMAIN))
-       {
+       if (!is_initial_xendomain()) {
                acpi_disabled = 1;
 #ifdef  CONFIG_ACPI
                acpi_ht = 0;
@@ -910,7 +909,7 @@ void __init setup_arch(char **cmdline_p)
         */
 #if defined(CONFIG_XEN_PRIVILEGED_GUEST)
        probe_roms();
-       if (xen_start_info->flags & SIF_INITDOMAIN) {
+       if (is_initial_xendomain()) {
                machine_e820 = alloc_bootmem_low_pages(PAGE_SIZE);
 
                memmap.nr_entries = E820MAX;
@@ -919,7 +918,7 @@ void __init setup_arch(char **cmdline_p)
                BUG_ON(HYPERVISOR_memory_op(XENMEM_machine_memory_map, 
&memmap));
 
                e820_reserve_resources(machine_e820, memmap.nr_entries);
-       } else if (!(xen_start_info->flags & SIF_INITDOMAIN))
+       } else
                e820_reserve_resources(e820.map, e820.nr_map);
 #elif defined(CONFIG_XEN)
        e820_reserve_resources(e820.map, e820.nr_map);
@@ -938,7 +937,7 @@ void __init setup_arch(char **cmdline_p)
        }
 
 #if defined(CONFIG_XEN_PRIVILEGED_GUEST)
-       if (xen_start_info->flags & SIF_INITDOMAIN) {
+       if (is_initial_xendomain()) {
                e820_setup_gap(machine_e820, memmap.nr_entries);
                free_bootmem(__pa(machine_e820), PAGE_SIZE);
        }
@@ -957,11 +956,7 @@ void __init setup_arch(char **cmdline_p)
                set_iopl.iopl = 1;
                HYPERVISOR_physdev_op(PHYSDEVOP_set_iopl, &set_iopl);
 
-               if (xen_start_info->flags & SIF_INITDOMAIN) {
-                       if (!(xen_start_info->flags & SIF_PRIVILEGED))
-                               panic("Xen granted us console access "
-                                     "but not privileged status");
-                      
+               if (is_initial_xendomain()) {
 #ifdef CONFIG_VT
 #if defined(CONFIG_VGA_CONSOLE)
                        conswitchp = &vga_con;
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c    Mon Aug 14 14:17:26 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c    Mon Aug 14 14:44:31 
2006 +0100
@@ -789,7 +789,7 @@ void __init paging_init(void)
 
        /* Setup mapping of lower 1st MB */
        for (i = 0; i < NR_FIX_ISAMAPS; i++)
-               if (xen_start_info->flags & SIF_PRIVILEGED)
+               if (is_initial_xendomain())
                        set_fixmap(FIX_ISAMAP_BEGIN - i, i * PAGE_SIZE);
                else
                        __set_fixmap(FIX_ISAMAP_BEGIN - i,
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c
--- a/linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c   Mon Aug 14 14:17:26 
2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/char/tpm/tpm_xen.c   Mon Aug 14 14:44:31 
2006 +0100
@@ -718,9 +718,8 @@ static int __init tpmif_init(void)
        long rc = 0;
        struct tpm_private *tp;
 
-       if ((xen_start_info->flags & SIF_INITDOMAIN)) {
+       if (is_initial_xendomain())
                return -EPERM;
-       }
 
        tp = tpm_private_get();
        if (!tp) {
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/drivers/xen/console/console.c
--- a/linux-2.6-xen-sparse/drivers/xen/console/console.c        Mon Aug 14 
14:17:26 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/console/console.c        Mon Aug 14 
14:44:31 2006 +0100
@@ -188,7 +188,7 @@ static int __init xen_console_init(void)
        if (!is_running_on_xen())
                return __RETCODE;
 
-       if (xen_start_info->flags & SIF_INITDOMAIN) {
+       if (is_initial_xendomain()) {
                if (xc_mode == XC_DEFAULT)
                        xc_mode = XC_SERIAL;
                kcons_info.write = kcons_write_dom0;
@@ -247,7 +247,7 @@ void xencons_force_flush(void)
        int sz;
 
        /* Emergency console is synchronous, so there's nothing to flush. */
-       if (xen_start_info->flags & SIF_INITDOMAIN)
+       if (is_initial_xendomain())
                return;
 
        /* Spin until console data is flushed through to the daemon. */
@@ -318,7 +318,7 @@ static void __xencons_tx_flush(void)
        int sent, sz, work_done = 0;
 
        if (x_char) {
-               if (xen_start_info->flags & SIF_INITDOMAIN)
+               if (is_initial_xendomain())
                        kcons_write_dom0(NULL, &x_char, 1);
                else
                        while (x_char)
@@ -332,7 +332,7 @@ static void __xencons_tx_flush(void)
                sz = wp - wc;
                if (sz > (wbuf_size - WBUF_MASK(wc)))
                        sz = wbuf_size - WBUF_MASK(wc);
-               if (xen_start_info->flags & SIF_INITDOMAIN) {
+               if (is_initial_xendomain()) {
                        kcons_write_dom0(NULL, &wbuf[WBUF_MASK(wc)], sz);
                        wc += sz;
                } else {
@@ -622,7 +622,7 @@ static int __init xencons_init(void)
                return rc;
        }
 
-       if (xen_start_info->flags & SIF_INITDOMAIN) {
+       if (is_initial_xendomain()) {
                xencons_priv_irq = bind_virq_to_irqhandler(
                        VIRQ_CONSOLE,
                        0,
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c       Mon Aug 14 
14:17:26 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/core/cpu_hotplug.c       Mon Aug 14 
14:44:31 2006 +0100
@@ -92,7 +92,7 @@ static int setup_cpu_watcher(struct noti
                .flags = XBWF_new_thread };
        (void)register_xenbus_watch(&cpu_watch);
 
-       if (!(xen_start_info->flags & SIF_INITDOMAIN)) {
+       if (!is_initial_xendomain()) {
                for_each_cpu(i)
                        vcpu_hotplug(i);
                printk(KERN_INFO "Brought up %ld CPUs\n",
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/drivers/xen/core/evtchn.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c    Mon Aug 14 14:17:26 
2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/core/evtchn.c    Mon Aug 14 14:44:31 
2006 +0100
@@ -840,8 +840,7 @@ void __init xen_init_IRQ(void)
 
 #ifdef RTC_IRQ
                /* If not domain 0, force our RTC driver to fail its probe. */
-               if ((i == RTC_IRQ) &&
-                   !(xen_start_info->flags & SIF_INITDOMAIN))
+               if ((i == RTC_IRQ) && !is_initial_xendomain())
                        continue;
 #endif
 
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/drivers/xen/core/skbuff.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/skbuff.c    Mon Aug 14 14:17:26 
2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/core/skbuff.c    Mon Aug 14 14:44:31 
2006 +0100
@@ -121,8 +121,7 @@ static int __init skbuff_init(void)
        for (order = 0; order <= MAX_SKBUFF_ORDER; order++) {
                size = PAGE_SIZE << order;
                sprintf(name[order], "xen-skb-%lu", size);
-               if (is_running_on_xen() &&
-                   (xen_start_info->flags & SIF_PRIVILEGED))
+               if (is_running_on_xen() && is_initial_xendomain())
                        skbuff_order_cachep[order] = kmem_cache_create(
                                name[order], size, size, 0,
                                skbuff_ctor, skbuff_dtor);
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/drivers/xen/core/smpboot.c
--- a/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c   Mon Aug 14 14:17:26 
2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/core/smpboot.c   Mon Aug 14 14:44:31 
2006 +0100
@@ -294,7 +294,7 @@ void __init smp_prepare_cpus(unsigned in
                irq_ctx_init(cpu);
 
 #ifdef CONFIG_HOTPLUG_CPU
-               if (xen_start_info->flags & SIF_INITDOMAIN)
+               if (is_initial_xendomain())
                        cpu_set(cpu, cpu_present_map);
 #else
                cpu_set(cpu, cpu_present_map);
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Mon Aug 14 
14:17:26 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c      Mon Aug 14 
14:44:31 2006 +0100
@@ -1818,7 +1818,7 @@ static int __init netif_init(void)
        if (!is_running_on_xen())
                return -ENODEV;
 
-       if (xen_start_info->flags & SIF_INITDOMAIN)
+       if (is_initial_xendomain())
                return 0;
 
        IPRINTK("Initialising virtual ethernet driver.\n");
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c
--- a/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c        Mon Aug 14 
14:17:26 2006 +0100
+++ b/linux-2.6-xen-sparse/drivers/xen/privcmd/privcmd.c        Mon Aug 14 
14:44:31 2006 +0100
@@ -246,7 +246,7 @@ static int capabilities_read(char *page,
        int len = 0;
        *page = 0;
 
-       if (xen_start_info->flags & SIF_INITDOMAIN)
+       if (is_initial_xendomain())
                len = sprintf( page, "control_d\n" );
 
        *eof = 1;
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h
--- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h   Mon Aug 
14 14:17:26 2006 +0100
+++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h   Mon Aug 
14 14:44:31 2006 +0100
@@ -58,6 +58,7 @@ extern shared_info_t *HYPERVISOR_shared_
 
 /* arch/xen/i386/kernel/setup.c */
 extern start_info_t *xen_start_info;
+#define is_initial_xendomain() (xen_start_info->flags & SIF_INITDOMAIN)
 
 /* arch/xen/kernel/evtchn.c */
 /* Force a proper event-channel callback from Xen. */
diff -r e061f14161b0 -r d8338b28bcd6 
linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h
--- a/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h        Mon Aug 14 
14:17:26 2006 +0100
+++ b/linux-2.6-xen-sparse/include/asm-ia64/hypervisor.h        Mon Aug 14 
14:44:31 2006 +0100
@@ -58,6 +58,8 @@ extern int running_on_xen;
 
 extern shared_info_t *HYPERVISOR_shared_info;
 extern start_info_t *xen_start_info;
+
+#define is_initial_xendomain() (xen_start_info->flags & SIF_INITDOMAIN)
 
 void force_evtchn_callback(void);
 

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.