The linker script collecting .init.rodata.* ahead of .init.rodata.cf_clobber
accidentally causes __initconst_cf_clobber to be a no-op.
Rearrange the linker script to unbreak this.
The IOMMU adjust_irq_affinities() hooks currently violate the safety
requirement for being cf_clobber, by also being plain __initcall()'s.
Consolidate to a single initcall using the iommu_adjust_irq_affinities()
wrapper (satisfying the cf_clobber safety requirement by using iommu_call()
under the hood), and also removes the dubious property that we'd call into
both vendors IOMMU drivers on boot, relying on the for_each_*() loops to be
empty for safety.
With this fixed, an all-enabled build of Xen has 1681 endbr64's in .text with
382 (23%) being clobbered during boot.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
DECL_SECTION(.init.data) {
#endif
+ . = ALIGN(POINTER_ALIGN);
+ __initdata_cf_clobber_start = .;
+ *(.init.data.cf_clobber)
+ *(.init.rodata.cf_clobber)
+ __initdata_cf_clobber_end = .;
+
*(.init.rodata)
*(.init.rodata.*)
*(.initcall1.init)
__initcall_end = .;
- . = ALIGN(POINTER_ALIGN);
- __initdata_cf_clobber_start = .;
- *(.init.data.cf_clobber)
- *(.init.rodata.cf_clobber)
- __initdata_cf_clobber_end = .;
-
*(.init.data)
*(.init.data.rel)
*(.init.data.rel.*)
return 0;
}
-__initcall(iov_adjust_irq_affinities);
/*
* Family15h Model 10h-1fh erratum 746 (IOMMU Logging May Stall Translations)
return 0;
}
-__initcall(adjust_vtd_irq_affinities);
static int __must_check init_vtd_hw(bool resume)
{
likely(!p2m_get_hostp2m(d)->global_logdirty));
}
+static int __init cf_check adjust_irq_affinities(void)
+{
+ return iommu_adjust_irq_affinities();
+}
+__initcall(adjust_irq_affinities);
+
/*
* Local variables:
* mode: C