From: Daniel De Graaf Date: Fri, 11 Apr 2014 09:21:54 +0000 (+0200) Subject: rename various functions referencing dom0 X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5221 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=c248d4264bb9148600a1b9fb813eaa812544ee82;p=xen.git rename various functions referencing dom0 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 Reviewed-by: Jan Beulich Acked-by: Keir Fraser --- diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c index b2411b066a..f75f6e7128 100644 --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -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: diff --git a/xen/arch/x86/hvm/i8254.c b/xen/arch/x86/hvm/i8254.c index dc5b78ccad..3ec01c0a13 100644 --- a/xen/arch/x86/hvm/i8254.c +++ b/xen/arch/x86/hvm/i8254.c @@ -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 */; } diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c index 89308bdbef..07bceda49d 100644 --- a/xen/arch/x86/time.c +++ b/xen/arch/x86/time.c @@ -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 ) diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index e5c126970f..b7303d7d70 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -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' */ diff --git a/xen/common/domain.c b/xen/common/domain.c index ccf7933ca7..c4720a95fa 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -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 ) { diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c index 627ef991e5..5afcfefb45 100644 --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -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); diff --git a/xen/common/shutdown.c b/xen/common/shutdown.c index fadb69be48..94d4c53e6d 100644 --- a/xen/common/shutdown.c +++ b/xen/common/shutdown.c @@ -32,7 +32,7 @@ static void noreturn maybe_reboot(void) } } -void dom0_shutdown(u8 reason) +void hwdom_shutdown(u8 reason) { switch ( reason ) { diff --git a/xen/drivers/passthrough/amd/pci_amd_iommu.c b/xen/drivers/passthrough/amd/pci_amd_iommu.c index 031480fe8b..366c75085e 100644 --- a/xen/drivers/passthrough/amd/pci_amd_iommu.c +++ b/xen/drivers/passthrough/amd/pci_amd_iommu.c @@ -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, diff --git a/xen/drivers/passthrough/iommu.c b/xen/drivers/passthrough/iommu.c index 25d9af9a16..96a79cece5 100644 --- a/xen/drivers/passthrough/iommu.c +++ b/xen/drivers/passthrough/iommu.c @@ -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) diff --git a/xen/drivers/passthrough/pci.c b/xen/drivers/passthrough/pci.c index fbc777c1d6..0794eaff01 100644 --- a/xen/drivers/passthrough/pci.c +++ b/xen/drivers/passthrough/pci.c @@ -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); } diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 263448dafb..abaa8c9cf2 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -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, diff --git a/xen/drivers/passthrough/vtd/x86/vtd.c b/xen/drivers/passthrough/vtd/x86/vtd.c index 00131b3ab7..218e223b47 100644 --- a/xen/drivers/passthrough/vtd/x86/vtd.c +++ b/xen/drivers/passthrough/vtd/x86/vtd.c @@ -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; diff --git a/xen/include/asm-x86/time.h b/xen/include/asm-x86/time.h index c01b0a2785..0631baaf43 100644 --- a/xen/include/asm-x86/time.h +++ b/xen/include/asm-x86/time.h @@ -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); diff --git a/xen/include/xen/iommu.h b/xen/include/xen/iommu.h index 4f534ed705..f8da9f2dce 100644 --- a/xen/include/xen/iommu.h +++ b/xen/include/xen/iommu.h @@ -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, diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h index cadb525ec6..edafa2016e 100644 --- a/xen/include/xen/pci.h +++ b/xen/include/xen/pci.h @@ -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); diff --git a/xen/include/xen/shutdown.h b/xen/include/xen/shutdown.h index a00bfeffd4..b3f7e30cde 100644 --- a/xen/include/xen/shutdown.h +++ b/xen/include/xen/shutdown.h @@ -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);