From: Ian Campbell Subject: Re: Re: [PATCH] [vTPM] Not building vTPM frontend as module Date: Wed, 10 May 2006 16:02:06 +0100 Message-ID: <1147273326.4281.5.camel@localhost.localdomain> References: <1147194526.421.4.camel@941e-2.watson.ibm.com> <95377b78a7bc3ca192d2e130212915fb@cl.cam.ac.uk> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <95377b78a7bc3ca192d2e130212915fb@cl.cam.ac.uk> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: xen-devel , Stefan Berger List-Id: xen-devel@lists.xenproject.org On Wed, 2006-05-10 at 15:55 +0100, Keir Fraser wrote: > Even if it is unsafe to unload the module, there is still enormous > benefit in allowing to build as a module as it allows the user to > choose whether or not to load it in the first place! > > I suggest you add __unsafe(THIS_MODULE) to the end of your module_init > function, as we have done for netback and blkback. This will make it > impossible for the user to unload the module, and print a message to > the kernel log explaining why. If a module_init() is present but a module_exit() is not then you cannot unload the module. (unless you enable CONFIG_MODULE_FORCE_UNLOAD and use rmmod's --force option, in which case your kernel become tainted) Ian.