[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+8MBbJ+mOWhZR5d8wP4x_ncgumGOANziOGmDBzj0QdbPSDH0w@mail.gmail.com>
Date: Mon, 14 Oct 2013 09:50:00 -0700
From: Tony Luck <tony.luck@...il.com>
To: Borislav Petkov <bp@...en8.de>
Cc: Chen Gong <gong.chen@...ux.intel.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-acpi <linux-acpi@...r.kernel.org>
Subject: Re: [PATCH 3/8] ACPI, x86: Extended error log driver for x86 platform
On Mon, Oct 14, 2013 at 3:26 AM, Borislav Petkov <bp@...en8.de> wrote:
> On Sun, Oct 13, 2013 at 11:16:33PM -0400, Chen Gong wrote:
>> But this driver can be loaded as a module. If this module is unloaded,
>> extlog_print is gone. I can't keep such a pointer internally.
>
> Sure you can - you define a weak extlog_print() function in a
> compilation unit which is always builtin. Maybe mce.c or so.
"weak" is a good compile/link time tool to provide a default function
while allowing override with a architecture (or more generally a CONFIG_*)
specific one. But it is no help when loading/unloading modules.
Think about it ... we have a call to this function from some place in the
base kernel (originating from mce.o). Before the module is loaded you
want that to leap to your weak function.
Now load the module with the not-weak definition of the function - the
module loader would have to go do a relocation fix-up in the base kernel
to point to this new function. At module unload it would have to undo
that.
-Tony
--
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