Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1583195

Re: [PATCHv3 2/2] arch: Rename CONFIG_DEBUG_RODATA and CONFIG_DEBUG_MODULE_RONX

From Helge Deller <deller@gmx.de>
Newsgroups linux.kernel
Subject Re: [PATCHv3 2/2] arch: Rename CONFIG_DEBUG_RODATA and CONFIG_DEBUG_MODULE_RONX
Date 2017-02-17 09:30 +0100
Message-ID <tbM5s-1KD-9@gated-at.bofh.it> (permalink)
References <t81Z7-3QF-3@gated-at.bofh.it> <t81Z7-3QF-1@gated-at.bofh.it> <tbCIO-4eZ-27@gated-at.bofh.it> <tbFdD-5Q6-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 17.02.2017 02:08, Kees Cook wrote:
> On Thu, Feb 16, 2017 at 2:25 PM, Pavel Machek <pavel@ucw.cz> wrote:
>> Hi!
>>
>>>
>>> -config DEBUG_RODATA
>>> +config STRICT_KERNEL_RWX
>>>       bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
>>>       depends on ARCH_HAS_STRICT_KERNEL_RWX
>>>       default !ARCH_OPTIONAL_KERNEL_RWX ||
>>
>> Debug features are expected to have runtime cost, so kconfig help is
>> silent about those. But there are runtime costs, right? It would be
>> nice to mention them in the help text...
> 
> It depends on the architecture. The prior help text for arm said:
> 
>          The tradeoff is that each region is padded to section-size (1MiB)
>          boundaries (because their permissions are different and splitting
>          the 1M pages into 4K ones causes TLB performance problems), which
>          can waste memory.
> 
> parisc (somewhat inaccurately) said:
> 
>          This option may have a slight performance impact because a
>          portion of the kernel code won't be covered by a TLB anymore.

The logic on parisc is actually:
If huge page support is enabled, we map 1MB pages (and behave like arm wrt alignments).
If huge page support is disabled we stay at 4k/PAGE_SIZE pages (without 1M alignment).
 
> IIUC, arm64 does what parisc is hinting at: mappings at the end are
> broken down to PAGE_SIZE. 

On parisc we never implemented that.

> On x86, IIUC, there's actually no change to
> TLB performance due to how the mappings are already set up.
> 
> I'm not sure the best way to express this in the new help text. Do you
> have some suggestions on wording? Personally, I don't really think
> it's worth mentioning this in Kconfig help,

I agree on this.

> which, in theory, is
> supposed to limit how technical it gets. And I think the performance
> impact is almost entirely negligible compared to the risks addressed.

Helge

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCHv3 2/2] arch: Rename CONFIG_DEBUG_RODATA and  CONFIG_DEBUG_MODULE_RONX Pavel Machek <pavel@ucw.cz> - 2017-02-16 23:30 +0100
  Re: [PATCHv3 2/2] arch: Rename CONFIG_DEBUG_RODATA and CONFIG_DEBUG_MODULE_RONX Kees Cook <keescook@chromium.org> - 2017-02-17 02:10 +0100
    Re: [PATCHv3 2/2] arch: Rename CONFIG_DEBUG_RODATA and  CONFIG_DEBUG_MODULE_RONX Helge Deller <deller@gmx.de> - 2017-02-17 09:30 +0100
    Re: [PATCHv3 2/2] arch: Rename CONFIG_DEBUG_RODATA and  CONFIG_DEBUG_MODULE_RONX Mark Rutland <mark.rutland@arm.com> - 2017-02-17 19:30 +0100
    Re: [PATCHv3 2/2] arch: Rename CONFIG_DEBUG_RODATA and  CONFIG_DEBUG_MODULE_RONX Ingo Molnar <mingo@kernel.org> - 2017-02-20 08:30 +0100

csiph-web