[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87tx99ckuh.fsf@tassilo.jf.intel.com>
Date: Thu, 01 May 2014 13:20:06 -0700
From: Andi Kleen <andi@...stfloor.org>
To: Jiri Slaby <jslaby@...e.cz>
Cc: linux-kernel@...r.kernel.org, jirislaby@...il.com,
Vojtech Pavlik <vojtech@...e.cz>, Michael Matz <matz@...e.de>,
Jiri Kosina <jkosina@...e.cz>,
Steven Rostedt <rostedt@...dmis.org>,
Frederic Weisbecker <fweisbec@...il.com>,
Ingo Molnar <mingo@...hat.com>
Subject: Re: [RFC 03/16] kgr: initial code
Jiri Slaby <jslaby@...e.cz> writes:
> OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx);
> diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
> index 1e96c3628bf2..a03b1e9d2de3 100644
> --- a/arch/x86/kernel/entry_64.S
> +++ b/arch/x86/kernel/entry_64.S
> @@ -615,6 +615,7 @@ GLOBAL(system_call_after_swapgs)
> movq %rax,ORIG_RAX-ARGOFFSET(%rsp)
> movq %rcx,RIP-ARGOFFSET(%rsp)
> CFI_REL_OFFSET rip,RIP-ARGOFFSET
> + movw $0, TI_kgr_in_progress+THREAD_INFO(%rsp,RIP-ARGOFFSET)
Better use 4 bytes. This has the potential to cause an expensive
Length Changing Prefixes Stall on Intel CPUs.
> +
> +static int kgr_init_ftrace_ops(const struct kgr_patch_fun *patch_fun)
> +{
> + struct kgr_loc_caches *caches;
> + unsigned long fentry_loc;
> +
> + /*
> + * Initialize the ftrace_ops->private with pointers to the fentry
> + * sites of both old and new functions. This is used as a
> + * redirection target in the per-arch stubs.
> + *
> + * Beware! -- freeing (once unloading will be implemented)
> + * will require synchronize_sched() etc.
> + */
> +
> + caches = kmalloc(sizeof(*caches), GFP_KERNEL);
> + if (!caches) {
> + kgr_debug("kgr: unable to allocate fentry caches\n");
> + return -ENOMEM;
> + }
All the error paths in this function leak memory.
-Andi
--
ak@...ux.intel.com -- Speaking for myself only
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists