Stefan Berger
2006-May-09 17:08 UTC
[Xen-devel] [PATCH] [vTPM] Not building vTPM frontend as module
This patch prevents the vTPM frontend to be built as module for now. An ''rmmod'' causes some problems since the backend is still using the shared page. This patch also fixes a problem in the backend. Signed-off-by: Stefan Berger <stefanb@us.ibm.com> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-May-10 14:55 UTC
[Xen-devel] Re: [PATCH] [vTPM] Not building vTPM frontend as module
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. I''ll apply the hunk of your patch that fixes the backend issue however. -- Keir On 9 May 2006, at 18:08, Stefan Berger wrote:> This patch prevents the vTPM frontend to be built as module for now. An > ''rmmod'' causes some problems since the backend is still using the > shared > page. > This patch also fixes a problem in the backend. > > Signed-off-by: Stefan Berger <stefanb@us.ibm.com> > > > <tpm_module.diff>_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Ian Campbell
2006-May-10 15:02 UTC
Re: [Xen-devel] Re: [PATCH] [vTPM] Not building vTPM frontend as module
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. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2006-May-10 15:41 UTC
Re: [Xen-devel] Re: [PATCH] [vTPM] Not building vTPM frontend as module
On 10 May 2006, at 16:02, Ian Campbell wrote:>> 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)Even better. We should be using this for netback and blkback too in that case. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel