add documentation to core kmod files

Signed-off-by: Seth Jennings <sjenning@redhat.com>
This commit is contained in:
Seth Jennings 2014-02-11 14:01:00 -06:00
parent e856a15881
commit 8b928cc173
2 changed files with 34 additions and 0 deletions

View File

@ -1,3 +1,28 @@
/*
* kpatch-kmod/base.c
*
* Copyright (C) 2014 Seth Jennings <sjenning@redhat.com>
* Copyright (C) 2013 Josh Poimboeuf <jpoimboe@redhat.com>
*
* Contains the code for the core kpatch module. This module reads
* information from the hotfix modules, find new patched functions,
* and register those functions in the ftrace handlers the redirects
* the old function call to the new function code.
*
* Each hotfix can contain one or more patched functions. This information
* is contained in the .patches section of the hotfix module. For each
* function patched by the module we must:
* - Call stop_machine
* - Ensure that no execution thread is currently in the function to be
* patched (or has the function in the call stack)
* - Add the new function address to the kpatch_funcs table
*
* After that, each call to the old function calls into kpatch_trampoline()
* which searches for a patched version of the function in the kpatch_funcs
* table. If a patched version is found, the return instruction pointer is
* overwritten to return to the new function.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>

View File

@ -1,3 +1,12 @@
/*
* kpatch.h
*
* Copyright (C) 2014 Seth Jennings <sjenning@redhat.com>
* Copyright (C) 2013 Josh Poimboeuf <jpoimboe@redhat.com>
*
* Contains the API for the core kpatch module used by the hotfix modules
*/
#ifndef _KPATCH_H_
#define _KPATCH_H_