diff options
author | Tim Deegan <Tim.Deegan@citrix.com> | 2011-05-26 12:37:47 +0100 |
---|---|---|
committer | Tim Deegan <Tim.Deegan@citrix.com> | 2011-05-26 12:37:47 +0100 |
commit | 093e1d2484fc46ec73e527c03af79664218045df (patch) | |
tree | 4ac0109f7f6d91c8c24a62bfdd20dc44e5370e9d | |
parent | de4bf084c8dc232a629e436ccd0ce989da8c470e (diff) | |
download | xen-093e1d2484fc46ec73e527c03af79664218045df.tar.gz xen-093e1d2484fc46ec73e527c03af79664218045df.tar.bz2 xen-093e1d2484fc46ec73e527c03af79664218045df.zip |
xen: remove extern function declarations from C files.
Move all extern declarations into appropriate header files.
This also fixes up a few places where the caller and the definition
had different signatures.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
54 files changed, 125 insertions, 164 deletions
diff --git a/xen/arch/x86/acpi/cpu_idle.c b/xen/arch/x86/acpi/cpu_idle.c index 064d235e95..23e8d3991e 100644 --- a/xen/arch/x86/acpi/cpu_idle.c +++ b/xen/arch/x86/acpi/cpu_idle.c @@ -72,10 +72,6 @@ static uint64_t (*ticks_elapsed)(uint64_t t1, uint64_t t2); static uint64_t (*tick_to_ns)(uint64_t ticks); static uint64_t (*ns_to_tick)(uint64_t ticks); -extern void (*pm_idle) (void); -extern void (*dead_idle) (void); -extern void menu_get_trace_data(u32 *expected, u32 *pred); - static void (*pm_idle_save) (void) __read_mostly; unsigned int max_cstate __read_mostly = ACPI_PROCESSOR_MAX_POWER - 1; integer_param("max_cstate", max_cstate); diff --git a/xen/arch/x86/cpu/mtrr/main.c b/xen/arch/x86/cpu/mtrr/main.c index b1a88474bd..968d8bd959 100644 --- a/xen/arch/x86/cpu/mtrr/main.c +++ b/xen/arch/x86/cpu/mtrr/main.c @@ -580,9 +580,6 @@ mtrr_del(int reg, unsigned long base, unsigned long size) * These should be called implicitly, but we can't yet until all the initcall * stuff is done... */ -extern void amd_init_mtrr(void); -extern void cyrix_init_mtrr(void); - static void __init init_ifs(void) { #ifndef CONFIG_X86_64 diff --git a/xen/arch/x86/cpu/mtrr/mtrr.h b/xen/arch/x86/cpu/mtrr/mtrr.h index f72cbbb174..429a142742 100644 --- a/xen/arch/x86/cpu/mtrr/mtrr.h +++ b/xen/arch/x86/cpu/mtrr/mtrr.h @@ -83,3 +83,6 @@ extern unsigned int num_var_ranges; void mtrr_state_warn(void); void mtrr_wrmsr(unsigned int msr, uint64_t msr_content); +extern int amd_init_mtrr(void); +extern int cyrix_init_mtrr(void); + diff --git a/xen/arch/x86/debug.c b/xen/arch/x86/debug.c index 62b5a1544d..449f5bd5b0 100644 --- a/xen/arch/x86/debug.c +++ b/xen/arch/x86/debug.c @@ -22,6 +22,7 @@ #include <xen/mm.h> #include <xen/domain_page.h> #include <xen/guest_access.h> +#include <asm/debugger.h> #include <asm/p2m.h> /* @@ -30,8 +31,8 @@ */ #ifdef XEN_KDB_CONFIG -extern volatile int kdbdbg; -extern void kdbp(const char *fmt, ...); +#include "../kdb/include/kdbdefs.h" +#include "../kdb/include/kdbproto.h" #define DBGP(...) {(kdbdbg) ? kdbp(__VA_ARGS__):0;} #define DBGP1(...) {(kdbdbg>1) ? kdbp(__VA_ARGS__):0;} #define DBGP2(...) {(kdbdbg>2) ? kdbp(__VA_ARGS__):0;} @@ -40,10 +41,6 @@ extern void kdbp(const char *fmt, ...); #define DBGP2(...) {0;} #endif -typedef unsigned long dbgva_t; -typedef unsigned char dbgbyte_t; - - /* Returns: mfn for the given (hvm guest) vaddr */ static unsigned long dbg_hvm_va2mfn(dbgva_t vaddr, struct domain *dp, int toaddr) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index d13599aed3..4c0c0122f8 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -34,22 +34,14 @@ #include <public/mem_event.h> #include <asm/mem_sharing.h> #include <asm/xstate.h> - -#ifdef XEN_KDB_CONFIG -#include "../kdb/include/kdbdefs.h" -#include "../kdb/include/kdbproto.h" -#else -typedef unsigned long kdbva_t; -typedef unsigned char kdbbyt_t; -extern int dbg_rw_mem(kdbva_t, kdbbyt_t *, int, domid_t, int, uint64_t); -#endif +#include <asm/debugger.h> static int gdbsx_guest_mem_io( domid_t domid, struct xen_domctl_gdbsx_memio *iop) { ulong l_uva = (ulong)iop->uva; iop->remain = dbg_rw_mem( - (kdbva_t)iop->gva, (kdbbyt_t *)l_uva, iop->len, domid, + (dbgva_t)iop->gva, (dbgbyte_t *)l_uva, iop->len, domid, iop->gwr, iop->pgd3val); return (iop->remain ? -EFAULT : 0); } @@ -732,8 +724,6 @@ long arch_do_domctl( case XEN_DOMCTL_SENDTRIGGER_SLEEP: { - extern void hvm_acpi_sleep_button(struct domain *d); - ret = -EINVAL; if ( is_hvm_domain(d) ) { diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c index b02be7b3ed..35bec23b75 100644 --- a/xen/arch/x86/hvm/hvm.c +++ b/xen/arch/x86/hvm/hvm.c @@ -108,10 +108,6 @@ static struct notifier_block cpu_nfb = { static int __init hvm_enable(void) { - extern struct hvm_function_table *start_svm(void); - extern struct hvm_function_table *start_vmx(void); - extern int hvm_port80_allowed; - struct hvm_function_table *fns = NULL; switch ( boot_cpu_data.x86_vendor ) @@ -502,8 +498,6 @@ int hvm_domain_initialise(struct domain *d) return rc; } -extern void msixtbl_pt_cleanup(struct domain *d); - void hvm_domain_relinquish_resources(struct domain *d) { hvm_destroy_ioreq_page(d, &d->arch.hvm_domain.ioreq); @@ -1377,8 +1371,6 @@ int hvm_set_efer(uint64_t value) return X86EMUL_OKAY; } -extern void shadow_blow_tables_per_domain(struct domain *d); - /* Exit UC mode only if all VCPUs agree on MTRR/PAT and are not in no_fill. */ static bool_t domain_exit_uc_mode(struct vcpu *v) { diff --git a/xen/arch/x86/hvm/nestedhvm.c b/xen/arch/x86/hvm/nestedhvm.c index 7c77e9cbc4..f77b84c286 100644 --- a/xen/arch/x86/hvm/nestedhvm.c +++ b/xen/arch/x86/hvm/nestedhvm.c @@ -200,7 +200,6 @@ unsigned long * nestedhvm_vcpu_iomap_get(bool_t port_80, bool_t port_ed) { int i; - extern int hvm_port80_allowed; if (!hvm_port80_allowed) port_80 = 1; diff --git a/xen/arch/x86/hvm/vmsi.c b/xen/arch/x86/hvm/vmsi.c index eee802adb0..cba074852f 100644 --- a/xen/arch/x86/hvm/vmsi.c +++ b/xen/arch/x86/hvm/vmsi.c @@ -447,7 +447,7 @@ found: spin_unlock_irq(&irq_desc->lock); } -void msixtbl_pt_cleanup(struct domain *d, int pirq) +void msixtbl_pt_cleanup(struct domain *d) { struct msixtbl_entry *entry, *temp; unsigned long flags; diff --git a/xen/arch/x86/ioport_emulate.c b/xen/arch/x86/ioport_emulate.c index d76f1ea567..b3d0ce9e3e 100644 --- a/xen/arch/x86/ioport_emulate.c +++ b/xen/arch/x86/ioport_emulate.c @@ -9,10 +9,6 @@ #include <xen/sched.h> #include <xen/dmi.h> -/* Function pointer used to handle platform specific I/O port emulation. */ -extern void (*ioemul_handle_quirk)( - u8 opcode, char *io_emul_stub, struct cpu_user_regs *regs); - static void ioemul_handle_proliant_quirk( u8 opcode, char *io_emul_stub, struct cpu_user_regs *regs) { diff --git a/xen/arch/x86/irq.c b/xen/arch/x86/irq.c index 43aa1a9568..635c7801f9 100644 --- a/xen/arch/x86/irq.c +++ b/xen/arch/x86/irq.c @@ -1708,8 +1708,6 @@ void free_domain_pirqs(struct domain *d) spin_unlock(&pcidevs_lock); } -extern void dump_ioapic_irq_info(void); - static void dump_irqs(unsigned char key) { int i, irq, pirq; diff --git a/xen/arch/x86/machine_kexec.c b/xen/arch/x86/machine_kexec.c index c998377dbb..d24ad21783 100644 --- a/xen/arch/x86/machine_kexec.c +++ b/xen/arch/x86/machine_kexec.c @@ -21,9 +21,6 @@ typedef void (*relocate_new_kernel_t)( #endif unsigned int preserve_context); -extern int machine_kexec_get_xen(xen_kexec_range_t *range); - - int machine_kexec_load(int type, int slot, xen_kexec_image_t *image) { unsigned long prev_ma = 0; @@ -101,10 +98,6 @@ void machine_kexec(xen_kexec_image_t *image) #ifdef CONFIG_COMPAT if ( is_pv_32on64_domain(dom0) ) { - extern void compat_machine_kexec(unsigned long rnk, - unsigned long indirection_page, - unsigned long *page_list, - unsigned long start_address); compat_machine_kexec(image->page_list[1], image->indirection_page, image->page_list, diff --git a/xen/arch/x86/mm/p2m-pod.c b/xen/arch/x86/mm/p2m-pod.c index fc0601c045..2e2dfbf18d 100644 --- a/xen/arch/x86/mm/p2m-pod.c +++ b/xen/arch/x86/mm/p2m-pod.c @@ -33,18 +33,6 @@ #include <asm/hvm/nestedhvm.h> #include <asm/hvm/svm/amd-iommu-proto.h> -/* Printouts */ -#define P2M_PRINTK(_f, _a...) \ - debugtrace_printk("p2m: %s(): " _f, __func__, ##_a) -#define P2M_ERROR(_f, _a...) \ - printk("pg error: %s(): " _f, __func__, ##_a) -#if P2M_DEBUGGING -#define P2M_DEBUG(_f, _a...) \ - debugtrace_printk("p2mdebug: %s(): " _f, __func__, ##_a) -#else -#define P2M_DEBUG(_f, _a...) do { (void)(_f); } while(0) -#endif - /* Override macros from asm/page.h to make them work with mfn_t */ #undef mfn_to_page @@ -54,12 +42,6 @@ #undef page_to_mfn #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg)) -#if P2M_AUDIT -extern void audit_p2m(struct p2m_domain *p2m, int strict_m2p); -#else -# define audit_p2m(_p2m, _m2p) do { (void)(_p2m),(_m2p); } while (0) -#endif /* P2M_AUDIT */ - #define SUPERPAGE_PAGES (1UL << 9) #define superpage_aligned(_x) (((_x)&(SUPERPAGE_PAGES-1))==0) diff --git a/xen/arch/x86/mm/p2m-pt.c b/xen/arch/x86/mm/p2m-pt.c index b1f96f04fe..3b87045f26 100644 --- a/xen/arch/x86/mm/p2m-pt.c +++ b/xen/arch/x86/mm/p2m-pt.c @@ -38,23 +38,6 @@ #include <asm/hvm/nestedhvm.h> #include <asm/hvm/svm/amd-iommu-proto.h> -/* Debugging and auditing of the P2M code? */ -#define P2M_AUDIT 0 -#define P2M_DEBUGGING 0 - -/* Printouts */ -#define P2M_PRINTK(_f, _a...) \ - debugtrace_printk("p2m: %s(): " _f, __func__, ##_a) -#define P2M_ERROR(_f, _a...) \ - printk("pg error: %s(): " _f, __func__, ##_a) -#if P2M_DEBUGGING -#define P2M_DEBUG(_f, _a...) \ - debugtrace_printk("p2mdebug: %s(): " _f, __func__, ##_a) -#else -#define P2M_DEBUG(_f, _a...) do { (void)(_f); } while(0) -#endif - - /* Override macros from asm/page.h to make them work with mfn_t */ #undef mfn_to_page #define mfn_to_page(_m) __mfn_to_page(mfn_x(_m)) @@ -113,11 +96,6 @@ unsigned long p2m_type_to_flags(p2m_type_t t, mfn_t mfn) } } -#if P2M_AUDIT -void audit_p2m(struct p2m_domain *p2m, int strict_m2p); -#else -# define audit_p2m(_p2m, _m2p) do { (void)(_p2m),(_m2p); } while (0) -#endif /* P2M_AUDIT */ // Find the next level's P2M entry, checking for out-of-range gfn's... // Returns NULL on error. diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index 13f14033ab..aba199e776 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -65,14 +65,6 @@ boolean_param("hap_2mb", opt_hap_2mb); #undef page_to_mfn #define page_to_mfn(_pg) _mfn(__page_to_mfn(_pg)) -#if P2M_AUDIT -extern void audit_p2m(struct p2m_domain *p2m, int strict_m2p); -#else -# define audit_p2m(_p2m, _m2p) do { (void)(_p2m),(_m2p); } while (0) -#endif /* P2M_AUDIT */ - -/* XXX declare functions moved to p2m-pt.c */ -extern void p2m_pt_init(struct p2m_domain *p2m); /* Init the datastructures for later use by the p2m code */ static void p2m_initialise(struct domain *d, struct p2m_domain *p2m) diff --git a/xen/arch/x86/mm/paging.c b/xen/arch/x86/mm/paging.c index 03961cfd1e..1ec6d62fdf 100644 --- a/xen/arch/x86/mm/paging.c +++ b/xen/arch/x86/mm/paging.c @@ -875,8 +875,6 @@ const struct paging_mode *paging_get_mode(struct vcpu *v) return paging_get_nestedmode(v); } -extern const struct paging_mode *hap_paging_get_mode(struct vcpu *); - void paging_update_nestedmode(struct vcpu *v) { ASSERT(nestedhvm_enabled(v->domain)); diff --git a/xen/arch/x86/physdev.c b/xen/arch/x86/physdev.c index e15dd0a95d..4f188546fd 100644 --- a/xen/arch/x86/physdev.c +++ b/xen/arch/x86/physdev.c @@ -9,6 +9,7 @@ #include <xen/guest_access.h> #include <xen/iocap.h> #include <asm/current.h> +#include <asm/io_apic.h> #include <asm/msi.h> #include <asm/hypercall.h> #include <public/xen.h> @@ -20,13 +21,6 @@ typedef long ret_t; #endif -int -ioapic_guest_read( - unsigned long physbase, unsigned int reg, u32 *pval); -int -ioapic_guest_write( - unsigned long physbase, unsigned int reg, u32 pval); - static int physdev_hvm_map_pirq( struct domain *d, struct physdev_map_pirq *map) { diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hypercall.c index 2733fc3b9e..022c6a7e18 100644 --- a/xen/arch/x86/platform_hypercall.c +++ b/xen/arch/x86/platform_hypercall.c @@ -20,6 +20,7 @@ #include <xen/guest_access.h> #include <xen/acpi.h> #include <xen/cpu.h> +#include <xen/pmstat.h> #include <asm/current.h> #include <public/platform.h> #include <acpi/cpufreq/processor_perf.h> @@ -47,9 +48,6 @@ extern spinlock_t xenpf_lock; static DEFINE_PER_CPU(uint64_t, freq); -extern int set_px_pminfo(uint32_t cpu, struct xen_processor_performance *perf); -extern long set_cx_pminfo(uint32_t cpu, struct xen_processor_power *power); - static long cpu_frequency_change_helper(void *data) { return cpu_frequency_change(this_cpu(freq)); diff --git a/xen/arch/x86/smpboot.c b/xen/arch/x86/smpboot.c index deab8f7607..44ee79c648 100644 --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -213,7 +213,6 @@ void smp_callin(void) if ( (rc = hvm_cpu_up()) != 0 ) { - extern void (*dead_idle) (void); printk("CPU%d: Failed to initialise HVM. Not coming online.\n", cpu); cpu_error = rc; clear_local_APIC(); @@ -840,7 +839,6 @@ remove_siblinginfo(int cpu) void __cpu_disable(void) { - extern void fixup_irqs(void); int cpu = smp_processor_id(); set_cpu_state(CPU_STATE_DYING); diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c index 042bde4c46..93f01c23f0 100644 --- a/xen/arch/x86/sysctl.c +++ b/xen/arch/x86/sysctl.c @@ -11,6 +11,7 @@ #include <xen/lib.h> #include <xen/mm.h> #include <xen/guest_access.h> +#include <xen/hypercall.h> #include <public/sysctl.h> #include <xen/sched.h> #include <xen/event.h> @@ -56,8 +57,6 @@ long cpu_down_helper(void *data) return ret; } -extern int __node_distance(int a, int b); - long arch_do_sysctl( struct xen_sysctl *sysctl, XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl) { diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 35cde514e7..c30b3e0f6a 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -69,6 +69,7 @@ #include <asm/hypercall.h> #include <asm/mce.h> #include <asm/apic.h> +#include <asm/hpet.h> #include <public/arch-x86/cpuid.h> /* @@ -1634,8 +1635,6 @@ static uint32_t guest_io_read( return data; } -extern void (*pv_rtc_handler)(unsigned int port, uint8_t value); - static void guest_io_write( unsigned int port, unsigned int bytes, uint32_t data, struct vcpu *v, struct cpu_user_regs *regs) diff --git a/xen/arch/x86/x86_32/traps.c b/xen/arch/x86/x86_32/traps.c index c50b146695..7751557bfa 100644 --- a/xen/arch/x86/x86_32/traps.c +++ b/xen/arch/x86/x86_32/traps.c @@ -21,8 +21,6 @@ #include <public/callback.h> -extern asmlinkage int hypercall(void); - static void print_xen_info(void) { char taint_str[TAINT_STRING_MAX_LEN]; diff --git a/xen/arch/x86/x86_64/cpu_idle.c b/xen/arch/x86/x86_64/cpu_idle.c index c26248e97b..3e7422fee4 100644 --- a/xen/arch/x86/x86_64/cpu_idle.c +++ b/xen/arch/x86/x86_64/cpu_idle.c @@ -28,6 +28,7 @@ #include <xen/types.h> #include <xen/xmalloc.h> #include <xen/guest_access.h> +#include <xen/pmstat.h> #include <compat/platform.h> CHECK_processor_csd; @@ -35,15 +36,6 @@ CHECK_processor_csd; DEFINE_XEN_GUEST_HANDLE(compat_processor_csd_t); DEFINE_XEN_GUEST_HANDLE(compat_processor_cx_t); -#define xlat_page_start ((unsigned long)COMPAT_ARG_XLAT_VIRT_BASE) -#define xlat_page_size COMPAT_ARG_XLAT_SIZE -#define xlat_page_left_size(xlat_page_current) \ - (xlat_page_start + xlat_page_size - xlat_page_current) - -#define xlat_malloc_init(xlat_page_current) do { \ - xlat_page_current = xlat_page_start; \ -} while (0) - void *xlat_malloc(unsigned long *xlat_page_current, size_t size) { void *ret; @@ -60,8 +52,6 @@ void *xlat_malloc(unsigned long *xlat_page_current, size_t size) return ret; } -#define xlat_malloc_array(_p, _t, _c) ((_t *) xlat_malloc(&_p, sizeof(_t) * _c)) - static int copy_from_compat_state(xen_processor_cx_t *xen_state, compat_processor_cx_t *state) { @@ -78,8 +68,6 @@ static int copy_from_compat_state(xen_processor_cx_t *xen_state, return 0; } -extern long set_cx_pminfo(uint32_t cpu, struct xen_processor_power *power); - long compat_set_cx_pminfo(uint32_t cpu, struct compat_processor_power *power) { struct xen_processor_power *xen_power; diff --git a/xen/arch/x86/x86_64/cpufreq.c b/xen/arch/x86/x86_64/cpufreq.c index d005dfdc6d..ce9864e187 100644 --- a/xen/arch/x86/x86_64/cpufreq.c +++ b/xen/arch/x86/x86_64/cpufreq.c @@ -25,23 +25,11 @@ #include <xen/types.h> #include <xen/xmalloc.h> #include <xen/guest_access.h> +#include <xen/pmstat.h> #include <compat/platform.h> DEFINE_XEN_GUEST_HANDLE(compat_processor_px_t); -#define xlat_page_start ((unsigned long)COMPAT_ARG_XLAT_VIRT_BASE) - -#define xlat_malloc_init(xlat_page_current) do { \ - xlat_page_current = xlat_page_start; \ -} while (0) - -extern void *xlat_malloc(unsigned long *xlat_page_current, size_t size); - -#define xlat_malloc_array(_p, _t, _c) ((_t *) xlat_malloc(&_p, sizeof(_t) * _c)) - -extern int -set_px_pminfo(uint32_t cpu, struct xen_processor_performance *perf); - int compat_set_px_pminfo(uint32_t cpu, struct compat_processor_performance *perf) { diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c index c705475538..d5380f8a46 100644 --- a/xen/common/cpupool.c +++ b/xen/common/cpupool.c @@ -582,8 +582,6 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op) return ret; } -void schedule_dump(struct cpupool *c); - void dump_runq(unsigned char key) { unsigned long flags; diff --git a/xen/common/domctl.c b/xen/common/domctl.c index 5e13094518..5f7194dc88 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -22,15 +22,13 @@ #include <xen/guest_access.h> #include <xen/bitmap.h> #include <xen/paging.h> +#include <xen/hypercall.h> #include <asm/current.h> #include <public/domctl.h> #include <xsm/xsm.h> static DEFINE_SPINLOCK(domctl_lock); -extern long arch_do_domctl( - struct xen_domctl *op, XEN_GUEST_HANDLE(xen_domctl_t) u_domctl); - int cpumask_to_xenctl_cpumap( struct xenctl_cpumap *xenctl_cpumap, cpumask_t *cpumask) { diff --git a/xen/common/kernel.c b/xen/common/kernel.c index c061a0d838..5558dc0712 100644 --- a/xen/common/kernel.c +++ b/xen/common/kernel.c @@ -18,6 +18,7 @@ #include <public/version.h> #ifdef CONFIG_X86 #include <asm/shared.h> +#include <asm/setup.h> #endif #ifndef COMPAT @@ -237,7 +238,6 @@ DO(xen_version)(int cmd, XEN_GUEST_HANDLE(void) arg) case XENVER_capabilities: { xen_capabilities_info_t info; - extern void arch_get_xen_caps(xen_capabilities_info_t *info); memset(info, 0, sizeof(info)); arch_get_xen_caps(&info); diff --git a/xen/common/keyhandler.c b/xen/common/keyhandler.c index 662d7e994e..f5c4adc1b6 100644 --- a/xen/common/keyhandler.c +++ b/xen/common/keyhandler.c @@ -14,6 +14,7 @@ #include <xen/rangeset.h> #include <xen/compat.h> #include <xen/ctype.h> +#include <xen/perfc.h> #include <asm/debugger.h> #include <asm/div64.h> @@ -403,7 +404,6 @@ static struct keyhandler read_clocks_keyhandler = { .desc = "display multi-cpu clock info" }; -extern void dump_runq(unsigned char key); static struct keyhandler dump_runq_keyhandler = { .diagnostic = 1, .u.fn = dump_runq, @@ -411,13 +411,11 @@ static struct keyhandler dump_runq_keyhandler = { }; #ifdef PERF_COUNTERS -extern void perfc_printall(unsigned char key); static struct keyhandler perfc_printall_keyhandler = { .diagnostic = 1, .u.fn = perfc_printall, .desc = "print performance counters" }; -extern void perfc_reset(unsigned char key); static struct keyhandler perfc_reset_keyhandler = { .u.fn = perfc_reset, .desc = "reset performance counters" @@ -425,13 +423,11 @@ static struct keyhandler perfc_reset_keyhandler = { #endif #ifdef LOCK_PROFILE -extern void spinlock_profile_printall(unsigned char key); static struct keyhandler spinlock_printall_keyhandler = { .diagnostic = 1, .u.fn = spinlock_profile_printall, .desc = "print lock profile info" }; -extern void spinlock_profile_reset(unsigned char key); static struct keyhandler spinlock_reset_keyhandler = { .u.fn = spinlock_profile_reset, .desc = "reset lock profile info" diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c index 5365c20f29..5cd5144151 100644 --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -27,12 +27,6 @@ #include <xsm/xsm.h> #include <xen/pmstat.h> -extern long arch_do_sysctl( - struct xen_sysctl *op, XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl); -#ifdef LOCK_PROFILE -extern int spinlock_profile_control(xen_sysctl_lockprof_op_t *pc); -#endif - long do_sysctl(XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl) { long ret = 0; diff --git a/xen/drivers/passthrough/io.c b/xen/drivers/passthrough/io.c index 67b022325c..d918c9ca62 100644 --- a/xen/drivers/passthrough/io.c +++ b/xen/drivers/passthrough/io.c @@ -452,7 +452,6 @@ void hvm_dpci_msi_eoi(struct domain *d, int vector) spin_unlock(&d->event_lock); } -extern int vmsi_deliver(struct domain *d, int pirq); static int hvm_pci_msi_assert(struct domain *d, int pirq) { if ( hvm_domain_use_pirq(d, pirq) ) diff --git a/xen/drivers/passthrough/vtd/x86/vtd.c b/xen/drivers/passthrough/vtd/x86/vtd.c index 6a33d7e557..50d0f7d358 100644 --- a/xen/drivers/passthrough/vtd/x86/vtd.c +++ b/xen/drivers/passthrough/vtd/x86/vtd.c @@ -25,6 +25,7 @@ #include <xen/iommu.h> #include <xen/numa.h> #include <asm/fixmap.h> +#include <asm/setup.h> #include "../iommu.h" #include "../dmar.h" #include "../vtd.h" @@ -113,7 +114,6 @@ void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq) void __init iommu_set_dom0_mapping(struct domain *d) { unsigned long i, j, tmp, top; - extern int xen_in_range(unsigned long mfn); BUG_ON(d->domain_id != 0); diff --git a/xen/include/asm-x86/acpi.h b/xen/include/asm-x86/acpi.h index 356af443ec..41322e2610 100644 --- a/xen/include/asm-x86/acpi.h +++ b/xen/include/asm-x86/acpi.h @@ -150,6 +150,7 @@ void acpi_mmcfg_init(void); extern uint32_t system_reset_counter; void hvm_acpi_power_button(struct domain *d); +void hvm_acpi_sleep_button(struct domain *d); /* suspend/resume */ void save_rest_processor_state(void); diff --git a/xen/include/asm-x86/debugger.h b/xen/include/asm-x86/debugger.h index 9fea5d64e8..e47935f631 100644 --- a/xen/include/asm-x86/debugger.h +++ b/xen/include/asm-x86/debugger.h @@ -77,4 +77,9 @@ static inline int debugger_trap_entry( return 0; } +typedef unsigned long dbgva_t; +typedef unsigned char dbgbyte_t; +extern int dbg_rw_mem(dbgva_t addr, dbgbyte_t *buf, int len, + domid_t domid, int toaddr, uint64_t pgd3); + #endif /* __X86_DEBUGGER_H__ */ diff --git a/xen/include/asm-x86/hap.h b/xen/include/asm-x86/hap.h index 6183049695..4d01f1b5d9 100644 --- a/xen/include/asm-x86/hap.h +++ b/xen/include/asm-x86/hap.h @@ -97,6 +97,8 @@ int hap_track_dirty_vram(struct domain *d, unsigned long nr, XEN_GUEST_HANDLE_64(uint8) dirty_bitmap); +extern const struct paging_mode *hap_paging_get_mode(struct vcpu *); + #endif /* XEN_HAP_H */ /* diff --git a/xen/include/asm-x86/hpet.h b/xen/include/asm-x86/hpet.h index 702fd016f1..550958cf29 100644 --- a/xen/include/asm-x86/hpet.h +++ b/xen/include/asm-x86/hpet.h @@ -74,4 +74,6 @@ void hpet_broadcast_exit(void); int hpet_broadcast_is_available(void); void hpet_disable_legacy_broadcast(void); +extern void (*pv_rtc_handler)(unsigned int port, uint8_t value); + #endif /* __X86_HPET_H__ */ diff --git a/xen/include/asm-x86/hvm/hvm.h b/xen/include/asm-x86/hvm/hvm.h index 1e5f7ec5fc..3ce78d7578 100644 --- a/xen/include/asm-x86/hvm/hvm.h +++ b/xen/include/asm-x86/hvm/hvm.h @@ -174,6 +174,10 @@ struct hvm_function_table { extern struct hvm_function_table hvm_funcs; extern bool_t hvm_enabled; extern bool_t cpu_has_lmsl; +extern s8 hvm_port80_allowed; + +extern struct hvm_function_table *start_svm(void); +extern struct hvm_function_table *start_vmx(void); int hvm_domain_initialise(struct domain *d); void hvm_domain_relinquish_resources(struct domain *d); @@ -195,6 +199,7 @@ void hvm_init_guest_time(struct domain *d); void hvm_set_guest_time(struct vcpu *v, u64 guest_time); u64 hvm_get_guest_time(struct vcpu *v); +int vmsi_deliver(struct domain *d, int pirq); int hvm_girq_dest_2_vcpu_id(struct domain *d, uint8_t dest, uint8_t dest_mode); #define hvm_paging_enabled(v) \ diff --git a/xen/include/asm-x86/hypercall.h b/xen/include/asm-x86/hypercall.h index a6615e895e..cb9fb331ea 100644 --- a/xen/include/asm-x86/hypercall.h +++ b/xen/include/asm-x86/hypercall.h @@ -101,6 +101,11 @@ arch_do_domctl( struct xen_domctl *domctl, XEN_GUEST_HANDLE(xen_domctl_t) u_domctl); +extern long +arch_do_sysctl( + struct xen_sysctl *op, + XEN_GUEST_HANDLE(xen_sysctl_t) u_sysctl); + extern int do_kexec( unsigned long op, unsigned arg1, XEN_GUEST_HANDLE(void) uarg); diff --git a/xen/include/asm-x86/io.h b/xen/include/asm-x86/io.h index 7179a9ee75..2e4d62046a 100644 --- a/xen/include/asm-x86/io.h +++ b/xen/include/asm-x86/io.h @@ -52,4 +52,8 @@ __OUT(l,,int) extern void (*pv_post_outb_hook)(unsigned int port, u8 value); +/* Function pointer used to handle platform specific I/O port emulation. */ +extern void (*ioemul_handle_quirk)( + u8 opcode, char *io_emul_stub, struct cpu_user_regs *regs); + #endif diff --git a/xen/include/asm-x86/io_apic.h b/xen/include/asm-x86/io_apic.h index 02c4b71f53..4bbbbe79d3 100644 --- a/xen/include/asm-x86/io_apic.h +++ b/xen/include/asm-x86/io_apic.h @@ -198,6 +198,8 @@ extern void init_ioapic_mappings(void); extern void ioapic_suspend(void); extern void ioapic_resume(void); +extern void dump_ioapic_irq_info(void); + extern struct IO_APIC_route_entry **alloc_ioapic_entries(void); extern void free_ioapic_entries(struct IO_APIC_route_entry **ioapic_entries); extern int save_IO_APIC_setup(struct IO_APIC_route_entry **ioapic_entries); @@ -215,4 +217,7 @@ extern int free_irq_vector(int vector); unsigned highest_gsi(void); +int ioapic_guest_read( unsigned long physbase, unsigned int reg, u32 *pval); +int ioapic_guest_write(unsigned long physbase, unsigned int reg, u32 pval); + #endif diff --git a/xen/include/asm-x86/irq.h b/xen/include/asm-x86/irq.h index 2e8322a05e..5399cb55c4 100644 --- a/xen/include/asm-x86/irq.h +++ b/xen/include/asm-x86/irq.h @@ -116,6 +116,9 @@ int map_domain_emuirq_pirq(struct domain *d, int pirq, int irq); int unmap_domain_pirq_emuirq(struct domain *d, int pirq); int hvm_domain_use_pirq(struct domain *d, int irq); +/* A cpu has been removed from cpu_online_mask. Re-set irq affinities. */ +void fixup_irqs(void); + int init_irq_data(void); void clear_irq_vector(int irq); diff --git a/xen/include/asm-x86/numa.h b/xen/include/asm-x86/numa.h index abe7468446..07d31bb249 100644 --- a/xen/include/asm-x86/numa.h +++ b/xen/include/asm-x86/numa.h @@ -83,5 +83,6 @@ extern int valid_numa_range(u64 start, u64 end, int node); #endif void srat_parse_regions(u64 addr); +extern int __node_distance(int a, int b); #endif diff --git a/xen/include/asm-x86/p2m.h b/xen/include/asm-x86/p2m.h index f097a35ef3..0bf9545ac7 100644 --- a/xen/include/asm-x86/p2m.h +++ b/xen/include/asm-x86/p2m.h @@ -666,6 +666,31 @@ static inline int p2m_gfn_check_limit( int set_p2m_entry(struct p2m_domain *p2m, unsigned long gfn, mfn_t mfn, unsigned int page_order, p2m_type_t p2mt, p2m_access_t p2ma); +/* Set up function pointers for PT implementation: only for use by p2m code */ +extern void p2m_pt_init(struct p2m_domain *p2m); + +/* Debugging and auditing of the P2M code? */ +#define P2M_AUDIT 0 +#define P2M_DEBUGGING 0 + +#if P2M_AUDIT +extern void audit_p2m(struct p2m_domain *p2m, int strict_m2p); +#else +# define audit_p2m(_p2m, _m2p) do { (void)(_p2m),(_m2p); } while (0) +#endif /* P2M_AUDIT */ + +/* Printouts */ +#define P2M_PRINTK(_f, _a...) \ + debugtrace_printk("p2m: %s(): " _f, __func__, ##_a) +#define P2M_ERROR(_f, _a...) \ + printk("pg error: %s(): " _f, __func__, ##_a) +#if P2M_DEBUGGING +#define P2M_DEBUG(_f, _a...) \ + debugtrace_printk("p2mdebug: %s(): " _f, __func__, ##_a) +#else +#define P2M_DEBUG(_f, _a...) do { (void)(_f); } while(0) +#endif + #endif /* _XEN_P2M_H */ /* diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h index f9fbf39d62..7272dfa058 100644 --- a/xen/include/asm-x86/processor.h +++ b/xen/include/asm-x86/processor.h @@ -580,6 +580,7 @@ DECLARE_TRAP_HANDLER(machine_check); DECLARE_TRAP_HANDLER(alignment_check); DECLARE_TRAP_HANDLER(spurious_interrupt_bug); #undef DECLARE_TRAP_HANDLER +extern asmlinkage int hypercall(void); int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx, uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx); diff --git a/xen/include/asm-x86/setup.h b/xen/include/asm-x86/setup.h index 9f1ef7c0b2..f7d6345eab 100644 --- a/xen/include/asm-x86/setup.h +++ b/xen/include/asm-x86/setup.h @@ -2,6 +2,7 @@ #define __X86_SETUP_H_ #include <xen/multiboot.h> +#include <public/version.h> extern bool_t early_boot; extern unsigned long xenheap_initial_phys_start; @@ -38,4 +39,7 @@ int construct_dom0( unsigned long initial_images_nrpages(void); void discard_initial_images(void); +int xen_in_range(unsigned long mfn); +void arch_get_xen_caps(xen_capabilities_info_t *info); + #endif diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h index e7dc66cf09..88a8cd2da3 100644 --- a/xen/include/asm-x86/shadow.h +++ b/xen/include/asm-x86/shadow.h @@ -115,6 +115,9 @@ static inline void shadow_remove_all_shadows(struct vcpu *v, mfn_t gmfn) sh_remove_shadows(v, gmfn, 0 /* Be thorough */, 1 /* Must succeed */); } +/* Discard _all_ mappings from the domain's shadows. */ +void shadow_blow_tables_per_domain(struct domain *d); + #endif /* _XEN_SHADOW_H */ /* diff --git a/xen/include/asm-x86/x86_64/uaccess.h b/xen/include/asm-x86/x86_64/uaccess.h index e35ce28e03..475bea216e 100644 --- a/xen/include/asm-x86/x86_64/uaccess.h +++ b/xen/include/asm-x86/x86_64/uaccess.h @@ -14,6 +14,19 @@ void free_compat_arg_xlat(struct vcpu *v); ((__off + (unsigned long)(size)) <= COMPAT_ARG_XLAT_SIZE); \ }) +#define xlat_page_start ((unsigned long)COMPAT_ARG_XLAT_VIRT_BASE) +#define xlat_page_size COMPAT_ARG_XLAT_SIZE +#define xlat_page_left_size(xlat_page_current) \ + (xlat_page_start + xlat_page_size - xlat_page_current) + +#define xlat_malloc_init(xlat_page_current) do { \ + xlat_page_current = xlat_page_start; \ +} while (0) + +extern void *xlat_malloc(unsigned long *xlat_page_current, size_t size); + +#define xlat_malloc_array(_p, _t, _c) ((_t *) xlat_malloc(&_p, sizeof(_t) * _c)) + /* * Valid if in +ve half of 48-bit address space, or above Xen-reserved area. * This is also valid for range checks (addr, addr+size). As long as the diff --git a/xen/include/xen/cpuidle.h b/xen/include/xen/cpuidle.h index bbdadb4ac4..5285063696 100644 --- a/xen/include/xen/cpuidle.h +++ b/xen/include/xen/cpuidle.h @@ -95,4 +95,6 @@ extern void cpuidle_wakeup_mwait(cpumask_t *mask); #define CPUIDLE_DRIVER_STATE_START 1 +extern void menu_get_trace_data(u32 *expected, u32 *pred); + #endif /* _XEN_CPUIDLE_H */ diff --git a/xen/include/xen/kexec.h b/xen/include/xen/kexec.h index 9b51004c38..26df1ac9ac 100644 --- a/xen/include/xen/kexec.h +++ b/xen/include/xen/kexec.h @@ -34,6 +34,12 @@ void kexec_crash_save_cpu(void); crash_xen_info_t *kexec_crash_save_info(void); void machine_crash_shutdown(void); int machine_kexec_get(xen_kexec_range_t *range); +int machine_kexec_get_xen(xen_kexec_range_t *range); + +void compat_machine_kexec(unsigned long rnk, + unsigned long indirection_page, + unsigned long *page_list, + unsigned long start_address); /* vmcoreinfo stuff */ #define VMCOREINFO_BYTES (4096) diff --git a/xen/include/xen/pci.h b/xen/include/xen/pci.h index 40c9847335..79082d1721 100644 --- a/xen/include/xen/pci.h +++ b/xen/include/xen/pci.h @@ -119,6 +119,7 @@ int pci_find_ext_capability(int seg, int bus, int devfn, int cap); int msixtbl_pt_register(struct domain *d, int pirq, uint64_t gtable); void msixtbl_pt_unregister(struct domain *d, int pirq); +void msixtbl_pt_cleanup(struct domain *d); void pci_enable_acs(struct pci_dev *pdev); #endif /* __XEN_PCI_H__ */ diff --git a/xen/include/xen/perfc.h b/xen/include/xen/perfc.h index 59353a34d4..6cb0cd1739 100644 --- a/xen/include/xen/perfc.h +++ b/xen/include/xen/perfc.h @@ -95,6 +95,10 @@ DECLARE_PER_CPU(perfc_t[NUM_PERFCOUNTERS], perfcounters); struct xen_sysctl_perfc_op; int perfc_control(struct xen_sysctl_perfc_op *); + +extern void perfc_printall(unsigned char key); +extern void perfc_reset(unsigned char key); + #else /* PERF_COUNTERS */ diff --git a/xen/include/xen/pmstat.h b/xen/include/xen/pmstat.h index 979af239c7..266bc16d86 100644 --- a/xen/include/xen/pmstat.h +++ b/xen/include/xen/pmstat.h @@ -5,6 +5,7 @@ #include <public/platform.h> /* for struct xen_processor_power */ #include <public/sysctl.h> /* for struct pm_cx_stat */ +int set_px_pminfo(uint32_t cpu, struct xen_processor_performance *perf); long set_cx_pminfo(uint32_t cpu, struct xen_processor_power *power); uint32_t pmstat_get_cx_nr(uint32_t cpuid); int pmstat_get_cx_stat(uint32_t cpuid, struct pm_cx_stat *stat); diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h index 7b546d77b9..e3eab706a3 100644 --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -534,6 +534,9 @@ void continue_running( struct vcpu *same); void startup_cpu_idle_loop(void); +extern void (*pm_idle) (void); +extern void (*dead_idle) (void); + /* * Creates a continuation to resume the current hypercall. The caller should @@ -653,6 +656,9 @@ void cpupool_put(struct cpupool *pool); int cpupool_add_domain(struct domain *d, int poolid); void cpupool_rm_domain(struct domain *d); int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op); +void schedule_dump(struct cpupool *c); +extern void dump_runq(unsigned char key); + #define num_cpupool_cpus(c) (cpus_weight((c)->cpu_valid)) #endif /* __SCHED_H__ */ diff --git a/xen/include/xen/spinlock.h b/xen/include/xen/spinlock.h index dd1550ca58..6400c2b616 100644 --- a/xen/include/xen/spinlock.h +++ b/xen/include/xen/spinlock.h @@ -98,6 +98,10 @@ void _lock_profile_deregister_struct(int32_t, struct lock_profile_qhead *); #define lock_profile_deregister_struct(type, ptr) \ _lock_profile_deregister_struct(type, &((ptr)->profile_head)) +extern int spinlock_profile_control(xen_sysctl_lockprof_op_t *pc); +extern void spinlock_profile_printall(unsigned char key); +extern void spinlock_profile_reset(unsigned char key); + #else struct lock_profile { }; diff --git a/xen/include/xsm/xsm.h b/xen/include/xsm/xsm.h index 7539cc7d7b..512c070c81 100644 --- a/xen/include/xsm/xsm.h +++ b/xen/include/xsm/xsm.h @@ -636,4 +636,7 @@ static inline int xsm_vcpuextstate(struct domain *d, uint32_t cmd) } #endif /* CONFIG_X86 */ +extern struct xsm_operations dummy_xsm_ops; +extern void xsm_fixup_ops(struct xsm_operations *ops); + #endif /* __XSM_H */ diff --git a/xen/xsm/xsm_core.c b/xen/xsm/xsm_core.c index b3d5a5b4f0..3396b3d729 100644 --- a/xen/xsm/xsm_core.c +++ b/xen/xsm/xsm_core.c @@ -21,9 +21,6 @@ #define XSM_FRAMEWORK_VERSION "1.0.0" -extern struct xsm_operations dummy_xsm_ops; -extern void xsm_fixup_ops(struct xsm_operations *ops); - struct xsm_operations *xsm_ops; static inline int verify(struct xsm_operations *ops) |