]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
xen: CFI hardening for __initcall()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 28 Oct 2021 09:24:13 +0000 (10:24 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 23 Feb 2022 15:33:43 +0000 (15:33 +0000)
Control Flow Integrity schemes use toolchain and optionally hardware support
to help protect against call/jump/return oriented programming attacks.

Use cf_check to annotate function pointer targets for the toolchain.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
48 files changed:
xen/arch/x86/acpi/cpu_idle.c
xen/arch/x86/acpi/cpufreq/cpufreq.c
xen/arch/x86/cpu/mcheck/non-fatal.c
xen/arch/x86/cpu/microcode/core.c
xen/arch/x86/cpu/mtrr/main.c
xen/arch/x86/cpu/vpmu.c
xen/arch/x86/domain.c
xen/arch/x86/extable.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/irq.c
xen/arch/x86/hvm/mtrr.c
xen/arch/x86/hvm/nestedhvm.c
xen/arch/x86/hvm/quirks.c
xen/arch/x86/include/asm/hvm/save.h
xen/arch/x86/ioport_emulate.c
xen/arch/x86/irq.c
xen/arch/x86/mm/shadow/common.c
xen/arch/x86/msi.c
xen/arch/x86/nmi.c
xen/arch/x86/numa.c
xen/arch/x86/oprofile/nmi_int.c
xen/arch/x86/percpu.c
xen/arch/x86/psr.c
xen/arch/x86/pv/domain.c
xen/arch/x86/shutdown.c
xen/arch/x86/time.c
xen/common/core_parking.c
xen/common/debugtrace.c
xen/common/event_channel.c
xen/common/gdbstub.c
xen/common/grant_table.c
xen/common/kernel.c
xen/common/kexec.c
xen/common/livepatch.c
xen/common/page_alloc.c
xen/common/radix-tree.c
xen/common/random.c
xen/common/sched/cpupool.c
xen/common/spinlock.c
xen/common/stop_machine.c
xen/drivers/cpufreq/cpufreq.c
xen/drivers/cpufreq/cpufreq_misc_governors.c
xen/drivers/cpufreq/cpufreq_ondemand.c
xen/drivers/passthrough/amd/iommu.h
xen/drivers/passthrough/amd/iommu_init.c
xen/drivers/passthrough/pci.c
xen/drivers/passthrough/vtd/iommu.c
xen/drivers/passthrough/x86/hvm.c

index 5d73eb5917afa99a727c6fa892f6fe07576ccd66..7902ccce6b9880edd22a3ea86549ab88225ccd8a 100644 (file)
@@ -410,7 +410,7 @@ static void dump_cx(unsigned char key)
     }
 }
 
-static int __init cpu_idle_key_init(void)
+static int __init cf_check cpu_idle_key_init(void)
 {
     register_keyhandler('c', dump_cx, "dump ACPI Cx structures", 1);
     return 0;
@@ -1655,7 +1655,7 @@ static struct notifier_block cpu_nfb = {
     .notifier_call = cpu_callback
 };
 
-static int __init cpuidle_presmp_init(void)
+static int __init cf_check cpuidle_presmp_init(void)
 {
     void *cpu = (void *)(long)smp_processor_id();
 
index 029c9398c42ab81a03d6e58f6f012988beec5103..9510f05340aae77a03733bb993b163c72bb5dd12 100644 (file)
@@ -630,7 +630,7 @@ static const struct cpufreq_driver __initconstrel acpi_cpufreq_driver = {
     .exit   = acpi_cpufreq_cpu_exit,
 };
 
-static int __init cpufreq_driver_init(void)
+static int __init cf_check cpufreq_driver_init(void)
 {
     int ret = 0;
 
index ec52d37c96e1396c969b8ad337c4e850d7d4d181..2679c220a8a242a2ac9449d67ff97ffc20ad78be 100644 (file)
@@ -86,7 +86,7 @@ static void mce_work_fn(void *data)
        adjust = 0;
 }
 
-static int __init init_nonfatal_mce_checker(void)
+static int __init cf_check init_nonfatal_mce_checker(void)
 {
        struct cpuinfo_x86 *c = &boot_cpu_data;
 
index 95d35ca0f3f7ee1dd49144c6e175667d96275fec..46f55fe7f19195500a554412101b17abc7a8c88f 100644 (file)
@@ -696,7 +696,7 @@ int microcode_update(XEN_GUEST_HANDLE(const_void) buf, unsigned long len)
                                      microcode_update_helper, buffer);
 }
 
-static int __init microcode_init(void)
+static int __init cf_check microcode_init(void)
 {
     /*
      * At this point, all CPUs should have updated their microcode
index e9df53f00d616713b0a3d9c692d84bebba6ab0bc..428133100d467e1087bfca5a80eb660626968ad0 100644 (file)
@@ -632,7 +632,7 @@ void mtrr_bp_restore(void)
        mtrr_if->set_all();
 }
 
-static int __init mtrr_init_finialize(void)
+static int __init cf_check mtrr_init_finialize(void)
 {
        if (!mtrr_if)
                return 0;
index b10d6e2eb458b1410b03f1f5a6db755fb6e5b347..9fc897dc8403fe76f3c743859268a84aaada85a1 100644 (file)
@@ -844,7 +844,7 @@ static struct notifier_block cpu_nfb = {
     .notifier_call = cpu_callback
 };
 
-static int __init vpmu_init(void)
+static int __init cf_check vpmu_init(void)
 {
     int vendor = current_cpu_data.x86_vendor;
     const struct arch_vpmu_ops *ops = NULL;
index 9835f90ea0719d074dbe513580daf53e259a9577..36748f67daefcb55295f219e0a0b1e6f2e550b8a 100644 (file)
@@ -2533,7 +2533,7 @@ static void vcpu_kick_softirq(void)
      */
 }
 
-static int __init init_vcpu_kick_softirq(void)
+static int __init cf_check init_vcpu_kick_softirq(void)
 {
     open_softirq(VCPU_KICK_SOFTIRQ, vcpu_kick_softirq);
     return 0;
index 78d67272258015da62d8ebf4c63ede2547c0dc97..51ef863d786c8fa1386084357b0d80b29179aefc 100644 (file)
@@ -126,7 +126,7 @@ search_exception_table(const struct cpu_user_regs *regs)
 #ifndef NDEBUG
 #include <asm/traps.h>
 
-static int __init stub_selftest(void)
+static int __init cf_check stub_selftest(void)
 {
     static const struct {
         uint8_t opc[4];
index 4e685c1b0c1bdabd88f68a07320e7bdc1f97d878..2ae1685d0aff24524eaa62c54b9914046d986be1 100644 (file)
@@ -164,7 +164,7 @@ static bool __init hap_supported(struct hvm_function_table *fns)
     return true;
 }
 
-static int __init hvm_enable(void)
+static int __init cf_check hvm_enable(void)
 {
     const struct hvm_function_table *fns = NULL;
 
@@ -1506,7 +1506,7 @@ static int hvm_load_cpu_msrs(struct domain *d, hvm_domain_context_t *h)
 /* We need variable length data chunks for XSAVE area and MSRs, hence
  * a custom declaration rather than HVM_REGISTER_SAVE_RESTORE.
  */
-static int __init hvm_register_CPU_save_and_restore(void)
+static int __init cf_check hvm_register_CPU_save_and_restore(void)
 {
     hvm_register_savevm(CPU_XSAVE_CODE,
                         "CPU_XSAVE",
index 52aae4565f0c4d31369e53bc668f26c727a5cb73..6045c9149bad3ee4a21a9cb0286c46a86b3f7f5d 100644 (file)
@@ -650,7 +650,7 @@ static void dump_irq_info(unsigned char key)
     rcu_read_unlock(&domlist_read_lock);
 }
 
-static int __init dump_irq_info_key_init(void)
+static int __init cf_check dump_irq_info_key_init(void)
 {
     register_keyhandler('I', dump_irq_info, "dump HVM irq info", 1);
     return 0;
index 4a9f3177edd4aa18e4da035716233ae529bf4df1..b3ef1bf54133ad6511a3a1dbc2583e3107886a1c 100644 (file)
@@ -75,7 +75,7 @@ static uint8_t __read_mostly mtrr_epat_tbl[MTRR_NUM_TYPES][MEMORY_NUM_TYPES] =
 static uint8_t __read_mostly pat_entry_tbl[PAT_TYPE_NUMS] =
     { [0 ... PAT_TYPE_NUMS-1] = INVALID_MEM_TYPE };
 
-static int __init hvm_mtrr_pat_init(void)
+static int __init cf_check hvm_mtrr_pat_init(void)
 {
     unsigned int i, j;
 
index 5021da667a47dca70aba231564088ff5e8d27831..23516884482bbc365b83bc7722f8809ac6dd586f 100644 (file)
@@ -125,8 +125,7 @@ nestedhvm_vmcx_flushtlb(struct p2m_domain *p2m)
  * iomap[2]      set        set
  */
 
-static int __init
-nestedhvm_setup(void)
+static int __init cf_check nestedhvm_setup(void)
 {
     /* Same format and size as hvm_io_bitmap (Intel needs only 2 pages). */
     unsigned nr = cpu_has_vmx ? 2 : 3;
index 54cc66c382b6246e3feac63420cd87c22b3da7dc..917356b1312c0bf8137df9403ce31a493cc7aa6b 100644 (file)
@@ -36,7 +36,7 @@ static int __init dmi_hvm_deny_port80(const struct dmi_system_id *id)
     return 0;
 }
 
-static int __init check_port80(void)
+static int __init cf_check check_port80(void)
 {
     /*
      * Quirk table for systems that misbehave (lock up, etc.) if port
index 4efc53505500c4466feaaadce7d17576ed899c1f..e975011ddb7112a2286242468a3df79c6a410d7b 100644 (file)
@@ -115,7 +115,7 @@ void hvm_register_savevm(uint16_t typecode,
 /* Syntactic sugar around that function: specify the max number of
  * saves, and this calculates the size of buffer needed */
 #define HVM_REGISTER_SAVE_RESTORE(_x, _save, _load, _num, _k)             \
-static int __init __hvm_register_##_x##_save_and_restore(void)            \
+static int __init cf_check __hvm_register_##_x##_save_and_restore(void)   \
 {                                                                         \
     hvm_register_savevm(HVM_SAVE_CODE(_x),                                \
                         #_x,                                              \
index cf1f3f922959be14e0e673c2804ee3b6efb79739..6caeb3d470ce8e19ee0974cdbaaa35939ccc3f83 100644 (file)
@@ -11,7 +11,7 @@
 unsigned int (*__read_mostly ioemul_handle_quirk)(
     uint8_t opcode, char *io_emul_stub, struct cpu_user_regs *regs);
 
-static unsigned int ioemul_handle_proliant_quirk(
+static unsigned int cf_check ioemul_handle_proliant_quirk(
     u8 opcode, char *io_emul_stub, struct cpu_user_regs *regs)
 {
     static const char stub[] = {
@@ -100,7 +100,7 @@ static const struct dmi_system_id __initconstrel ioport_quirks_tbl[] = {
     { }
 };
 
-static int __init ioport_quirks_init(void)
+static int __init cf_check ioport_quirks_init(void)
 {
     if ( dmi_check_system(ioport_quirks_tbl) )
         ioemul_handle_quirk = ioemul_handle_proliant_quirk;
index 84b174d0f51ff3303a405c6766fe1ab5374e181d..bcf46cd54d1646d8b63c7681211a566658623e70 100644 (file)
@@ -954,7 +954,7 @@ static void irq_ratelimit_timer_fn(void *data)
     spin_unlock_irqrestore(&irq_ratelimit_lock, flags);
 }
 
-static int __init irq_ratelimit_init(void)
+static int __init cf_check irq_ratelimit_init(void)
 {
     if ( irq_ratelimit_threshold )
         init_timer(&irq_ratelimit_timer, irq_ratelimit_timer_fn, NULL, 0);
@@ -2504,7 +2504,7 @@ static void dump_irqs(unsigned char key)
     dump_ioapic_irq_info();
 }
 
-static int __init setup_dump_irqs(void)
+static int __init cf_check setup_dump_irqs(void)
 {
     /* In lieu of being able to live in init_irq_data(). */
     BUILD_BUG_ON(sizeof(irq_max_guests) >
index 6221630fc2dc452fd6307fd0b9046e6f3fbea6a5..b8730a9441ce6c083d4bcfe370773938f5b0a4d3 100644 (file)
@@ -105,7 +105,7 @@ static void shadow_audit_key(unsigned char key)
            __func__, shadow_audit_enable);
 }
 
-static int __init shadow_audit_key_init(void)
+static int __init cf_check shadow_audit_key_init(void)
 {
     register_keyhandler('O', shadow_audit_key, "toggle shadow audits", 0);
     return 0;
@@ -1057,7 +1057,7 @@ static void shadow_blow_all_tables(unsigned char c)
 }
 
 /* Register this function in the Xen console keypress table */
-static __init int shadow_blow_tables_keyhandler_init(void)
+static int __init cf_check shadow_blow_tables_keyhandler_init(void)
 {
     register_keyhandler('S', shadow_blow_all_tables, "reset shadow pagetables", 1);
     return 0;
index 5febc0ea4b7ce12e3b933682f79f89fe3da3fb57..d1497254b18811dde4c4db79ba35c684816b6ffd 100644 (file)
@@ -1485,7 +1485,7 @@ static void dump_msi(unsigned char key)
     vpci_dump_msi();
 }
 
-static int __init msi_setup_keyhandler(void)
+static int __init cf_check msi_setup_keyhandler(void)
 {
     register_keyhandler('M', dump_msi, "dump MSI state", 1);
     return 0;
index 515a3633e5aa9ff1e63c920383cae098bef9cd78..b112921b394e3e5c6046abd5e890f6f670978453 100644 (file)
@@ -605,7 +605,7 @@ static void do_nmi_stats(unsigned char key)
         printk("%pv: NMI neither pending nor masked\n", v);
 }
 
-static __init int register_nmi_trigger(void)
+static int __init cf_check register_nmi_trigger(void)
 {
     register_keyhandler('N', do_nmi_trigger, "trigger an NMI", 0);
     register_keyhandler('n', do_nmi_stats, "NMI statistics", 1);
index 6be5a0c93322ada06f163b42e7962963fa9c8d76..5de9db4e9943968599bc65031e952d854e60613b 100644 (file)
@@ -504,7 +504,7 @@ static void dump_numa(unsigned char key)
     rcu_read_unlock(&domlist_read_lock);
 }
 
-static __init int register_numa_trigger(void)
+static int __init cf_check register_numa_trigger(void)
 {
     register_keyhandler('u', dump_numa, "dump NUMA info", 1);
     return 0;
index 7842d95b95ea5de155c9430e25455c8851af92cf..ba9c4b9804ca74859a1d217f7b8cd0aa4c48e167 100644 (file)
@@ -388,7 +388,7 @@ static int __init arch_perfmon_init(char **cpu_type)
        return 1;
 }
 
-static int __init nmi_init(void)
+static int __init cf_check nmi_init(void)
 {
        __u8 vendor = current_cpu_data.x86_vendor;
        __u8 family = current_cpu_data.x86;
index 5ea14b6ec3123f25aa13339e87bd8010fe1ae065..0e0b6577ca451f7aba61fb12369d5e23f3f08fcf 100644 (file)
@@ -94,7 +94,7 @@ static struct notifier_block cpu_percpu_nfb = {
     .priority = 100 /* highest priority */
 };
 
-static int __init percpu_presmp_init(void)
+static int __init cf_check percpu_presmp_init(void)
 {
     register_cpu_notifier(&cpu_percpu_nfb);
 
index 56916344cb1deb6d987de162fec635eca949f8c2..9a3670afc341d631ef07b3a58be8354bf06403a3 100644 (file)
@@ -1675,7 +1675,7 @@ static struct notifier_block cpu_nfb = {
     .priority = -1
 };
 
-static int __init psr_presmp_init(void)
+static int __init cf_check psr_presmp_init(void)
 {
     if ( (opt_psr & PSR_CMT) && opt_rmid_max )
         init_psr_cmt(opt_rmid_max);
index 125c4561a7ea740174e5c9332214ea85f5c15018..55146c15c85351093ffabdbdb070bf89cbeead9b 100644 (file)
@@ -167,7 +167,7 @@ unsigned long pv_fixup_guest_cr4(const struct vcpu *v, unsigned long cr4)
 static int8_t __read_mostly opt_global_pages = -1;
 boolean_runtime_param("global-pages", opt_global_pages);
 
-static int __init pge_init(void)
+static int __init cf_check pge_init(void)
 {
     if ( opt_global_pages == -1 )
         opt_global_pages = !cpu_has_hypervisor ||
index a01354d93319b595638f53c213a1eae4abf23959..ad3e3a76916f837dc72eb69dd1f9353402b07b44 100644 (file)
@@ -533,7 +533,7 @@ static const struct dmi_system_id __initconstrel reboot_dmi_table[] = {
     { }
 };
 
-static int __init reboot_init(void)
+static int __init cf_check reboot_init(void)
 {
     /*
      * Only do the DMI check if reboot_type hasn't been overridden
index 818a42a406c5a093e4957aacb4d4108c7edc203f..b94aa8f216954085d2354707d67e7dee2d1712ee 100644 (file)
@@ -537,7 +537,7 @@ static struct platform_timesource __initdata plt_pmtimer =
 
 static struct time_scale __read_mostly pmt_scale;
 
-static __init int init_pmtmr_scale(void)
+static __init int cf_check init_pmtmr_scale(void)
 {
     set_time_scale(&pmt_scale, ACPI_PM_FREQUENCY);
     return 0;
@@ -2051,7 +2051,7 @@ static void __init try_platform_timer_tail(void)
 }
 
 /* Late init function, after all cpus have booted */
-static int __init verify_tsc_reliability(void)
+static int __init cf_check verify_tsc_reliability(void)
 {
     if ( boot_cpu_has(X86_FEATURE_TSC_RELIABLE) )
     {
@@ -2221,7 +2221,7 @@ static int _disable_pit_irq(void(*hpet_broadcast_setup)(void))
     return ret;
 }
 
-static int __init disable_pit_irq(void)
+static int __init cf_check disable_pit_irq(void)
 {
     if ( !_disable_pit_irq(hpet_broadcast_init) )
     {
@@ -2584,7 +2584,7 @@ static void dump_softtsc(unsigned char key)
             printk("No domains have emulated TSC\n");
 }
 
-static int __init setup_dump_softtsc(void)
+static int __init cf_check setup_dump_softtsc(void)
 {
     register_keyhandler('s', dump_softtsc, "dump softtsc stats", 1);
     return 0;
index aa432ed2f57b48eb79de3d231aa1d64ba59fb182..44a907abfd7fd8b464ee322250fc2476f63eded4 100644 (file)
@@ -258,7 +258,7 @@ static int __init register_core_parking_policy(const struct cp_policy *policy)
     return 0;
 }
 
-static int __init core_parking_init(void)
+static int __init cf_check core_parking_init(void)
 {
     int ret = 0;
 
index 29b11239f5a5b130c3c73ee853415f93d7b54b42..f3c0fd8aa17b667734c9f7e6c859408451912c98 100644 (file)
@@ -279,7 +279,7 @@ static struct notifier_block debugtrace_nfb = {
     .notifier_call = debugtrace_cpu_callback
 };
 
-static int __init debugtrace_init(void)
+static int __init cf_check debugtrace_init(void)
 {
     unsigned int cpu;
 
index a5ee8b8ebf769fe23255121fc97955ffd65ccc58..2026bc30dc9570ba331b4911221acaccce95bd85 100644 (file)
@@ -1642,7 +1642,7 @@ static void dump_evtchn_info(unsigned char key)
     rcu_read_unlock(&domlist_read_lock);
 }
 
-static int __init dump_evtchn_info_key_init(void)
+static int __init cf_check dump_evtchn_info_key_init(void)
 {
     register_keyhandler('e', dump_evtchn_info, "dump evtchn info", 1);
     return 0;
index 848c1f4327e8bb5ad048752f507a07932f892cef..99bfd9a654c9c3a4371fc8b3c9d432f30cd86a0b 100644 (file)
@@ -640,7 +640,7 @@ __trap_to_gdb(struct cpu_user_regs *regs, unsigned long cookie)
     return rc;
 }
 
-static int __init initialise_gdb(void)
+static int __init cf_check initialise_gdb(void)
 {
     if ( *opt_gdb == '\0' )
         return 0;
index b663845d9c6c346302ab5e62e99cf1b93eaab9b0..1078e3e16cda152a1a9bf6695cdd175f303dae85 100644 (file)
@@ -4291,7 +4291,7 @@ static void gnttab_usage_print_all(unsigned char key)
     printk("%s ] done\n", __func__);
 }
 
-static int __init gnttab_usage_init(void)
+static int __init cf_check gnttab_usage_init(void)
 {
     register_keyhandler('g', gnttab_usage_print_all,
                         "print grant table usage", 1);
index 752c2e0dae441aabe395228b7bfbcfe654b6a53d..adff2d2c77f331184fff0dd785bcc100d0b361ee 100644 (file)
@@ -393,7 +393,7 @@ static HYPFS_STRING_INIT(extra, "extra");
 static HYPFS_STRING_INIT(config, "config");
 #endif
 
-static int __init buildinfo_init(void)
+static int __init cf_check buildinfo_init(void)
 {
     hypfs_add_dir(&hypfs_root, &buildinfo, true);
 
@@ -431,7 +431,7 @@ __initcall(buildinfo_init);
 
 static HYPFS_DIR_INIT(params, "params");
 
-static int __init param_init(void)
+static int __init cf_check param_init(void)
 {
     struct param_hypfs *param;
 
index 6286c0bbf08bae338df3e89e62a29649c3eb7e6d..36384f782db35897bbca28421168cccf925d62fe 100644 (file)
@@ -570,7 +570,7 @@ void __init kexec_early_calculations(void)
         crashinfo_maxaddr_bits = fls64(crashinfo_maxaddr) - 1;
 }
 
-static int __init kexec_init(void)
+static int __init cf_check kexec_init(void)
 {
     void *cpu = (void *)(unsigned long)smp_processor_id();
 
index 7118551b27e21a1825a1545508d459280d3f42ce..33708b4e2388db598b1be43236f5bdc02e43f5e4 100644 (file)
@@ -2139,7 +2139,7 @@ static struct notifier_block cpu_nfb = {
     .notifier_call = cpu_callback
 };
 
-static int __init livepatch_init(void)
+static int __init cf_check livepatch_init(void)
 {
     unsigned int cpu;
 
index ad06655158d2903dbbd38bc5d23cc2eb8ed389a8..561e238d2d6ae8609adb507a10dba97a77d5f5b7 100644 (file)
@@ -2549,7 +2549,7 @@ static void pagealloc_info(unsigned char key)
     printk("    Dom heap: %lukB free\n", total << (PAGE_SHIFT-10));
 }
 
-static __init int pagealloc_keyhandler_init(void)
+static __init int cf_check pagealloc_keyhandler_init(void)
 {
     register_keyhandler('m', pagealloc_info, "memory info", 1);
     return 0;
@@ -2597,7 +2597,7 @@ static void dump_heap(unsigned char key)
     }
 }
 
-static __init int register_heap_trigger(void)
+static __init int cf_check register_heap_trigger(void)
 {
     register_keyhandler('H', dump_heap, "dump heap info", 1);
     return 0;
index 2384655a2e90fba39b3509bbb2399a9b0e963f6d..628a7e06988fbafe6645ecb0fd0a165e7c08069f 100644 (file)
@@ -744,7 +744,7 @@ static __init unsigned long __maxindex(unsigned int height)
        return ~0UL >> shift;
 }
 
-static __init int radix_tree_init_maxindex(void)
+static int __init cf_check radix_tree_init_maxindex(void)
 {
        unsigned int i;
 
index fb805b0ecd950305aed346385ed0783b9f10cf84..a29f2fcb991ac6994dc6a4cdf55cbcfd77ac1771 100644 (file)
@@ -31,7 +31,7 @@ unsigned int get_random(void)
     return val;
 }
 
-static int __init init_boot_random(void)
+static int __init cf_check init_boot_random(void)
 {
     boot_random = get_random();
     return 0;
index f0dd626054a63b23a9a40211fa9223732b8d0b0d..f26c7f289539ceb3a8abb0c85fb2c9e3a04a7b08 100644 (file)
@@ -1218,7 +1218,7 @@ static void cpupool_hypfs_init(void)
 
 #endif /* CONFIG_HYPFS */
 
-static int __init cpupool_init(void)
+static int __init cf_check cpupool_init(void)
 {
     unsigned int cpu;
 
index b90981bb271ed8df9d708bee924065006047813a..5ce7e3363863f112073ebd081d794a14f54ff90e 100644 (file)
@@ -508,7 +508,7 @@ void _lock_profile_deregister_struct(
     spin_unlock(&lock_profile_lock);
 }
 
-static int __init lock_prof_init(void)
+static int __init cf_check lock_prof_init(void)
 {
     struct lock_profile **q;
 
index 2d5f6aef61edebf7f886fc2cba9c17adfcb48dae..8979d553d677867c7a83b8d748f05118bf8d56ca 100644 (file)
@@ -198,7 +198,7 @@ static struct notifier_block cpu_nfb = {
     .notifier_call = cpu_callback
 };
 
-static int __init cpu_stopmachine_init(void)
+static int __init cf_check cpu_stopmachine_init(void)
 {
     unsigned int cpu;
     for_each_online_cpu ( cpu )
index 36b079296235ee23fbc40806069e050557808fd1..e55e202d5a183bd36a24a69f4b588c753cd7c765 100644 (file)
@@ -657,7 +657,7 @@ static struct notifier_block cpu_nfb = {
     .notifier_call = cpu_callback
 };
 
-static int __init cpufreq_presmp_init(void)
+static int __init cf_check cpufreq_presmp_init(void)
 {
     register_cpu_notifier(&cpu_nfb);
     return 0;
index 746bbcd5ff36ff677f37f04edfb5d7b29d58756f..8343f491da87425f2c4ad60691d44b9516b3e2c3 100644 (file)
@@ -116,7 +116,7 @@ struct cpufreq_governor cpufreq_gov_userspace = {
     .handle_option = cpufreq_userspace_handle_option
 };
 
-static int __init cpufreq_gov_userspace_init(void)
+static int __init cf_check cpufreq_gov_userspace_init(void)
 {
     unsigned int cpu;
 
@@ -160,7 +160,7 @@ struct cpufreq_governor cpufreq_gov_performance = {
     .governor = cpufreq_governor_performance,
 };
 
-static int __init cpufreq_gov_performance_init(void)
+static int __init cf_check cpufreq_gov_performance_init(void)
 {
     return cpufreq_register_governor(&cpufreq_gov_performance);
 }
@@ -199,7 +199,7 @@ struct cpufreq_governor cpufreq_gov_powersave = {
     .governor = cpufreq_governor_powersave,
 };
 
-static int __init cpufreq_gov_powersave_init(void)
+static int __init cf_check cpufreq_gov_powersave_init(void)
 {
     return cpufreq_register_governor(&cpufreq_gov_powersave);
 }
index 6b905d7cfca8a9b02b3807c896b110783abf1512..cabd9ffa8886816072d3e2d21cb03d0fc9b592a9 100644 (file)
@@ -356,7 +356,7 @@ struct cpufreq_governor cpufreq_gov_dbs = {
     .handle_option = cpufreq_dbs_handle_option
 };
 
-static int __init cpufreq_gov_dbs_init(void)
+static int __init cf_check cpufreq_gov_dbs_init(void)
 {
     return cpufreq_register_governor(&cpufreq_gov_dbs);
 }
index 93243424e85d98ad2b2d162d53f205feca9b98c5..04517c1a024c69005ca4ac0ea80d51b89c318a3c 100644 (file)
@@ -234,7 +234,7 @@ int amd_iommu_prepare(bool xt);
 int amd_iommu_init(bool xt);
 int amd_iommu_init_late(void);
 int amd_iommu_update_ivrs_mapping_acpi(void);
-int iov_adjust_irq_affinities(void);
+int cf_check iov_adjust_irq_affinities(void);
 
 int amd_iommu_quarantine_init(struct domain *d);
 
index 559a734bdaa56611dd794d65664071d55cb62fe7..f1ed75558227088dd8159f80860e0f0e989d9055 100644 (file)
@@ -808,7 +808,7 @@ static bool_t __init set_iommu_interrupt_handler(struct amd_iommu *iommu)
     return 1;
 }
 
-int iov_adjust_irq_affinities(void)
+int cf_check iov_adjust_irq_affinities(void)
 {
     const struct amd_iommu *iommu;
 
index 4b59b332f01fa6e7d9e977d27e7fe1c3f2272a62..9f79a016085b5233ce311c1a7beacdf54affc1cf 100644 (file)
@@ -1358,7 +1358,7 @@ static void dump_pci_devices(unsigned char ch)
     pcidevs_unlock();
 }
 
-static int __init setup_dump_pcidevs(void)
+static int __init cf_check setup_dump_pcidevs(void)
 {
     register_keyhandler('Q', dump_pci_devices, "dump PCI devices", 1);
     return 0;
index 0fc818fd2707ae4160c13df8426130a947b3ff5b..6ed32922c453adba667d5c835912747a22d1b793 100644 (file)
@@ -2106,7 +2106,7 @@ static void adjust_irq_affinity(struct acpi_drhd_unit *drhd)
     spin_unlock_irqrestore(&desc->lock, flags);
 }
 
-static int adjust_vtd_irq_affinities(void)
+static int cf_check adjust_vtd_irq_affinities(void)
 {
     struct acpi_drhd_unit *drhd;
 
index 0b37cd145b60076f4cb01fb6de79f6a20d7c7a96..e5a2c5830348c28bbfff55a0c72fd3734e3705d1 100644 (file)
@@ -1076,7 +1076,7 @@ static struct notifier_block cpu_nfb = {
     .notifier_call = cpu_callback,
 };
 
-static int __init setup_dpci_softirq(void)
+static int __init cf_check setup_dpci_softirq(void)
 {
     unsigned int cpu;