rename various functions referencing dom0
authorDaniel De Graaf <dgdegra@tycho.nsa.gov>
Fri, 11 Apr 2014 09:21:54 +0000 (11:21 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 11 Apr 2014 09:21:54 +0000 (11:21 +0200)
Most of these functions actually act on the hardware domain, so change
their names to reflect this.

Command line parameters and variables based on those parameters are
excluded since those changes would be user-visible, as are any public
headers.

Signed-off-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
16 files changed:
xen/arch/x86/domain_build.c
xen/arch/x86/hvm/i8254.c
xen/arch/x86/time.c
xen/arch/x86/traps.c
xen/common/domain.c
xen/common/keyhandler.c
xen/common/shutdown.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/drivers/passthrough/vtd/x86/vtd.c
xen/include/asm-x86/time.h
xen/include/xen/iommu.h
xen/include/xen/pci.h
xen/include/xen/shutdown.h

index b2411b066a250b7c3191fdc04b1dfb3982509e07..f75f6e71287d6b0ae2bffa8c64a2bd7883f45d7a 100644 (file)
@@ -1150,7 +1150,7 @@ int __init construct_dom0(
         printk(" Xen warning: dom0 kernel broken ELF: %s\n",
                elf_check_broken(&elf));
 
-    iommu_dom0_init(hardware_domain);
+    iommu_hwdom_init(hardware_domain);
     return 0;
 
 out:
index dc5b78ccad0c5321ea1af01a16ba25eac9fa2fdf..3ec01c0a1367953ee6c0d2d3cc6bcad697ab8ad7 100644 (file)
@@ -549,7 +549,7 @@ int pv_pit_handler(int port, int data, int write)
         .data = data
     };
 
-    if ( is_hardware_domain(current->domain) && dom0_pit_access(&ioreq) )
+    if ( is_hardware_domain(current->domain) && hwdom_pit_access(&ioreq) )
     {
         /* nothing to do */;
     }
index 89308bdbefc13786fd364ee0945a8b19d8855969..07bceda49d6fde594fa748d1a99c503e7eb3e987 100644 (file)
@@ -1602,7 +1602,7 @@ int time_resume(void)
     return 0;
 }
 
-int dom0_pit_access(struct ioreq *ioreq)
+int hwdom_pit_access(struct ioreq *ioreq)
 {
     /* Is Xen using Channel 2? Then disallow direct dom0 access. */
     if ( using_pit )
index e5c126970fb084e68ab026e9e6ca3993757eacbf..b7303d7d702a6f38e0eccb93e983a0a6229f4c24 100644 (file)
@@ -3150,7 +3150,7 @@ void async_exception_cleanup(struct vcpu *curr)
     curr->async_exception_mask = curr->async_exception_state(trap).old_mask;
 }
 
-static void nmi_dom0_report(unsigned int reason_idx)
+static void nmi_hwdom_report(unsigned int reason_idx)
 {
     struct domain *d = hardware_domain;
 
@@ -3169,7 +3169,7 @@ static void pci_serr_error(struct cpu_user_regs *regs)
     switch ( opt_nmi[0] )
     {
     case 'd': /* 'dom0' */
-        nmi_dom0_report(_XEN_NMIREASON_pci_serr);
+        nmi_hwdom_report(_XEN_NMIREASON_pci_serr);
     case 'i': /* 'ignore' */
         /* Would like to print a diagnostic here but can't call printk()
            from NMI context -- raise a softirq instead. */
@@ -3187,7 +3187,7 @@ static void io_check_error(struct cpu_user_regs *regs)
     switch ( opt_nmi[0] )
     {
     case 'd': /* 'dom0' */
-        nmi_dom0_report(_XEN_NMIREASON_io_error);
+        nmi_hwdom_report(_XEN_NMIREASON_io_error);
     case 'i': /* 'ignore' */
         break;
     default:  /* 'fatal' */
@@ -3206,7 +3206,7 @@ static void unknown_nmi_error(struct cpu_user_regs *regs, unsigned char reason)
     switch ( opt_nmi[0] )
     {
     case 'd': /* 'dom0' */
-        nmi_dom0_report(_XEN_NMIREASON_unknown);
+        nmi_hwdom_report(_XEN_NMIREASON_unknown);
     case 'i': /* 'ignore' */
         break;
     default:  /* 'fatal' */
index ccf7933ca70aa1b4fc2f23f8a3ed4881ab7113d5..c4720a95fa2edf98387f4e24c7581a7b81845fb0 100644 (file)
@@ -595,7 +595,7 @@ void domain_shutdown(struct domain *d, u8 reason)
     reason = d->shutdown_code;
 
     if ( is_hardware_domain(d) )
-        dom0_shutdown(reason);
+        hwdom_shutdown(reason);
 
     if ( d->is_shutting_down )
     {
index 627ef991e56aac35b9e4eea71867a8f83f78be88..5afcfefb454403e22f18c220143adec725a211bb 100644 (file)
@@ -148,9 +148,9 @@ static struct keyhandler dump_registers_keyhandler = {
     .desc = "dump registers"
 };
 
-static DECLARE_TASKLET(dump_dom0_tasklet, NULL, 0);
+static DECLARE_TASKLET(dump_hwdom_tasklet, NULL, 0);
 
-static void dump_dom0_action(unsigned long arg)
+static void dump_hwdom_action(unsigned long arg)
 {
     struct vcpu *v = (void *)arg;
 
@@ -161,14 +161,14 @@ static void dump_dom0_action(unsigned long arg)
             break;
         if ( softirq_pending(smp_processor_id()) )
         {
-            dump_dom0_tasklet.data = (unsigned long)v;
-            tasklet_schedule_on_cpu(&dump_dom0_tasklet, v->processor);
+            dump_hwdom_tasklet.data = (unsigned long)v;
+            tasklet_schedule_on_cpu(&dump_hwdom_tasklet, v->processor);
             break;
         }
     }
 }
 
-static void dump_dom0_registers(unsigned char key)
+static void dump_hwdom_registers(unsigned char key)
 {
     struct vcpu *v;
 
@@ -181,19 +181,19 @@ static void dump_dom0_registers(unsigned char key)
     {
         if ( alt_key_handling && softirq_pending(smp_processor_id()) )
         {
-            tasklet_kill(&dump_dom0_tasklet);
-            tasklet_init(&dump_dom0_tasklet, dump_dom0_action,
+            tasklet_kill(&dump_hwdom_tasklet);
+            tasklet_init(&dump_hwdom_tasklet, dump_hwdom_action,
                          (unsigned long)v);
-            tasklet_schedule_on_cpu(&dump_dom0_tasklet, v->processor);
+            tasklet_schedule_on_cpu(&dump_hwdom_tasklet, v->processor);
             return;
         }
         vcpu_show_execution_state(v);
     }
 }
 
-static struct keyhandler dump_dom0_registers_keyhandler = {
+static struct keyhandler dump_hwdom_registers_keyhandler = {
     .diagnostic = 1,
-    .u.fn = dump_dom0_registers,
+    .u.fn = dump_hwdom_registers,
     .desc = "dump Dom0 registers"
 };
 
@@ -543,7 +543,7 @@ void __init initialize_keytable(void)
     register_keyhandler('r', &dump_runq_keyhandler);
     register_keyhandler('R', &reboot_machine_keyhandler);
     register_keyhandler('t', &read_clocks_keyhandler);
-    register_keyhandler('0', &dump_dom0_registers_keyhandler);
+    register_keyhandler('0', &dump_hwdom_registers_keyhandler);
     register_keyhandler('%', &do_debug_key_keyhandler);
     register_keyhandler('*', &run_all_keyhandlers_keyhandler);
 
index fadb69be48211e0d2e8ff0ecaa502baac84aa26d..94d4c53e6d77cc528242f579a2660b3edc57f912 100644 (file)
@@ -32,7 +32,7 @@ static void noreturn maybe_reboot(void)
     }
 }
 
-void dom0_shutdown(u8 reason)
+void hwdom_shutdown(u8 reason)
 {
     switch ( reason )
     {
index 031480fe8b33658f86a6f7b876744761633d453c..366c75085e06249d939183ee5455ccf1ea125753 100644 (file)
@@ -169,7 +169,7 @@ static void amd_iommu_setup_domain_device(
     }
 }
 
-static int __hwdom_init amd_iommu_setup_dom0_device(
+static int __hwdom_init amd_iommu_setup_hwdom_device(
     u8 devfn, struct pci_dev *pdev)
 {
     int bdf = PCI_BDF2(pdev->bus, pdev->devfn);
@@ -281,7 +281,7 @@ static int amd_iommu_domain_init(struct domain *d)
     return 0;
 }
 
-static void __hwdom_init amd_iommu_dom0_init(struct domain *d)
+static void __hwdom_init amd_iommu_hwdom_init(struct domain *d)
 {
     unsigned long i; 
 
@@ -305,7 +305,7 @@ static void __hwdom_init amd_iommu_dom0_init(struct domain *d)
         }
     }
 
-    setup_dom0_pci_devices(d, amd_iommu_setup_dom0_device);
+    setup_hwdom_pci_devices(d, amd_iommu_setup_hwdom_device);
 }
 
 void amd_iommu_disable_domain_device(struct domain *domain,
@@ -603,7 +603,7 @@ static void amd_dump_p2m_table(struct domain *d)
 
 const struct iommu_ops amd_iommu_ops = {
     .init = amd_iommu_domain_init,
-    .dom0_init = amd_iommu_dom0_init,
+    .hwdom_init = amd_iommu_hwdom_init,
     .add_device = amd_iommu_add_device,
     .remove_device = amd_iommu_remove_device,
     .assign_device  = amd_iommu_assign_device,
index 25d9af9a165dffb432bdde008d89692614eae9dd..96a79cece574029c9ac197f2857e3cade35bfd85 100644 (file)
@@ -130,7 +130,7 @@ int iommu_domain_init(struct domain *d)
     return hd->platform_ops->init(d);
 }
 
-static void __hwdom_init check_dom0_pvh_reqs(struct domain *d)
+static void __hwdom_init check_hwdom_pvh_reqs(struct domain *d)
 {
     if ( !iommu_enabled )
         panic("Presently, iommu must be enabled for pvh dom0\n");
@@ -141,12 +141,12 @@ static void __hwdom_init check_dom0_pvh_reqs(struct domain *d)
     iommu_dom0_strict = 1;
 }
 
-void __hwdom_init iommu_dom0_init(struct domain *d)
+void __hwdom_init iommu_hwdom_init(struct domain *d)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
 
     if ( is_pvh_domain(d) )
-        check_dom0_pvh_reqs(d);
+        check_hwdom_pvh_reqs(d);
 
     if ( !iommu_enabled )
         return;
@@ -173,7 +173,7 @@ void __hwdom_init iommu_dom0_init(struct domain *d)
         }
     }
 
-    return hd->platform_ops->dom0_init(d);
+    return hd->platform_ops->hwdom_init(d);
 }
 
 int iommu_add_device(struct pci_dev *pdev)
index fbc777c1d68af8de2e7b33eccf09cf177b5d4242..0794eaff013b266982f367909213b8496f3c695a 100644 (file)
@@ -867,12 +867,12 @@ int __init scan_pci_devices(void)
     return ret;
 }
 
-struct setup_dom0 {
+struct setup_hwdom {
     struct domain *d;
     int (*handler)(u8 devfn, struct pci_dev *);
 };
 
-static void setup_one_dom0_device(const struct setup_dom0 *ctxt,
+static void setup_one_hwdom_device(const struct setup_hwdom *ctxt,
                                   struct pci_dev *pdev)
 {
     u8 devfn = pdev->devfn;
@@ -893,9 +893,9 @@ static void setup_one_dom0_device(const struct setup_dom0 *ctxt,
               PCI_SLOT(devfn) == PCI_SLOT(pdev->devfn) );
 }
 
-static int __hwdom_init _setup_dom0_pci_devices(struct pci_seg *pseg, void *arg)
+static int __hwdom_init _setup_hwdom_pci_devices(struct pci_seg *pseg, void *arg)
 {
-    struct setup_dom0 *ctxt = arg;
+    struct setup_hwdom *ctxt = arg;
     int bus, devfn;
 
     for ( bus = 0; bus < 256; bus++ )
@@ -911,12 +911,12 @@ static int __hwdom_init _setup_dom0_pci_devices(struct pci_seg *pseg, void *arg)
             {
                 pdev->domain = ctxt->d;
                 list_add(&pdev->domain_list, &ctxt->d->arch.pdev_list);
-                setup_one_dom0_device(ctxt, pdev);
+                setup_one_hwdom_device(ctxt, pdev);
             }
             else if ( pdev->domain == dom_xen )
             {
                 pdev->domain = ctxt->d;
-                setup_one_dom0_device(ctxt, pdev);
+                setup_one_hwdom_device(ctxt, pdev);
                 pdev->domain = dom_xen;
             }
             else if ( pdev->domain != ctxt->d )
@@ -943,13 +943,13 @@ static int __hwdom_init _setup_dom0_pci_devices(struct pci_seg *pseg, void *arg)
     return 0;
 }
 
-void __hwdom_init setup_dom0_pci_devices(
+void __hwdom_init setup_hwdom_pci_devices(
     struct domain *d, int (*handler)(u8 devfn, struct pci_dev *))
 {
-    struct setup_dom0 ctxt = { .d = d, .handler = handler };
+    struct setup_hwdom ctxt = { .d = d, .handler = handler };
 
     spin_lock(&pcidevs_lock);
-    pci_segments_iterate(_setup_dom0_pci_devices, &ctxt);
+    pci_segments_iterate(_setup_hwdom_pci_devices, &ctxt);
     spin_unlock(&pcidevs_lock);
 }
 
index 263448dafb76886e28806b7a1c80ddfacc8fa48d..abaa8c9cf26530e06df559d2f0cfc5330f88f113 100644 (file)
@@ -55,8 +55,8 @@ int nr_iommus;
 
 static struct tasklet vtd_fault_tasklet;
 
-static int setup_dom0_device(u8 devfn, struct pci_dev *);
-static void setup_dom0_rmrr(struct domain *d);
+static int setup_hwdom_device(u8 devfn, struct pci_dev *);
+static void setup_hwdom_rmrr(struct domain *d);
 
 static int domain_iommu_domid(struct domain *d,
                               struct iommu *iommu)
@@ -1242,18 +1242,18 @@ static int intel_iommu_domain_init(struct domain *d)
     return 0;
 }
 
-static void __hwdom_init intel_iommu_dom0_init(struct domain *d)
+static void __hwdom_init intel_iommu_hwdom_init(struct domain *d)
 {
     struct acpi_drhd_unit *drhd;
 
     if ( !iommu_passthrough && !need_iommu(d) )
     {
         /* Set up 1:1 page table for dom0 */
-        iommu_set_dom0_mapping(d);
+        iommu_set_hwdom_mapping(d);
     }
 
-    setup_dom0_pci_devices(d, setup_dom0_device);
-    setup_dom0_rmrr(d);
+    setup_hwdom_pci_devices(d, setup_hwdom_device);
+    setup_hwdom_rmrr(d);
 
     iommu_flush_all();
 
@@ -1992,7 +1992,7 @@ static int intel_iommu_remove_device(u8 devfn, struct pci_dev *pdev)
     return domain_context_unmap(pdev->domain, devfn, pdev);
 }
 
-static int __hwdom_init setup_dom0_device(u8 devfn, struct pci_dev *pdev)
+static int __hwdom_init setup_hwdom_device(u8 devfn, struct pci_dev *pdev)
 {
     int err;
 
@@ -2140,7 +2140,7 @@ static int init_vtd_hw(void)
     return 0;
 }
 
-static void __hwdom_init setup_dom0_rmrr(struct domain *d)
+static void __hwdom_init setup_hwdom_rmrr(struct domain *d)
 {
     struct acpi_rmrr_unit *rmrr;
     u16 bdf;
@@ -2464,7 +2464,7 @@ static void vtd_dump_p2m_table(struct domain *d)
 
 const struct iommu_ops intel_iommu_ops = {
     .init = intel_iommu_domain_init,
-    .dom0_init = intel_iommu_dom0_init,
+    .hwdom_init = intel_iommu_hwdom_init,
     .add_device = intel_iommu_add_device,
     .enable_device = intel_iommu_enable_device,
     .remove_device = intel_iommu_remove_device,
index 00131b3ab78a8f9639fdb4e97ba74e1183626c69..218e223b478c32d252c82e5fbecf496d8d1b6df1 100644 (file)
@@ -107,7 +107,7 @@ void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq)
     spin_unlock(&d->event_lock);
 }
 
-void __hwdom_init iommu_set_dom0_mapping(struct domain *d)
+void __hwdom_init iommu_set_hwdom_mapping(struct domain *d)
 {
     unsigned long i, j, tmp, top;
 
index c01b0a278577d4f2990229c703d7adee3869ddd4..0631baaf43f29f21b1fba3aea114d295a4f77db5 100644 (file)
@@ -44,7 +44,7 @@ int time_resume(void);
 void init_percpu_time(void);
 
 struct ioreq;
-int dom0_pit_access(struct ioreq *ioreq);
+int hwdom_pit_access(struct ioreq *ioreq);
 
 int cpu_frequency_change(u64 freq);
 
index 4f534ed705a70cf931448cba672553a1f1b05558..f8da9f2dcea153dda341af5f55617bdddfe02e07 100644 (file)
@@ -55,7 +55,7 @@ int iommu_add_device(struct pci_dev *pdev);
 int iommu_enable_device(struct pci_dev *pdev);
 int iommu_remove_device(struct pci_dev *pdev);
 int iommu_domain_init(struct domain *d);
-void iommu_dom0_init(struct domain *d);
+void iommu_hwdom_init(struct domain *d);
 void iommu_domain_destroy(struct domain *d);
 int deassign_device(struct domain *d, u16 seg, u8 bus, u8 devfn);
 
@@ -90,7 +90,7 @@ struct page_info;
 
 struct iommu_ops {
     int (*init)(struct domain *d);
-    void (*dom0_init)(struct domain *d);
+    void (*hwdom_init)(struct domain *d);
     int (*add_device)(u8 devfn, struct pci_dev *);
     int (*enable_device)(struct pci_dev *pdev);
     int (*remove_device)(u8 devfn, struct pci_dev *);
@@ -127,7 +127,7 @@ void iommu_suspend(void);
 void iommu_resume(void);
 void iommu_crash_shutdown(void);
 
-void iommu_set_dom0_mapping(struct domain *d);
+void iommu_set_hwdom_mapping(struct domain *d);
 void iommu_share_p2m_table(struct domain *d);
 
 int iommu_do_domctl(struct xen_domctl *, struct domain *d,
index cadb525ec6ae1237c96d1ddae5f5c0042a06e063..edafa2016ebba454085ac7a7b0eeb4768a1cd089 100644 (file)
@@ -97,7 +97,7 @@ struct pci_dev *pci_lock_pdev(int seg, int bus, int devfn);
 struct pci_dev *pci_lock_domain_pdev(
     struct domain *, int seg, int bus, int devfn);
 
-void setup_dom0_pci_devices(struct domain *,
+void setup_hwdom_pci_devices(struct domain *,
                             int (*)(u8 devfn, struct pci_dev *));
 void pci_release_devices(struct domain *d);
 int pci_add_segment(u16 seg);
index a00bfeffd452aa97476314391dfe0c59e6f07ac5..b3f7e30cde5c2763778108e4ad2efff90b5cadfa 100644 (file)
@@ -6,7 +6,7 @@
 /* opt_noreboot: If true, machine will need manual reset on error. */
 extern bool_t opt_noreboot;
 
-void noreturn dom0_shutdown(u8 reason);
+void noreturn hwdom_shutdown(u8 reason);
 
 void noreturn machine_restart(unsigned int delay_millisecs);
 void noreturn machine_halt(void);