Re: [PATCH 0/7] Allocate module text and data separately

2022-01-25 Thread Christophe Leroy


Le 25/01/2022 à 21:52, Luis Chamberlain a écrit :
> On Mon, Jan 24, 2022 at 09:22:11AM +, Christophe Leroy wrote:
>> This series allow architectures to request having modules data in
>> vmalloc area instead of module area.
>>
>> This is required on powerpc book3s/32 in order to set data non
>> executable, because it is not possible to set executability on page
>> basis, this is done per 256 Mbytes segments. The module area has exec
>> right, vmalloc area has noexec.
>>
>> This can also be useful on other powerpc/32 in order to maximize the
>> chance of code being close enough to kernel core to avoid branch
>> trampolines.
> 
> Am I understanding that this entire effort is for 32-bit powerpc?
> If so, why such an interest in 32-bit these days?
> 

32 bit powerpc processors are still manufactured and are widely used in 
embedded products like internet boxes, small routers, etc ...
One of the reason is that there power consumption hence their heat 
dissipation is way lower than 64 bits variants.

I found the effort quite small compared to the benefit it provides.

Christophe

Re: [PATCH 0/7] Allocate module text and data separately

2022-01-25 Thread Luis Chamberlain
On Mon, Jan 24, 2022 at 09:22:11AM +, Christophe Leroy wrote:
> This series allow architectures to request having modules data in
> vmalloc area instead of module area.
> 
> This is required on powerpc book3s/32 in order to set data non
> executable, because it is not possible to set executability on page
> basis, this is done per 256 Mbytes segments. The module area has exec
> right, vmalloc area has noexec.
> 
> This can also be useful on other powerpc/32 in order to maximize the
> chance of code being close enough to kernel core to avoid branch
> trampolines.

Am I understanding that this entire effort is for 32-bit powerpc?
If so, why such an interest in 32-bit these days?

  Luis


[PATCH 0/7] Allocate module text and data separately

2022-01-24 Thread Christophe Leroy
This series allow architectures to request having modules data in
vmalloc area instead of module area.

This is required on powerpc book3s/32 in order to set data non
executable, because it is not possible to set executability on page
basis, this is done per 256 Mbytes segments. The module area has exec
right, vmalloc area has noexec.

This can also be useful on other powerpc/32 in order to maximize the
chance of code being close enough to kernel core to avoid branch
trampolines.

Christophe Leroy (7):
  modules: Refactor within_module_core() and within_module_init()
  modules: Add within_module_text() macro
  modules: Always have struct mod_tree_root
  modules: Prepare for handling several RB trees
  modules: Introduce data_layout
  modules: Add CONFIG_ARCH_WANTS_MODULES_DATA_IN_VMALLOC
  powerpc: Select ARCH_WANTS_MODULES_DATA_IN_VMALLOC on book3s/32 and
8xx

 arch/Kconfig|   6 ++
 arch/powerpc/Kconfig|   1 +
 include/linux/module.h  |  38 ++-
 kernel/debug/kdb/kdb_main.c |  10 +-
 kernel/module.c | 207 
 5 files changed, 186 insertions(+), 76 deletions(-)

-- 
2.33.1