lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 31 May 2021 15:29:54 +0300
From:   Mike Rapoport <rppt@...nel.org>
To:     linux-kernel@...r.kernel.org
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Catalin Marinas <catalin.marinas@....com>,
        Christian Borntraeger <borntraeger@...ibm.com>,
        David Hildenbrand <david@...hat.com>,
        Heiko Carstens <hca@...ux.ibm.com>,
        Mike Rapoport <rppt@...nel.org>,
        Mike Rapoport <rppt@...ux.ibm.com>,
        Russell King <linux@...linux.org.uk>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        Vasily Gorbik <gor@...ux.ibm.com>,
        Will Deacon <will@...nel.org>,
        linux-arm-kernel@...ts.infradead.org, linux-mips@...r.kernel.org,
        linux-mm@...ck.org, linux-s390@...r.kernel.org
Subject: [RFC/RFT PATCH 0/5] consolidate "System RAM" resources setup

From: Mike Rapoport <rppt@...ux.ibm.com>

Hi,

There are several architectures that use very similar code for setup if
"System RAM" resources under iomem_resource tree and requesting memory
resources corresponding to the kernel code, data etc.

The flow for resources setup iterates over memory regions registered in
memblock, adds a resource for each region as "System RAM" and than
registers the areas used by the kernel image and, optionally, the crash
kernel area, as children of the "System RAM" resources.

The notable differences are:
* arm/arm64 use [__text, __init_begin] range for kernel code resource and
  [_sdata, _end] range for kernel data, while most other architectures use
  more fine grained ranges.
* arm has "System RAM (boot alias)" that do not seem useful for any other
  architecture
* arm64 has special treatment for NOMAP areas and all the areas reserved in
  memblock
* s390 has crashk_res in parallel with the "System RAM" resource, but it
  seems it was required some time ago but no longer actually needed.

These patches use s390 implementation of the resource setup as the basis
and then switch MIPS, arm and arm64 to use it with modifications required
to support each architecture. 

The generic code loops over all memblock.memory regions, adds the NOMAP
regions as "reserved" iomem resources and "normal" regions as "System RAM"
iomem resrouces, reserves the areas occupied by the kernel code, rodata,
data and bss, if there is crash kernel resource it is also reserved.

In addition, if an architectures selects
CONFIG_ARCH_WANT_RESERVE_MEMBLOCK_RESERVED_REGIONS (bad name, but I could
not find a better one) the memblock.reserved regions are registered as
"reserved" resources in iomem_resource.

It would be also possible to convert other architectures (e.g, RISC-V and
sh) to use the common infrastructure.

Mike Rapoport (5):
  s390: make crashk_res resource a child of "System RAM"
  memblock: introduce generic memblock_setup_resources()
  arm: switch to generic memblock_setup_resources()
  MIPS: switch to generic memblock_setup_resources
  arm64: switch to generic memblock_setup_resources()

 arch/Kconfig              |   7 ++
 arch/arm/kernel/setup.c   |  37 +----------
 arch/arm64/Kconfig        |   1 +
 arch/arm64/kernel/setup.c | 101 +----------------------------
 arch/mips/kernel/setup.c  |  78 ++--------------------
 arch/s390/kernel/setup.c  |  86 +------------------------
 include/linux/memblock.h  |   2 +
 mm/memblock.c             | 132 ++++++++++++++++++++++++++++++++++++++
 8 files changed, 151 insertions(+), 293 deletions(-)


base-commit: c4681547bcce777daf576925a966ffa824edd09d
-- 
2.28.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ