]> xenbits.xensource.com Git - xen.git/commitdiff
rename dom0 to hardware_domain
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>
Fri, 11 Apr 2014 09:20:55 +0000 (11:20 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 11 Apr 2014 09:20:55 +0000 (11:20 +0200)
This should not change any functionality other than renaming the global
variable.  In a few cases (primarily the domain building code), a local
variable or argument named dom0 was created and used instead of the
global hardware_domain to clarify that the domain being used in this
case is actually domain 0.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Christoph Egger <chegger@amazon.de>
Acked-by: Keir Fraser <keir@xen.org>
26 files changed:
xen/arch/arm/domain_build.c
xen/arch/arm/setup.c
xen/arch/x86/acpi/cpu_idle.c
xen/arch/x86/cpu/mcheck/vmce.h
xen/arch/x86/crash.c
xen/arch/x86/domain_build.c
xen/arch/x86/io_apic.c
xen/arch/x86/irq.c
xen/arch/x86/mm.c
xen/arch/x86/nmi.c
xen/arch/x86/setup.c
xen/arch/x86/traps.c
xen/arch/x86/x86_64/mm.c
xen/common/domain.c
xen/common/event_channel.c
xen/common/kexec.c
xen/common/keyhandler.c
xen/common/xenoprof.c
xen/drivers/char/ns16550.c
xen/drivers/passthrough/amd/pci_amd_iommu.c
xen/drivers/passthrough/iommu.c
xen/drivers/passthrough/pci.c
xen/drivers/passthrough/vtd/iommu.c
xen/include/asm-arm/domain.h
xen/include/xen/domain.h
xen/include/xen/sched.h

index 502db84690ea7deabc8e7cddfd8d3f1fc9d6c9bb..fede5c014534683a3428038afb5ff562984a7582 100644 (file)
@@ -50,7 +50,7 @@ custom_param("dom0_mem", parse_dom0_mem);
  */
 #define DOM0_FDT_EXTRA_SIZE (128 + sizeof(struct fdt_reserve_entry))
 
-struct vcpu *__init alloc_dom0_vcpu0(void)
+struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0)
 {
     if ( opt_dom0_max_vcpus == 0 )
         opt_dom0_max_vcpus = num_online_cpus();
index 0892a54da0e1e488a183420c4eb94e65e4773dbf..358eafb0941f4b59a7a01c707e4fb0d4dc0938e9 100644 (file)
@@ -663,6 +663,7 @@ void __init start_xen(unsigned long boot_phys_offset,
     size_t fdt_size;
     int cpus, i;
     const char *cmdline;
+    struct domain *dom0;
 
     setup_cache();
 
@@ -760,8 +761,8 @@ void __init start_xen(unsigned long boot_phys_offset,
     do_initcalls();
 
     /* Create initial domain 0. */
-    dom0 = domain_create(0, 0, 0);
-    if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) )
+    hardware_domain = dom0 = domain_create(0, 0, 0);
+    if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) )
             panic("Error creating domain 0");
 
     dom0->is_privileged = 1;
index d2119e27cd14fe66bcf614b8dab09c09dc25128e..b05fb391824bf9927de604871b0c887d7ed8936c 100644 (file)
@@ -972,7 +972,7 @@ static void set_cx(
             cx->entry_method = ACPI_CSTATE_EM_HALT;
         break;
     case ACPI_ADR_SPACE_SYSTEM_IO:
-        if ( ioports_deny_access(dom0, cx->address, cx->address) )
+        if ( ioports_deny_access(hardware_domain, cx->address, cx->address) )
             printk(XENLOG_WARNING "Could not deny access to port %04x\n",
                    cx->address);
         cx->entry_method = ACPI_CSTATE_EM_SYSIO;
index 6b2c95a8aee8f31da0248f3592f49decc987be5e..163ce3c39f095c5f633398cf6cd47cb648c60395 100644 (file)
@@ -5,8 +5,9 @@
 
 int vmce_init(struct cpuinfo_x86 *c);
 
-#define dom0_vmce_enabled() (dom0 && dom0->max_vcpus && dom0->vcpu[0] \
-        && guest_enabled_event(dom0->vcpu[0], VIRQ_MCA))
+#define dom0_vmce_enabled() (hardware_domain && hardware_domain->max_vcpus \
+        && hardware_domain->vcpu[0] \
+        && guest_enabled_event(hardware_domain->vcpu[0], VIRQ_MCA))
 
 int unmmap_broken_page(struct domain *d, mfn_t mfn, unsigned long gfn);
 
index ec586bd22f5394d8d5478e78ef19eafa7c8fbc01..aed3b3ec75208e241c0f7738fbb2a4c708340b5c 100644 (file)
@@ -205,7 +205,7 @@ void machine_crash_shutdown(void)
     info = kexec_crash_save_info();
     info->xen_phys_start = xen_phys_start;
     info->dom0_pfn_to_mfn_frame_list_list =
-        arch_get_pfn_to_mfn_frame_list_list(dom0);
+        arch_get_pfn_to_mfn_frame_list_list(hardware_domain);
 }
 
 /*
index 84ce392352b943d4b8c890030352537eeca74980..b2411b066a250b7c3191fdc04b1dfb3982509e07 100644 (file)
@@ -100,7 +100,7 @@ static void __init parse_dom0_max_vcpus(const char *s)
 }
 custom_param("dom0_max_vcpus", parse_dom0_max_vcpus);
 
-struct vcpu *__init alloc_dom0_vcpu0(void)
+struct vcpu *__init alloc_dom0_vcpu0(struct domain *dom0)
 {
     unsigned max_vcpus;
 
@@ -302,7 +302,7 @@ static void __init process_dom0_ioports_disable(void)
         printk("Disabling dom0 access to ioport range %04lx-%04lx\n",
             io_from, io_to);
 
-        if ( ioports_deny_access(dom0, io_from, io_to) != 0 )
+        if ( ioports_deny_access(hardware_domain, io_from, io_to) != 0 )
             BUG();
     }
 }
@@ -1082,27 +1082,28 @@ int __init construct_dom0(
 
     rc = 0;
 
-    /* DOM0 is permitted full I/O capabilities. */
-    rc |= ioports_permit_access(dom0, 0, 0xFFFF);
-    rc |= iomem_permit_access(dom0, 0UL, ~0UL);
-    rc |= irqs_permit_access(dom0, 1, nr_irqs_gsi - 1);
+    /* The hardware domain is initially permitted full I/O capabilities. */
+    rc |= ioports_permit_access(hardware_domain, 0, 0xFFFF);
+    rc |= iomem_permit_access(hardware_domain, 0UL, ~0UL);
+    rc |= irqs_permit_access(hardware_domain, 1, nr_irqs_gsi - 1);
 
     /*
      * Modify I/O port access permissions.
      */
     /* Master Interrupt Controller (PIC). */
-    rc |= ioports_deny_access(dom0, 0x20, 0x21);
+    rc |= ioports_deny_access(hardware_domain, 0x20, 0x21);
     /* Slave Interrupt Controller (PIC). */
-    rc |= ioports_deny_access(dom0, 0xA0, 0xA1);
+    rc |= ioports_deny_access(hardware_domain, 0xA0, 0xA1);
     /* Interval Timer (PIT). */
-    rc |= ioports_deny_access(dom0, 0x40, 0x43);
+    rc |= ioports_deny_access(hardware_domain, 0x40, 0x43);
     /* PIT Channel 2 / PC Speaker Control. */
-    rc |= ioports_deny_access(dom0, 0x61, 0x61);
+    rc |= ioports_deny_access(hardware_domain, 0x61, 0x61);
     /* ACPI PM Timer. */
     if ( pmtmr_ioport )
-        rc |= ioports_deny_access(dom0, pmtmr_ioport, pmtmr_ioport + 3);
+        rc |= ioports_deny_access(hardware_domain, pmtmr_ioport,
+                                         pmtmr_ioport + 3);
     /* PCI configuration space (NB. 0xcf8 has special treatment). */
-    rc |= ioports_deny_access(dom0, 0xcfc, 0xcff);
+    rc |= ioports_deny_access(hardware_domain, 0xcfc, 0xcff);
     /* Command-line I/O ranges. */
     process_dom0_ioports_disable();
 
@@ -1113,22 +1114,22 @@ int __init construct_dom0(
     if ( mp_lapic_addr != 0 )
     {
         mfn = paddr_to_pfn(mp_lapic_addr);
-        rc |= iomem_deny_access(dom0, mfn, mfn);
+        rc |= iomem_deny_access(hardware_domain, mfn, mfn);
     }
     /* I/O APICs. */
     for ( i = 0; i < nr_ioapics; i++ )
     {
         mfn = paddr_to_pfn(mp_ioapics[i].mpc_apicaddr);
         if ( !rangeset_contains_singleton(mmio_ro_ranges, mfn) )
-            rc |= iomem_deny_access(dom0, mfn, mfn);
+            rc |= iomem_deny_access(hardware_domain, mfn, mfn);
     }
     /* MSI range. */
-    rc |= iomem_deny_access(dom0, paddr_to_pfn(MSI_ADDR_BASE_LO),
+    rc |= iomem_deny_access(hardware_domain, paddr_to_pfn(MSI_ADDR_BASE_LO),
                             paddr_to_pfn(MSI_ADDR_BASE_LO +
                                          MSI_ADDR_DEST_ID_MASK));
     /* HyperTransport range. */
     if ( boot_cpu_data.x86_vendor == X86_VENDOR_AMD )
-        rc |= iomem_deny_access(dom0, paddr_to_pfn(0xfdULL << 32),
+        rc |= iomem_deny_access(hardware_domain, paddr_to_pfn(0xfdULL << 32),
                                 paddr_to_pfn((1ULL << 40) - 1));
 
     /* Remove access to E820_UNUSABLE I/O regions above 1MB. */
@@ -1140,7 +1141,7 @@ int __init construct_dom0(
         if ( (e820.map[i].type == E820_UNUSABLE) &&
              (e820.map[i].size != 0) &&
              (sfn <= efn) )
-            rc |= iomem_deny_access(dom0, sfn, efn);
+            rc |= iomem_deny_access(hardware_domain, sfn, efn);
     }
 
     BUG_ON(rc != 0);
@@ -1149,7 +1150,7 @@ int __init construct_dom0(
         printk(" Xen warning: dom0 kernel broken ELF: %s\n",
                elf_check_broken(&elf));
 
-    iommu_dom0_init(dom0);
+    iommu_dom0_init(hardware_domain);
     return 0;
 
 out:
index bddc588186fb620d3f5d4b54b981f1a0c27fec9a..4e6fe2bd7e4beeed8d6f3db0458b31a0d284fc97 100644 (file)
@@ -2363,7 +2363,7 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
      * that dom0 pirq == irq.
      */
     pirq = (irq >= 256) ? irq : rte.vector;
-    if ( (pirq < 0) || (pirq >= dom0->nr_pirqs) )
+    if ( (pirq < 0) || (pirq >= hardware_domain->nr_pirqs) )
         return -EINVAL;
     
     if ( desc->action )
@@ -2399,10 +2399,10 @@ int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 val)
 
         printk(XENLOG_INFO "allocated vector %02x for irq %d\n", ret, irq);
     }
-    spin_lock(&dom0->event_lock);
-    ret = map_domain_pirq(dom0, pirq, irq,
+    spin_lock(&hardware_domain->event_lock);
+    ret = map_domain_pirq(hardware_domain, pirq, irq,
             MAP_PIRQ_TYPE_GSI, NULL);
-    spin_unlock(&dom0->event_lock);
+    spin_unlock(&hardware_domain->event_lock);
     if ( ret < 0 )
         return ret;
 
index 60b1a5061a218e32575ddbb18f86fca842370a01..5b5b16955cef1cdb318cbb50951f9e51b57e82c8 100644 (file)
@@ -185,9 +185,9 @@ int create_irq(int node)
         desc->arch.used = IRQ_UNUSED;
         irq = ret;
     }
-    else if ( dom0 )
+    else if ( hardware_domain )
     {
-        ret = irq_permit_access(dom0, irq);
+        ret = irq_permit_access(hardware_domain, irq);
         if ( ret )
             printk(XENLOG_G_ERR
                    "Could not grant Dom0 access to IRQ%d (error %d)\n",
@@ -205,9 +205,9 @@ void destroy_irq(unsigned int irq)
 
     BUG_ON(!MSI_IRQ(irq));
 
-    if ( dom0 )
+    if ( hardware_domain )
     {
-        int err = irq_deny_access(dom0, irq);
+        int err = irq_deny_access(hardware_domain, irq);
 
         if ( err )
             printk(XENLOG_G_ERR
index ad48acc4b0d3052fcb1423dead438d8d7fa40256..b9a54a5318d0ef30d822c3a19ec4ed942c2da665 100644 (file)
@@ -5222,7 +5222,7 @@ void *alloc_xen_pagetable(void)
     {
         void *ptr = alloc_xenheap_page();
 
-        BUG_ON(!dom0 && !ptr);
+        BUG_ON(!hardware_domain && !ptr);
         return ptr;
     }
 
index c67a9c3c65255ae71120e4eb73ad013256e7387c..526020b1b6e7ddb68179f0461895adfcfb6f90cb 100644 (file)
@@ -519,7 +519,7 @@ static void do_nmi_stats(unsigned char key)
     for_each_online_cpu ( i )
         printk("%3d\t%3d\n", i, nmi_count(i));
 
-    if ( ((d = dom0) == NULL) || (d->vcpu == NULL) ||
+    if ( ((d = hardware_domain) == NULL) || (d->vcpu == NULL) ||
          ((v = d->vcpu[0]) == NULL) )
         return;
 
index 1fd70ec81c6351e14d8d66582c6985f295359477..11c95fcd583f85c25b4e53433d1bf5bd95b9c048 100644 (file)
@@ -547,6 +547,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
     unsigned long nr_pages, raw_max_page, modules_headroom, *module_map;
     int i, j, e820_warn = 0, bytes = 0;
     bool_t acpi_boot_table_init_done = 0;
+    struct domain *dom0;
     struct ns16550_defaults ns16550 = {
         .data_bits = 8,
         .parity    = 'n',
@@ -1338,8 +1339,8 @@ void __init noreturn __start_xen(unsigned long mbi_p)
         panic("Could not protect TXT memory regions");
 
     /* Create initial domain 0. */
-    dom0 = domain_create(0, DOMCRF_s3_integrity, 0);
-    if ( IS_ERR(dom0) || (alloc_dom0_vcpu0() == NULL) )
+    hardware_domain = dom0 = domain_create(0, DOMCRF_s3_integrity, 0);
+    if ( IS_ERR(dom0) || (alloc_dom0_vcpu0(dom0) == NULL) )
         panic("Error creating domain 0");
 
     dom0->is_privileged = 1;
index 21c8b63a829fb3d0af9e7689b2b412a1f0565692..e5c126970fb084e68ab026e9e6ca3993757eacbf 100644 (file)
@@ -3152,7 +3152,7 @@ void async_exception_cleanup(struct vcpu *curr)
 
 static void nmi_dom0_report(unsigned int reason_idx)
 {
-    struct domain *d = dom0;
+    struct domain *d = hardware_domain;
 
     if ( (d == NULL) || (d->vcpu == NULL) || (d->vcpu[0] == NULL) )
         return;
index f6ea01224acc2b941397b269e8c40f580f171cd1..71ae519e19349c875c9d1807756587a420726a2a 100644 (file)
@@ -1447,15 +1447,15 @@ int memory_add(unsigned long spfn, unsigned long epfn, unsigned int pxm)
     if ( ret )
         goto destroy_m2p;
 
-    if ( !need_iommu(dom0) )
+    if ( !need_iommu(hardware_domain) )
     {
         for ( i = spfn; i < epfn; i++ )
-            if ( iommu_map_page(dom0, i, i, IOMMUF_readable|IOMMUF_writable) )
+            if ( iommu_map_page(hardware_domain, i, i, IOMMUF_readable|IOMMUF_writable) )
                 break;
         if ( i != epfn )
         {
             while (i-- > old_max)
-                iommu_unmap_page(dom0, i);
+                iommu_unmap_page(hardware_domain, i);
             goto destroy_m2p;
         }
     }
index ccd159ef1d96c056876960443827670b3cd50eb9..ccf7933ca70aa1b4fc2f23f8a3ed4881ab7113d5 100644 (file)
@@ -59,7 +59,7 @@ DEFINE_RCU_READ_LOCK(domlist_read_lock);
 static struct domain *domain_hash[DOMAIN_HASH_SIZE];
 struct domain *domain_list;
 
-struct domain *dom0;
+struct domain *hardware_domain __read_mostly;
 
 struct vcpu *idle_vcpu[NR_CPUS] __read_mostly;
 
index 83bc7dfd0947e6577c08553886954d5b59b0f563..cbd495da298479b231db0b359dd975cf1f7c210a 100644 (file)
@@ -743,7 +743,7 @@ void send_global_virq(uint32_t virq)
     ASSERT(virq < NR_VIRQS);
     ASSERT(virq_is_global(virq));
 
-    send_guest_global_virq(global_virq_handlers[virq] ?: dom0, virq);
+    send_guest_global_virq(global_virq_handlers[virq] ?: hardware_domain, virq);
 }
 
 int set_global_virq_handler(struct domain *d, uint32_t virq)
index 23d964e1f9ade95fccfe258ad2047dc8e34f3763..2239ee8df3e16f55309031a5d4c3f224c0f3d22d 100644 (file)
@@ -872,7 +872,7 @@ static int kexec_load_slot(struct kexec_image *kimage)
 static uint16_t kexec_load_v1_arch(void)
 {
 #ifdef CONFIG_X86
-    return is_pv_32on64_domain(dom0) ? EM_386 : EM_X86_64;
+    return is_pv_32on64_domain(hardware_domain) ? EM_386 : EM_X86_64;
 #else
     return EM_NONE;
 #endif
index 5a974b15e554177a80b7785b8928f53159edeac8..627ef991e56aac35b9e4eea71867a8f83f78be88 100644 (file)
@@ -172,12 +172,12 @@ static void dump_dom0_registers(unsigned char key)
 {
     struct vcpu *v;
 
-    if ( dom0 == NULL )
+    if ( hardware_domain == NULL )
         return;
 
     printk("'%c' pressed -> dumping Dom0's registers\n", key);
 
-    for_each_vcpu ( dom0, v )
+    for_each_vcpu ( hardware_domain, v )
     {
         if ( alt_key_handling && softirq_pending(smp_processor_id()) )
         {
index 3c30c3e3e1db19f35fcf4606bedc191bc22857df..3de20b8f9d5943a3c0567e523600adbf346f6861 100644 (file)
@@ -219,7 +219,7 @@ static int alloc_xenoprof_struct(
     bufsize = sizeof(struct xenoprof_buf);
     i = sizeof(struct event_log);
 #ifdef CONFIG_COMPAT
-    d->xenoprof->is_compat = is_pv_32on64_domain(is_passive ? dom0 : d);
+    d->xenoprof->is_compat = is_pv_32on64_domain(is_passive ? hardware_domain : d);
     if ( XENOPROF_COMPAT(d->xenoprof) )
     {
         bufsize = sizeof(struct compat_oprof_buf);
index 5952de1e7cbd5f073ee942aa5a136258a634a61f..4aa33d53bec7bf419f6b1a3bf251f8405e688c2e 100644 (file)
@@ -726,10 +726,12 @@ static void __init ns16550_endboot(struct serial_port *port)
 {
 #ifdef HAS_IOPORTS
     struct ns16550 *uart = port->uart;
+    int rv;
 
     if ( uart->remapped_io_base )
         return;
-    if ( ioports_deny_access(dom0, uart->io_base, uart->io_base + 7) != 0 )
+    rv = ioports_deny_access(hardware_domain, uart->io_base, uart->io_base + 7);
+    if ( rv != 0 )
         BUG();
 #endif
 }
index ff5f06e305573349602f69bf95ada097c4777813..031480fe8b33658f86a6f7b876744761633d453c 100644 (file)
@@ -403,7 +403,7 @@ static int amd_iommu_assign_device(struct domain *d, u8 devfn,
             ivrs_mappings[req_id].read_permission);
     }
 
-    return reassign_device(dom0, d, devfn, pdev);
+    return reassign_device(hardware_domain, d, devfn, pdev);
 }
 
 static void deallocate_next_page_table(struct page_info *pg, int level)
index 3e5635cd616aa217b779cf1d3735898a6685d51a..25d9af9a165dffb432bdde008d89692614eae9dd 100644 (file)
@@ -265,7 +265,7 @@ static void iommu_teardown(struct domain *d)
 }
 
 /*
- * If the device isn't owned by dom0, it means it already
+ * If the device isn't owned by the hardware domain, it means it already
  * has been assigned to other domain, or it doesn't exist.
  */
 static int device_assigned(u16 seg, u8 bus, u8 devfn)
@@ -273,7 +273,7 @@ static int device_assigned(u16 seg, u8 bus, u8 devfn)
     struct pci_dev *pdev;
 
     spin_lock(&pcidevs_lock);
-    pdev = pci_get_pdev_by_domain(dom0, seg, bus, devfn);
+    pdev = pci_get_pdev_by_domain(hardware_domain, seg, bus, devfn);
     spin_unlock(&pcidevs_lock);
 
     return pdev ? 0 : -EBUSY;
@@ -312,7 +312,7 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
         d->need_iommu = 1;
     }
 
-    pdev = pci_get_pdev_by_domain(dom0, seg, bus, devfn);
+    pdev = pci_get_pdev_by_domain(hardware_domain, seg, bus, devfn);
     if ( !pdev )
     {
         rc = pci_get_pdev(seg, bus, devfn) ? -EBUSY : -ENODEV;
@@ -507,7 +507,7 @@ int deassign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
         devfn += pdev->phantom_stride;
         if ( PCI_SLOT(devfn) != PCI_SLOT(pdev->devfn) )
             break;
-        ret = hd->platform_ops->reassign_device(d, dom0, devfn, pdev);
+        ret = hd->platform_ops->reassign_device(d, hardware_domain, devfn, pdev);
         if ( !ret )
             continue;
 
@@ -517,7 +517,7 @@ int deassign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
     }
 
     devfn = pdev->devfn;
-    ret = hd->platform_ops->reassign_device(d, dom0, devfn, pdev);
+    ret = hd->platform_ops->reassign_device(d, hardware_domain, devfn, pdev);
     if ( ret )
     {
         dprintk(XENLOG_G_ERR,
index dfa195ac9e2c9a7f236cdb8a297eda4178390135..fbc777c1d68af8de2e7b33eccf09cf177b5d4242 100644 (file)
@@ -569,7 +569,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn, const struct pci_dev_info *info)
     ret = 0;
     if ( !pdev->domain )
     {
-        pdev->domain = dom0;
+        pdev->domain = hardware_domain;
         ret = iommu_add_device(pdev);
         if ( ret )
         {
@@ -577,7 +577,7 @@ int pci_add_device(u16 seg, u8 bus, u8 devfn, const struct pci_dev_info *info)
             goto out;
         }
 
-        list_add(&pdev->domain_list, &dom0->arch.pdev_list);
+        list_add(&pdev->domain_list, &hardware_domain->arch.pdev_list);
     }
     else
         iommu_enable_device(pdev);
index d22d51850fc7059576d2277dc14121774b2bc183..263448dafb76886e28806b7a1c80ddfacc8fa48d 100644 (file)
@@ -1667,7 +1667,7 @@ static int reassign_device_ownership(
      * can attempt to send arbitrary LAPIC/MSI messages. We are unprotected
      * by the root complex unless interrupt remapping is enabled.
      */
-    if ( (target != dom0) && !iommu_intremap )
+    if ( (target != hardware_domain) && !iommu_intremap )
         untrusted_msi = 1;
 
     ret = domain_context_unmap(source, devfn, pdev);
@@ -2270,7 +2270,7 @@ static int intel_iommu_assign_device(
     if ( list_empty(&acpi_drhd_units) )
         return -ENODEV;
 
-    ret = reassign_device_ownership(dom0, d, devfn, pdev);
+    ret = reassign_device_ownership(hardware_domain, d, devfn, pdev);
     if ( ret )
         goto done;
 
index 28c359aa9620742b15782d192093eb3eb4e29b72..ec66a4e9e913d0a798473ad6cdcc2ef8d2f72540 100644 (file)
@@ -87,7 +87,7 @@ enum domain_type {
 #endif
 
 extern int dom0_11_mapping;
-#define is_domain_direct_mapped(d) ((d) == dom0 && dom0_11_mapping)
+#define is_domain_direct_mapped(d) ((d) == hardware_domain && dom0_11_mapping)
 
 struct vtimer {
         struct vcpu *v;
index a05706948a0fe84232e18030c951aed59d547227..bb1c39899f21d027136f902967a56f8df71aa3ab 100644 (file)
@@ -12,7 +12,7 @@ typedef union {
 
 struct vcpu *alloc_vcpu(
     struct domain *d, unsigned int vcpu_id, unsigned int cpu_id);
-struct vcpu *alloc_dom0_vcpu0(void);
+struct vcpu *alloc_dom0_vcpu0(struct domain *dom0);
 int vcpu_reset(struct vcpu *);
 
 struct xen_domctl_getdomaininfo;
index 3d33a90aaad6341fe0ddaa6c7e27e030ee120d58..cbbe8a4d68a06dafff4c373b7706eb7c2a3e943a 100644 (file)
@@ -43,8 +43,8 @@ DEFINE_XEN_GUEST_HANDLE(vcpu_runstate_info_compat_t);
 
 #define SCHED_STAT_CRANK(_X)                (perfc_incr(_X))
 
-/* A global pointer to the initial domain (DOM0). */
-extern struct domain *dom0;
+/* A global pointer to the hardware domain (usually DOM0). */
+extern struct domain *hardware_domain;
 
 #ifndef CONFIG_COMPAT
 #define BITS_PER_EVTCHN_WORD(d) BITS_PER_XEN_ULONG