Re: Proposal: Disable autoload of compat_xyz modules
On Sat, 16 Sep 2017, Martin Husemann wrote: On Sat, Sep 16, 2017 at 11:15:04AM -0400, Christos Zoulas wrote: It could be a sysctl listing by name the emulations available and another listing the emulations currently enabled. emul.available=linux,linux_32,svr4,svr4_32 emul.autoload=linux,linux_32 I would not mind excluding emulations from autoload in general, with no switch at all. We currently have a single autoload-enabling sysctl. Perhaps we should instead have several? One for device drivers (called from specfs), another for compat/emulations, etc.? +--+--++ | Paul Goyette | PGP Key fingerprint: | E-mail addresses: | | (Retired)| FA29 0E3B 35AF E8AE 6651 | paul at whooppee dot com | | Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd dot org | +--+--++
Re: Proposal: Disable autoload of compat_xyz modules
Le 16/09/2017 à 17:30, Martin Husemann a écrit : On Sat, Sep 16, 2017 at 11:15:04AM -0400, Christos Zoulas wrote: It could be a sysctl listing by name the emulations available and another listing the emulations currently enabled. emul.available=linux,linux_32,svr4,svr4_32 emul.autoload=linux,linux_32 I would not mind excluding emulations from autoload in general, with no switch at all. Yes, there is little interest for this. My initial noload diff did take that into account transparently, but it is true that it was perhaps too complicated compared to a simple sysctl. Maxime
Re: Proposal: Disable autoload of compat_xyz modules
Le 13/09/2017 à 22:00, Christos Zoulas a écrit : Can't we add a sysctl that controls the behavior and have autoload of the compat modules off by default? Well, let's just do this. I've written (and tested) [1] - it works. A new leaf is added in emul.linux, emul.linux.enabled={0,1}, which registers linux_execsw. Obviously, after applying this patch we'll have to remove compat_linux from the autoload array. And the same will have to be done in compat_linux32. Ok? Maxime [1] http://m00nbsd.net/garbage/module/sysctl.diff
Re: Proposal: Disable autoload of compat_xyz modules
On Sat, Sep 16, 2017 at 11:15:04AM -0400, Christos Zoulas wrote: > It could be a sysctl listing by name the emulations available and another > listing the emulations currently enabled. > > > emul.available=linux,linux_32,svr4,svr4_32 > emul.autoload=linux,linux_32 I would not mind excluding emulations from autoload in general, with no switch at all. When I need them I can do a manual modload, or add them to /etc/modules.conf/ include the option in the kernel and reboot. Martin
Re: Proposal: Disable autoload of compat_xyz modules
Le 16/09/2017 à 16:46, Christos Zoulas a écrit : On Sep 16, 4:42pm, m...@m00nbsd.net (Maxime Villard) wrote: -- Subject: Re: Proposal: Disable autoload of compat_xyz modules | Le 16/09/2017 à 16:36, Christos Zoulas a écrit : | > On Sep 16, 4:15pm, m...@m00nbsd.net (Maxime Villard) wrote: | > -- Subject: Re: Proposal: Disable autoload of compat_xyz modules | > | > | Le 13/09/2017 Ã 22:00, Christos Zoulas a écrit : | > | > Can't we add a sysctl that controls the behavior and have autoload | > | > of the compat modules off by default? | > | | > | Well, let's just do this. I've written (and tested) [1] - it works. A new | > | leaf is added in emul.linux, emul.linux.enabled={0,1}, which registers | > | linux_execsw. | > | | > | Obviously, after applying this patch we'll have to remove compat_linux from | > | the autoload array. And the same will have to be done in compat_linux32. | > | | > | Ok? | > | > Why? Leave it in the autoload, but fail to load it unless the sysctl is | > enabled... | | Does not work, the leaf is added by the module itself, so you can't sysctl it | to 'enabled=1' unless the module is already loaded... The sysctl does not have to live in the module space. Where do you put the helper then? It needs access to linux_execsw, which is in the module space.
Re: Proposal: Disable autoload of compat_xyz modules
Le 16/09/2017 à 16:36, Christos Zoulas a écrit : On Sep 16, 4:15pm, m...@m00nbsd.net (Maxime Villard) wrote: -- Subject: Re: Proposal: Disable autoload of compat_xyz modules | Le 13/09/2017 à 22:00, Christos Zoulas a écrit : | > Can't we add a sysctl that controls the behavior and have autoload | > of the compat modules off by default? | | Well, let's just do this. I've written (and tested) [1] - it works. A new | leaf is added in emul.linux, emul.linux.enabled={0,1}, which registers | linux_execsw. | | Obviously, after applying this patch we'll have to remove compat_linux from | the autoload array. And the same will have to be done in compat_linux32. | | Ok? Why? Leave it in the autoload, but fail to load it unless the sysctl is enabled... Does not work, the leaf is added by the module itself, so you can't sysctl it to 'enabled=1' unless the module is already loaded... Maxime
Re: Proposal: Disable autoload of compat_xyz modules
On Sep 16, 4:15pm, m...@m00nbsd.net (Maxime Villard) wrote: -- Subject: Re: Proposal: Disable autoload of compat_xyz modules | Le 13/09/2017 à 22:00, Christos Zoulas a écrit : | > Can't we add a sysctl that controls the behavior and have autoload | > of the compat modules off by default? | | Well, let's just do this. I've written (and tested) [1] - it works. A new | leaf is added in emul.linux, emul.linux.enabled={0,1}, which registers | linux_execsw. | | Obviously, after applying this patch we'll have to remove compat_linux from | the autoload array. And the same will have to be done in compat_linux32. | | Ok? Why? Leave it in the autoload, but fail to load it unless the sysctl is enabled... christos