forked from luck/tmp_suning_uos_patched
2f6c9bf31a
The current VDSO patch mechanism has several problems: 1) It assumes how gcc will emit a function, with a register window, an initial save instruction and then immediately the %tick read when compiling vread_tick(). There is no such guarantees, code generation could change at any time, gcc could put a nop between the save and the %tick read, etc. So this is extremely fragile and would fail some day. 2) It disallows us to properly inline vread_tick() into the callers and thus get the best possible code sequences. So fix this to patch properly, with location based annotations. We have to be careful because we cannot do it the way we do patches elsewhere in the kernel. Those use a sequence like: 1: insn .section .whatever_patch, "ax" .word 1b replacement_insn .previous This is a dynamic shared object, so that .word cannot be resolved at build time, and thus cannot be used to execute the patches when the kernel initializes the images. Even trying to use label difference equations doesn't work in the above kind of scheme: 1: insn .section .whatever_patch, "ax" .word . - 1b replacement_insn .previous The assembler complains that it cannot resolve that computation. The issue is that this is contained in an executable section. Borrow the sequence used by x86 alternatives, which is: 1: insn .pushsection .whatever_patch, "a" .word . - 1b, . - 1f .popsection .pushsection .whatever_patch_replacements, "ax" 1: replacement_insn .previous This works, allows us to inline vread_tick() as much as we like, and can be used for arbitrary kinds of VDSO patching in the future. Also, reverse the condition for patching. Most systems are %stick based, so if we only patch on %tick systems the patching code will get little or no testing. Signed-off-by: David S. Miller <davem@davemloft.net> |
||
---|---|---|
.. | ||
.gitignore | ||
adi_64.c | ||
apc.c | ||
asm-offsets.c | ||
audit.c | ||
auxio_32.c | ||
auxio_64.c | ||
btext.c | ||
central.c | ||
cherrs.S | ||
chmc.c | ||
compat_audit.c | ||
cpu.c | ||
cpumap.c | ||
cpumap.h | ||
devices.c | ||
ds.c | ||
dtlb_miss.S | ||
dtlb_prot.S | ||
ebus.c | ||
entry.h | ||
entry.S | ||
etrap_32.S | ||
etrap_64.S | ||
fpu_traps.S | ||
ftrace.c | ||
getsetcc.S | ||
head_32.S | ||
head_64.S | ||
helpers.S | ||
hvapi.c | ||
hvcalls.S | ||
hvtramp.S | ||
idprom.c | ||
iommu_common.h | ||
iommu-common.c | ||
iommu.c | ||
ioport.c | ||
irq_32.c | ||
irq_64.c | ||
irq.h | ||
itlb_miss.S | ||
ivec.S | ||
jump_label.c | ||
kernel.h | ||
kgdb_32.c | ||
kgdb_64.c | ||
kprobes.c | ||
kstack.h | ||
ktlb.S | ||
ldc.c | ||
led.c | ||
leon_kernel.c | ||
leon_pci_grpci1.c | ||
leon_pci_grpci2.c | ||
leon_pci.c | ||
leon_pmc.c | ||
leon_smp.c | ||
Makefile | ||
mdesc.c | ||
misctrap.S | ||
module.c | ||
nmi.c | ||
of_device_32.c | ||
of_device_64.c | ||
of_device_common.c | ||
of_device_common.h | ||
pci_common.c | ||
pci_fire.c | ||
pci_impl.h | ||
pci_msi.c | ||
pci_psycho.c | ||
pci_sabre.c | ||
pci_schizo.c | ||
pci_sun4v_asm.S | ||
pci_sun4v.c | ||
pci_sun4v.h | ||
pci.c | ||
pcic.c | ||
pcr.c | ||
perf_event.c | ||
pmc.c | ||
power.c | ||
process_32.c | ||
process_64.c | ||
prom_32.c | ||
prom_64.c | ||
prom_common.c | ||
prom_irqtrans.c | ||
prom.h | ||
psycho_common.c | ||
psycho_common.h | ||
ptrace_32.c | ||
ptrace_64.c | ||
reboot.c | ||
rtrap_32.S | ||
rtrap_64.S | ||
sbus.c | ||
setup_32.c | ||
setup_64.c | ||
signal_32.c | ||
signal_64.c | ||
signal32.c | ||
sigutil_32.c | ||
sigutil_64.c | ||
sigutil.h | ||
smp_32.c | ||
smp_64.c | ||
sparc_ksyms.c | ||
spiterrs.S | ||
sstate.c | ||
stacktrace.c | ||
starfire.c | ||
sun4d_irq.c | ||
sun4d_smp.c | ||
sun4m_irq.c | ||
sun4m_smp.c | ||
sun4v_ivec.S | ||
sun4v_mcd.S | ||
sun4v_tlb_miss.S | ||
sys_sparc_32.c | ||
sys_sparc_64.c | ||
sys_sparc32.c | ||
sys32.S | ||
syscalls.S | ||
sysfs.c | ||
systbls_32.S | ||
systbls_64.S | ||
systbls.h | ||
time_32.c | ||
time_64.c | ||
trampoline_32.S | ||
trampoline_64.S | ||
traps_32.c | ||
traps_64.c | ||
tsb.S | ||
ttable_32.S | ||
ttable_64.S | ||
una_asm_32.S | ||
una_asm_64.S | ||
unaligned_32.c | ||
unaligned_64.c | ||
uprobes.c | ||
urtt_fill.S | ||
utrap.S | ||
vdso.c | ||
vio.c | ||
viohs.c | ||
visemul.c | ||
vmlinux.lds.S | ||
windows.c | ||
winfixup.S | ||
wof.S | ||
wuf.S |