summaryrefslogtreecommitdiff
path: root/geoip.c
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2015-03-19 10:13:56 +0100
committerDaniel Borkmann <dborkman@redhat.com>2015-03-19 10:13:56 +0100
commit3dfaab495b62658b88a1ed201b2ed61aea34570d (patch)
tree5a9d7a544a32364c8534e31b898eabbd01edbd31 /geoip.c
parent6f542884d002d55d517a50dd9892068e95400b25 (diff)
authors: add Vadim for his contributions
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Diffstat (limited to 'geoip.c')
0 files changed, 0 insertions, 0 deletions
The live patch handler modifies the NIP so as to redirect the return from ftrace_caller() to the new patched function. However there is one particularly tricky case we need to handle. If a function A calls another function B, and it is known at link time that they share the same TOC, then A will not save or restore its TOC, and will call the local entry point of B. When we live patch B, we replace it with a new function C, which may not have the same TOC as A. At live patch time it's too late to modify A to do the TOC save/restore, so the live patching code must interpose itself between A and C, and do the TOC save/restore that A omitted. An additionaly complication is that the livepatch code can not create a stack frame in order to save the TOC. That is because if C takes > 8 arguments, or is varargs, A will have written the arguments for C in A's stack frame. To solve this, we introduce a "livepatch stack" which grows upward from the base of the regular stack, and is used to store the TOC & LR when calling a live patched function. When the patched function returns, we retrieve the real LR & TOC from the livepatch stack, restore them, and pop the livepatch "stack frame". Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Reviewed-by: Torsten Duwe <duwe@suse.de> Reviewed-by: Balbir Singh <bsingharora@gmail.com>
Diffstat (limited to 'Documentation/early-userspace')