From: Dmitry Safonov <dsafonov@virtuozzo•com>
To: <linux-kernel@vger•kernel.org>
Cc: <0x7f454c46@gmail•com>, Dmitry Safonov <dsafonov@virtuozzo•com>,
Thomas Gleixner <tglx@linutronix•de>,
Ingo Molnar <mingo@redhat•com>, "H. Peter Anvin" <hpa@zytor•com>,
Andy Lutomirski <luto@kernel•org>,
"Kirill A . Shutemov" <kirill.shutemov@linux•intel.com>,
<x86@kernel•org>, Catalin Marinas <catalin.marinas@arm•com>,
Will Deacon <will.deacon@arm•com>,
Ralf Baechle <ralf@linux-mips•org>,
"James E.J. Bottomley" <jejb@parisc-linux•org>,
Helge Deller <deller@gmx•de>,
Benjamin Herrenschmidt <benh@kernel•crashing.org>,
Paul Mackerras <paulus@samba•org>,
Michael Ellerman <mpe@ellerman•id.au>,
Martin Schwidefsky <schwidefsky@de•ibm.com>,
Heiko Carstens <heiko.carstens@de•ibm.com>,
"David S. Miller" <davem@davemloft•net>,
Peter Zijlstra <peterz@infradead•org>,
<linux-arm-kernel@lists•infradead.org>,
<linux-mips@linux-mips•org>, <linux-parisc@vger•kernel.org>,
<linuxppc-dev@lists•ozlabs.org>, <linux-s390@vger•kernel.org>,
<sparclinux@vger•kernel.org>
Subject: [RFC 0/4] x86: keep TASK_SIZE in sync with mm->task_size
Date: Fri, 30 Dec 2016 18:56:30 +0300 [thread overview]
Message-ID: <20161230155634.8692-1-dsafonov@virtuozzo.com> (raw)
At this moment, we have following task_size-related things:
- TASK_SIZE_OF() macro, which is unused;
- current->mm->task_size which is used in half and TASK_SIZE() macro
which is used in the other half of code
- TIF_ADDR32, which is used to detect 32-bit address space and is
x86-specific, where some other arches misused TIF_32BIT
- personality ADDR_LIMIT_32BIT, which is used on arm/alpha
- ADDR_LIMIT_3GB, which is x86-specific and can be used to change
running task's TASK_SIZE 3GB <-> 4GB
This patches set removes unused definition of TASK_SIZE_OF (1),
defines TASK_SIZE macro as current->mm->task_size (3).
I would suggest define TASK_SIZE this way in generic version,
but currently I test it only on x86.
It also frees thread info flag (2) and adds arch_prctl()
on x86_64 to get/set current virtual address space size - as
it's needed by now only for CRIU, hide it under CHECKPOINT_RESTORE
config.
Hope those patches will help to clean task_size-related code
at least a bit (and helps me to restore vaddr limits).
Cc: Thomas Gleixner <tglx@linutronix•de>
Cc: Ingo Molnar <mingo@redhat•com>
Cc: "H. Peter Anvin" <hpa@zytor•com>
Cc: Andy Lutomirski <luto@kernel•org>
Cc: Kirill A. Shutemov <kirill.shutemov@linux•intel.com>
Cc: x86@kernel•org
Dmitry Safonov (4):
mm: remove unused TASK_SIZE_OF()
x86/thread_info: kill TIF_ADDR32 in favour of ADDR_LIMIT_32BIT
x86/mm: define TASK_SIZE as current->mm->task_size
x86/arch_prctl: add ARCH_{GET,SET}_TASK_SIZE
arch/arm64/include/asm/memory.h | 2 --
arch/mips/include/asm/processor.h | 3 ---
arch/parisc/include/asm/processor.h | 3 +--
arch/powerpc/include/asm/processor.h | 3 +--
arch/s390/include/asm/processor.h | 3 +--
arch/sparc/include/asm/processor_64.h | 3 ---
arch/x86/include/asm/elf.h | 7 +++++--
arch/x86/include/asm/processor.h | 19 +++++++++----------
arch/x86/include/asm/thread_info.h | 4 +---
arch/x86/include/uapi/asm/prctl.h | 3 +++
arch/x86/kernel/process_64.c | 17 +++++++++++++++--
arch/x86/kernel/sys_x86_64.c | 4 ++--
arch/x86/um/asm/segment.h | 2 +-
arch/x86/xen/mmu.c | 4 ++--
fs/exec.c | 17 +++++++++++------
include/linux/sched.h | 4 ----
16 files changed, 52 insertions(+), 46 deletions(-)
--
2.11.0
next reply other threads:[~2016-12-30 16:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-30 15:56 Dmitry Safonov [this message]
2016-12-30 15:56 ` [RFC 1/4] mm: remove unused TASK_SIZE_OF() Dmitry Safonov
2016-12-31 1:36 ` Andy Lutomirski
2017-01-02 6:57 ` Heiko Carstens
2017-01-02 9:53 ` Kirill A. Shutemov
2017-01-05 9:51 ` David Laight
2017-01-05 17:54 ` Andy Lutomirski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161230155634.8692-1-dsafonov@virtuozzo.com \
--to=dsafonov@virtuozzo$(echo .)com \
--cc=0x7f454c46@gmail$(echo .)com \
--cc=benh@kernel$(echo .)crashing.org \
--cc=catalin.marinas@arm$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=deller@gmx$(echo .)de \
--cc=heiko.carstens@de$(echo .)ibm.com \
--cc=hpa@zytor$(echo .)com \
--cc=jejb@parisc-linux$(echo .)org \
--cc=kirill.shutemov@linux$(echo .)intel.com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-mips@linux-mips$(echo .)org \
--cc=linux-parisc@vger$(echo .)kernel.org \
--cc=linux-s390@vger$(echo .)kernel.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=luto@kernel$(echo .)org \
--cc=mingo@redhat$(echo .)com \
--cc=mpe@ellerman$(echo .)id.au \
--cc=paulus@samba$(echo .)org \
--cc=peterz@infradead$(echo .)org \
--cc=ralf@linux-mips$(echo .)org \
--cc=schwidefsky@de$(echo .)ibm.com \
--cc=sparclinux@vger$(echo .)kernel.org \
--cc=tglx@linutronix$(echo .)de \
--cc=will.deacon@arm$(echo .)com \
--cc=x86@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox