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:   Wed, 18 Nov 2020 20:48:38 +0100
From:   Thomas Gleixner <tglx@...utronix.de>
To:     LKML <linux-kernel@...r.kernel.org>
Cc:     x86@...nel.org, Linus Torvalds <torvalds@...uxfoundation.org>,
        Christoph Hellwig <hch@....de>,
        Matthew Wilcox <willy@...radead.org>,
        Daniel Vetter <daniel@...ll.ch>,
        Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...nel.org>,
        Juri Lelli <juri.lelli@...hat.com>,
        Vincent Guittot <vincent.guittot@...aro.org>,
        Dietmar Eggemann <dietmar.eggemann@....com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>,
        Daniel Bristot de Oliveira <bristot@...hat.com>
Subject: [patch V4 0/8] mm/highmem: Preemptible variant of kmap_atomic & friends

This is the outstanding set of patches for the preemptible kmap_*()
implementation. The previous version is here:

  https://lore.kernel.org/r/20201103092712.714480842@linutronix.de

The following changes come with it:

 - Better debugging for kmap* by enforcing the temporary mappings even for
   lowmem pages when the architecture allows it.

 - Support for enforced mappings on X86 for both 32 and 64 bit. As
   KMAP_LOCAL is already independent from HIGHMEM this needs only the extra
   fixmap space on 64bit and no further code changes.

 - Removing the RT dependency from migrate_disable/enable(). This patch
   still needs some help from the scheduler folks vs. the comment in
   preempt.h.

 - Switching from per CPU storage of the kmap index to a per task storage
   by adding a pteval array to the per task storage which contains the
   ptevals of the currently active temporary kmaps

 - Adding context switch code which checks whether the outgoing or the
   incoming task has active temporary kmaps. If so, the outgoing task's
   kmaps are removed and the incoming task's kmaps are restored.

 - Adding new interfaces k[un]map_local*() which are not disabling
   preemption and can be called from any context (except NMI).

   Contrary to kmap() which provides preemptible and "persistant" mappings,
   these interfaces are meant to replace the temporary mappings provided by
   kmap_atomic*() today.

This allows to get rid of conditional mapping choices and allows to have
preemptible short term "mappings" on 64bit which are today enforced to be
non-preemptible due to the highmem constraints. It clearly puts overhead on
the highmem users, but highmem is slow anyway.

This is not a wholesale conversion which makes kmap_atomic magically
preemptible because there might be usage sites which rely on the implicit
preempt disable. So this needs to be done on a case by case basis and the
call sites converted to kmap_local().

Changes vs. V3:

   - Rebased on top of the merged consolidation patches and on top of
     the latest version of migrate disable support.

   - New debug features (enforced mappings)

   - Dropped the conversion patches as they need review from the respective
     subsystems and better go through the relevant trees for 5.12

The series is based on

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git core/mm

with

   git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched/core

merged in.

It is also available from git:

   git://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git highmem

Thanks,

	tglx
---
 Documentation/driver-api/io-mapping.rst |   74 +++++++++++--------
 arch/x86/Kconfig                        |    1 
 arch/x86/include/asm/fixmap.h           |   12 ++-
 arch/x86/include/asm/pgtable_64_types.h |    6 +
 arch/x86/kernel/crash_dump_32.c         |   48 ++----------
 include/asm-generic/kmap_size.h         |    2 
 include/linux/highmem-internal.h        |   58 +++++++++++++++
 include/linux/highmem.h                 |   43 +++++++----
 include/linux/io-mapping.h              |   30 +++++++
 include/linux/kernel.h                  |   21 +++--
 include/linux/preempt.h                 |   38 ----------
 include/linux/sched.h                   |   11 ++
 kernel/entry/common.c                   |    2 
 kernel/fork.c                           |    1 
 kernel/sched/core.c                     |   63 ++++++++++++++--
 kernel/sched/sched.h                    |    4 -
 lib/Kconfig.debug                       |   22 +++++
 lib/smp_processor_id.c                  |    2 
 mm/highmem.c                            |  121 ++++++++++++++++++++++++++++----
 19 files changed, 400 insertions(+), 159 deletions(-)



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ