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


Groups > linux.kernel > #1278675

Re: [PATCH v3 3/4] arm64: mm: support ARCH_MMAP_RND_BITS.

From Catalin Marinas <catalin.marinas@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 3/4] arm64: mm: support ARCH_MMAP_RND_BITS.
Date 2015-11-27 10:40 +0100
Message-ID <qznFx-11n-23@gated-at.bofh.it> (permalink)
References (4 earlier) <qy0UG-3v4-15@gated-at.bofh.it> <qy4vg-5JC-7@gated-at.bofh.it> <qyH3A-67h-27@gated-at.bofh.it> <qyP18-2J1-17@gated-at.bofh.it> <qzmJt-pZ-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Nov 27, 2015 at 11:36:30AM +0300, Andrey Ryabinin wrote:
> 2015-11-25 23:39 GMT+03:00 Daniel Cashman <dcashman@android.com>:
> > On 11/25/2015 04:06 AM, Catalin Marinas wrote:
> >> For KASan, we ended up calculating KASAN_SHADOW_OFFSET in
> >> arch/arm64/Makefile. What would the formula be for the above
> >> ARCH_MMAP_RND_BITS_MAX?
> >
> > The general formula I used ended up being:
> > _max = floor(log(TASK_SIZE)) - log(PAGE_SIZE) - 3
> 
> For kasan, we calculate KASAN_SHADOW_OFFSET in Makefile, because we need to use
> that value in Makefiles.
> 
> For ARCH_MMAP_RND_COMPAT_BITS_MIN/MAX I don't see a reason why it has
> to be in Kconfig.
> Can't we just use your formula to #define ARCH_MMAP_RND_COMPAT_BITS_*
> in some arch header?

Because there is another option, ARCH_MMAP_RND_BITS depending on EXPERT
which uses the MIN/MAX range defined per architecture. Since it's an
expert feature, we could as well ignore the MIN/MAX in Kconfig and just
add BUILD_BUG_ON checks to the code. This way we could simply define
them in C files.

Alternatively, add arithmetics support to kbuild ;).

-- 
Catalin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

[PATCH v3 2/4] arm: mm: support ARCH_MMAP_RND_BITS. Daniel Cashman <dcashman@android.com> - 2015-11-19 00:30 +0100
  [PATCH v3 3/4] arm64: mm: support ARCH_MMAP_RND_BITS. Daniel Cashman <dcashman@android.com> - 2015-11-19 00:30 +0100
    Re: [PATCH v3 3/4] arm64: mm: support ARCH_MMAP_RND_BITS. Will Deacon <will.deacon@arm.com> - 2015-11-23 16:10 +0100
      Re: [PATCH v3 3/4] arm64: mm: support ARCH_MMAP_RND_BITS. Daniel Cashman <dcashman@android.com> - 2015-11-23 20:00 +0100
        Re: [PATCH v3 3/4] arm64: mm: support ARCH_MMAP_RND_BITS. Michael Ellerman <mpe@ellerman.id.au> - 2015-11-25 05:30 +0100
          Re: [PATCH v3 3/4] arm64: mm: support ARCH_MMAP_RND_BITS. Daniel Cashman <dcashman@android.com> - 2015-11-25 20:40 +0100
        Re: [PATCH v3 3/4] arm64: mm: support ARCH_MMAP_RND_BITS. Catalin Marinas <catalin.marinas@arm.com> - 2015-11-25 13:10 +0100
          Re: [PATCH v3 3/4] arm64: mm: support ARCH_MMAP_RND_BITS. Daniel Cashman <dcashman@android.com> - 2015-11-25 21:40 +0100
            Re: [PATCH v3 3/4] arm64: mm: support ARCH_MMAP_RND_BITS. Andrey Ryabinin <ryabinin.a.a@gmail.com> - 2015-11-27 09:40 +0100
              Re: [PATCH v3 3/4] arm64: mm: support ARCH_MMAP_RND_BITS. Catalin Marinas <catalin.marinas@arm.com> - 2015-11-27 10:40 +0100

csiph-web